Lines Matching refs:buf
15 static int mem_write(BIO *h, const char *buf, int num);
16 static int mem_read(BIO *h, char *buf, int size);
63 struct buf_mem_st *buf; /* allocated buffer */ member
82 BIO *BIO_new_mem_buf(const void *buf, int len) in BIO_new_mem_buf() argument
89 if (buf == NULL) { in BIO_new_mem_buf()
93 sz = (len < 0) ? strlen(buf) : (size_t)len; in BIO_new_mem_buf()
97 b = bb->buf; in BIO_new_mem_buf()
99 b->data = (void *)buf; in BIO_new_mem_buf()
102 *bb->readp = *bb->buf; in BIO_new_mem_buf()
115 if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) { in mem_init()
120 BUF_MEM_free(bb->buf); in mem_init()
124 *bb->readp = *bb->buf; in mem_init()
164 BUF_MEM *b = bb->buf; in mem_buf_free()
182 if (bbm->readp->data != bbm->buf->data) { in mem_buf_sync()
183 memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length); in mem_buf_sync()
184 bbm->buf->length = bbm->readp->length; in mem_buf_sync()
185 bbm->readp->data = bbm->buf->data; in mem_buf_sync()
198 bm = bbm->buf; in mem_read()
233 if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0) in mem_write()
235 memcpy(bbm->buf->data + blen, in, inl); in mem_write()
236 *bbm->readp = *bbm->buf; in mem_write()
251 bm = bbm->buf; in mem_ctrl()
255 bo = bbm->buf; in mem_ctrl()
262 bm = bbm->buf; in mem_ctrl()
269 *bbm->readp = *bbm->buf; in mem_ctrl()
272 *bbm->buf = *bbm->readp; in mem_ctrl()
304 bbm->buf = ptr; in mem_ctrl()
305 *bbm->readp = *bbm->buf; in mem_ctrl()
311 bm = bbm->buf; in mem_ctrl()
341 static int mem_gets(BIO *bp, char *buf, int size) in mem_gets() argument
350 bm = bbm->buf; in mem_gets()
356 *buf = '\0'; in mem_gets()
372 i = mem_read(bp, buf, i); in mem_gets()
374 buf[i] = '\0'; in mem_gets()