Lines Matching +full:1 +full:k
31 uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1]; in twobyte_strstr()
34 return *h ? (char *)h - 1 : 0; in twobyte_strstr()
40 uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8; in threebyte_strstr()
41 uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8; in threebyte_strstr()
50 uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3]; in fourbyte_strstr()
51 uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3]; in fourbyte_strstr()
62 (size_t)1 << ((size_t)(b) % (8 * sizeof *(a))))
67 * initialized to avoid fully initializing a 1kb/2kb table.
76 size_t l, ip, jp, k, p, ms, p0, mem, mem0; in twoway_strstr() local
82 BITOP(byteset, n[l], |=), shift[n[l]] = l + 1; in twoway_strstr()
87 ip = -1; in twoway_strstr()
89 k = p = 1; in twoway_strstr()
90 while (jp + k < l) { in twoway_strstr()
91 if (n[ip + k] == n[jp + k]) { in twoway_strstr()
92 if (k == p) { in twoway_strstr()
94 k = 1; in twoway_strstr()
96 k++; in twoway_strstr()
97 } else if (n[ip + k] > n[jp + k]) { in twoway_strstr()
98 jp += k; in twoway_strstr()
99 k = 1; in twoway_strstr()
103 k = p = 1; in twoway_strstr()
110 ip = -1; in twoway_strstr()
112 k = p = 1; in twoway_strstr()
113 while (jp + k < l) { in twoway_strstr()
114 if (n[ip + k] == n[jp + k]) { in twoway_strstr()
115 if (k == p) { in twoway_strstr()
117 k = 1; in twoway_strstr()
119 k++; in twoway_strstr()
120 } else if (n[ip + k] < n[jp + k]) { in twoway_strstr()
121 jp += k; in twoway_strstr()
122 k = 1; in twoway_strstr()
126 k = p = 1; in twoway_strstr()
129 if (ip + 1 > ms + 1) in twoway_strstr()
135 if (memcmp(n, n + p, ms + 1)) { in twoway_strstr()
137 p = MAX(ms, l - ms - 1) + 1; in twoway_strstr()
161 if (BITOP(byteset, h[l - 1], &)) { in twoway_strstr()
162 k = l - shift[h[l - 1]]; in twoway_strstr()
163 if (k) { in twoway_strstr()
164 if (k < mem) in twoway_strstr()
165 k = mem; in twoway_strstr()
166 h += k; in twoway_strstr()
177 for (k = MAX(ms + 1, mem); n[k] && n[k] == h[k]; k++) in twoway_strstr()
179 if (n[k]) { in twoway_strstr()
180 h += k - ms; in twoway_strstr()
185 for (k = ms + 1; k > mem && n[k - 1] == h[k - 1]; k--) in twoway_strstr()
187 if (k <= mem) in twoway_strstr()
203 if (!h || !n[1]) in strstr()
205 if (!h[1]) in strstr()