Go to the documentation of this file.
9 #ifndef SQUID_REGEXP_LIBRARY_H
10 #define SQUID_REGEXP_LIBRARY_H
17 #include <sys/types.h>
60 #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
65 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
71 #define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
85 #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
93 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
97 #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
101 #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
105 #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
109 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
114 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
118 #define RE_LIMITED_OPS (RE_INTERVALS << 1)
122 #define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
127 #define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
131 #define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
135 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
139 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
145 #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
149 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
155 #define RE_SYNTAX_EMACS 0
157 #define RE_SYNTAX_AWK \
158 (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
159 | RE_NO_BK_PARENS | RE_NO_BK_REFS \
160 | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
161 | RE_UNMATCHED_RIGHT_PAREN_ORD)
163 #define RE_SYNTAX_POSIX_AWK \
164 (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
166 #define RE_SYNTAX_GREP \
167 (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
168 | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
171 #define RE_SYNTAX_EGREP \
172 (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
173 | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
174 | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
177 #define RE_SYNTAX_POSIX_EGREP \
178 (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
181 #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
183 #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
186 #define _RE_SYNTAX_POSIX_COMMON \
187 (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
188 | RE_INTERVALS | RE_NO_EMPTY_RANGES)
190 #define RE_SYNTAX_POSIX_BASIC \
191 (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
196 #define RE_SYNTAX_POSIX_MINIMAL_BASIC \
197 (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
199 #define RE_SYNTAX_POSIX_EXTENDED \
200 (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
201 | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
202 | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
203 | RE_UNMATCHED_RIGHT_PAREN_ORD)
207 #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
208 (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
209 | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
210 | RE_NO_BK_PARENS | RE_NO_BK_REFS \
211 | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
220 #define RE_DUP_MAX ((1 << 15) - 1)
226 #define REG_EXTENDED 1
230 #define REG_ICASE (REG_EXTENDED << 1)
235 #define REG_NEWLINE (REG_ICASE << 1)
239 #define REG_NOSUB (REG_NEWLINE << 1)
251 #define REG_NOTEOL (1 << 1)
327 #define REGS_UNALLOCATED 0
328 #define REGS_REALLOCATE 1
357 #define RE_EXACTN_VALUE 1
394 extern int regcomp(
regex_t * preg,
const char *pattern,
int cflags);
396 extern size_t regerror(
int errcode,
const regex_t * preg,
char *errbuf,
size_t errbuf_size);
void regfree(regex_t *preg)
int regcomp(regex_t *preg, const char *pattern, int cflags)
int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)
size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
unsigned fastmap_accurate