Lines Matching refs:newstr

146   struct Strent *newstr;  in newstring()  local
164 newstr = (struct Strent *) (st->backp + align); in newstring()
165 newstr->string = str; in newstring()
166 newstr->len = len; in newstring()
167 newstr->next = NULL; in newstring()
168 newstr->left = NULL; in newstring()
169 newstr->right = NULL; in newstring()
170 newstr->offset = 0; in newstring()
172 newstr->reverse[i] = str[len - 2 - i]; in newstring()
173 newstr->reverse[len - 1] = '\0'; in newstring()
177 return newstr; in newstring()
185 searchstring (struct Strent **sep, struct Strent *newstr) in searchstring() argument
192 *sep = newstr; in searchstring()
197 cmpres = memcmp ((*sep)->reverse, newstr->reverse, in searchstring()
198 MIN ((*sep)->len, newstr->len) - 1); in searchstring()
203 return searchstring (&(*sep)->left, newstr); in searchstring()
205 return searchstring (&(*sep)->right, newstr); in searchstring()
213 struct Strent *newstr; in strtabadd() local
225 newstr = newstring (st, str, len); in strtabadd()
230 sep = searchstring (&st->root, newstr); in strtabadd()
231 if (*sep != newstr) in strtabadd()
234 if ((*sep)->len > newstr->len) in strtabadd()
239 if (subs->len == newstr->len) in strtabadd()
243 st->left += st->backp - (char *) newstr; in strtabadd()
244 st->backp = (char *) newstr; in strtabadd()
251 st->backp -= newstr->len; in strtabadd()
252 st->left += newstr->len; in strtabadd()
254 newstr->next = (*sep)->next; in strtabadd()
255 (*sep)->next = newstr; in strtabadd()
257 else if ((*sep)->len != newstr->len) in strtabadd()
262 st->total += newstr->len - (*sep)->len; in strtabadd()
263 newstr->next = *sep; in strtabadd()
264 newstr->left = (*sep)->left; in strtabadd()
265 newstr->right = (*sep)->right; in strtabadd()
266 *sep = newstr; in strtabadd()
271 st->left += st->backp - (char *) newstr; in strtabadd()
272 st->backp = (char *) newstr; in strtabadd()
274 newstr = *sep; in strtabadd()
278 st->total += newstr->len; in strtabadd()
280 return newstr; in strtabadd()