Lines Matching refs:buf
30 static int bio_read(BIO *bio, char *buf, int size);
31 static int bio_write(BIO *bio, const char *buf, int num);
68 char *buf; /* "size" elements (if != NULL) */ member
103 OPENSSL_free(b->buf); in bio_free()
109 static int bio_read(BIO *bio, char *buf, int size_) in bio_read() argument
125 assert(peer_b->buf != NULL); in bio_read()
129 if (buf == NULL || size == 0) in bio_read()
168 memcpy(buf, peer_b->buf + peer_b->offset, chunk); in bio_read()
176 buf += chunk; in bio_read()
200 static ossl_ssize_t bio_nread0(BIO *bio, char **buf) in bio_nread0() argument
215 assert(peer_b->buf != NULL); in bio_nread0()
232 if (buf != NULL) in bio_nread0()
233 *buf = peer_b->buf + peer_b->offset; in bio_nread0()
237 static ossl_ssize_t bio_nread(BIO *bio, char **buf, size_t num_) in bio_nread() argument
247 available = bio_nread0(bio, buf); in bio_nread()
268 static int bio_write(BIO *bio, const char *buf, int num_) in bio_write() argument
276 if (!bio->init || buf == NULL || num_ <= 0) in bio_write()
282 assert(b->buf != NULL); in bio_write()
324 memcpy(b->buf + write_offset, buf, chunk); in bio_write()
331 buf += chunk; in bio_write()
345 static ossl_ssize_t bio_nwrite0(BIO *bio, char **buf) in bio_nwrite0() argument
359 assert(b->buf != NULL); in bio_nwrite0()
386 if (buf != NULL) in bio_nwrite0()
387 *buf = b->buf + write_offset; in bio_nwrite0()
393 static ossl_ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) in bio_nwrite() argument
403 space = bio_nwrite0(bio, buf); in bio_nwrite()
437 OPENSSL_free(b->buf); in bio_ctrl()
438 b->buf = NULL; in bio_ctrl()
528 if (b->buf != NULL) { in bio_ctrl()
554 if (b->buf != NULL) in bio_ctrl()
570 assert(other_b->buf == NULL); /* other_bio is always fresh */ in bio_ctrl()
621 if (b1->buf == NULL) { in bio_make_pair()
622 b1->buf = OPENSSL_malloc(b1->size); in bio_make_pair()
623 if (b1->buf == NULL) in bio_make_pair()
629 if (b2->buf == NULL) { in bio_make_pair()
630 b2->buf = OPENSSL_malloc(b2->size); in bio_make_pair()
631 if (b2->buf == NULL) in bio_make_pair()
665 assert(peer_b->buf != NULL); in bio_destroy_pair()
671 assert(b->buf != NULL); in bio_destroy_pair()
742 int BIO_nread0(BIO *bio, char **buf) in BIO_nread0() argument
751 ret = BIO_ctrl(bio, BIO_C_NREAD0, 0, buf); in BIO_nread0()
758 int BIO_nread(BIO *bio, char **buf, int num) in BIO_nread() argument
767 ret = (int)BIO_ctrl(bio, BIO_C_NREAD, num, buf); in BIO_nread()
773 int BIO_nwrite0(BIO *bio, char **buf) in BIO_nwrite0() argument
782 ret = BIO_ctrl(bio, BIO_C_NWRITE0, 0, buf); in BIO_nwrite0()
789 int BIO_nwrite(BIO *bio, char **buf, int num) in BIO_nwrite() argument
798 ret = BIO_ctrl(bio, BIO_C_NWRITE, num, buf); in BIO_nwrite()