Lines Matching refs:needle_len
108 critical_factorization (const unsigned char *needle, size_t needle_len,
120 if (needle_len < 3)
123 return needle_len - 1;
139 while (j + k < needle_len)
174 while (j + k < needle_len)
236 const unsigned char *needle, size_t needle_len)
246 suffix = critical_factorization (needle, needle_len, &period);
257 while (AVAILABLE (haystack, haystack_len, j, needle_len))
261 while (i < needle_len && (CANON_ELEMENT (needle[i])
264 if (needle_len <= i)
276 memory = needle_len - period;
289 period = MAX (suffix, needle_len - suffix) + 1;
291 while (AVAILABLE (haystack, haystack_len, j, needle_len))
295 while (i < needle_len && (CANON_ELEMENT (needle[i])
298 if (needle_len <= i)
330 const unsigned char *needle, size_t needle_len)
341 suffix = critical_factorization (needle, needle_len, &period);
348 shift_table[i] = needle_len;
349 for (i = 0; i < needle_len; i++)
350 shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
362 while (AVAILABLE (haystack, haystack_len, j, needle_len))
366 shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
374 shift = needle_len - period;
383 while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
386 if (needle_len - 1 <= i)
398 memory = needle_len - period;
412 period = MAX (suffix, needle_len - suffix) + 1;
414 while (AVAILABLE (haystack, haystack_len, j, needle_len))
418 shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
427 while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
430 if (needle_len - 1 <= i)