• Home
  • Raw
  • Download

Lines Matching refs:bio

97 static int mem_new(BIO *bio) {  in mem_new()  argument
107 bio->shutdown = 1; in mem_new()
108 bio->init = 1; in mem_new()
109 bio->num = -1; in mem_new()
110 bio->ptr = (char *)b; in mem_new()
115 static int mem_free(BIO *bio) { in mem_free() argument
118 if (bio == NULL) { in mem_free()
122 if (!bio->shutdown || !bio->init || bio->ptr == NULL) { in mem_free()
126 b = (BUF_MEM *)bio->ptr; in mem_free()
127 if (bio->flags & BIO_FLAGS_MEM_RDONLY) { in mem_free()
131 bio->ptr = NULL; in mem_free()
135 static int mem_read(BIO *bio, char *out, int outl) { in mem_read() argument
137 BUF_MEM *b = (BUF_MEM*) bio->ptr; in mem_read()
139 BIO_clear_retry_flags(bio); in mem_read()
148 if (bio->flags & BIO_FLAGS_MEM_RDONLY) { in mem_read()
154 ret = bio->num; in mem_read()
156 BIO_set_retry_read(bio); in mem_read()
162 static int mem_write(BIO *bio, const char *in, int inl) { in mem_write() argument
167 b = (BUF_MEM *)bio->ptr; in mem_write()
169 if (bio->flags & BIO_FLAGS_MEM_RDONLY) { in mem_write()
174 BIO_clear_retry_flags(bio); in mem_write()
193 static int mem_gets(BIO *bio, char *buf, int size) { in mem_gets() argument
196 BUF_MEM *b = (BUF_MEM *)bio->ptr; in mem_gets()
198 BIO_clear_retry_flags(bio); in mem_gets()
221 i = mem_read(bio, buf, i); in mem_gets()
228 static long mem_ctrl(BIO *bio, int cmd, long num, void *ptr) { in mem_ctrl() argument
232 BUF_MEM *b = (BUF_MEM *)bio->ptr; in mem_ctrl()
238 if (bio->flags & BIO_FLAGS_MEM_RDONLY) { in mem_ctrl()
251 bio->num = (int)num; in mem_ctrl()
261 mem_free(bio); in mem_ctrl()
262 bio->shutdown = (int)num; in mem_ctrl()
263 bio->ptr = ptr; in mem_ctrl()
272 ret = (long)bio->shutdown; in mem_ctrl()
275 bio->shutdown = (int)num; in mem_ctrl()
300 int BIO_mem_contents(const BIO *bio, const uint8_t **out_contents, in BIO_mem_contents() argument
303 if (bio->method != &mem_method) { in BIO_mem_contents()
307 b = (BUF_MEM *)bio->ptr; in BIO_mem_contents()
313 long BIO_get_mem_data(BIO *bio, char **contents) { in BIO_get_mem_data() argument
314 return BIO_ctrl(bio, BIO_CTRL_INFO, 0, (char *) contents); in BIO_get_mem_data()
317 int BIO_get_mem_ptr(BIO *bio, BUF_MEM **out) { in BIO_get_mem_ptr() argument
318 return BIO_ctrl(bio, BIO_C_GET_BUF_MEM_PTR, 0, (char *) out); in BIO_get_mem_ptr()
321 int BIO_set_mem_buf(BIO *bio, BUF_MEM *b, int take_ownership) { in BIO_set_mem_buf() argument
322 return BIO_ctrl(bio, BIO_C_SET_BUF_MEM, take_ownership, (char *) b); in BIO_set_mem_buf()
325 int BIO_set_mem_eof_return(BIO *bio, int eof_value) { in BIO_set_mem_eof_return() argument
326 return BIO_ctrl(bio, BIO_C_SET_BUF_MEM_EOF_RETURN, eof_value, NULL); in BIO_set_mem_eof_return()