/[gnats]/gnats/gnats/regex.h
ViewVC logotype

Diff of /gnats/gnats/regex.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by brendan, Thu Nov 5 19:54:10 1998 UTC revision 1.2 by pdm, Mon Dec 10 22:00:21 2001 UTC
# Line 1  Line 1 
1  /* Definitions for data structures and routines for the regular  /* Definitions for data structures and routines for the regular
2     expression library, version 0.12.     expression library, version 0.12.
3    
4     Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.     Copyright (C) 1985,89,90,91,92,93,95,2000 Free Software Foundation, Inc.
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 15  Line 15 
15    
16     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19       USA.  */
20    
21  #ifndef __REGEXP_LIBRARY_H__  #ifndef _REGEX_H
22  #define __REGEXP_LIBRARY_H__  #define _REGEX_H 1
23    
24    /* Allow the use in C++ code.  */
25    #ifdef __cplusplus
26    extern "C" {
27    #endif
28    
29  /* POSIX says that <sys/types.h> must be included (by the caller) before  /* POSIX says that <sys/types.h> must be included (by the caller) before
30     <regex.h>.  */     <regex.h>.  */
31    
32  #ifdef VMS  #if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
33  /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it  /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
34     should be there.  */     should be there.  */
35  #include <stddef.h>  # include <stddef.h>
36  #endif  #endif
37    
   
38  /* The following bits are used to determine the regexp syntax we  /* The following bits are used to determine the regexp syntax we
39     recognize.  The set/not-set meanings are chosen so that Emacs syntax     recognize.  The set/not-set meanings where historically chosen so
40     remains the value 0.  The bits are given in alphabetical order, and     that Emacs syntax had the value 0.
41       The bits are given in alphabetical order, and
42     the definitions shifted by one from the previous bit; thus, when we     the definitions shifted by one from the previous bit; thus, when we
43     add or remove a bit, only one other definition need change.  */     add or remove a bit, only one other definition need change.  */
44  typedef unsigned reg_syntax_t;  typedef unsigned long int reg_syntax_t;
45    
46  /* If this bit is not set, then \ inside a bracket expression is literal.  /* If this bit is not set, then \ inside a bracket expression is literal.
47     If set, then such a \ quotes the following character.  */     If set, then such a \ quotes the following character.  */
48  #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)  #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
49    
50  /* If this bit is not set, then + and ? are operators, and \+ and \? are  /* If this bit is not set, then + and ? are operators, and \+ and \? are
51       literals.       literals.
52     If set, then \+ and \? are operators and + and ? are literals.  */     If set, then \+ and \? are operators and + and ? are literals.  */
53  #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)  #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
54    
# Line 58  typedef unsigned reg_syntax_t; Line 64  typedef unsigned reg_syntax_t;
64          ^  is an anchor if it is at the beginning of a regular          ^  is an anchor if it is at the beginning of a regular
65             expression or after an open-group or an alternation operator;             expression or after an open-group or an alternation operator;
66          $  is an anchor if it is at the end of a regular expression, or          $  is an anchor if it is at the end of a regular expression, or
67             before a close-group or an alternation operator.               before a close-group or an alternation operator.
68    
69     This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because     This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
70     POSIX draft 11.2 says that * etc. in leading positions is undefined.     POSIX draft 11.2 says that * etc. in leading positions is undefined.
# Line 69  typedef unsigned reg_syntax_t; Line 75  typedef unsigned reg_syntax_t;
75  /* If this bit is set, then special characters are always special  /* If this bit is set, then special characters are always special
76       regardless of where they are in the pattern.       regardless of where they are in the pattern.
77     If this bit is not set, then special characters are special only in     If this bit is not set, then special characters are special only in
78       some contexts; otherwise they are ordinary.  Specifically,       some contexts; otherwise they are ordinary.  Specifically,
79       * + ? and intervals are only special when not after the beginning,       * + ? and intervals are only special when not after the beginning,
80       open-group, or alternation operator.  */       open-group, or alternation operator.  */
81  #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)  #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
# Line 91  typedef unsigned reg_syntax_t; Line 97  typedef unsigned reg_syntax_t;
97  #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)  #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
98    
99  /* If this bit is set, either \{...\} or {...} defines an  /* If this bit is set, either \{...\} or {...} defines an
100       interval, depending on RE_NO_BK_BRACES.       interval, depending on RE_NO_BK_BRACES.
101     If not set, \{, \}, {, and } are literals.  */     If not set, \{, \}, {, and } are literals.  */
102  #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)  #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
103    
# Line 116  typedef unsigned reg_syntax_t; Line 122  typedef unsigned reg_syntax_t;
122     If not set, then \<digit> is a back-reference.  */     If not set, then \<digit> is a back-reference.  */
123  #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)  #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
124    
125  /* If this bit is set, then | is an alternation operator, and \| is literal.  /* If this bit is set, then | is an alternation operator, and \| is literal.
126     If not set, then \| is an alternation operator, and | is literal.  */     If not set, then \| is an alternation operator, and | is literal.  */
127  #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)  #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
128    
# Line 130  typedef unsigned reg_syntax_t; Line 136  typedef unsigned reg_syntax_t;
136     If not set, then an unmatched ) is invalid.  */     If not set, then an unmatched ) is invalid.  */
137  #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)  #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
138    
139    /* If this bit is set, succeed as soon as we match the whole pattern,
140       without further backtracking.  */
141    #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
142    
143    /* If this bit is set, do not process the GNU regex operators.
144       If not set, then the GNU regex operators are recognized. */
145    #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
146    
147    /* If this bit is set, then *?, +? and ?? match non greedily. */
148    #define RE_FRUGAL (RE_NO_GNU_OPS << 1)
149    
150    /* If this bit is set, then (?:...) is treated as a shy group.  */
151    #define RE_SHY_GROUPS (RE_FRUGAL << 1)
152    
153    /* If this bit is set, ^ and $ only match at beg/end of buffer.  */
154    #define RE_NO_NEWLINE_ANCHOR (RE_SHY_GROUPS << 1)
155    
156    /* If this bit is set, turn on internal regex debugging.
157       If not set, and debugging was on, turn it off.
158       This only works if regex.c is compiled -DDEBUG.
159       We define this bit always, so that all that's needed to turn on
160       debugging is to recompile regex.c; the calling code can always have
161       this bit set, and it won't affect anything in the normal case. */
162    #define RE_DEBUG (RE_NO_NEWLINE_ANCHOR << 1)
163    
164  /* This global variable defines the particular regexp syntax to use (for  /* This global variable defines the particular regexp syntax to use (for
165     some interfaces).  When a regexp is compiled, the syntax used is     some interfaces).  When a regexp is compiled, the syntax used is
166     stored in the pattern buffer, so changing this does not affect     stored in the pattern buffer, so changing this does not affect
167     already-compiled regexps.  */     already-compiled regexps.  */
168  extern reg_syntax_t re_syntax_options;  extern reg_syntax_t re_syntax_options;
169    
170    #ifdef emacs
171    /* In Emacs, this is the string or buffer in which we
172       are matching.  It is used for looking up syntax properties.  */
173    extern Lisp_Object re_match_object;
174    #endif
175    
176    
177  /* Define combinations of the above bits for the standard possibilities.  /* Define combinations of the above bits for the standard possibilities.
178     (The [[[ comments delimit what gets put into the Texinfo file, so     (The [[[ comments delimit what gets put into the Texinfo file, so
179     don't delete them!)  */     don't delete them!)  */
180  /* [[[begin syntaxes]]] */  /* [[[begin syntaxes]]] */
181  #define RE_SYNTAX_EMACS 0  #define RE_SYNTAX_EMACS                                                 \
182      (RE_CHAR_CLASSES | RE_INTERVALS | RE_SHY_GROUPS | RE_FRUGAL)
183    
184  #define RE_SYNTAX_AWK                                                   \  #define RE_SYNTAX_AWK                                                   \
185    (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL                       \    (RE_BACKSLASH_ESCAPE_IN_LISTS   | RE_DOT_NOT_NULL                     \
186     | RE_NO_BK_PARENS            | RE_NO_BK_REFS                         \     | RE_NO_BK_PARENS              | RE_NO_BK_REFS                       \
187     | RE_NO_BK_VBAR               | RE_NO_EMPTY_RANGES                   \     | RE_NO_BK_VBAR                | RE_NO_EMPTY_RANGES                  \
188     | RE_UNMATCHED_RIGHT_PAREN_ORD)     | RE_DOT_NEWLINE               | RE_CONTEXT_INDEP_ANCHORS            \
189       | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
190    
191    #define RE_SYNTAX_GNU_AWK                                               \
192      ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
193       & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
194    
195  #define RE_SYNTAX_POSIX_AWK                                             \  #define RE_SYNTAX_POSIX_AWK                                             \
196    (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)    (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS              \
197       | RE_INTERVALS           | RE_NO_GNU_OPS)
198    
199  #define RE_SYNTAX_GREP                                                  \  #define RE_SYNTAX_GREP                                                  \
200    (RE_BK_PLUS_QM              | RE_CHAR_CLASSES                         \    (RE_BK_PLUS_QM              | RE_CHAR_CLASSES                         \
# Line 185  extern reg_syntax_t re_syntax_options; Line 230  extern reg_syntax_t re_syntax_options;
230    (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)    (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
231    
232  #define RE_SYNTAX_POSIX_EXTENDED                                        \  #define RE_SYNTAX_POSIX_EXTENDED                                        \
233    (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS                   \    (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS                  \
234     | RE_CONTEXT_INDEP_OPS  | RE_NO_BK_BRACES                            \     | RE_CONTEXT_INDEP_OPS   | RE_NO_BK_BRACES                           \
235     | RE_NO_BK_PARENS       | RE_NO_BK_VBAR                              \     | RE_NO_BK_PARENS        | RE_NO_BK_VBAR                             \
236     | RE_UNMATCHED_RIGHT_PAREN_ORD)     | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
237    
238  /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS  /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
239     replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added.  */     removed and RE_NO_BK_REFS is added.  */
240  #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED                                \  #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED                                \
241    (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS                  \    (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS                  \
242     | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES                           \     | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES                           \
# Line 203  extern reg_syntax_t re_syntax_options; Line 248  extern reg_syntax_t re_syntax_options;
248     (erroneously) define this in other header files, but we want our     (erroneously) define this in other header files, but we want our
249     value, so remove any previous define.  */     value, so remove any previous define.  */
250  #ifdef RE_DUP_MAX  #ifdef RE_DUP_MAX
251  #undef RE_DUP_MAX  # undef RE_DUP_MAX
252  #endif  #endif
253  #define RE_DUP_MAX ((1 << 15) - 1)  /* If sizeof(int) == 2, then ((1 << 15) - 1) overflows.  */
254    #define RE_DUP_MAX (0x7fff)
255    
256    
257  /* POSIX `cflags' bits (i.e., information for `regcomp').  */  /* POSIX `cflags' bits (i.e., information for `regcomp').  */
# Line 217  extern reg_syntax_t re_syntax_options; Line 263  extern reg_syntax_t re_syntax_options;
263  /* If this bit is set, then ignore case when matching.  /* If this bit is set, then ignore case when matching.
264     If not set, then case is significant.  */     If not set, then case is significant.  */
265  #define REG_ICASE (REG_EXTENDED << 1)  #define REG_ICASE (REG_EXTENDED << 1)
266    
267  /* If this bit is set, then anchors do not match at newline  /* If this bit is set, then anchors do not match at newline
268       characters in the string.       characters in the string.
269     If not set, then anchors do match at newlines.  */     If not set, then anchors do match at newlines.  */
# Line 245  extern reg_syntax_t re_syntax_options; Line 291  extern reg_syntax_t re_syntax_options;
291     `re_error_msg' table in regex.c.  */     `re_error_msg' table in regex.c.  */
292  typedef enum  typedef enum
293  {  {
294    #ifdef _XOPEN_SOURCE
295      REG_ENOSYS = -1,      /* This will never happen for this implementation.  */
296    #endif
297    
298    REG_NOERROR = 0,      /* Success.  */    REG_NOERROR = 0,      /* Success.  */
299    REG_NOMATCH,          /* Didn't find a match (for regexec).  */    REG_NOMATCH,          /* Didn't find a match (for regexec).  */
300    
# Line 256  typedef enum Line 306  typedef enum
306    REG_EESCAPE,          /* Trailing backslash.  */    REG_EESCAPE,          /* Trailing backslash.  */
307    REG_ESUBREG,          /* Invalid back reference.  */    REG_ESUBREG,          /* Invalid back reference.  */
308    REG_EBRACK,           /* Unmatched left bracket.  */    REG_EBRACK,           /* Unmatched left bracket.  */
309    REG_EPAREN,           /* Parenthesis imbalance.  */    REG_EPAREN,           /* Parenthesis imbalance.  */
310    REG_EBRACE,           /* Unmatched \{.  */    REG_EBRACE,           /* Unmatched \{.  */
311    REG_BADBR,            /* Invalid contents of \{\}.  */    REG_BADBR,            /* Invalid contents of \{\}.  */
312    REG_ERANGE,           /* Invalid range end.  */    REG_ERANGE,           /* Invalid range end.  */
# Line 275  typedef enum Line 325  typedef enum
325     compiled, the `re_nsub' field is available.  All other fields are     compiled, the `re_nsub' field is available.  All other fields are
326     private to the regex routines.  */     private to the regex routines.  */
327    
328    #ifndef RE_TRANSLATE_TYPE
329    # define RE_TRANSLATE_TYPE char *
330    #endif
331    
332  struct re_pattern_buffer  struct re_pattern_buffer
333  {  {
334  /* [[[begin pattern_buffer]]] */  /* [[[begin pattern_buffer]]] */
# Line 284  struct re_pattern_buffer Line 338  struct re_pattern_buffer
338    unsigned char *buffer;    unsigned char *buffer;
339    
340          /* Number of bytes to which `buffer' points.  */          /* Number of bytes to which `buffer' points.  */
341    unsigned long allocated;    size_t allocated;
342    
343          /* Number of bytes actually used in `buffer'.  */          /* Number of bytes actually used in `buffer'.  */
344    unsigned long used;      size_t used;
345    
346          /* Syntax setting with which the pattern was compiled.  */          /* Syntax setting with which the pattern was compiled.  */
347    reg_syntax_t syntax;    reg_syntax_t syntax;
# Line 301  struct re_pattern_buffer Line 355  struct re_pattern_buffer
355             comparing them, or zero for no translation.  The translation             comparing them, or zero for no translation.  The translation
356             is applied to a pattern when it is compiled and to a string             is applied to a pattern when it is compiled and to a string
357             when it is matched.  */             when it is matched.  */
358    char *translate;    RE_TRANSLATE_TYPE translate;
359    
360          /* Number of subexpressions found by the compiler.  */          /* Number of subexpressions found by the compiler.  */
361    size_t re_nsub;    size_t re_nsub;
# Line 309  struct re_pattern_buffer Line 363  struct re_pattern_buffer
363          /* Zero if this pattern cannot match the empty string, one else.          /* Zero if this pattern cannot match the empty string, one else.
364             Well, in truth it's used only in `re_search_2', to see             Well, in truth it's used only in `re_search_2', to see
365             whether or not we should use the fastmap, so we don't set             whether or not we should use the fastmap, so we don't set
366             this absolutely perfectly; see `re_compile_fastmap' (the             this absolutely perfectly; see `re_compile_fastmap'.  */
            `duplicate' case).  */  
367    unsigned can_be_null : 1;    unsigned can_be_null : 1;
368    
369          /* If REGS_UNALLOCATED, allocate space in the `regs' structure          /* If REGS_UNALLOCATED, allocate space in the `regs' structure
# Line 331  struct re_pattern_buffer Line 384  struct re_pattern_buffer
384    unsigned no_sub : 1;    unsigned no_sub : 1;
385    
386          /* If set, a beginning-of-line anchor doesn't match at the          /* If set, a beginning-of-line anchor doesn't match at the
387             beginning of the string.  */             beginning of the string.  */
388    unsigned not_bol : 1;    unsigned not_bol : 1;
389    
390          /* Similarly for an end-of-line anchor.  */          /* Similarly for an end-of-line anchor.  */
391    unsigned not_eol : 1;    unsigned not_eol : 1;
392    
393          /* If true, an anchor at a newline matches.  */  #ifdef emacs
394    unsigned newline_anchor : 1;    /* If true, multi-byte form in the `buffer' should be recognized as a
395         multibyte character. */
396      unsigned multibyte : 1;
397    #endif
398    
399  /* [[[end pattern_buffer]]] */  /* [[[end pattern_buffer]]] */
400  };  };
401    
402  typedef struct re_pattern_buffer regex_t;  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  
403    
404  /* Type for byte offsets within the string.  POSIX mandates this.  */  /* Type for byte offsets within the string.  POSIX mandates this.  */
405  typedef int regoff_t;  typedef int regoff_t;
# Line 368  struct re_registers Line 419  struct re_registers
419     `re_match_2' returns information about at least this many registers     `re_match_2' returns information about at least this many registers
420     the first time a `regs' structure is passed.  */     the first time a `regs' structure is passed.  */
421  #ifndef RE_NREGS  #ifndef RE_NREGS
422  #define RE_NREGS 30  # define RE_NREGS 30
423  #endif  #endif
424    
425    
# Line 389  typedef struct Line 440  typedef struct
440     unfortunately clutters up the declarations a bit, but I think it's     unfortunately clutters up the declarations a bit, but I think it's
441     worth it.  */     worth it.  */
442    
443  #if __STDC__  #if defined __STDC__ || defined PROTOTYPES
444    
445  #define _RE_ARGS(args) args  # define _RE_ARGS(args) args
446    
447  #else /* not __STDC__ */  #else /* not __STDC__  || PROTOTYPES */
448    
449  #ifndef const  # define _RE_ARGS(args) ()
 #define const  
 #endif  
450    
451  #define _RE_ARGS(args) ()  #endif /* not __STDC__  || PROTOTYPES */
   
 #endif /* not __STDC__ */  
452    
453  /* Sets the current default syntax to SYNTAX, and return the old syntax.  /* Sets the current default syntax to SYNTAX, and return the old syntax.
454     You can also simply assign to the `re_syntax_options' variable.  */     You can also simply assign to the `re_syntax_options' variable.  */
# Line 411  extern reg_syntax_t re_set_syntax _RE_AR Line 458  extern reg_syntax_t re_set_syntax _RE_AR
458     and syntax given by the global `re_syntax_options', into the buffer     and syntax given by the global `re_syntax_options', into the buffer
459     BUFFER.  Return NULL if successful, and an error string if not.  */     BUFFER.  Return NULL if successful, and an error string if not.  */
460  extern const char *re_compile_pattern  extern const char *re_compile_pattern
461    _RE_ARGS ((const char *pattern, int length,    _RE_ARGS ((const char *pattern, size_t length,
462               struct re_pattern_buffer *buffer));               struct re_pattern_buffer *buffer));
463    
464    
# Line 447  extern int re_match Line 494  extern int re_match
494    
495    
496  /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */  /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
497  extern int re_match_2  extern int re_match_2
498    _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,    _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
499               int length1, const char *string2, int length2,               int length1, const char *string2, int length2,
500               int start, struct re_registers *regs, int stop));               int start, struct re_registers *regs, int stop));
# Line 469  extern void re_set_registers Line 516  extern void re_set_registers
516    _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,    _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
517               unsigned num_regs, regoff_t *starts, regoff_t *ends));               unsigned num_regs, regoff_t *starts, regoff_t *ends));
518    
519    #if defined _REGEX_RE_COMP || defined _LIBC
520    # ifndef _CRAY
521  /* 4.2 bsd compatibility.  */  /* 4.2 bsd compatibility.  */
522  extern char *re_comp _RE_ARGS ((const char *));  extern char *re_comp _RE_ARGS ((const char *));
523  extern int re_exec _RE_ARGS ((const char *));  extern int re_exec _RE_ARGS ((const char *));
524    # endif
525    #endif
526    
527    /* GCC 2.95 and later have "__restrict"; C99 compilers have
528       "restrict", and "configure" may have defined "restrict".  */
529    #ifndef __restrict
530    # if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
531    #  if defined restrict || 199901L <= __STDC_VERSION__
532    #   define __restrict restrict
533    #  else
534    #   define __restrict
535    #  endif
536    # endif
537    #endif
538    /* For now unconditionally define __restrict_arr to expand to nothing.
539       Ideally we would have a test for the compiler which allows defining
540       it to restrict.  */
541    #define __restrict_arr
542    
543  /* POSIX compatibility.  */  /* POSIX compatibility.  */
544  extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));  extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
545  extern int regexec                                const char *__restrict __pattern,
546    _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,                                int __cflags));
547               regmatch_t pmatch[], int eflags));  
548  extern size_t regerror  extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
549    _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,                                const char *__restrict __string, size_t __nmatch,
550               size_t errbuf_size));                                regmatch_t __pmatch[__restrict_arr],
551  extern void regfree _RE_ARGS ((regex_t *preg));                                int __eflags));
552    
553    extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
554                                      char *__errbuf, size_t __errbuf_size));
555    
556    extern void regfree _RE_ARGS ((regex_t *__preg));
557    
558    
559    #ifdef __cplusplus
560    }
561    #endif  /* C++ */
562    
563  #endif /* not __REGEXP_LIBRARY_H__ */  #endif /* regex.h */
564    
565  /*  /*
566  Local variables:  Local variables:

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26