Lines Matching refs:buf
66 char *buf = NULL, *newstr; in file_printf() local
69 len = vspprintf(&buf, 0, fmt, ap); in file_printf()
72 if (ms->o.buf != NULL) { in file_printf()
73 len = spprintf(&newstr, 0, "%s%s", ms->o.buf, (buf ? buf : "")); in file_printf()
74 if (buf) { in file_printf()
75 efree(buf); in file_printf()
77 efree(ms->o.buf); in file_printf()
78 ms->o.buf = newstr; in file_printf()
80 ms->o.buf = buf; in file_printf()
93 char *buf = NULL; in file_error_core() local
99 efree(ms->o.buf); in file_error_core()
100 ms->o.buf = NULL; in file_error_core()
104 vspprintf(&buf, 0, f, va); in file_error_core()
108 file_printf(ms, "%s (%s)", (*buf ? buf : ""), strerror(error)); in file_error_core()
109 } else if (*buf) { in file_error_core()
110 file_printf(ms, "%s", buf); in file_error_core()
113 if (buf) { in file_error_core()
114 efree(buf); in file_error_core()
164 file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf, in file_buffer() argument
169 const unsigned char *ubuf = CAST(const unsigned char *, buf); in file_buffer()
194 switch (file_os2_apptype(ms, inname, buf, nb)) { in file_buffer()
302 if (ms->o.buf) { in file_reset()
303 efree(ms->o.buf); in file_reset()
304 ms->o.buf = NULL; in file_reset()
333 return ms->o.buf; in file_getbuffer()
335 if (ms->o.buf == NULL) in file_getbuffer()
339 len = strlen(ms->o.buf); in file_getbuffer()
360 op = ms->o.buf; in file_getbuffer()
389 for (np = ms->o.pbuf, op = ms->o.buf; *op;) { in file_getbuffer()
426 return ms->o.buf == NULL ? 0 : strlen(ms->o.buf); in file_printedlen()
451 res = php_pcre_replace_impl(pce, NULL, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt); in file_replace()
459 strncpy(ms->o.buf, ZSTR_VAL(res), ZSTR_LEN(res)); in file_replace()
460 ms->o.buf[ZSTR_LEN(res)] = '\0'; in file_replace()
480 pb->buf = ms->o.buf; in file_push_buffer()
483 ms->o.buf = NULL; in file_push_buffer()
495 efree(pb->buf); in file_pop_buffer()
500 rbuf = ms->o.buf; in file_pop_buffer()
502 ms->o.buf = pb->buf; in file_pop_buffer()
513 file_printable(char *buf, size_t bufsiz, const char *str) in file_printable() argument
518 for (ptr = buf, eptr = ptr + bufsiz - 1; ptr < eptr && *s; s++) { in file_printable()
531 return buf; in file_printable()