Lines Matching refs:newstr
173 struct Ebl_Strent *newstr = (struct Ebl_Strent *) (st->backp + align); in newstring() local
174 newstr->string = str; in newstring()
175 newstr->len = len; in newstring()
176 newstr->next = NULL; in newstring()
177 newstr->left = NULL; in newstring()
178 newstr->right = NULL; in newstring()
179 newstr->offset = 0; in newstring()
181 newstr->reverse[i] = str[len - 2 - i]; in newstring()
182 newstr->reverse[len - 1] = '\0'; in newstring()
186 return newstr; in newstring()
194 searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) in searchstring() argument
199 *sep = newstr; in searchstring()
204 int cmpres = memcmp ((*sep)->reverse, newstr->reverse, in searchstring()
205 MIN ((*sep)->len, newstr->len) - 1); in searchstring()
210 return searchstring (&(*sep)->left, newstr); in searchstring()
212 return searchstring (&(*sep)->right, newstr); in searchstring()
230 struct Ebl_Strent *newstr = newstring (st, str, len); in ebl_strtabadd() local
231 if (newstr == NULL) in ebl_strtabadd()
237 struct Ebl_Strent **sep = searchstring (&st->root, newstr); in ebl_strtabadd()
238 if (*sep != newstr) in ebl_strtabadd()
241 if ((*sep)->len > newstr->len) in ebl_strtabadd()
246 if (subs->len == newstr->len) in ebl_strtabadd()
250 st->left += st->backp - (char *) newstr; in ebl_strtabadd()
251 st->backp = (char *) newstr; in ebl_strtabadd()
258 st->backp -= newstr->len; in ebl_strtabadd()
259 st->left += newstr->len; in ebl_strtabadd()
261 newstr->next = (*sep)->next; in ebl_strtabadd()
262 (*sep)->next = newstr; in ebl_strtabadd()
264 else if ((*sep)->len != newstr->len) in ebl_strtabadd()
269 st->total += newstr->len - (*sep)->len; in ebl_strtabadd()
270 newstr->next = *sep; in ebl_strtabadd()
271 newstr->left = (*sep)->left; in ebl_strtabadd()
272 newstr->right = (*sep)->right; in ebl_strtabadd()
273 *sep = newstr; in ebl_strtabadd()
278 st->left += st->backp - (char *) newstr; in ebl_strtabadd()
279 st->backp = (char *) newstr; in ebl_strtabadd()
281 newstr = *sep; in ebl_strtabadd()
285 st->total += newstr->len; in ebl_strtabadd()
287 return newstr; in ebl_strtabadd()