Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: regex.h
/* Definitions for data structures and routines for the regular
[0] Fix | Delete
expression library.
[1] Fix | Delete
Copyright (C) 1985, 1989-2018 Free Software Foundation, Inc.
[2] Fix | Delete
This file is part of the GNU C Library.
[3] Fix | Delete
[4] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[5] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[6] Fix | Delete
License as published by the Free Software Foundation; either
[7] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[8] Fix | Delete
[9] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[10] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[11] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[12] Fix | Delete
Lesser General Public License for more details.
[13] Fix | Delete
[14] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[15] Fix | Delete
License along with the GNU C Library; if not, see
[16] Fix | Delete
<https://www.gnu.org/licenses/>. */
[17] Fix | Delete
[18] Fix | Delete
#ifndef _REGEX_H
[19] Fix | Delete
#define _REGEX_H 1
[20] Fix | Delete
[21] Fix | Delete
#include <sys/types.h>
[22] Fix | Delete
[23] Fix | Delete
/* Allow the use in C++ code. */
[24] Fix | Delete
#ifdef __cplusplus
[25] Fix | Delete
extern "C" {
[26] Fix | Delete
#endif
[27] Fix | Delete
[28] Fix | Delete
/* Define __USE_GNU to declare GNU extensions that violate the
[29] Fix | Delete
POSIX name space rules. */
[30] Fix | Delete
#ifdef _GNU_SOURCE
[31] Fix | Delete
# define __USE_GNU 1
[32] Fix | Delete
#endif
[33] Fix | Delete
[34] Fix | Delete
#ifdef _REGEX_LARGE_OFFSETS
[35] Fix | Delete
[36] Fix | Delete
/* Use types and values that are wide enough to represent signed and
[37] Fix | Delete
unsigned byte offsets in memory. This currently works only when
[38] Fix | Delete
the regex code is used outside of the GNU C library; it is not yet
[39] Fix | Delete
supported within glibc itself, and glibc users should not define
[40] Fix | Delete
_REGEX_LARGE_OFFSETS. */
[41] Fix | Delete
[42] Fix | Delete
/* The type of object sizes. */
[43] Fix | Delete
typedef size_t __re_size_t;
[44] Fix | Delete
[45] Fix | Delete
/* The type of object sizes, in places where the traditional code
[46] Fix | Delete
uses unsigned long int. */
[47] Fix | Delete
typedef size_t __re_long_size_t;
[48] Fix | Delete
[49] Fix | Delete
#else
[50] Fix | Delete
[51] Fix | Delete
/* The traditional GNU regex implementation mishandles strings longer
[52] Fix | Delete
than INT_MAX. */
[53] Fix | Delete
typedef unsigned int __re_size_t;
[54] Fix | Delete
typedef unsigned long int __re_long_size_t;
[55] Fix | Delete
[56] Fix | Delete
#endif
[57] Fix | Delete
[58] Fix | Delete
/* The following two types have to be signed and unsigned integer type
[59] Fix | Delete
wide enough to hold a value of a pointer. For most ANSI compilers
[60] Fix | Delete
ptrdiff_t and size_t should be likely OK. Still size of these two
[61] Fix | Delete
types is 2 for Microsoft C. Ugh... */
[62] Fix | Delete
typedef long int s_reg_t;
[63] Fix | Delete
typedef unsigned long int active_reg_t;
[64] Fix | Delete
[65] Fix | Delete
/* The following bits are used to determine the regexp syntax we
[66] Fix | Delete
recognize. The set/not-set meanings are chosen so that Emacs syntax
[67] Fix | Delete
remains the value 0. The bits are given in alphabetical order, and
[68] Fix | Delete
the definitions shifted by one from the previous bit; thus, when we
[69] Fix | Delete
add or remove a bit, only one other definition need change. */
[70] Fix | Delete
typedef unsigned long int reg_syntax_t;
[71] Fix | Delete
[72] Fix | Delete
#ifdef __USE_GNU
[73] Fix | Delete
/* If this bit is not set, then \ inside a bracket expression is literal.
[74] Fix | Delete
If set, then such a \ quotes the following character. */
[75] Fix | Delete
# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
[76] Fix | Delete
[77] Fix | Delete
/* If this bit is not set, then + and ? are operators, and \+ and \? are
[78] Fix | Delete
literals.
[79] Fix | Delete
If set, then \+ and \? are operators and + and ? are literals. */
[80] Fix | Delete
# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
[81] Fix | Delete
[82] Fix | Delete
/* If this bit is set, then character classes are supported. They are:
[83] Fix | Delete
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
[84] Fix | Delete
[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
[85] Fix | Delete
If not set, then character classes are not supported. */
[86] Fix | Delete
# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
[87] Fix | Delete
[88] Fix | Delete
/* If this bit is set, then ^ and $ are always anchors (outside bracket
[89] Fix | Delete
expressions, of course).
[90] Fix | Delete
If this bit is not set, then it depends:
[91] Fix | Delete
^ is an anchor if it is at the beginning of a regular
[92] Fix | Delete
expression or after an open-group or an alternation operator;
[93] Fix | Delete
$ is an anchor if it is at the end of a regular expression, or
[94] Fix | Delete
before a close-group or an alternation operator.
[95] Fix | Delete
[96] Fix | Delete
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
[97] Fix | Delete
POSIX draft 11.2 says that * etc. in leading positions is undefined.
[98] Fix | Delete
We already implemented a previous draft which made those constructs
[99] Fix | Delete
invalid, though, so we haven't changed the code back. */
[100] Fix | Delete
# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
[101] Fix | Delete
[102] Fix | Delete
/* If this bit is set, then special characters are always special
[103] Fix | Delete
regardless of where they are in the pattern.
[104] Fix | Delete
If this bit is not set, then special characters are special only in
[105] Fix | Delete
some contexts; otherwise they are ordinary. Specifically,
[106] Fix | Delete
* + ? and intervals are only special when not after the beginning,
[107] Fix | Delete
open-group, or alternation operator. */
[108] Fix | Delete
# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
[109] Fix | Delete
[110] Fix | Delete
/* If this bit is set, then *, +, ?, and { cannot be first in an re or
[111] Fix | Delete
immediately after an alternation or begin-group operator. */
[112] Fix | Delete
# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
[113] Fix | Delete
[114] Fix | Delete
/* If this bit is set, then . matches newline.
[115] Fix | Delete
If not set, then it doesn't. */
[116] Fix | Delete
# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
[117] Fix | Delete
[118] Fix | Delete
/* If this bit is set, then . doesn't match NUL.
[119] Fix | Delete
If not set, then it does. */
[120] Fix | Delete
# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
[121] Fix | Delete
[122] Fix | Delete
/* If this bit is set, nonmatching lists [^...] do not match newline.
[123] Fix | Delete
If not set, they do. */
[124] Fix | Delete
# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
[125] Fix | Delete
[126] Fix | Delete
/* If this bit is set, either \{...\} or {...} defines an
[127] Fix | Delete
interval, depending on RE_NO_BK_BRACES.
[128] Fix | Delete
If not set, \{, \}, {, and } are literals. */
[129] Fix | Delete
# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
[130] Fix | Delete
[131] Fix | Delete
/* If this bit is set, +, ? and | aren't recognized as operators.
[132] Fix | Delete
If not set, they are. */
[133] Fix | Delete
# define RE_LIMITED_OPS (RE_INTERVALS << 1)
[134] Fix | Delete
[135] Fix | Delete
/* If this bit is set, newline is an alternation operator.
[136] Fix | Delete
If not set, newline is literal. */
[137] Fix | Delete
# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
[138] Fix | Delete
[139] Fix | Delete
/* If this bit is set, then '{...}' defines an interval, and \{ and \}
[140] Fix | Delete
are literals.
[141] Fix | Delete
If not set, then '\{...\}' defines an interval. */
[142] Fix | Delete
# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
[143] Fix | Delete
[144] Fix | Delete
/* If this bit is set, (...) defines a group, and \( and \) are literals.
[145] Fix | Delete
If not set, \(...\) defines a group, and ( and ) are literals. */
[146] Fix | Delete
# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
[147] Fix | Delete
[148] Fix | Delete
/* If this bit is set, then \<digit> matches <digit>.
[149] Fix | Delete
If not set, then \<digit> is a back-reference. */
[150] Fix | Delete
# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
[151] Fix | Delete
[152] Fix | Delete
/* If this bit is set, then | is an alternation operator, and \| is literal.
[153] Fix | Delete
If not set, then \| is an alternation operator, and | is literal. */
[154] Fix | Delete
# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
[155] Fix | Delete
[156] Fix | Delete
/* If this bit is set, then an ending range point collating higher
[157] Fix | Delete
than the starting range point, as in [z-a], is invalid.
[158] Fix | Delete
If not set, then when ending range point collates higher than the
[159] Fix | Delete
starting range point, the range is ignored. */
[160] Fix | Delete
# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
[161] Fix | Delete
[162] Fix | Delete
/* If this bit is set, then an unmatched ) is ordinary.
[163] Fix | Delete
If not set, then an unmatched ) is invalid. */
[164] Fix | Delete
# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
[165] Fix | Delete
[166] Fix | Delete
/* If this bit is set, succeed as soon as we match the whole pattern,
[167] Fix | Delete
without further backtracking. */
[168] Fix | Delete
# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
[169] Fix | Delete
[170] Fix | Delete
/* If this bit is set, do not process the GNU regex operators.
[171] Fix | Delete
If not set, then the GNU regex operators are recognized. */
[172] Fix | Delete
# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
[173] Fix | Delete
[174] Fix | Delete
/* If this bit is set, turn on internal regex debugging.
[175] Fix | Delete
If not set, and debugging was on, turn it off.
[176] Fix | Delete
This only works if regex.c is compiled -DDEBUG.
[177] Fix | Delete
We define this bit always, so that all that's needed to turn on
[178] Fix | Delete
debugging is to recompile regex.c; the calling code can always have
[179] Fix | Delete
this bit set, and it won't affect anything in the normal case. */
[180] Fix | Delete
# define RE_DEBUG (RE_NO_GNU_OPS << 1)
[181] Fix | Delete
[182] Fix | Delete
/* If this bit is set, a syntactically invalid interval is treated as
[183] Fix | Delete
a string of ordinary characters. For example, the ERE 'a{1' is
[184] Fix | Delete
treated as 'a\{1'. */
[185] Fix | Delete
# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
[186] Fix | Delete
[187] Fix | Delete
/* If this bit is set, then ignore case when matching.
[188] Fix | Delete
If not set, then case is significant. */
[189] Fix | Delete
# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
[190] Fix | Delete
[191] Fix | Delete
/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
[192] Fix | Delete
for ^, because it is difficult to scan the regex backwards to find
[193] Fix | Delete
whether ^ should be special. */
[194] Fix | Delete
# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
[195] Fix | Delete
[196] Fix | Delete
/* If this bit is set, then \{ cannot be first in a regex or
[197] Fix | Delete
immediately after an alternation, open-group or \} operator. */
[198] Fix | Delete
# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
[199] Fix | Delete
[200] Fix | Delete
/* If this bit is set, then no_sub will be set to 1 during
[201] Fix | Delete
re_compile_pattern. */
[202] Fix | Delete
# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
[203] Fix | Delete
#endif
[204] Fix | Delete
[205] Fix | Delete
/* This global variable defines the particular regexp syntax to use (for
[206] Fix | Delete
some interfaces). When a regexp is compiled, the syntax used is
[207] Fix | Delete
stored in the pattern buffer, so changing this does not affect
[208] Fix | Delete
already-compiled regexps. */
[209] Fix | Delete
extern reg_syntax_t re_syntax_options;
[210] Fix | Delete
[211] Fix | Delete
#ifdef __USE_GNU
[212] Fix | Delete
/* Define combinations of the above bits for the standard possibilities.
[213] Fix | Delete
(The [[[ comments delimit what gets put into the Texinfo file, so
[214] Fix | Delete
don't delete them!) */
[215] Fix | Delete
/* [[[begin syntaxes]]] */
[216] Fix | Delete
# define RE_SYNTAX_EMACS 0
[217] Fix | Delete
[218] Fix | Delete
# define RE_SYNTAX_AWK \
[219] Fix | Delete
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
[220] Fix | Delete
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
[221] Fix | Delete
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
[222] Fix | Delete
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
[223] Fix | Delete
| RE_CHAR_CLASSES \
[224] Fix | Delete
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
[225] Fix | Delete
[226] Fix | Delete
# define RE_SYNTAX_GNU_AWK \
[227] Fix | Delete
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
[228] Fix | Delete
| RE_INVALID_INTERVAL_ORD) \
[229] Fix | Delete
& ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \
[230] Fix | Delete
| RE_CONTEXT_INVALID_OPS ))
[231] Fix | Delete
[232] Fix | Delete
# define RE_SYNTAX_POSIX_AWK \
[233] Fix | Delete
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
[234] Fix | Delete
| RE_INTERVALS | RE_NO_GNU_OPS \
[235] Fix | Delete
| RE_INVALID_INTERVAL_ORD)
[236] Fix | Delete
[237] Fix | Delete
# define RE_SYNTAX_GREP \
[238] Fix | Delete
((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \
[239] Fix | Delete
& ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL))
[240] Fix | Delete
[241] Fix | Delete
# define RE_SYNTAX_EGREP \
[242] Fix | Delete
((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \
[243] Fix | Delete
& ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL))
[244] Fix | Delete
[245] Fix | Delete
/* POSIX grep -E behavior is no longer incompatible with GNU. */
[246] Fix | Delete
# define RE_SYNTAX_POSIX_EGREP \
[247] Fix | Delete
RE_SYNTAX_EGREP
[248] Fix | Delete
[249] Fix | Delete
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
[250] Fix | Delete
# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
[251] Fix | Delete
[252] Fix | Delete
# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
[253] Fix | Delete
[254] Fix | Delete
/* Syntax bits common to both basic and extended POSIX regex syntax. */
[255] Fix | Delete
# define _RE_SYNTAX_POSIX_COMMON \
[256] Fix | Delete
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
[257] Fix | Delete
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
[258] Fix | Delete
[259] Fix | Delete
# define RE_SYNTAX_POSIX_BASIC \
[260] Fix | Delete
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
[261] Fix | Delete
[262] Fix | Delete
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
[263] Fix | Delete
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
[264] Fix | Delete
isn't minimal, since other operators, such as \`, aren't disabled. */
[265] Fix | Delete
# define RE_SYNTAX_POSIX_MINIMAL_BASIC \
[266] Fix | Delete
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
[267] Fix | Delete
[268] Fix | Delete
# define RE_SYNTAX_POSIX_EXTENDED \
[269] Fix | Delete
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
[270] Fix | Delete
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
[271] Fix | Delete
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
[272] Fix | Delete
| RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
[273] Fix | Delete
[274] Fix | Delete
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
[275] Fix | Delete
removed and RE_NO_BK_REFS is added. */
[276] Fix | Delete
# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
[277] Fix | Delete
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
[278] Fix | Delete
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
[279] Fix | Delete
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
[280] Fix | Delete
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
[281] Fix | Delete
/* [[[end syntaxes]]] */
[282] Fix | Delete
[283] Fix | Delete
/* Maximum number of duplicates an interval can allow. POSIX-conforming
[284] Fix | Delete
systems might define this in <limits.h>, but we want our
[285] Fix | Delete
value, so remove any previous define. */
[286] Fix | Delete
# ifdef _REGEX_INCLUDE_LIMITS_H
[287] Fix | Delete
# include <limits.h>
[288] Fix | Delete
# endif
[289] Fix | Delete
# ifdef RE_DUP_MAX
[290] Fix | Delete
# undef RE_DUP_MAX
[291] Fix | Delete
# endif
[292] Fix | Delete
[293] Fix | Delete
/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
[294] Fix | Delete
the counter as a 2-byte signed integer. This is no longer true, so
[295] Fix | Delete
RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
[296] Fix | Delete
((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined.
[297] Fix | Delete
However, there would be a huge performance problem if someone
[298] Fix | Delete
actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
[299] Fix | Delete
its historical value. */
[300] Fix | Delete
# define RE_DUP_MAX (0x7fff)
[301] Fix | Delete
#endif
[302] Fix | Delete
[303] Fix | Delete
[304] Fix | Delete
/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */
[305] Fix | Delete
[306] Fix | Delete
/* If this bit is set, then use extended regular expression syntax.
[307] Fix | Delete
If not set, then use basic regular expression syntax. */
[308] Fix | Delete
#define REG_EXTENDED 1
[309] Fix | Delete
[310] Fix | Delete
/* If this bit is set, then ignore case when matching.
[311] Fix | Delete
If not set, then case is significant. */
[312] Fix | Delete
#define REG_ICASE (1 << 1)
[313] Fix | Delete
[314] Fix | Delete
/* If this bit is set, then anchors do not match at newline
[315] Fix | Delete
characters in the string.
[316] Fix | Delete
If not set, then anchors do match at newlines. */
[317] Fix | Delete
#define REG_NEWLINE (1 << 2)
[318] Fix | Delete
[319] Fix | Delete
/* If this bit is set, then report only success or fail in regexec.
[320] Fix | Delete
If not set, then returns differ between not matching and errors. */
[321] Fix | Delete
#define REG_NOSUB (1 << 3)
[322] Fix | Delete
[323] Fix | Delete
[324] Fix | Delete
/* POSIX 'eflags' bits (i.e., information for regexec). */
[325] Fix | Delete
[326] Fix | Delete
/* If this bit is set, then the beginning-of-line operator doesn't match
[327] Fix | Delete
the beginning of the string (presumably because it's not the
[328] Fix | Delete
beginning of a line).
[329] Fix | Delete
If not set, then the beginning-of-line operator does match the
[330] Fix | Delete
beginning of the string. */
[331] Fix | Delete
#define REG_NOTBOL 1
[332] Fix | Delete
[333] Fix | Delete
/* Like REG_NOTBOL, except for the end-of-line. */
[334] Fix | Delete
#define REG_NOTEOL (1 << 1)
[335] Fix | Delete
[336] Fix | Delete
/* Use PMATCH[0] to delimit the start and end of the search in the
[337] Fix | Delete
buffer. */
[338] Fix | Delete
#define REG_STARTEND (1 << 2)
[339] Fix | Delete
[340] Fix | Delete
[341] Fix | Delete
/* If any error codes are removed, changed, or added, update the
[342] Fix | Delete
'__re_error_msgid' table in regcomp.c. */
[343] Fix | Delete
[344] Fix | Delete
typedef enum
[345] Fix | Delete
{
[346] Fix | Delete
_REG_ENOSYS = -1, /* This will never happen for this implementation. */
[347] Fix | Delete
_REG_NOERROR = 0, /* Success. */
[348] Fix | Delete
_REG_NOMATCH, /* Didn't find a match (for regexec). */
[349] Fix | Delete
[350] Fix | Delete
/* POSIX regcomp return error codes. (In the order listed in the
[351] Fix | Delete
standard.) */
[352] Fix | Delete
_REG_BADPAT, /* Invalid pattern. */
[353] Fix | Delete
_REG_ECOLLATE, /* Invalid collating element. */
[354] Fix | Delete
_REG_ECTYPE, /* Invalid character class name. */
[355] Fix | Delete
_REG_EESCAPE, /* Trailing backslash. */
[356] Fix | Delete
_REG_ESUBREG, /* Invalid back reference. */
[357] Fix | Delete
_REG_EBRACK, /* Unmatched left bracket. */
[358] Fix | Delete
_REG_EPAREN, /* Parenthesis imbalance. */
[359] Fix | Delete
_REG_EBRACE, /* Unmatched \{. */
[360] Fix | Delete
_REG_BADBR, /* Invalid contents of \{\}. */
[361] Fix | Delete
_REG_ERANGE, /* Invalid range end. */
[362] Fix | Delete
_REG_ESPACE, /* Ran out of memory. */
[363] Fix | Delete
_REG_BADRPT, /* No preceding re for repetition op. */
[364] Fix | Delete
[365] Fix | Delete
/* Error codes we've added. */
[366] Fix | Delete
_REG_EEND, /* Premature end. */
[367] Fix | Delete
_REG_ESIZE, /* Too large (e.g., repeat count too large). */
[368] Fix | Delete
_REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
[369] Fix | Delete
} reg_errcode_t;
[370] Fix | Delete
[371] Fix | Delete
#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K
[372] Fix | Delete
# define REG_ENOSYS _REG_ENOSYS
[373] Fix | Delete
#endif
[374] Fix | Delete
#define REG_NOERROR _REG_NOERROR
[375] Fix | Delete
#define REG_NOMATCH _REG_NOMATCH
[376] Fix | Delete
#define REG_BADPAT _REG_BADPAT
[377] Fix | Delete
#define REG_ECOLLATE _REG_ECOLLATE
[378] Fix | Delete
#define REG_ECTYPE _REG_ECTYPE
[379] Fix | Delete
#define REG_EESCAPE _REG_EESCAPE
[380] Fix | Delete
#define REG_ESUBREG _REG_ESUBREG
[381] Fix | Delete
#define REG_EBRACK _REG_EBRACK
[382] Fix | Delete
#define REG_EPAREN _REG_EPAREN
[383] Fix | Delete
#define REG_EBRACE _REG_EBRACE
[384] Fix | Delete
#define REG_BADBR _REG_BADBR
[385] Fix | Delete
#define REG_ERANGE _REG_ERANGE
[386] Fix | Delete
#define REG_ESPACE _REG_ESPACE
[387] Fix | Delete
#define REG_BADRPT _REG_BADRPT
[388] Fix | Delete
#define REG_EEND _REG_EEND
[389] Fix | Delete
#define REG_ESIZE _REG_ESIZE
[390] Fix | Delete
#define REG_ERPAREN _REG_ERPAREN
[391] Fix | Delete
[392] Fix | Delete
/* This data structure represents a compiled pattern. Before calling
[393] Fix | Delete
the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
[394] Fix | Delete
and 'translate' can be set. After the pattern has been compiled,
[395] Fix | Delete
the fields 're_nsub', 'not_bol' and 'not_eol' are available. All
[396] Fix | Delete
other fields are private to the regex routines. */
[397] Fix | Delete
[398] Fix | Delete
#ifndef RE_TRANSLATE_TYPE
[399] Fix | Delete
# define __RE_TRANSLATE_TYPE unsigned char *
[400] Fix | Delete
# ifdef __USE_GNU
[401] Fix | Delete
# define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE
[402] Fix | Delete
# endif
[403] Fix | Delete
#endif
[404] Fix | Delete
[405] Fix | Delete
#ifdef __USE_GNU
[406] Fix | Delete
# define __REPB_PREFIX(name) name
[407] Fix | Delete
#else
[408] Fix | Delete
# define __REPB_PREFIX(name) __##name
[409] Fix | Delete
#endif
[410] Fix | Delete
[411] Fix | Delete
struct re_pattern_buffer
[412] Fix | Delete
{
[413] Fix | Delete
/* Space that holds the compiled pattern. The type
[414] Fix | Delete
'struct re_dfa_t' is private and is not declared here. */
[415] Fix | Delete
struct re_dfa_t *__REPB_PREFIX(buffer);
[416] Fix | Delete
[417] Fix | Delete
/* Number of bytes to which 'buffer' points. */
[418] Fix | Delete
__re_long_size_t __REPB_PREFIX(allocated);
[419] Fix | Delete
[420] Fix | Delete
/* Number of bytes actually used in 'buffer'. */
[421] Fix | Delete
__re_long_size_t __REPB_PREFIX(used);
[422] Fix | Delete
[423] Fix | Delete
/* Syntax setting with which the pattern was compiled. */
[424] Fix | Delete
reg_syntax_t __REPB_PREFIX(syntax);
[425] Fix | Delete
[426] Fix | Delete
/* Pointer to a fastmap, if any, otherwise zero. re_search uses the
[427] Fix | Delete
fastmap, if there is one, to skip over impossible starting points
[428] Fix | Delete
for matches. */
[429] Fix | Delete
char *__REPB_PREFIX(fastmap);
[430] Fix | Delete
[431] Fix | Delete
/* Either a translate table to apply to all characters before
[432] Fix | Delete
comparing them, or zero for no translation. The translation is
[433] Fix | Delete
applied to a pattern when it is compiled and to a string when it
[434] Fix | Delete
is matched. */
[435] Fix | Delete
__RE_TRANSLATE_TYPE __REPB_PREFIX(translate);
[436] Fix | Delete
[437] Fix | Delete
/* Number of subexpressions found by the compiler. */
[438] Fix | Delete
size_t re_nsub;
[439] Fix | Delete
[440] Fix | Delete
/* Zero if this pattern cannot match the empty string, one else.
[441] Fix | Delete
Well, in truth it's used only in 're_search_2', to see whether or
[442] Fix | Delete
not we should use the fastmap, so we don't set this absolutely
[443] Fix | Delete
perfectly; see 're_compile_fastmap' (the "duplicate" case). */
[444] Fix | Delete
unsigned __REPB_PREFIX(can_be_null) : 1;
[445] Fix | Delete
[446] Fix | Delete
/* If REGS_UNALLOCATED, allocate space in the 'regs' structure
[447] Fix | Delete
for 'max (RE_NREGS, re_nsub + 1)' groups.
[448] Fix | Delete
If REGS_REALLOCATE, reallocate space if necessary.
[449] Fix | Delete
If REGS_FIXED, use what's there. */
[450] Fix | Delete
#ifdef __USE_GNU
[451] Fix | Delete
# define REGS_UNALLOCATED 0
[452] Fix | Delete
# define REGS_REALLOCATE 1
[453] Fix | Delete
# define REGS_FIXED 2
[454] Fix | Delete
#endif
[455] Fix | Delete
unsigned __REPB_PREFIX(regs_allocated) : 2;
[456] Fix | Delete
[457] Fix | Delete
/* Set to zero when 're_compile_pattern' compiles a pattern; set to
[458] Fix | Delete
one by 're_compile_fastmap' if it updates the fastmap. */
[459] Fix | Delete
unsigned __REPB_PREFIX(fastmap_accurate) : 1;
[460] Fix | Delete
[461] Fix | Delete
/* If set, 're_match_2' does not return information about
[462] Fix | Delete
subexpressions. */
[463] Fix | Delete
unsigned __REPB_PREFIX(no_sub) : 1;
[464] Fix | Delete
[465] Fix | Delete
/* If set, a beginning-of-line anchor doesn't match at the beginning
[466] Fix | Delete
of the string. */
[467] Fix | Delete
unsigned __REPB_PREFIX(not_bol) : 1;
[468] Fix | Delete
[469] Fix | Delete
/* Similarly for an end-of-line anchor. */
[470] Fix | Delete
unsigned __REPB_PREFIX(not_eol) : 1;
[471] Fix | Delete
[472] Fix | Delete
/* If true, an anchor at a newline matches. */
[473] Fix | Delete
unsigned __REPB_PREFIX(newline_anchor) : 1;
[474] Fix | Delete
};
[475] Fix | Delete
[476] Fix | Delete
typedef struct re_pattern_buffer regex_t;
[477] Fix | Delete
[478] Fix | Delete
/* Type for byte offsets within the string. POSIX mandates this. */
[479] Fix | Delete
#ifdef _REGEX_LARGE_OFFSETS
[480] Fix | Delete
/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
[481] Fix | Delete
ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t
[482] Fix | Delete
is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not
[483] Fix | Delete
visible here, so use ssize_t. */
[484] Fix | Delete
typedef ssize_t regoff_t;
[485] Fix | Delete
#else
[486] Fix | Delete
/* The traditional GNU regex implementation mishandles strings longer
[487] Fix | Delete
than INT_MAX. */
[488] Fix | Delete
typedef int regoff_t;
[489] Fix | Delete
#endif
[490] Fix | Delete
[491] Fix | Delete
[492] Fix | Delete
#ifdef __USE_GNU
[493] Fix | Delete
/* This is the structure we store register match data in. See
[494] Fix | Delete
regex.texinfo for a full description of what registers match. */
[495] Fix | Delete
struct re_registers
[496] Fix | Delete
{
[497] Fix | Delete
__re_size_t num_regs;
[498] Fix | Delete
regoff_t *start;
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function