#include "../src/conf.h"#include <sys/types.h>#include "gnuregex.h"#include <ctype.h>Go to the source code of this file.
Classes | |
| struct | compile_stack_elt_t |
| struct | compile_stack_type |
| struct | fail_stack_type |
| union | register_info_type |
Defines | |
| #define | _GNU_SOURCE |
| #define | HAVE_STRING_H 1 |
| #define | HAVE_ALLOCA_H 0 |
| #define | bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) |
| #define | bcopy(s, d, n) memcpy ((d), (s), (n)) |
| #define | bzero(s, n) memset ((s), 0, (n)) |
| #define | Sword 1 |
| #define | CHAR_SET_SIZE 256 |
| #define | SYNTAX(c) re_syntax_table[c] |
| #define | isascii(c) 1 |
| #define | ISBLANK(c) ((c) == ' ' || (c) == '\t') |
| #define | ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c)) |
| #define | ISPRINT(c) (isascii (c) && isprint (c)) |
| #define | ISDIGIT(c) (isascii (c) && isdigit (c)) |
| #define | ISALNUM(c) (isascii (c) && isalnum (c)) |
| #define | ISALPHA(c) (isascii (c) && isalpha (c)) |
| #define | ISCNTRL(c) (isascii (c) && iscntrl (c)) |
| #define | ISLOWER(c) (isascii (c) && islower (c)) |
| #define | ISPUNCT(c) (isascii (c) && ispunct (c)) |
| #define | ISSPACE(c) (isascii (c) && isspace (c)) |
| #define | ISUPPER(c) (isascii (c) && isupper (c)) |
| #define | ISXDIGIT(c) (isascii (c) && isxdigit (c)) |
| #define | NULL (void *)0 |
| #define | SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) |
| #define | REGEX_ALLOCATE alloca |
| #define | REGEX_REALLOCATE(source, osize, nsize) |
| #define | FIRST_STRING_P(ptr) (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) |
| #define | TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) |
| #define | RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) |
| #define | REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) |
| #define | BYTEWIDTH 8 |
| #define | STREQ(s1, s2) ((strcmp (s1, s2) == 0)) |
| #define | MAX(a, b) ((a) > (b) ? (a) : (b)) |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | false 0 |
| #define | true 1 |
| #define | STORE_NUMBER(destination, number) |
| #define | STORE_NUMBER_AND_INCR(destination, number) |
| #define | EXTRACT_NUMBER(destination, source) |
| #define | EXTRACT_NUMBER_AND_INCR(destination, source) |
| #define | assert(e) |
| #define | DEBUG_STATEMENT(e) |
| #define | DEBUG_PRINT1(x) |
| #define | DEBUG_PRINT2(x1, x2) |
| #define | DEBUG_PRINT3(x1, x2, x3) |
| #define | DEBUG_PRINT4(x1, x2, x3, x4) |
| #define | DEBUG_PRINT_COMPILED_PATTERN(p, s, e) |
| #define | DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) |
| #define | PATFETCH(c) |
| #define | PATFETCH_RAW(c) |
| #define | PATUNFETCH p-- |
| #define | TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) |
| #define | INIT_BUF_SIZE 32 |
| #define | GET_BUFFER_SPACE(n) |
| #define | BUF_PUSH(c) |
| #define | BUF_PUSH_2(c1, c2) |
| #define | BUF_PUSH_3(c1, c2, c3) |
| #define | STORE_JUMP(op, loc, to) store_op1 (op, loc, (to) - (loc) - 3) |
| #define | STORE_JUMP2(op, loc, to, arg) store_op2 (op, loc, (to) - (loc) - 3, arg) |
| #define | INSERT_JUMP(op, loc, to) insert_op1 (op, loc, (to) - (loc) - 3, b) |
| #define | INSERT_JUMP2(op, loc, to, arg) insert_op2 (op, loc, (to) - (loc) - 3, arg, b) |
| #define | MAX_BUF_SIZE (1L << 16) |
| #define | EXTEND_BUFFER() |
| #define | MAX_REGNUM 255 |
| #define | INIT_COMPILE_STACK_SIZE 32 |
| #define | COMPILE_STACK_EMPTY (compile_stack.avail == 0) |
| #define | COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) |
| #define | COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) |
| #define | SET_LIST_BIT(c) |
| #define | GET_UNSIGNED_NUMBER(num) |
| #define | CHAR_CLASS_MAX_LENGTH 6 |
| #define | IS_CHAR_CLASS(string) |
| #define | INIT_FAILURE_ALLOC 5 |
| #define | FAIL_STACK_EMPTY() (fail_stack.avail == 0) |
| #define | FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) |
| #define | FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) |
| #define | FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail]) |
| #define | INIT_FAIL_STACK() |
| #define | DOUBLE_FAIL_STACK(fail_stack) |
| #define | PUSH_PATTERN_OP(pattern_op, fail_stack) |
| #define | PUSH_FAILURE_ITEM(item) fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item |
| #define | POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail] |
| #define | DEBUG_PUSH(item) |
| #define | DEBUG_POP(item_addr) |
| #define | PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) |
| #define | NUM_REG_ITEMS 3 |
| #define | NUM_NONREG_ITEMS 4 |
| #define | MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS) |
| #define | NUM_FAILURE_ITEMS |
| #define | REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) |
| #define | POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info) |
| #define | MATCH_NULL_UNSET_VALUE 3 |
| #define | REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) |
| #define | IS_ACTIVE(R) ((R).bits.is_active) |
| #define | MATCHED_SOMETHING(R) ((R).bits.matched_something) |
| #define | EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) |
| #define | SET_REGS_MATCHED() |
| #define | POINTER_TO_OFFSET(ptr) (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1) |
| #define | REG_UNSET_VALUE ((char *) -1) |
| #define | REG_UNSET(e) ((e) == REG_UNSET_VALUE) |
| #define | MATCHING_IN_FIRST_STRING (dend == end_match_1) |
| #define | PREFETCH() |
| #define | AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) |
| #define | AT_STRINGS_END(d) ((d) == end2) |
| #define | WORDCHAR_P(d) |
| #define | AT_WORD_BOUNDARY(d) |
| #define | FREE_VARIABLES() alloca (0) |
| #define | NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) |
| #define | NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) |
Typedefs | |
| typedef char | boolean |
| typedef unsigned | regnum_t |
| typedef int | pattern_offset_t |
| typedef unsigned char * | fail_stack_elt_t |
Enumerations | |
| enum | re_opcode_t { no_op = 0, exactn = 1, anychar, charset, charset_not, start_memory, stop_memory, duplicate, begline, endline, begbuf, endbuf, jump, jump_past_alt, on_failure_jump, on_failure_keep_string_jump, pop_failure_jump, maybe_pop_jump, dummy_failure_jump, push_dummy_failure, succeed_n, jump_n, set_number_at, wordchar, notwordchar, wordbeg, wordend, wordbound, notwordbound } |
Functions | |
| char * | malloc () |
| char * | realloc () |
| static void | init_syntax_once () |
| char * | alloca () |
| reg_syntax_t | re_set_syntax (reg_syntax_t syntax) |
| static void | store_op1 () |
| static void | store_op2 () |
| static void | insert_op1 () |
| static void | insert_op2 () |
| static boolean | at_begline_loc_p () |
| static boolean | at_endline_loc_p () |
| static boolean | group_in_compile_stack () |
| static reg_errcode_t | compile_range () |
| static reg_errcode_t | regex_compile (char *pattern, int size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) |
| int | re_compile_fastmap (struct re_pattern_buffer *bufp) |
| void | re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends) |
| int | re_search (struct re_pattern_buffer *bufp, char *string, int size, int startpos, int range, struct re_registers *regs) |
| int | re_search_2 (struct re_pattern_buffer *bufp, char *string1, int size1, char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop) |
| static int | bcmp_translate () |
| static boolean | alt_match_null_string_p () |
| static boolean | common_op_match_null_string_p () |
| static boolean | group_match_null_string_p () |
| int | re_match (struct re_pattern_buffer *bufp, char *string, int size, int pos, struct re_registers *regs) |
| int | re_match_2 (struct re_pattern_buffer *bufp, char *string1, int size1, char *string2, int size2, int pos, struct re_registers *regs, int stop) |
| char * | re_compile_pattern (char *pattern, int length, struct re_pattern_buffer *bufp) |
| char * | re_comp (char *s) |
| int | re_exec (char *s) |
| int | regcomp (regex_t *preg, char *pattern, int cflags) |
| int | regexec (regex_t *preg, char *string, size_t nmatch, pmatch, int eflags) |
| size_t | regerror (int errcode, regex_t *preg, char *errbuf, size_t errbuf_size) |
| void | regfree (regex_t *preg) |
Variables | |
| static char | re_syntax_table [CHAR_SET_SIZE] |
| reg_syntax_t | re_syntax_options = RE_SYNTAX_EMACS |
| static char * | re_error_msg [] |
| int | re_max_failures = 2000 |
| static struct re_pattern_buffer | re_comp_buf |
|
|
|
|
|
Definition at line 787 of file regex.c. Referenced by common_op_match_null_string_p(), group_match_null_string_p(), re_compile_fastmap(), re_match_2(), and regex_compile(). |
|
|
Definition at line 3081 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 3082 of file regex.c. Referenced by re_match_2(). |
|
|
Value: (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) Definition at line 3096 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 62 of file regex.c. Referenced by re_match_2(), WarnIfContainsFilePattern(), and WarnIfContainsRegex(). |
|
|
|
Value: do { \ GET_BUFFER_SPACE (1); \ *b++ = (unsigned char) (c); \ } while (0) Definition at line 892 of file regex.c. Referenced by regex_compile(). |
|
|
Value: do { \ GET_BUFFER_SPACE (2); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ } while (0) Definition at line 900 of file regex.c. Referenced by regex_compile(). |
|
|
Value: do { \ GET_BUFFER_SPACE (3); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ *b++ = (unsigned char) (c3); \ } while (0) Definition at line 909 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 234 of file regex.c. Referenced by re_compile_fastmap(), re_match_2(), and regex_compile(). |
|
|
|
Definition at line 1038 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 94 of file regex.c. Referenced by regcomp(). |
|
|
Definition at line 1008 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 1009 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 1012 of file regex.c. Referenced by regex_compile(). |
|
|
|
|
|
Definition at line 790 of file regex.c. Referenced by re_match_2(), and regex_compile(). |
|
|
Definition at line 791 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 792 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 793 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 794 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 795 of file regex.c. Referenced by re_match_2(). |
|
|
|
|
|
|
|
|
Value: ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \ ? 0 \ : ((fail_stack).stack = (fail_stack_elt_t *) \ REGEX_REALLOCATE ((fail_stack).stack, \ (fail_stack).size * sizeof (fail_stack_elt_t), \ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ \ (fail_stack).stack == NULL \ ? 0 \ : ((fail_stack).size <<= 1, \ 1))) |
|
|
Definition at line 3031 of file regex.c. Referenced by re_match_2(). |
|
|
Value: do { \ unsigned char *old_buffer = bufp->buffer; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ bufp->allocated = MAX_BUF_SIZE; \ bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\ if (bufp->buffer == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ b = (b - old_buffer) + bufp->buffer; \ begalt = (begalt - old_buffer) + bufp->buffer; \ if (fixup_alt_jump) \ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ if (laststart) \ laststart = (laststart - old_buffer) + bufp->buffer; \ if (pending_exact) \ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ } \ } while (0) |
|
|
Value: do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) Definition at line 408 of file regex.c. Referenced by group_match_null_string_p(), and re_match_2(). |
|
|
Value: do { \ EXTRACT_NUMBER (destination, source); \ (source) += 2; \ } while (0) Definition at line 435 of file regex.c. Referenced by alt_match_null_string_p(), common_op_match_null_string_p(), group_match_null_string_p(), re_compile_fastmap(), and re_match_2(). |
|
|
Definition at line 2277 of file regex.c. Referenced by re_compile_fastmap(), and re_match_2(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 226 of file regex.c. Referenced by re_match_2(). |
|
|
Definition at line 3119 of file regex.c. Referenced by re_match_2(). |
|
|
Value: while (b - bufp->buffer + (n) > bufp->allocated) \ EXTEND_BUFFER () Definition at line 887 of file regex.c. Referenced by regex_compile(). |
|
|
Value: { if (p != pend) \
{ \
PATFETCH (c); \
while (ISDIGIT (c)) \
{ \
if (num < 0) \
num = 0; \
num = num * 10 + c - '0'; \
if (p == pend) \
break; \
PATFETCH (c); \
} \
} \
}
Definition at line 1022 of file regex.c. Referenced by regex_compile(). |
|
|
|
|
|
|
|
|
Definition at line 884 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 1006 of file regex.c. Referenced by regex_compile(). |
|
|
Value: do { \ fail_stack.stack = (fail_stack_elt_t *) \ REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ \ if (fail_stack.stack == NULL) \ return -2; \ \ fail_stack.size = INIT_FAILURE_ALLOC; \ fail_stack.avail = 0; \ } while (0) Definition at line 2285 of file regex.c. Referenced by re_compile_fastmap(), and re_match_2(). |
|
|
|
|
|
Definition at line 928 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 932 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 3029 of file regex.c. Referenced by re_match_2(). |
|
|
Value: (STREQ (string, "alpha") || STREQ (string, "upper") \ || STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) Definition at line 1040 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 152 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 153 of file regex.c. Referenced by regex_compile(). |
|
|
|
|
|
Definition at line 142 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 154 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 151 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 147 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 155 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 150 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 156 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 157 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 158 of file regex.c. Referenced by regcomp(), and regex_compile(). |
|
|
Definition at line 159 of file regex.c. Referenced by regex_compile(). |
|
|
Definition at line 3020 of file regex.c. Referenced by common_op_match_null_string_p(), and re_match_2(). |
|
|
|