Lines Matching refs:dgs
3220 d_growable_string_init (struct d_growable_string *dgs, size_t estimate) in d_growable_string_init() argument
3222 dgs->buf = NULL; in d_growable_string_init()
3223 dgs->len = 0; in d_growable_string_init()
3224 dgs->alc = 0; in d_growable_string_init()
3225 dgs->allocation_failure = 0; in d_growable_string_init()
3228 d_growable_string_resize (dgs, estimate); in d_growable_string_init()
3234 d_growable_string_resize (struct d_growable_string *dgs, size_t need) in d_growable_string_resize() argument
3239 if (dgs->allocation_failure) in d_growable_string_resize()
3245 newalc = dgs->alc > 0 ? dgs->alc : 2; in d_growable_string_resize()
3249 newbuf = (char *) realloc (dgs->buf, newalc); in d_growable_string_resize()
3252 free (dgs->buf); in d_growable_string_resize()
3253 dgs->buf = NULL; in d_growable_string_resize()
3254 dgs->len = 0; in d_growable_string_resize()
3255 dgs->alc = 0; in d_growable_string_resize()
3256 dgs->allocation_failure = 1; in d_growable_string_resize()
3259 dgs->buf = newbuf; in d_growable_string_resize()
3260 dgs->alc = newalc; in d_growable_string_resize()
3266 d_growable_string_append_buffer (struct d_growable_string *dgs, in d_growable_string_append_buffer() argument
3271 need = dgs->len + l + 1; in d_growable_string_append_buffer()
3272 if (need > dgs->alc) in d_growable_string_append_buffer()
3273 d_growable_string_resize (dgs, need); in d_growable_string_append_buffer()
3275 if (dgs->allocation_failure) in d_growable_string_append_buffer()
3278 memcpy (dgs->buf + dgs->len, s, l); in d_growable_string_append_buffer()
3279 dgs->buf[dgs->len + l] = '\0'; in d_growable_string_append_buffer()
3280 dgs->len += l; in d_growable_string_append_buffer()
3288 struct d_growable_string *dgs = (struct d_growable_string*) opaque; in d_growable_string_callback_adapter() local
3290 d_growable_string_append_buffer (dgs, s, l); in d_growable_string_callback_adapter()
3417 struct d_growable_string dgs; in cplus_demangle_print() local
3419 d_growable_string_init (&dgs, estimate); in cplus_demangle_print()
3423 &dgs)) in cplus_demangle_print()
3425 free (dgs.buf); in cplus_demangle_print()
3430 *palc = dgs.allocation_failure ? 1 : dgs.alc; in cplus_demangle_print()
3431 return dgs.buf; in cplus_demangle_print()
4875 struct d_growable_string dgs; in d_demangle() local
4878 d_growable_string_init (&dgs, 0); in d_demangle()
4881 d_growable_string_callback_adapter, &dgs); in d_demangle()
4884 free (dgs.buf); in d_demangle()
4889 *palc = dgs.allocation_failure ? 1 : dgs.alc; in d_demangle()
4890 return dgs.buf; in d_demangle()