X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=regex.h;h=61bdd6e11a42863cc27827d6a4716c1d916aedef;hb=a61e0df68c977b70b8958098bbc84cf100a06978;hp=ea701231c20dabaee197c8404581c8fd96b811e0;hpb=e7562765bf08c5dee8aa0737ee2de4511b87e4e9;p=gnulib.git diff --git a/regex.h b/regex.h index ea701231c..61bdd6e11 100644 --- a/regex.h +++ b/regex.h @@ -1,7 +1,7 @@ /* Definitions for data structures and routines for the regular - expression library, version 0.11. + expression library, version 0.12. - Copyright (C) 1985, 89, 90, 91, 92 Free Software Foundation, Inc. + Copyright (C) 1985, 89, 90, 91, 92, 93, 95 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ #ifndef __REGEXP_LIBRARY_H__ #define __REGEXP_LIBRARY_H__ @@ -23,7 +24,7 @@ /* POSIX says that must be included (by the caller) before . */ -#ifdef VMS +#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS) /* VMS doesn't have `size_t' in , even though POSIX says it should be there. */ #include @@ -130,6 +131,10 @@ typedef unsigned reg_syntax_t; If not set, then an unmatched ) is invalid. */ #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) +/* If this bit is set, succeed as soon as we match the whole pattern, + without further backtracking. */ +#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) + /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect @@ -275,6 +280,10 @@ typedef enum compiled, the `re_nsub' field is available. All other fields are private to the regex routines. */ +#ifndef RE_TRANSLATE_TYPE +#define RE_TRANSLATE_TYPE char * +#endif + struct re_pattern_buffer { /* [[[begin pattern_buffer]]] */ @@ -301,7 +310,7 @@ struct re_pattern_buffer comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ - char *translate; + RE_TRANSLATE_TYPE translate; /* Number of subexpressions found by the compiler. */ size_t re_nsub; @@ -344,11 +353,6 @@ struct re_pattern_buffer }; typedef struct re_pattern_buffer regex_t; - - -/* search.c (search_buffer) in Emacs needs this one opcode value. It is - defined both in `regex.c' and here. */ -#define RE_EXACTN_VALUE 1 /* Type for byte offsets within the string. POSIX mandates this. */ typedef int regoff_t; @@ -387,10 +391,7 @@ typedef struct prototype (if we are ANSI), and once without (if we aren't) -- we use the following macro to declare argument types. This unfortunately clutters up the declarations a bit, but I think it's - worth it. - - We may also have to undo `const' if we are not ANSI -- but if it has - already been defined, as by Autoconf's AC_CONST, don't do anything. */ + worth it. */ #if __STDC__ @@ -400,18 +401,6 @@ typedef struct #define _RE_ARGS(args) () -#ifndef USING_AUTOCONF - -#ifndef HAVE_CONST -#define const -#else -#if !HAVE_CONST -#define const -#endif -#endif - -#endif /* not USING_AUTOCONF */ - #endif /* not __STDC__ */ /* Sets the current default syntax to SYNTAX, and return the old syntax. @@ -480,9 +469,11 @@ extern void re_set_registers _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)); +#ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ extern char *re_comp _RE_ARGS ((const char *)); extern int re_exec _RE_ARGS ((const char *)); +#endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));