Lines Matching refs:pattern

51  * Clean up if pattern compilation fails.
55 if (fg->pattern) \
56 xfree(fg->pattern); \
68 * matching is based on bit pattern not character representations
83 * Converts the wide string pattern to SB/MB string and stores
84 * it in fg->pattern. Sets fg->len to the byte length of the
95 fg->pattern = xmalloc(siz + 1); \
96 if (fg->pattern == NULL) \
98 wcstombs(fg->pattern, fg->wpattern, siz); \
99 fg->pattern[siz] = '\0'; \
184 * next character after the comparison is within the pattern. With
217 fg->qsBc[(unsigned char)fg->pattern[i]] = fg->len - i; \
218 DPRINT(("BC shift for char %c is %zu\n", fg->pattern[i], \
222 char c = islower((unsigned char)fg->pattern[i]) ? \
223 toupper((unsigned char)fg->pattern[i]) : \
224 tolower((unsigned char)fg->pattern[i]); \
235 fg->qsBc[(unsigned char)fg->pattern[i]] = i + 1; \
236 DPRINT(("Reverse BC shift for char %c is %d\n", fg->pattern[i], \
240 char c = islower((unsigned char)fg->pattern[i]) ? \
241 toupper((unsigned char)fg->pattern[i]) : \
242 tolower((unsigned char)fg->pattern[i]); \
254 * in the pattern, so we can store them in a hashtable and store a
271 /* Preprocess pattern. */ \
301 /* Preprocess pattern. */ \
349 _FILL_BMGS(fg->sbmGs, fg->pattern, fg->len, false); \
447 * Copies the pattern pat having length n to p and stores
460 * Initializes pattern compiling.
478 * Checks whether we have a 0-length pattern that will match
492 fg->pattern = xmalloc(sizeof(char)); \
493 if (!fg->pattern) \
495 fg->pattern[0] = '\0'; \
526 SAVE_PATTERN(pat, n, fg->pattern, fg->len);
529 DPRINT(("tre_compile_literal: pattern: %s, len %zu, icase: %c, word: %c, "
530 "newline %c\n", fg->pattern, fg->len, fg->icase ? 'y' : 'n',
587 /* Copies the char into the stored pattern and skips to the next char. */
596 /* Traverse the input pattern for processing */
692 DPRINT(("tre_compile_fast: compilation of pattern failed, falling"
700 * The pattern has been processed and copied to tmp as a literal string
728 if (fg->pattern[i] == '\\')
730 else if (fg->pattern[i] == '.' && fg->escmap && escaped)
735 else if (fg->pattern[i] == '.' && !escaped)
745 SAVE_PATTERN(tmp, pos, fg->pattern, fg->len);
751 DPRINT(("tre_compile_fast: pattern: %s, len %zu, bol %c, eol %c, "
752 "icase: %c, word: %c, newline %c\n", fg->pattern, fg->len,
838 * Executes matching of the precompiled pattern on the input string.
865 /* Shortcut for empty pattern */
968 * Frees the resources that were allocated when the pattern was compiled.
974 DPRINT(("tre_fast_free: freeing structures for pattern %s\n",
975 fg->pattern));
989 xfree(fg->pattern);
1001 const char *pat_byte = fg->pattern;
1008 /* Compare the pattern and the input char-by-char from the last position. */