Home | History | Annotate | Download | only in libebl

Lines Matching refs:st

117 morememory (struct Ebl_Strtab *st, size_t len)
129 newmem->next = st->memory;
130 st->memory = newmem;
131 st->backp = newmem->memory;
132 st->left = len - overhead;
139 ebl_strtabfree (struct Ebl_Strtab *st)
141 struct memoryblock *mb = st->memory;
150 free (st);
155 newstring (struct Ebl_Strtab *st, const char *str, size_t len)
159 - (((uintptr_t) st->backp)
164 if (st->left < align + sizeof (struct Ebl_Strent) + len)
166 if (morememory (st, sizeof (struct Ebl_Strent) + len))
173 struct Ebl_Strent *newstr = (struct Ebl_Strent *) (st->backp + align);
183 st->backp += align + sizeof (struct Ebl_Strent) + len;
184 st->left -= align + sizeof (struct Ebl_Strent) + len;
218 ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len)
226 if (len == 1 && st->null.string != NULL)
227 return &st->null;
230 struct Ebl_Strent *newstr = newstring (st, str, len);
237 struct Ebl_Strent **sep = searchstring (&st->root, newstr);
250 st->left += st->backp - (char *) newstr;
251 st->backp = (char *) newstr;
258 st->backp -= newstr->len;
259 st->left += newstr->len;
269 st->total += newstr->len - (*sep)->len;
278 st->left += st->backp - (char *) newstr;
279 st->backp = (char *) newstr;
285 st->total += newstr->len;
315 ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data)
317 size_t nulllen = st->nullstr ? 1 : 0;
320 data->d_buf = malloc (st->total + nulllen);
326 if (st->nullstr)
330 data->d_size = st->total + nulllen;
339 if (st->root)
340 copystrings (st->root, &endp, &copylen);
341 assert (copylen == st->total + nulllen);