Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenregex.h
Go to the documentation of this file.
00001 /* Definitions for data structures and routines for the regular 00002 expression library, version 0.12. 00003 Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc. 00004 00005 This file is part of the GNU C Library. Its master source is NOT part of 00006 the C library, however. The master source lives in /gd/gnu/lib. 00007 00008 The GNU C Library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 The GNU C Library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with the GNU C Library; if not, write to the Free 00020 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 Boston, MA 02110-1301, USA. 00022 */ 00023 00024 #ifndef _REGEX_H 00025 #define _REGEX_H 1 00026 00027 /* Allow the use in C++ code. */ 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 /* POSIX says that <sys/types.h> must be included (by the caller) before 00033 <regex.h>. */ 00034 00035 #if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS 00036 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it 00037 should be there. */ 00038 # include <stddef.h> 00039 #endif 00040 00041 /* The following two types have to be signed and unsigned integer type 00042 wide enough to hold a value of a pointer. For most ANSI compilers 00043 ptrdiff_t and size_t should be likely OK. Still size of these two 00044 types is 2 for Microsoft C. Ugh... */ 00045 typedef long int s_reg_t; 00046 typedef unsigned long int active_reg_t; 00047 00048 /* The following bits are used to determine the regexp syntax we 00049 recognize. The set/not-set meanings are chosen so that Emacs syntax 00050 remains the value 0. The bits are given in alphabetical order, and 00051 the definitions shifted by one from the previous bit; thus, when we 00052 add or remove a bit, only one other definition need change. */ 00053 typedef unsigned long int reg_syntax_t; 00054 00055 /* If this bit is not set, then \ inside a bracket expression is literal. 00056 If set, then such a \ quotes the following character. */ 00057 #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) 00058 00059 /* If this bit is not set, then + and ? are operators, and \+ and \? are 00060 literals. 00061 If set, then \+ and \? are operators and + and ? are literals. */ 00062 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) 00063 00064 /* If this bit is set, then character classes are supported. They are: 00065 [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], 00066 [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. 00067 If not set, then character classes are not supported. */ 00068 #define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) 00069 00070 /* If this bit is set, then ^ and $ are always anchors (outside bracket 00071 expressions, of course). 00072 If this bit is not set, then it depends: 00073 ^ is an anchor if it is at the beginning of a regular 00074 expression or after an open-group or an alternation operator; 00075 $ is an anchor if it is at the end of a regular expression, or 00076 before a close-group or an alternation operator. 00077 00078 This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because 00079 POSIX draft 11.2 says that * etc. in leading positions is undefined. 00080 We already implemented a previous draft which made those constructs 00081 invalid, though, so we haven't changed the code back. */ 00082 #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) 00083 00084 /* If this bit is set, then special characters are always special 00085 regardless of where they are in the pattern. 00086 If this bit is not set, then special characters are special only in 00087 some contexts; otherwise they are ordinary. Specifically, 00088 * + ? and intervals are only special when not after the beginning, 00089 open-group, or alternation operator. */ 00090 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) 00091 00092 /* If this bit is set, then *, +, ?, and { cannot be first in an re or 00093 immediately after an alternation or begin-group operator. */ 00094 #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) 00095 00096 /* If this bit is set, then . matches newline. 00097 If not set, then it doesn't. */ 00098 #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) 00099 00100 /* If this bit is set, then . doesn't match NUL. 00101 If not set, then it does. */ 00102 #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) 00103 00104 /* If this bit is set, nonmatching lists [^...] do not match newline. 00105 If not set, they do. */ 00106 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) 00107 00108 /* If this bit is set, either \{...\} or {...} defines an 00109 interval, depending on RE_NO_BK_BRACES. 00110 If not set, \{, \}, {, and } are literals. */ 00111 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) 00112 00113 /* If this bit is set, +, ? and | aren't recognized as operators. 00114 If not set, they are. */ 00115 #define RE_LIMITED_OPS (RE_INTERVALS << 1) 00116 00117 /* If this bit is set, newline is an alternation operator. 00118 If not set, newline is literal. */ 00119 #define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) 00120 00121 /* If this bit is set, then `{...}' defines an interval, and \{ and \} 00122 are literals. 00123 If not set, then `\{...\}' defines an interval. */ 00124 #define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) 00125 00126 /* If this bit is set, (...) defines a group, and \( and \) are literals. 00127 If not set, \(...\) defines a group, and ( and ) are literals. */ 00128 #define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) 00129 00130 /* If this bit is set, then <digit> matches <digit>. 00131 If not set, then <digit> is a back-reference. */ 00132 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) 00133 00134 /* If this bit is set, then | is an alternation operator, and \| is literal. 00135 If not set, then \| is an alternation operator, and | is literal. */ 00136 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) 00137 00138 /* If this bit is set, then an ending range point collating higher 00139 than the starting range point, as in [z-a], is invalid. 00140 If not set, then when ending range point collates higher than the 00141 starting range point, the range is ignored. */ 00142 #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) 00143 00144 /* If this bit is set, then an unmatched ) is ordinary. 00145 If not set, then an unmatched ) is invalid. */ 00146 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) 00147 00148 /* If this bit is set, succeed as soon as we match the whole pattern, 00149 without further backtracking. */ 00150 #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) 00151 00152 /* If this bit is set, do not process the GNU regex operators. 00153 If not set, then the GNU regex operators are recognized. */ 00154 #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) 00155 00156 /* If this bit is set, turn on internal regex debugging. 00157 If not set, and debugging was on, turn it off. 00158 This only works if regex.c is compiled -DDEBUG. 00159 We define this bit always, so that all that's needed to turn on 00160 debugging is to recompile regex.c; the calling code can always have 00161 this bit set, and it won't affect anything in the normal case. */ 00162 #define RE_DEBUG (RE_NO_GNU_OPS << 1) 00163 00164 /* This global variable defines the particular regexp syntax to use (for 00165 some interfaces). When a regexp is compiled, the syntax used is 00166 stored in the pattern buffer, so changing this does not affect 00167 already-compiled regexps. */ 00168 extern reg_syntax_t re_syntax_options; 00169 00170 /* Define combinations of the above bits for the standard possibilities. 00171 (The [[[ comments delimit what gets put into the Texinfo file, so 00172 don't delete them!) */ 00173 /* [[[begin syntaxes]]] */ 00174 #define RE_SYNTAX_EMACS 0 00175 00176 #define RE_SYNTAX_AWK \ 00177 (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ 00178 | RE_NO_BK_PARENS | RE_NO_BK_REFS \ 00179 | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ 00180 | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ 00181 | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) 00182 00183 #define RE_SYNTAX_GNU_AWK \ 00184 ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ 00185 & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS)) 00186 00187 #define RE_SYNTAX_POSIX_AWK \ 00188 (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ 00189 | RE_INTERVALS | RE_NO_GNU_OPS) 00190 00191 #define RE_SYNTAX_GREP \ 00192 (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ 00193 | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ 00194 | RE_NEWLINE_ALT) 00195 00196 #define RE_SYNTAX_EGREP \ 00197 (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ 00198 | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ 00199 | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ 00200 | RE_NO_BK_VBAR) 00201 00202 #define RE_SYNTAX_POSIX_EGREP \ 00203 (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) 00204 00205 /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ 00206 #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC 00207 00208 #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC 00209 00210 /* Syntax bits common to both basic and extended POSIX regex syntax. */ 00211 #define _RE_SYNTAX_POSIX_COMMON \ 00212 (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ 00213 | RE_INTERVALS | RE_NO_EMPTY_RANGES) 00214 00215 #define RE_SYNTAX_POSIX_BASIC \ 00216 (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) 00217 00218 /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes 00219 RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this 00220 isn't minimal, since other operators, such as \`, aren't disabled. */ 00221 #define RE_SYNTAX_POSIX_MINIMAL_BASIC \ 00222 (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) 00223 00224 #define RE_SYNTAX_POSIX_EXTENDED \ 00225 (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ 00226 | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ 00227 | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ 00228 | RE_UNMATCHED_RIGHT_PAREN_ORD) 00229 00230 /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS 00231 replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ 00232 #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ 00233 (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ 00234 | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ 00235 | RE_NO_BK_PARENS | RE_NO_BK_REFS \ 00236 | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) 00237 /* [[[end syntaxes]]] */ 00238 00239 /* Maximum number of duplicates an interval can allow. Some systems 00240 (erroneously) define this in other header files, but we want our 00241 value, so remove any previous define. */ 00242 #ifdef RE_DUP_MAX 00243 # undef RE_DUP_MAX 00244 #endif 00245 /* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */ 00246 #define RE_DUP_MAX (0x7fff) 00247 00248 00249 /* POSIX `cflags' bits (i.e., information for `regcomp'). */ 00250 00251 /* If this bit is set, then use extended regular expression syntax. 00252 If not set, then use basic regular expression syntax. */ 00253 #define REG_EXTENDED 1 00254 00255 /* If this bit is set, then ignore case when matching. 00256 If not set, then case is significant. */ 00257 #define REG_ICASE (REG_EXTENDED << 1) 00258 00259 /* If this bit is set, then anchors do not match at newline 00260 characters in the string. 00261 If not set, then anchors do match at newlines. */ 00262 #define REG_NEWLINE (REG_ICASE << 1) 00263 00264 /* If this bit is set, then report only success or fail in regexec. 00265 If not set, then returns differ between not matching and errors. */ 00266 #define REG_NOSUB (REG_NEWLINE << 1) 00267 00268 00269 /* POSIX `eflags' bits (i.e., information for regexec). */ 00270 00271 /* If this bit is set, then the beginning-of-line operator doesn't match 00272 the beginning of the string (presumably because it's not the 00273 beginning of a line). 00274 If not set, then the beginning-of-line operator does match the 00275 beginning of the string. */ 00276 #define REG_NOTBOL 1 00277 00278 /* Like REG_NOTBOL, except for the end-of-line. */ 00279 #define REG_NOTEOL (1 << 1) 00280 00281 00282 /* If any error codes are removed, changed, or added, update the 00283 `re_error_msg' table in regex.c. */ 00284 typedef enum 00285 { 00286 #ifdef _XOPEN_SOURCE 00287 REG_ENOSYS = -1, /* This will never happen for this implementation. */ 00288 #endif 00289 00290 REG_NOERROR = 0, /* Success. */ 00291 REG_NOMATCH, /* Didn't find a match (for regexec). */ 00292 00293 /* POSIX regcomp return error codes. (In the order listed in the 00294 standard.) */ 00295 REG_BADPAT, /* Invalid pattern. */ 00296 REG_ECOLLATE, /* Not implemented. */ 00297 REG_ECTYPE, /* Invalid character class name. */ 00298 REG_EESCAPE, /* Trailing backslash. */ 00299 REG_ESUBREG, /* Invalid back reference. */ 00300 REG_EBRACK, /* Unmatched left bracket. */ 00301 REG_EPAREN, /* Parenthesis imbalance. */ 00302 REG_EBRACE, /* Unmatched \{. */ 00303 REG_BADBR, /* Invalid contents of \{\}. */ 00304 REG_ERANGE, /* Invalid range end. */ 00305 REG_ESPACE, /* Ran out of memory. */ 00306 REG_BADRPT, /* No preceding re for repetition op. */ 00307 00308 /* Error codes we've added. */ 00309 REG_EEND, /* Premature end. */ 00310 REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ 00311 REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ 00312 } reg_errcode_t; 00313 00314 /* This data structure represents a compiled pattern. Before calling 00315 the pattern compiler, the fields `buffer', `allocated', `fastmap', 00316 `translate', and `no_sub' can be set. After the pattern has been 00317 compiled, the `re_nsub' field is available. All other fields are 00318 private to the regex routines. */ 00319 00320 #ifndef RE_TRANSLATE_TYPE 00321 # define RE_TRANSLATE_TYPE char * 00322 #endif 00323 00324 struct re_pattern_buffer 00325 { 00326 /* [[[begin pattern_buffer]]] */ 00327 /* Space that holds the compiled pattern. It is declared as 00328 `unsigned char *' because its elements are 00329 sometimes used as array indexes. */ 00330 unsigned char *buffer; 00331 00332 /* Number of bytes to which `buffer' points. */ 00333 unsigned long int allocated; 00334 00335 /* Number of bytes actually used in `buffer'. */ 00336 unsigned long int used; 00337 00338 /* Syntax setting with which the pattern was compiled. */ 00339 reg_syntax_t syntax; 00340 00341 /* Pointer to a fastmap, if any, otherwise zero. re_search uses 00342 the fastmap, if there is one, to skip over impossible 00343 starting points for matches. */ 00344 char *fastmap; 00345 00346 /* Either a translate table to apply to all characters before 00347 comparing them, or zero for no translation. The translation 00348 is applied to a pattern when it is compiled and to a string 00349 when it is matched. */ 00350 RE_TRANSLATE_TYPE translate; 00351 00352 /* Number of subexpressions found by the compiler. */ 00353 size_t re_nsub; 00354 00355 /* Zero if this pattern cannot match the empty string, one else. 00356 Well, in truth it's used only in `re_search_2', to see 00357 whether or not we should use the fastmap, so we don't set 00358 this absolutely perfectly; see `re_compile_fastmap' (the 00359 `duplicate' case). */ 00360 unsigned can_be_null : 1; 00361 00362 /* If REGS_UNALLOCATED, allocate space in the `regs' structure 00363 for `max (RE_NREGS, re_nsub + 1)' groups. 00364 If REGS_REALLOCATE, reallocate space if necessary. 00365 If REGS_FIXED, use what's there. */ 00366 #define REGS_UNALLOCATED 0 00367 #define REGS_REALLOCATE 1 00368 #define REGS_FIXED 2 00369 unsigned regs_allocated : 2; 00370 00371 /* Set to zero when `regex_compile' compiles a pattern; set to one 00372 by `re_compile_fastmap' if it updates the fastmap. */ 00373 unsigned fastmap_accurate : 1; 00374 00375 /* If set, `re_match_2' does not return information about 00376 subexpressions. */ 00377 unsigned no_sub : 1; 00378 00379 /* If set, a beginning-of-line anchor doesn't match at the 00380 beginning of the string. */ 00381 unsigned not_bol : 1; 00382 00383 /* Similarly for an end-of-line anchor. */ 00384 unsigned not_eol : 1; 00385 00386 /* If true, an anchor at a newline matches. */ 00387 unsigned newline_anchor : 1; 00388 00389 /* [[[end pattern_buffer]]] */ 00390 }; 00391 00392 typedef struct re_pattern_buffer regex_t; 00393 00394 /* Type for byte offsets within the string. POSIX mandates this. */ 00395 typedef int regoff_t; 00396 00397 00398 /* This is the structure we store register match data in. See 00399 regex.texinfo for a full description of what registers match. */ 00400 struct re_registers 00401 { 00402 unsigned num_regs; 00403 regoff_t *start; 00404 regoff_t *end; 00405 }; 00406 00407 00408 /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, 00409 `re_match_2' returns information about at least this many registers 00410 the first time a `regs' structure is passed. */ 00411 #ifndef RE_NREGS 00412 # define RE_NREGS 30 00413 #endif 00414 00415 00416 /* POSIX specification for registers. Aside from the different names than 00417 `re_registers', POSIX uses an array of structures, instead of a 00418 structure of arrays. */ 00419 typedef struct 00420 { 00421 regoff_t rm_so; /* Byte offset from string's start to substring's start. */ 00422 regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ 00423 } regmatch_t; 00424 00425 /* Declarations for routines. */ 00426 00427 /* To avoid duplicating every routine declaration -- once with a 00428 prototype (if we are ANSI), and once without (if we aren't) -- we 00429 use the following macro to declare argument types. This 00430 unfortunately clutters up the declarations a bit, but I think it's 00431 worth it. */ 00432 00433 #if __STDC__ 00434 00435 # define _RE_ARGS(args) args 00436 00437 #else /* not __STDC__ */ 00438 00439 # define _RE_ARGS(args) () 00440 00441 #endif /* not __STDC__ */ 00442 00443 /* Sets the current default syntax to SYNTAX, and return the old syntax. 00444 You can also simply assign to the `re_syntax_options' variable. */ 00445 extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); 00446 extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); 00447 00448 /* Compile the regular expression PATTERN, with length LENGTH 00449 and syntax given by the global `re_syntax_options', into the buffer 00450 BUFFER. Return NULL if successful, and an error string if not. */ 00451 extern const char *__re_compile_pattern 00452 _RE_ARGS ((const char *pattern, size_t length, 00453 struct re_pattern_buffer *buffer)); 00454 extern const char *re_compile_pattern 00455 _RE_ARGS ((const char *pattern, size_t length, 00456 struct re_pattern_buffer *buffer)); 00457 00458 00459 /* Compile a fastmap for the compiled pattern in BUFFER; used to 00460 accelerate searches. Return 0 if successful and -2 if was an 00461 internal error. */ 00462 extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); 00463 extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); 00464 00465 00466 /* Search in the string STRING (with length LENGTH) for the pattern 00467 compiled into BUFFER. Start searching at position START, for RANGE 00468 characters. Return the starting position of the match, -1 for no 00469 match, or -2 for an internal error. Also return register 00470 information in REGS (if REGS and BUFFER->no_sub are nonzero). */ 00471 extern int __re_search 00472 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 00473 int length, int start, int range, struct re_registers *regs)); 00474 extern int re_search 00475 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 00476 int length, int start, int range, struct re_registers *regs)); 00477 00478 00479 /* Like `re_search', but search in the concatenation of STRING1 and 00480 STRING2. Also, stop searching at index START + STOP. */ 00481 extern int __re_search_2 00482 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 00483 int length1, const char *string2, int length2, 00484 int start, int range, struct re_registers *regs, int stop)); 00485 extern int re_search_2 00486 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 00487 int length1, const char *string2, int length2, 00488 int start, int range, struct re_registers *regs, int stop)); 00489 00490 00491 /* Like `re_search', but return how many characters in STRING the regexp 00492 in BUFFER matched, starting at position START. */ 00493 extern int __re_match 00494 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 00495 int length, int start, struct re_registers *regs)); 00496 extern int re_match 00497 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 00498 int length, int start, struct re_registers *regs)); 00499 00500 00501 /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ 00502 extern int __re_match_2 00503 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 00504 int length1, const char *string2, int length2, 00505 int start, struct re_registers *regs, int stop)); 00506 extern int re_match_2 00507 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 00508 int length1, const char *string2, int length2, 00509 int start, struct re_registers *regs, int stop)); 00510 00511 00512 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and 00513 ENDS. Subsequent matches using BUFFER and REGS will use this memory 00514 for recording register information. STARTS and ENDS must be 00515 allocated with malloc, and must each be at least `NUM_REGS * sizeof 00516 (regoff_t)' bytes long. 00517 00518 If NUM_REGS == 0, then subsequent matches should allocate their own 00519 register data. 00520 00521 Unless this function is called, the first search or match using 00522 PATTERN_BUFFER will allocate its own register data, without 00523 freeing the old data. */ 00524 extern void __re_set_registers 00525 _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, 00526 unsigned num_regs, regoff_t *starts, regoff_t *ends)); 00527 extern void re_set_registers 00528 _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, 00529 unsigned num_regs, regoff_t *starts, regoff_t *ends)); 00530 00531 #ifdef _REGEX_RE_COMP 00532 # ifndef _CRAY 00533 /* 4.2 bsd compatibility. */ 00534 extern char *re_comp _RE_ARGS ((const char *)); 00535 extern int re_exec _RE_ARGS ((const char *)); 00536 # endif 00537 #endif 00538 00539 /* POSIX compatibility. */ 00540 extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, 00541 int __cflags)); 00542 extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, 00543 int __cflags)); 00544 00545 extern int __regexec _RE_ARGS ((const regex_t *__preg, 00546 const char *__string, size_t __nmatch, 00547 regmatch_t __pmatch[], int __eflags)); 00548 extern int regexec _RE_ARGS ((const regex_t *__preg, 00549 const char *__string, size_t __nmatch, 00550 regmatch_t __pmatch[], int __eflags)); 00551 00552 extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg, 00553 char *__errbuf, size_t __errbuf_size)); 00554 extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg, 00555 char *__errbuf, size_t __errbuf_size)); 00556 00557 extern void __regfree _RE_ARGS ((regex_t *__preg)); 00558 extern void regfree _RE_ARGS ((regex_t *__preg)); 00559 00560 00561 #ifdef __cplusplus 00562 } 00563 #endif /* C++ */ 00564 00565 #endif /* regex.h */ 00566 00567 /* 00568 Local variables: 00569 make-backup-files: t 00570 version-control: t 00571 trim-versions-without-asking: nil 00572 End: 00573 */ Generated on Fri May 25 2012 04:31:49 for ReactOS by
1.7.6.1
|