Mercurial > hg > octave-nkf > gnulib-hg
annotate lib/regex.h @ 6104:1e308ce32c4c
* config/srclist.txt: Add glibc bug 1240.
* lib/regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
* lib/regex.h (regerror): Likewise.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 25 Aug 2005 05:08:59 +0000 |
parents | b4fe67182e68 |
children | f1728546eca4 |
rev | line source |
---|---|
14 | 1 /* Definitions for data structures and routines for the regular |
4020 | 2 expression library. |
6076
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
3 Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005 |
4020 | 4 Free Software Foundation, Inc. |
5 This file is part of the GNU C Library. | |
1283 | 6 |
4020 | 7 This program is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | |
9 the Free Software Foundation; either version 2, or (at your option) | |
10 any later version. | |
14 | 11 |
4020 | 12 This program is distributed in the hope that it will be useful, |
1283 | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
4020 | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 GNU General Public License for more details. | |
14 | 16 |
4020 | 17 You should have received a copy of the GNU General Public License along |
18 with this program; if not, write to the Free Software Foundation, | |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
14 | 20 |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
21 #ifndef _REGEX_H |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
22 #define _REGEX_H 1 |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
23 |
4304 | 24 #include <sys/types.h> |
25 | |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
26 /* Allow the use in C++ code. */ |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
27 #ifdef __cplusplus |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
28 extern "C" { |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
29 #endif |
14 | 30 |
6099 | 31 /* Define _REGEX_SOURCE to get definitions that are incompatible with |
32 POSIX. */ | |
33 #if (!defined _REGEX_SOURCE \ | |
34 && (defined _GNU_SOURCE \ | |
35 || (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE \ | |
36 && !defined _XOPEN_SOURCE))) | |
37 # define _REGEX_SOURCE 1 | |
38 #endif | |
389 | 39 |
6099 | 40 #if defined _REGEX_SOURCE && defined VMS |
389 | 41 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it |
42 should be there. */ | |
1283 | 43 # include <stddef.h> |
389 | 44 #endif |
45 | |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
46 /* The following two types have to be signed and unsigned integer type |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
47 wide enough to hold a value of a pointer. For most ANSI compilers |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
48 ptrdiff_t and size_t should be likely OK. Still size of these two |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
49 types is 2 for Microsoft C. Ugh... */ |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
50 typedef long int s_reg_t; |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
51 typedef unsigned long int active_reg_t; |
14 | 52 |
53 /* The following bits are used to determine the regexp syntax we | |
54 recognize. The set/not-set meanings are chosen so that Emacs syntax | |
55 remains the value 0. The bits are given in alphabetical order, and | |
56 the definitions shifted by one from the previous bit; thus, when we | |
57 add or remove a bit, only one other definition need change. */ | |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
58 typedef unsigned long int reg_syntax_t; |
14 | 59 |
60 /* If this bit is not set, then \ inside a bracket expression is literal. | |
61 If set, then such a \ quotes the following character. */ | |
6099 | 62 #define REG_BACKSLASH_ESCAPE_IN_LISTS 1ul |
14 | 63 |
64 /* If this bit is not set, then + and ? are operators, and \+ and \? are | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
65 literals. |
14 | 66 If set, then \+ and \? are operators and + and ? are literals. */ |
6099 | 67 #define REG_BK_PLUS_QM (1ul << 1) |
14 | 68 |
69 /* If this bit is set, then character classes are supported. They are: | |
70 [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], | |
71 [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. | |
72 If not set, then character classes are not supported. */ | |
6099 | 73 #define REG_CHAR_CLASSES (1ul << 2) |
14 | 74 |
75 /* If this bit is set, then ^ and $ are always anchors (outside bracket | |
76 expressions, of course). | |
77 If this bit is not set, then it depends: | |
78 ^ is an anchor if it is at the beginning of a regular | |
79 expression or after an open-group or an alternation operator; | |
80 $ is an anchor if it is at the end of a regular expression, or | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
81 before a close-group or an alternation operator. |
14 | 82 |
6099 | 83 This bit could be (re)combined with REG_CONTEXT_INDEP_OPS, because |
14 | 84 POSIX draft 11.2 says that * etc. in leading positions is undefined. |
85 We already implemented a previous draft which made those constructs | |
86 invalid, though, so we haven't changed the code back. */ | |
6099 | 87 #define REG_CONTEXT_INDEP_ANCHORS (1ul << 3) |
14 | 88 |
89 /* If this bit is set, then special characters are always special | |
90 regardless of where they are in the pattern. | |
91 If this bit is not set, then special characters are special only in | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
92 some contexts; otherwise they are ordinary. Specifically, |
14 | 93 * + ? and intervals are only special when not after the beginning, |
94 open-group, or alternation operator. */ | |
6099 | 95 #define REG_CONTEXT_INDEP_OPS (1ul << 4) |
14 | 96 |
97 /* If this bit is set, then *, +, ?, and { cannot be first in an re or | |
98 immediately after an alternation or begin-group operator. */ | |
6099 | 99 #define REG_CONTEXT_INVALID_OPS (1ul << 5) |
14 | 100 |
101 /* If this bit is set, then . matches newline. | |
102 If not set, then it doesn't. */ | |
6099 | 103 #define REG_DOT_NEWLINE (1ul << 6) |
14 | 104 |
105 /* If this bit is set, then . doesn't match NUL. | |
106 If not set, then it does. */ | |
6099 | 107 #define REG_DOT_NOT_NULL (1ul << 7) |
14 | 108 |
109 /* If this bit is set, nonmatching lists [^...] do not match newline. | |
110 If not set, they do. */ | |
6099 | 111 #define REG_HAT_LISTS_NOT_NEWLINE (1ul << 8) |
14 | 112 |
113 /* If this bit is set, either \{...\} or {...} defines an | |
6099 | 114 interval, depending on REG_NO_BK_BRACES. |
14 | 115 If not set, \{, \}, {, and } are literals. */ |
6099 | 116 #define REG_INTERVALS (1ul << 9) |
14 | 117 |
118 /* If this bit is set, +, ? and | aren't recognized as operators. | |
119 If not set, they are. */ | |
6099 | 120 #define REG_LIMITED_OPS (1ul << 10) |
14 | 121 |
122 /* If this bit is set, newline is an alternation operator. | |
123 If not set, newline is literal. */ | |
6099 | 124 #define REG_NEWLINE_ALT (1ul << 11) |
14 | 125 |
126 /* If this bit is set, then `{...}' defines an interval, and \{ and \} | |
127 are literals. | |
128 If not set, then `\{...\}' defines an interval. */ | |
6099 | 129 #define REG_NO_BK_BRACES (1ul << 12) |
14 | 130 |
131 /* If this bit is set, (...) defines a group, and \( and \) are literals. | |
132 If not set, \(...\) defines a group, and ( and ) are literals. */ | |
6099 | 133 #define REG_NO_BK_PARENS (1ul << 13) |
14 | 134 |
135 /* If this bit is set, then \<digit> matches <digit>. | |
136 If not set, then \<digit> is a back-reference. */ | |
6099 | 137 #define REG_NO_BK_REFS (1ul << 14) |
14 | 138 |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
139 /* If this bit is set, then | is an alternation operator, and \| is literal. |
14 | 140 If not set, then \| is an alternation operator, and | is literal. */ |
6099 | 141 #define REG_NO_BK_VBAR (1ul << 15) |
14 | 142 |
143 /* If this bit is set, then an ending range point collating higher | |
144 than the starting range point, as in [z-a], is invalid. | |
6085
d7b1b7dd9bf8
* config/srclist.txt: Add glibc bug 1232.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6076
diff
changeset
|
145 If not set, the containing range is empty and does not match any string. */ |
6099 | 146 #define REG_NO_EMPTY_RANGES (1ul << 16) |
14 | 147 |
148 /* If this bit is set, then an unmatched ) is ordinary. | |
149 If not set, then an unmatched ) is invalid. */ | |
6099 | 150 #define REG_UNMATCHED_RIGHT_PAREN_ORD (1ul << 17) |
14 | 151 |
389 | 152 /* If this bit is set, succeed as soon as we match the whole pattern, |
153 without further backtracking. */ | |
6099 | 154 #define REG_NO_POSIX_BACKTRACKING (1ul << 18) |
389 | 155 |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
156 /* If this bit is set, do not process the GNU regex operators. |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
157 If not set, then the GNU regex operators are recognized. */ |
6099 | 158 #define REG_NO_GNU_OPS (1ul << 19) |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
159 |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
160 /* If this bit is set, turn on internal regex debugging. |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
161 If not set, and debugging was on, turn it off. |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
162 This only works if regex.c is compiled -DDEBUG. |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
163 We define this bit always, so that all that's needed to turn on |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
164 debugging is to recompile regex.c; the calling code can always have |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
165 this bit set, and it won't affect anything in the normal case. */ |
6099 | 166 #define REG_DEBUG (1ul << 20) |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
167 |
3227 | 168 /* If this bit is set, a syntactically invalid interval is treated as |
169 a string of ordinary characters. For example, the ERE 'a{1' is | |
170 treated as 'a\{1'. */ | |
6099 | 171 #define REG_INVALID_INTERVAL_ORD (1ul << 21) |
3227 | 172 |
4020 | 173 /* If this bit is set, then ignore case when matching. |
174 If not set, then case is significant. */ | |
6099 | 175 #define REG_IGNORE_CASE (1ul << 22) |
4020 | 176 |
6099 | 177 /* This bit is used internally like REG_CONTEXT_INDEP_ANCHORS but only |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
178 for ^, because it is difficult to scan the regex backwards to find |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
179 whether ^ should be special. */ |
6099 | 180 #define REG_CARET_ANCHORS_HERE (1ul << 23) |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
181 |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
182 /* If this bit is set, then \{ cannot be first in an bre or |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
183 immediately after an alternation or begin-group operator. */ |
6099 | 184 #define REG_CONTEXT_INVALID_DUP (1ul << 24) |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
185 |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
186 /* If this bit is set, then no_sub will be set to 1 during |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
187 re_compile_pattern. */ |
6099 | 188 #define REG_NO_SUB (1ul << 25) |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
189 |
14 | 190 /* This global variable defines the particular regexp syntax to use (for |
191 some interfaces). When a regexp is compiled, the syntax used is | |
192 stored in the pattern buffer, so changing this does not affect | |
193 already-compiled regexps. */ | |
194 extern reg_syntax_t re_syntax_options; | |
195 | |
196 /* Define combinations of the above bits for the standard possibilities. | |
197 (The [[[ comments delimit what gets put into the Texinfo file, so | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
198 don't delete them!) */ |
14 | 199 /* [[[begin syntaxes]]] */ |
6099 | 200 #define REG_SYNTAX_EMACS 0 |
14 | 201 |
6099 | 202 #define REG_SYNTAX_AWK \ |
203 (REG_BACKSLASH_ESCAPE_IN_LISTS | REG_DOT_NOT_NULL \ | |
204 | REG_NO_BK_PARENS | REG_NO_BK_REFS \ | |
205 | REG_NO_BK_VBAR | REG_NO_EMPTY_RANGES \ | |
206 | REG_DOT_NEWLINE | REG_CONTEXT_INDEP_ANCHORS \ | |
207 | REG_UNMATCHED_RIGHT_PAREN_ORD | REG_NO_GNU_OPS) | |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
208 |
6099 | 209 #define REG_SYNTAX_GNU_AWK \ |
210 ((REG_SYNTAX_POSIX_EXTENDED | REG_BACKSLASH_ESCAPE_IN_LISTS \ | |
211 | REG_DEBUG) \ | |
212 & ~(REG_DOT_NOT_NULL | REG_INTERVALS | REG_CONTEXT_INDEP_OPS \ | |
213 | REG_CONTEXT_INVALID_OPS )) | |
14 | 214 |
6099 | 215 #define REG_SYNTAX_POSIX_AWK \ |
216 (REG_SYNTAX_POSIX_EXTENDED | REG_BACKSLASH_ESCAPE_IN_LISTS \ | |
217 | REG_INTERVALS | REG_NO_GNU_OPS) | |
14 | 218 |
6099 | 219 #define REG_SYNTAX_GREP \ |
220 (REG_BK_PLUS_QM | REG_CHAR_CLASSES \ | |
221 | REG_HAT_LISTS_NOT_NEWLINE | REG_INTERVALS \ | |
222 | REG_NEWLINE_ALT) | |
14 | 223 |
6099 | 224 #define REG_SYNTAX_EGREP \ |
225 (REG_CHAR_CLASSES | REG_CONTEXT_INDEP_ANCHORS \ | |
226 | REG_CONTEXT_INDEP_OPS | REG_HAT_LISTS_NOT_NEWLINE \ | |
227 | REG_NEWLINE_ALT | REG_NO_BK_PARENS \ | |
228 | REG_NO_BK_VBAR) | |
14 | 229 |
6099 | 230 #define REG_SYNTAX_POSIX_EGREP \ |
231 (REG_SYNTAX_EGREP | REG_INTERVALS | REG_NO_BK_BRACES \ | |
232 | REG_INVALID_INTERVAL_ORD) | |
14 | 233 |
389 | 234 /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ |
6099 | 235 #define REG_SYNTAX_ED REG_SYNTAX_POSIX_BASIC |
389 | 236 |
6099 | 237 #define REG_SYNTAX_SED REG_SYNTAX_POSIX_BASIC |
14 | 238 |
239 /* Syntax bits common to both basic and extended POSIX regex syntax. */ | |
6099 | 240 #define _REG_SYNTAX_POSIX_COMMON \ |
241 (REG_CHAR_CLASSES | REG_DOT_NEWLINE | REG_DOT_NOT_NULL \ | |
242 | REG_INTERVALS | REG_NO_EMPTY_RANGES) | |
14 | 243 |
6099 | 244 #define REG_SYNTAX_POSIX_BASIC \ |
245 (_REG_SYNTAX_POSIX_COMMON | REG_BK_PLUS_QM | REG_CONTEXT_INVALID_DUP) | |
14 | 246 |
6099 | 247 /* Differs from ..._POSIX_BASIC only in that REG_BK_PLUS_QM becomes |
248 REG_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this | |
14 | 249 isn't minimal, since other operators, such as \`, aren't disabled. */ |
6099 | 250 #define REG_SYNTAX_POSIX_MINIMAL_BASIC \ |
251 (_REG_SYNTAX_POSIX_COMMON | REG_LIMITED_OPS) | |
14 | 252 |
6099 | 253 #define REG_SYNTAX_POSIX_EXTENDED \ |
254 (_REG_SYNTAX_POSIX_COMMON | REG_CONTEXT_INDEP_ANCHORS \ | |
255 | REG_CONTEXT_INDEP_OPS | REG_NO_BK_BRACES \ | |
256 | REG_NO_BK_PARENS | REG_NO_BK_VBAR \ | |
257 | REG_CONTEXT_INVALID_OPS | REG_UNMATCHED_RIGHT_PAREN_ORD) | |
14 | 258 |
6099 | 259 /* Differs from ..._POSIX_EXTENDED in that REG_CONTEXT_INDEP_OPS is |
260 removed and REG_NO_BK_REFS is added. */ | |
261 #define REG_SYNTAX_POSIX_MINIMAL_EXTENDED \ | |
262 (_REG_SYNTAX_POSIX_COMMON | REG_CONTEXT_INDEP_ANCHORS \ | |
263 | REG_CONTEXT_INVALID_OPS | REG_NO_BK_BRACES \ | |
264 | REG_NO_BK_PARENS | REG_NO_BK_REFS \ | |
265 | REG_NO_BK_VBAR | REG_UNMATCHED_RIGHT_PAREN_ORD) | |
14 | 266 /* [[[end syntaxes]]] */ |
267 | |
6099 | 268 /* Maximum number of duplicates an interval can allow. This is |
269 distinct from RE_DUP_MAX, to conform to POSIX name space rules and | |
270 to avoid collisions with <limits.h>. */ | |
271 #define REG_DUP_MAX 32767 | |
14 | 272 |
273 | |
274 /* POSIX `cflags' bits (i.e., information for `regcomp'). */ | |
275 | |
276 /* If this bit is set, then use extended regular expression syntax. | |
277 If not set, then use basic regular expression syntax. */ | |
278 #define REG_EXTENDED 1 | |
279 | |
280 /* If this bit is set, then ignore case when matching. | |
281 If not set, then case is significant. */ | |
6099 | 282 #define REG_ICASE (1 << 1) |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
283 |
14 | 284 /* If this bit is set, then anchors do not match at newline |
285 characters in the string. | |
286 If not set, then anchors do match at newlines. */ | |
6099 | 287 #define REG_NEWLINE (1 << 2) |
14 | 288 |
289 /* If this bit is set, then report only success or fail in regexec. | |
290 If not set, then returns differ between not matching and errors. */ | |
6099 | 291 #define REG_NOSUB (1 << 3) |
14 | 292 |
293 | |
294 /* POSIX `eflags' bits (i.e., information for regexec). */ | |
295 | |
296 /* If this bit is set, then the beginning-of-line operator doesn't match | |
297 the beginning of the string (presumably because it's not the | |
298 beginning of a line). | |
299 If not set, then the beginning-of-line operator does match the | |
300 beginning of the string. */ | |
301 #define REG_NOTBOL 1 | |
302 | |
303 /* Like REG_NOTBOL, except for the end-of-line. */ | |
304 #define REG_NOTEOL (1 << 1) | |
305 | |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
306 /* Use PMATCH[0] to delimit the start and end of the search in the |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
307 buffer. */ |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
308 #define REG_STARTEND (1 << 2) |
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5851
diff
changeset
|
309 |
14 | 310 |
311 /* If any error codes are removed, changed, or added, update the | |
6099 | 312 `__re_error_msgid' table in regcomp.c. */ |
313 | |
14 | 314 typedef enum |
315 { | |
6099 | 316 _REG_ENOSYS = -1, /* This will never happen for this implementation. */ |
317 #define REG_ENOSYS _REG_ENOSYS | |
1283 | 318 |
6099 | 319 _REG_NOERROR, /* Success. */ |
320 #define REG_NOERROR _REG_NOERROR | |
321 | |
322 _REG_NOMATCH, /* Didn't find a match (for regexec). */ | |
323 #define REG_NOMATCH _REG_NOMATCH | |
14 | 324 |
325 /* POSIX regcomp return error codes. (In the order listed in the | |
326 standard.) */ | |
6099 | 327 |
328 _REG_BADPAT, /* Invalid pattern. */ | |
329 #define REG_BADPAT _REG_BADPAT | |
330 | |
331 _REG_ECOLLATE, /* Inalid collating element. */ | |
332 #define REG_ECOLLATE _REG_ECOLLATE | |
333 | |
334 _REG_ECTYPE, /* Invalid character class name. */ | |
335 #define REG_ECTYPE _REG_ECTYPE | |
336 | |
337 _REG_EESCAPE, /* Trailing backslash. */ | |
338 #define REG_EESCAPE _REG_EESCAPE | |
339 | |
340 _REG_ESUBREG, /* Invalid back reference. */ | |
341 #define REG_ESUBREG _REG_ESUBREG | |
342 | |
343 _REG_EBRACK, /* Unmatched left bracket. */ | |
344 #define REG_EBRACK _REG_EBRACK | |
345 | |
346 _REG_EPAREN, /* Parenthesis imbalance. */ | |
347 #define REG_EPAREN _REG_EPAREN | |
348 | |
349 _REG_EBRACE, /* Unmatched \{. */ | |
350 #define REG_EBRACE _REG_EBRACE | |
351 | |
352 _REG_BADBR, /* Invalid contents of \{\}. */ | |
353 #define REG_BADBR _REG_BADBR | |
354 | |
355 _REG_ERANGE, /* Invalid range end. */ | |
356 #define REG_ERANGE _REG_ERANGE | |
357 | |
358 _REG_ESPACE, /* Ran out of memory. */ | |
359 #define REG_ESPACE _REG_ESPACE | |
360 | |
361 _REG_BADRPT, /* No preceding re for repetition op. */ | |
362 #define REG_BADRPT _REG_BADRPT | |
14 | 363 |
364 /* Error codes we've added. */ | |
6099 | 365 |
366 _REG_EEND, /* Premature end. */ | |
367 #define REG_EEND _REG_EEND | |
368 | |
369 _REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ | |
370 #define REG_ESIZE _REG_ESIZE | |
371 | |
372 _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ | |
373 #define REG_ERPAREN _REG_ERPAREN | |
374 | |
14 | 375 } reg_errcode_t; |
376 | |
6099 | 377 /* In the traditional GNU implementation, regex.h defined member names |
378 like `buffer' that POSIX does not allow. These members now have | |
379 names with leading `re_' (e.g., `re_buffer'). Support the old | |
380 names only if _REGEX_SOURCE is defined. New programs should use | |
381 the new names. */ | |
382 #ifdef _REGEX_SOURCE | |
383 # define _REG_RE_NAME(id) id | |
384 # define _REG_RM_NAME(id) id | |
385 #else | |
386 # define _REG_RE_NAME(id) re_##id | |
387 # define _REG_RM_NAME(id) rm_##id | |
388 #endif | |
389 | |
390 /* The user can specify the type of the re_translate member by | |
391 defining the macro REG_TRANSLATE_TYPE. In the traditional GNU | |
392 implementation, this macro was named RE_TRANSLATE_TYPE, but POSIX | |
393 does not allow this. Support the old name only if _REGEX_SOURCE | |
394 and if the new name is not defined. New programs should use the new | |
395 name. */ | |
396 #ifndef REG_TRANSLATE_TYPE | |
397 # if defined _REGEX_SOURCE && defined RE_TRANSLATE_TYPE | |
398 # define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE | |
399 # else | |
400 # define REG_TRANSLATE_TYPE char * | |
401 # endif | |
402 #endif | |
403 | |
14 | 404 /* This data structure represents a compiled pattern. Before calling |
6099 | 405 the pattern compiler), the fields `re_buffer', `re_allocated', `re_fastmap', |
406 `re_translate', and `re_no_sub' can be set. After the pattern has been | |
14 | 407 compiled, the `re_nsub' field is available. All other fields are |
408 private to the regex routines. */ | |
409 | |
410 struct re_pattern_buffer | |
411 { | |
412 /* [[[begin pattern_buffer]]] */ | |
413 /* Space that holds the compiled pattern. It is declared as | |
414 `unsigned char *' because its elements are | |
415 sometimes used as array indexes. */ | |
6099 | 416 unsigned char *_REG_RE_NAME (buffer); |
14 | 417 |
6099 | 418 /* Number of bytes to which `re_buffer' points. */ |
419 unsigned long int _REG_RE_NAME (allocated); | |
14 | 420 |
6099 | 421 /* Number of bytes actually used in `re_buffer'. */ |
422 unsigned long int _REG_RE_NAME (used); | |
14 | 423 |
424 /* Syntax setting with which the pattern was compiled. */ | |
6099 | 425 reg_syntax_t _REG_RE_NAME (syntax); |
14 | 426 |
427 /* Pointer to a fastmap, if any, otherwise zero. re_search uses | |
428 the fastmap, if there is one, to skip over impossible | |
429 starting points for matches. */ | |
6099 | 430 char *_REG_RE_NAME (fastmap); |
14 | 431 |
432 /* Either a translate table to apply to all characters before | |
433 comparing them, or zero for no translation. The translation | |
434 is applied to a pattern when it is compiled and to a string | |
435 when it is matched. */ | |
6099 | 436 REG_TRANSLATE_TYPE _REG_RE_NAME (translate); |
14 | 437 |
438 /* Number of subexpressions found by the compiler. */ | |
439 size_t re_nsub; | |
440 | |
441 /* Zero if this pattern cannot match the empty string, one else. | |
442 Well, in truth it's used only in `re_search_2', to see | |
443 whether or not we should use the fastmap, so we don't set | |
444 this absolutely perfectly; see `re_compile_fastmap' (the | |
445 `duplicate' case). */ | |
6099 | 446 unsigned int _REG_RE_NAME (can_be_null) : 1; |
14 | 447 |
6099 | 448 /* If REG_UNALLOCATED, allocate space in the `regs' structure |
449 for `max (REG_NREGS, re_nsub + 1)' groups. | |
450 If REG_REALLOCATE, reallocate space if necessary. | |
451 If REG_FIXED, use what's there. */ | |
452 #define REG_UNALLOCATED 0 | |
453 #define REG_REALLOCATE 1 | |
454 #define REG_FIXED 2 | |
455 unsigned int _REG_RE_NAME (regs_allocated) : 2; | |
14 | 456 |
389 | 457 /* Set to zero when `regex_compile' compiles a pattern; set to one |
458 by `re_compile_fastmap' if it updates the fastmap. */ | |
6099 | 459 unsigned int _REG_RE_NAME (fastmap_accurate) : 1; |
14 | 460 |
389 | 461 /* If set, `re_match_2' does not return information about |
462 subexpressions. */ | |
6099 | 463 unsigned int _REG_RE_NAME (no_sub) : 1; |
14 | 464 |
465 /* If set, a beginning-of-line anchor doesn't match at the | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
502
diff
changeset
|
466 beginning of the string. */ |
6099 | 467 unsigned int _REG_RE_NAME (not_bol) : 1; |
14 | 468 |
469 /* Similarly for an end-of-line anchor. */ | |
6099 | 470 unsigned int _REG_RE_NAME (not_eol) : 1; |
14 | 471 |
472 /* If true, an anchor at a newline matches. */ | |
6099 | 473 unsigned int _REG_RE_NAME (newline_anchor) : 1; |
14 | 474 |
475 /* [[[end pattern_buffer]]] */ | |
476 }; | |
477 | |
478 typedef struct re_pattern_buffer regex_t; | |
479 | |
480 /* Type for byte offsets within the string. POSIX mandates this. */ | |
481 typedef int regoff_t; | |
482 | |
483 | |
484 /* This is the structure we store register match data in. See | |
485 regex.texinfo for a full description of what registers match. */ | |
486 struct re_registers | |
487 { | |
6099 | 488 unsigned int _REG_RM_NAME (num_regs); |
489 regoff_t *_REG_RM_NAME (start); | |
490 regoff_t *_REG_RM_NAME (end); | |
14 | 491 }; |
492 | |
493 | |
6099 | 494 /* If `regs_allocated' is REG_UNALLOCATED in the pattern buffer, |
14 | 495 `re_match_2' returns information about at least this many registers |
496 the first time a `regs' structure is passed. */ | |
6099 | 497 #ifndef REG_NREGS |
498 # define REG_NREGS 30 | |
14 | 499 #endif |
500 | |
501 | |
502 /* POSIX specification for registers. Aside from the different names than | |
503 `re_registers', POSIX uses an array of structures, instead of a | |
504 structure of arrays. */ | |
505 typedef struct | |
506 { | |
507 regoff_t rm_so; /* Byte offset from string's start to substring's start. */ | |
508 regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ | |
509 } regmatch_t; | |
510 | |
511 /* Declarations for routines. */ | |
512 | |
513 /* Sets the current default syntax to SYNTAX, and return the old syntax. | |
514 You can also simply assign to the `re_syntax_options' variable. */ | |
6099 | 515 extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); |
14 | 516 |
517 /* Compile the regular expression PATTERN, with length LENGTH | |
518 and syntax given by the global `re_syntax_options', into the buffer | |
519 BUFFER. Return NULL if successful, and an error string if not. */ | |
6099 | 520 extern const char *re_compile_pattern (const char *__pattern, size_t __length, |
521 struct re_pattern_buffer *__buffer); | |
14 | 522 |
523 | |
524 /* Compile a fastmap for the compiled pattern in BUFFER; used to | |
525 accelerate searches. Return 0 if successful and -2 if was an | |
526 internal error. */ | |
6099 | 527 extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); |
14 | 528 |
529 | |
530 /* Search in the string STRING (with length LENGTH) for the pattern | |
531 compiled into BUFFER. Start searching at position START, for RANGE | |
532 characters. Return the starting position of the match, -1 for no | |
533 match, or -2 for an internal error. Also return register | |
6099 | 534 information in REGS (if REGS and BUFFER->re_no_sub are nonzero). */ |
535 extern int re_search (struct re_pattern_buffer *__buffer, const char *__string, | |
536 int __length, int __start, int __range, | |
537 struct re_registers *__regs); | |
14 | 538 |
539 | |
540 /* Like `re_search', but search in the concatenation of STRING1 and | |
541 STRING2. Also, stop searching at index START + STOP. */ | |
6099 | 542 extern int re_search_2 (struct re_pattern_buffer *__buffer, |
543 const char *__string1, int __length1, | |
544 const char *__string2, int __length2, | |
545 int __start, int __range, struct re_registers *__regs, | |
546 int __stop); | |
14 | 547 |
548 | |
549 /* Like `re_search', but return how many characters in STRING the regexp | |
550 in BUFFER matched, starting at position START. */ | |
6099 | 551 extern int re_match (struct re_pattern_buffer *__buffer, const char *__string, |
552 int __length, int __start, struct re_registers *__regs); | |
14 | 553 |
554 | |
555 /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ | |
6099 | 556 extern int re_match_2 (struct re_pattern_buffer *__buffer, |
557 const char *__string1, int __length1, | |
558 const char *__string2, int __length2, | |
559 int __start, struct re_registers *__regs, int __stop); | |
14 | 560 |
561 | |
562 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and | |
563 ENDS. Subsequent matches using BUFFER and REGS will use this memory | |
564 for recording register information. STARTS and ENDS must be | |
565 allocated with malloc, and must each be at least `NUM_REGS * sizeof | |
566 (regoff_t)' bytes long. | |
567 | |
568 If NUM_REGS == 0, then subsequent matches should allocate their own | |
569 register data. | |
570 | |
571 Unless this function is called, the first search or match using | |
572 PATTERN_BUFFER will allocate its own register data, without | |
573 freeing the old data. */ | |
6099 | 574 extern void re_set_registers (struct re_pattern_buffer *__buffer, |
575 struct re_registers *__regs, | |
576 unsigned int __num_regs, | |
577 regoff_t *__starts, regoff_t *__ends); | |
14 | 578 |
1639 | 579 #if defined _REGEX_RE_COMP || defined _LIBC |
1283 | 580 # ifndef _CRAY |
14 | 581 /* 4.2 bsd compatibility. */ |
6076
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
582 extern char *re_comp (const char *); |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
583 extern int re_exec (const char *); |
1283 | 584 # endif |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
585 #endif |
14 | 586 |
2927 | 587 /* GCC 2.95 and later have "__restrict"; C99 compilers have |
588 "restrict", and "configure" may have defined "restrict". */ | |
589 #ifndef __restrict | |
590 # if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) | |
591 # if defined restrict || 199901L <= __STDC_VERSION__ | |
592 # define __restrict restrict | |
593 # else | |
594 # define __restrict | |
595 # endif | |
596 # endif | |
2940
c7143052abca
(__restrict_arr): Move definition out of #ifndef block.
Jim Meyering <jim@meyering.net>
parents:
2927
diff
changeset
|
597 #endif |
6041
05710fe33bb1
* config/srclist.txt: Comment out $LIBCSRC/posix/regex.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5968
diff
changeset
|
598 /* gcc 3.1 and up support the [restrict] syntax, but g++ doesn't. */ |
3684
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
599 #ifndef __restrict_arr |
6041
05710fe33bb1
* config/srclist.txt: Comment out $LIBCSRC/posix/regex.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5968
diff
changeset
|
600 # if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) && !defined __cplusplus |
3684
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
601 # define __restrict_arr __restrict |
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
602 # else |
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
603 # define __restrict_arr |
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
604 # endif |
c8ed84e015e6
(__restrict_arr): Update from libc.
Jim Meyering <jim@meyering.net>
parents:
3336
diff
changeset
|
605 #endif |
2927 | 606 |
14 | 607 /* POSIX compatibility. */ |
6076
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
608 extern int regcomp (regex_t *__restrict __preg, |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
609 const char *__restrict __pattern, |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
610 int __cflags); |
1466 | 611 |
6076
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
612 extern int regexec (const regex_t *__restrict __preg, |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
613 const char *__restrict __string, size_t __nmatch, |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
614 regmatch_t __pmatch[__restrict_arr], |
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
615 int __eflags); |
1466 | 616 |
6104
1e308ce32c4c
* config/srclist.txt: Add glibc bug 1240.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6100
diff
changeset
|
617 extern size_t regerror (int __errcode, const regex_t *__restrict __preg, |
1e308ce32c4c
* config/srclist.txt: Add glibc bug 1240.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6100
diff
changeset
|
618 char *__restrict __errbuf, size_t __errbuf_size); |
1466 | 619 |
6076
e2dd51f6e259
* config/srclist.txt: Add glibc bugs 1220, 1221, 1222.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6059
diff
changeset
|
620 extern void regfree (regex_t *__preg); |
14 | 621 |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
622 |
6099 | 623 #ifdef _REGEX_SOURCE |
624 | |
625 /* Define the POSIX-compatible member names in terms of the | |
626 incompatible (and deprecated) names established by _REG_RE_NAME. | |
627 New programs should use the re_* names. */ | |
628 | |
629 # define re_allocated allocated | |
630 # define re_buffer buffer | |
631 # define re_can_be_null can_be_null | |
632 # define re_fastmap fastmap | |
6100
b4fe67182e68
[_REGEX_SOURCE]: Define re_fastmap_accurate too; this was
Paul Eggert <eggert@cs.ucla.edu>
parents:
6099
diff
changeset
|
633 # define re_fastmap_accurate fastmap_accurate |
6099 | 634 # define re_newline_anchor newline_anchor |
635 # define re_no_sub no_sub | |
636 # define re_not_bol not_bol | |
637 # define re_not_eol not_eol | |
638 # define re_regs_allocated regs_allocated | |
639 # define re_syntax syntax | |
640 # define re_translate translate | |
641 # define re_used used | |
642 | |
643 /* Similarly for _REG_RM_NAME. */ | |
644 | |
645 # define rm_end end | |
646 # define rm_num_regs num_regs | |
647 # define rm_start start | |
648 | |
649 /* Undef RE_DUP_MAX first, in case the user has already included a | |
650 <limits.h> with an incompatible definition. | |
651 | |
652 On GNU systems, the most common spelling for RE_DUP_MAX's value in | |
653 <limits.h> is (0x7ffff), so define RE_DUP_MAX to that, not to | |
654 REG_DUP_MAX. This avoid some duplicate-macro-definition warnings | |
655 with programs that include <limits.h> after this file. | |
656 | |
657 New programs should not assume that regex.h defines RE_DUP_MAX; to | |
658 get the value of RE_DUP_MAX, they should instead include <limits.h> | |
659 and possibly invoke the sysconf function. */ | |
660 | |
661 # undef RE_DUP_MAX | |
662 # define RE_DUP_MAX (0x7fff) | |
663 | |
664 /* Define the following symbols for backward source compatibility. | |
665 These symbols violate the POSIX name space rules, and new programs | |
666 should avoid them. */ | |
667 | |
668 # define REGS_FIXED REG_FIXED | |
669 # define REGS_REALLOCATE REG_REALLOCATE | |
670 # define REGS_UNALLOCATED REG_UNALLOCATED | |
671 # define RE_BACKSLASH_ESCAPE_IN_LISTS REG_BACKSLASH_ESCAPE_IN_LISTS | |
672 # define RE_BK_PLUS_QM REG_BK_PLUS_QM | |
673 # define RE_CARET_ANCHORS_HERE REG_CARET_ANCHORS_HERE | |
674 # define RE_CHAR_CLASSES REG_CHAR_CLASSES | |
675 # define RE_CONTEXT_INDEP_ANCHORS REG_CONTEXT_INDEP_ANCHORS | |
676 # define RE_CONTEXT_INDEP_OPS REG_CONTEXT_INDEP_OPS | |
677 # define RE_CONTEXT_INVALID_DUP REG_CONTEXT_INVALID_DUP | |
678 # define RE_CONTEXT_INVALID_OPS REG_CONTEXT_INVALID_OPS | |
679 # define RE_DEBUG REG_DEBUG | |
680 # define RE_DOT_NEWLINE REG_DOT_NEWLINE | |
681 # define RE_DOT_NOT_NULL REG_DOT_NOT_NULL | |
682 # define RE_HAT_LISTS_NOT_NEWLINE REG_HAT_LISTS_NOT_NEWLINE | |
683 # define RE_ICASE REG_IGNORE_CASE /* avoid collision with REG_ICASE */ | |
684 # define RE_INTERVALS REG_INTERVALS | |
685 # define RE_INVALID_INTERVAL_ORD REG_INVALID_INTERVAL_ORD | |
686 # define RE_LIMITED_OPS REG_LIMITED_OPS | |
687 # define RE_NEWLINE_ALT REG_NEWLINE_ALT | |
688 # define RE_NO_BK_BRACES REG_NO_BK_BRACES | |
689 # define RE_NO_BK_PARENS REG_NO_BK_PARENS | |
690 # define RE_NO_BK_REFS REG_NO_BK_REFS | |
691 # define RE_NO_BK_VBAR REG_NO_BK_VBAR | |
692 # define RE_NO_EMPTY_RANGES REG_NO_EMPTY_RANGES | |
693 # define RE_NO_GNU_OPS REG_NO_GNU_OPS | |
694 # define RE_NO_POSIX_BACKTRACKING REG_NO_POSIX_BACKTRACKING | |
695 # define RE_NO_SUB REG_NO_SUB | |
696 # define RE_NREGS REG_NREGS | |
697 # define RE_SYNTAX_AWK REG_SYNTAX_AWK | |
698 # define RE_SYNTAX_ED REG_SYNTAX_ED | |
699 # define RE_SYNTAX_EGREP REG_SYNTAX_EGREP | |
700 # define RE_SYNTAX_EMACS REG_SYNTAX_EMACS | |
701 # define RE_SYNTAX_GNU_AWK REG_SYNTAX_GNU_AWK | |
702 # define RE_SYNTAX_GREP REG_SYNTAX_GREP | |
703 # define RE_SYNTAX_POSIX_AWK REG_SYNTAX_POSIX_AWK | |
704 # define RE_SYNTAX_POSIX_BASIC REG_SYNTAX_POSIX_BASIC | |
705 # define RE_SYNTAX_POSIX_EGREP REG_SYNTAX_POSIX_EGREP | |
706 # define RE_SYNTAX_POSIX_EXTENDED REG_SYNTAX_POSIX_EXTENDED | |
707 # define RE_SYNTAX_POSIX_MINIMAL_BASIC REG_SYNTAX_POSIX_MINIMAL_BASIC | |
708 # define RE_SYNTAX_POSIX_MINIMAL_EXTENDED REG_SYNTAX_POSIX_MINIMAL_EXTENDED | |
709 # define RE_SYNTAX_SED REG_SYNTAX_SED | |
710 # define RE_UNMATCHED_RIGHT_PAREN_ORD REG_UNMATCHED_RIGHT_PAREN_ORD | |
711 # ifndef RE_TRANSLATE_TYPE | |
712 # define RE_TRANSLATE_TYPE REG_TRANSLATE_TYPE | |
713 # endif | |
714 | |
715 #endif /* defined _REGEX_SOURCE */ | |
716 | |
988
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
717 #ifdef __cplusplus |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
718 } |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
719 #endif /* C++ */ |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
720 |
ba13cef00d11
replace with new version from libc
Jim Meyering <jim@meyering.net>
parents:
649
diff
changeset
|
721 #endif /* regex.h */ |
14 | 722 |
723 /* | |
724 Local variables: | |
725 make-backup-files: t | |
726 version-control: t | |
727 trim-versions-without-asking: nil | |
728 End: | |
729 */ |