Lines Matching refs:kmp
44 struct ts_kmp *kmp = ts_config_priv(conf); in kmp_find() local
56 while (q > 0 && kmp->pattern[q] in kmp_find()
58 q = kmp->prefix_tbl[q - 1]; in kmp_find()
59 if (kmp->pattern[q] in kmp_find()
62 if (unlikely(q == kmp->pattern_len)) { in kmp_find()
64 return state->offset - kmp->pattern_len; in kmp_find()
95 struct ts_kmp *kmp; in kmp_init() local
98 size_t priv_size = sizeof(*kmp) + len + prefix_tbl_len; in kmp_init()
105 kmp = ts_config_priv(conf); in kmp_init()
106 kmp->pattern_len = len; in kmp_init()
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()
120 struct ts_kmp *kmp = ts_config_priv(conf); in kmp_get_pattern() local
121 return kmp->pattern; in kmp_get_pattern()
126 struct ts_kmp *kmp = ts_config_priv(conf); in kmp_get_pattern_len() local
127 return kmp->pattern_len; in kmp_get_pattern_len()