Lines Matching full:pattern
13 * auxiliary function PI[1..m], for m being length(pattern),
14 * precomputed from the pattern in time O(m). The array PI allows
37 u8 * pattern; member
56 while (q > 0 && kmp->pattern[q] in kmp_find()
59 if (kmp->pattern[q] in kmp_find()
74 static inline void compute_prefix_tbl(const u8 *pattern, unsigned int len, in compute_prefix_tbl() argument
81 while (k > 0 && (icase ? toupper(pattern[k]) : pattern[k]) in compute_prefix_tbl()
82 != (icase ? toupper(pattern[q]) : pattern[q])) in compute_prefix_tbl()
84 if ((icase ? toupper(pattern[k]) : pattern[k]) in compute_prefix_tbl()
85 == (icase ? toupper(pattern[q]) : pattern[q])) in compute_prefix_tbl()
91 static struct ts_config *kmp_init(const void *pattern, unsigned int len, in kmp_init() argument
107 compute_prefix_tbl(pattern, len, kmp->prefix_tbl, flags); in kmp_init()
108 kmp->pattern = (u8 *) kmp->prefix_tbl + prefix_tbl_len; in kmp_init()
111 kmp->pattern[i] = toupper(((u8 *)pattern)[i]); in kmp_init()
113 memcpy(kmp->pattern, pattern, len); in kmp_init()
121 return kmp->pattern; in kmp_get_pattern()