• Home
  • Raw
  • Download

Lines Matching refs:bio

96 static int bio_new(BIO *bio);
97 static int bio_free(BIO *bio);
98 static int bio_read(BIO *bio, char *buf, int size);
99 static int bio_write(BIO *bio, const char *buf, int num);
100 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
101 static int bio_puts(BIO *bio, const char *str);
104 static void bio_destroy_pair(BIO *bio);
145 static int bio_new(BIO *bio) in bio_new() argument
157 bio->ptr = b; in bio_new()
162 static int bio_free(BIO *bio) in bio_free() argument
166 if (bio == NULL) in bio_free()
168 b = bio->ptr; in bio_free()
173 bio_destroy_pair(bio); in bio_free()
187 static int bio_read(BIO *bio, char *buf, int size_) in bio_read() argument
193 BIO_clear_retry_flags(bio); in bio_read()
195 if (!bio->init) in bio_read()
198 b = bio->ptr; in bio_read()
216 BIO_set_retry_read(bio); /* buffer is empty */ in bio_read()
280 static ossl_ssize_t bio_nread0(BIO *bio, char **buf) in bio_nread0() argument
285 BIO_clear_retry_flags(bio); in bio_nread0()
287 if (!bio->init) in bio_nread0()
290 b = bio->ptr; in bio_nread0()
304 return bio_read(bio, &dummy, 1); /* returns 0 or -1 */ in bio_nread0()
318 static ossl_ssize_t bio_nread(BIO *bio, char **buf, size_t num_) in bio_nread() argument
328 available = bio_nread0(bio, buf); in bio_nread()
334 b = bio->ptr; in bio_nread()
352 static int bio_write(BIO *bio, const char *buf, int num_) in bio_write() argument
358 BIO_clear_retry_flags(bio); in bio_write()
360 if (!bio->init || buf == NULL || num == 0) in bio_write()
363 b = bio->ptr; in bio_write()
380 BIO_set_retry_write(bio); /* buffer is full */ in bio_write()
431 static ossl_ssize_t bio_nwrite0(BIO *bio, char **buf) in bio_nwrite0() argument
437 BIO_clear_retry_flags(bio); in bio_nwrite0()
439 if (!bio->init) in bio_nwrite0()
442 b = bio->ptr; in bio_nwrite0()
458 BIO_set_retry_write(bio); in bio_nwrite0()
479 static ossl_ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) in bio_nwrite() argument
489 space = bio_nwrite0(bio, buf); in bio_nwrite()
494 b = bio->ptr; in bio_nwrite()
503 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) in bio_ctrl() argument
506 struct bio_bio_st *b = bio->ptr; in bio_ctrl()
550 if (bio_make_pair(bio, other_bio)) in bio_ctrl()
560 bio_destroy_pair(bio); in bio_ctrl()
597 ret = (long) bio_nread0(bio, ptr); in bio_ctrl()
602 ret = (long) bio_nread(bio, ptr, (size_t) num); in bio_ctrl()
607 ret = (long) bio_nwrite0(bio, ptr); in bio_ctrl()
612 ret = (long) bio_nwrite(bio, ptr, (size_t) num); in bio_ctrl()
628 ret = bio->shutdown; in bio_ctrl()
632 bio->shutdown = (int) num; in bio_ctrl()
698 static int bio_puts(BIO *bio, const char *str) in bio_puts() argument
700 return bio_write(bio, str, strlen(str)); in bio_puts()
757 static void bio_destroy_pair(BIO *bio) in bio_destroy_pair() argument
759 struct bio_bio_st *b = bio->ptr; in bio_destroy_pair()
770 assert(peer_b->peer == bio); in bio_destroy_pair()
779 bio->init = 0; in bio_destroy_pair()
841 size_t BIO_ctrl_get_write_guarantee(BIO *bio) in BIO_ctrl_get_write_guarantee() argument
843 return BIO_ctrl(bio, BIO_C_GET_WRITE_GUARANTEE, 0, NULL); in BIO_ctrl_get_write_guarantee()
846 size_t BIO_ctrl_get_read_request(BIO *bio) in BIO_ctrl_get_read_request() argument
848 return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL); in BIO_ctrl_get_read_request()
851 int BIO_ctrl_reset_read_request(BIO *bio) in BIO_ctrl_reset_read_request() argument
853 return (BIO_ctrl(bio, BIO_C_RESET_READ_REQUEST, 0, NULL) != 0); in BIO_ctrl_reset_read_request()
860 int BIO_nread0(BIO *bio, char **buf) in BIO_nread0() argument
864 if (!bio->init) in BIO_nread0()
870 ret = BIO_ctrl(bio, BIO_C_NREAD0, 0, buf); in BIO_nread0()
877 int BIO_nread(BIO *bio, char **buf, int num) in BIO_nread() argument
881 if (!bio->init) in BIO_nread()
887 ret = (int) BIO_ctrl(bio, BIO_C_NREAD, num, buf); in BIO_nread()
889 bio->num_read += ret; in BIO_nread()
893 int BIO_nwrite0(BIO *bio, char **buf) in BIO_nwrite0() argument
897 if (!bio->init) in BIO_nwrite0()
903 ret = BIO_ctrl(bio, BIO_C_NWRITE0, 0, buf); in BIO_nwrite0()
910 int BIO_nwrite(BIO *bio, char **buf, int num) in BIO_nwrite() argument
914 if (!bio->init) in BIO_nwrite()
920 ret = BIO_ctrl(bio, BIO_C_NWRITE, num, buf); in BIO_nwrite()
922 bio->num_write += ret; in BIO_nwrite()