Home | History | Annotate | Download | only in libebl

Lines Matching refs:len

54   size_t len;
107 ret->null.len = 1;
117 morememory (struct Ebl_Strtab *st, size_t len)
120 len += overhead + MALLOC_OVERHEAD;
122 /* Allocate nearest multiple of pagesize >= len. */
123 len = ((len / ps) + (len % ps != 0)) * ps - MALLOC_OVERHEAD;
125 struct memoryblock *newmem = (struct memoryblock *) malloc (len);
132 st->left = len - overhead;
155 newstring (struct Ebl_Strtab *st, const char *str, size_t len)
164 if (st->left < align + sizeof (struct Ebl_Strent) + len)
166 if (morememory (st, sizeof (struct Ebl_Strent) + len))
175 newstr->len = len;
180 for (int i = len - 2; i >= 0; --i)
181 newstr->reverse[i] = str[len - 2 - i];
182 newstr->reverse[len - 1] = '\0';
183 st->backp += align + sizeof (struct Ebl_Strent) + len;
184 st->left -= align + sizeof (struct Ebl_Strent) + len;
205 MIN ((*sep)->len, newstr->len) - 1);
218 ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len)
221 if (len == 0)
222 len = strlen (str) + 1;
226 if (len == 1 && st->null.string != NULL)
230 struct Ebl_Strent *newstr = newstring (st, str, len);
241 if ((*sep)->len > newstr->len)
246 if (subs->len == newstr->len)
258 st->backp -= newstr->len;
259 st->left += newstr->len;
264 else if ((*sep)->len != newstr->len)
269 st->total += newstr->len - (*sep)->len;
285 st->total += newstr->len;
299 *freep = (char *) mempcpy (*freep, nodep->string, nodep->len);
300 *offsetp += nodep->len;
304 assert (subs->len < nodep->len);
305 subs->offset = nodep->offset + nodep->len - subs->len;