Lines Matching refs:buf
23 char *buf; member
36 static ssize_t oms_write(register void *cookie, const char *buf, size_t bufsize) in oms_write() argument
47 newbuf = realloc(COOKIE->buf, COOKIE->len + bufsize - count); in oms_write()
49 *COOKIE->bufloc = COOKIE->buf = newbuf; in oms_write()
60 memcpy(COOKIE->buf + COOKIE->pos, buf, bufsize); in oms_write()
65 COOKIE->buf[COOKIE->eof] = 0; /* Need to nul-terminate. */ in oms_write()
74 register char *buf; in oms_seek() local
95 buf = realloc(COOKIE->buf, leastlen); in oms_seek()
96 if (buf) { in oms_seek()
97 *COOKIE->bufloc = COOKIE->buf = buf; in oms_seek()
99 memset(buf + COOKIE->eof, 0, leastlen - COOKIE->eof); /* 0-fill */ in oms_seek()
109 memset(COOKIE->buf + COOKIE->eof, 0, leastlen - COOKIE->eof); in oms_seek()
139 if ((cookie->buf = malloc(cookie->len = MEMSTREAM_BUFSIZ)) == NULL) { in open_memstream()
142 *cookie->buf = 0; /* Set nul terminator for buffer. */ in open_memstream()
143 *(cookie->bufloc = bufloc) = cookie->buf; in open_memstream()
160 free(cookie->buf); in open_memstream()