Lines Matching refs:buf
59 file_copystr(char *buf, size_t blen, size_t width, const char *str) in file_copystr() argument
63 strlcpy(buf, str, width); in file_copystr()
64 return buf; in file_copystr()
70 efree(ms->o.buf); in file_clearbuf()
71 ms->o.buf = NULL; in file_clearbuf()
133 char *buf = NULL, *newstr; in file_printf() local
136 vspprintf(&buf, 0, fmt, ap); in file_printf()
139 if (ms->o.buf != NULL) { in file_printf()
140 spprintf(&newstr, 0, "%s%s", ms->o.buf, (buf ? buf : "")); in file_printf()
141 if (buf) { in file_printf()
142 efree(buf); in file_printf()
144 efree(ms->o.buf); in file_printf()
145 ms->o.buf = newstr; in file_printf()
147 ms->o.buf = buf; in file_printf()
160 char *buf = NULL; in file_error_core() local
166 efree(ms->o.buf); in file_error_core()
167 ms->o.buf = NULL; in file_error_core()
171 vspprintf(&buf, 0, f, va); in file_error_core()
175 file_printf(ms, "%s (%s)", (*buf ? buf : ""), strerror(error)); in file_error_core()
176 } else if (*buf) { in file_error_core()
177 file_printf(ms, "%s", buf); in file_error_core()
180 if (buf) { in file_error_core()
181 efree(buf); in file_error_core()
281 const void *buf, size_t nb) in file_buffer() argument
304 buffer_init(&b, fd, st, buf, nb); in file_buffer()
507 return ms->o.buf; in file_getbuffer()
509 if (ms->o.buf == NULL) in file_getbuffer()
513 len = strlen(ms->o.buf); in file_getbuffer()
535 op = ms->o.buf; in file_getbuffer()
564 for (np = ms->o.pbuf, op = ms->o.buf; *op;) { in file_getbuffer()
601 return ms->o.buf == NULL ? 0 : strlen(ms->o.buf); in file_printedlen()
624 res = php_pcre_replace_impl(pce, NULL, ms->o.buf, strlen(ms->o.buf), repl, -1, &rep_cnt); in file_replace()
632 strncpy(ms->o.buf, ZSTR_VAL(res), ZSTR_LEN(res)); in file_replace()
633 ms->o.buf[ZSTR_LEN(res)] = '\0'; in file_replace()
652 pb->buf = ms->o.buf; in file_push_buffer()
656 ms->o.buf = NULL; in file_push_buffer()
669 efree(pb->buf); in file_pop_buffer()
674 rbuf = ms->o.buf; in file_pop_buffer()
676 ms->o.buf = pb->buf; in file_pop_buffer()
688 file_printable(char *buf, size_t bufsiz, const char *str, size_t slen) in file_printable() argument
690 char *ptr, *eptr = buf + bufsiz - 1; in file_printable()
694 for (ptr = buf; ptr < eptr && s < es && *s; s++) { in file_printable()
707 return buf; in file_printable()