Lines Matching refs:buffer
39 buffer_debug(pkgconf_buffer_t *buffer)
41 for (char *c = buffer->base; c <= buffer->end; c++)
62 pkgconf_buffer_append(pkgconf_buffer_t *buffer, const char *text) in pkgconf_buffer_append() argument
65 size_t newsize = pkgconf_buffer_len(buffer) + needed; in pkgconf_buffer_append()
67 char *newbase = realloc(buffer->base, target_allocation_size(newsize)); in pkgconf_buffer_append()
71 char *newend = newbase + pkgconf_buffer_len(buffer); in pkgconf_buffer_append()
74 buffer->base = newbase; in pkgconf_buffer_append()
75 buffer->end = newend + (needed - 1); in pkgconf_buffer_append()
77 *buffer->end = '\0'; in pkgconf_buffer_append()
121 pkgconf_buffer_append_vfmt(pkgconf_buffer_t *buffer, const char *fmt, va_list src_va) in pkgconf_buffer_append_vfmt() argument
139 bool ret = pkgconf_buffer_append(buffer, buf); in pkgconf_buffer_append_vfmt()
158 pkgconf_buffer_append_fmt(pkgconf_buffer_t *buffer, const char *fmt, ...) in pkgconf_buffer_append_fmt() argument
163 bool ret = pkgconf_buffer_append_vfmt(buffer, fmt, va); in pkgconf_buffer_append_fmt()
182 pkgconf_buffer_prepend(pkgconf_buffer_t *buffer, const char *text) in pkgconf_buffer_prepend() argument
189 if (!pkgconf_buffer_append(&tmpbuf, pkgconf_buffer_str_or_empty(buffer))) in pkgconf_buffer_prepend()
196 pkgconf_buffer_copy(&tmpbuf, buffer); in pkgconf_buffer_prepend()
215 pkgconf_buffer_push_byte(pkgconf_buffer_t *buffer, char byte) in pkgconf_buffer_push_byte() argument
217 size_t newsize = pkgconf_buffer_len(buffer) + 1; in pkgconf_buffer_push_byte()
218 char *newbase = realloc(buffer->base, target_allocation_size(newsize)); in pkgconf_buffer_push_byte()
226 buffer->base = newbase; in pkgconf_buffer_push_byte()
227 buffer->end = newend; in pkgconf_buffer_push_byte()
243 pkgconf_buffer_trim_byte(pkgconf_buffer_t *buffer) in pkgconf_buffer_trim_byte() argument
245 size_t len = pkgconf_buffer_len(buffer); in pkgconf_buffer_trim_byte()
250 char *newbase = realloc(buffer->base, target_allocation_size(newsize)); in pkgconf_buffer_trim_byte()
255 buffer->base = newbase; in pkgconf_buffer_trim_byte()
256 buffer->end = newbase + newsize; in pkgconf_buffer_trim_byte()
257 *(buffer->end) = '\0'; in pkgconf_buffer_trim_byte()
273 pkgconf_buffer_finalize(pkgconf_buffer_t *buffer) in pkgconf_buffer_finalize() argument
275 free(buffer->base); in pkgconf_buffer_finalize()
276 buffer->base = buffer->end = NULL; in pkgconf_buffer_finalize()
293 pkgconf_buffer_fputs(pkgconf_buffer_t *buffer, FILE *out) in pkgconf_buffer_fputs() argument
295 if (pkgconf_buffer_len(buffer) != 0) in pkgconf_buffer_fputs()
297 if (fputs(pkgconf_buffer_str(buffer), out) == EOF) in pkgconf_buffer_fputs()
321 pkgconf_buffer_vjoin(pkgconf_buffer_t *buffer, char delim, va_list src_va) in pkgconf_buffer_vjoin() argument
330 if (pkgconf_buffer_str(buffer) != NULL) in pkgconf_buffer_vjoin()
332 if (!pkgconf_buffer_push_byte(buffer, delim)) in pkgconf_buffer_vjoin()
339 if (!pkgconf_buffer_append(buffer, arg)) in pkgconf_buffer_vjoin()
364 pkgconf_buffer_join(pkgconf_buffer_t *buffer, int delim, ...) in pkgconf_buffer_join() argument
369 bool ret = pkgconf_buffer_vjoin(buffer, (char)delim, va); in pkgconf_buffer_join()