Home | History | Annotate | Download | only in bio

Lines Matching refs:bio

1 /* crypto/bio/bio_lib.c */
63 #include <openssl/bio.h>
66 BIO *BIO_new(BIO_METHOD *method)
68 BIO *ret=NULL;
70 ret=(BIO *)OPENSSL_malloc(sizeof(BIO));
84 int BIO_set(BIO *bio, BIO_METHOD *method)
86 bio->method=method;
87 bio->callback=NULL;
88 bio->cb_arg=NULL;
89 bio->init=0;
90 bio->shutdown=1;
91 bio->flags=0;
92 bio->retry_reason=0;
93 bio->num=0;
94 bio->ptr=NULL;
95 bio->prev_bio=NULL;
96 bio->next_bio=NULL;
97 bio->references=1;
98 bio->num_read=0L;
99 bio->num_write=0L;
100 CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
102 if (!method->create(bio))
104 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio,
105 &bio->ex_data);
111 int BIO_free(BIO *a)
119 REF_PRINT("BIO",a);
141 void BIO_vfree(BIO *a)
144 void BIO_clear_flags(BIO *b, int flags)
149 int BIO_test_flags(const BIO *b, int flags)
154 void BIO_set_flags(BIO *b, int flags)
159 long (*BIO_get_callback(const BIO *b))(struct bio_st *,int,const char *,int, long,long)
164 void BIO_set_callback(BIO *b, long (*cb)(struct bio_st *,int,const char *,int, long,long))
169 void BIO_set_callback_arg(BIO *b, char *arg)
174 char * BIO_get_callback_arg(const BIO *b)
179 const char * BIO_method_name(const BIO *b)
184 int BIO_method_type(const BIO *b)
190 int BIO_read(BIO *b, void *out, int outl)
193 long (*cb)(BIO *,int,const char *,int,long,long);
222 int BIO_write(BIO *b, const void *in, int inl)
225 long (*cb)(BIO *,int,const char *,int,long,long);
257 int BIO_puts(BIO *b, const char *in)
260 long (*cb)(BIO *,int,const char *,int,long,long);
290 int BIO_gets(BIO *b, char *in, int inl)
293 long (*cb)(BIO *,int,const char *,int,long,long);
321 int BIO_indent(BIO *b,int indent,int max)
333 long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)
341 char *BIO_ptr_ctrl(BIO *b, int cmd, long larg)
351 long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
354 long (*cb)(BIO *,int,const char *,int,long,long);
378 long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long))
381 long (*cb)(BIO *,int,const char *,int,long,long);
408 size_t BIO_ctrl_pending(BIO *bio)
410 return BIO_ctrl(bio, BIO_CTRL_PENDING, 0, NULL);
413 size_t BIO_ctrl_wpending(BIO *bio)
415 return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL);
419 /* put the 'bio' on the end of b's list of operators */
420 BIO *BIO_push(BIO *b, BIO *bio)
422 BIO *lb;
424 if (b == NULL) return(bio);
428 lb->next_bio=bio;
429 if (bio != NULL)
430 bio->prev_bio=lb;
437 BIO *BIO_pop(BIO *b)
439 BIO *ret;
456 BIO *BIO_get_retry_BIO(BIO *bio, int *reason)
458 BIO *b,*last;
460 b=last=bio;
472 int BIO_get_retry_reason(BIO *bio)
474 return(bio->retry_reason);
477 BIO *BIO_find_type(BIO *bio, int type)
481 if(!bio) return NULL;
484 if (bio->method != NULL)
486 mt=bio->method->type;
490 if (mt & type) return(bio);
493 return(bio);
495 bio=bio->next_bio;
496 } while (bio != NULL);
500 BIO *BIO_next(BIO *b)
506 void BIO_free_all(BIO *bio)
508 BIO *b;
511 while (bio != NULL)
513 b=bio;
515 bio=bio->next_bio;
522 BIO *BIO_dup_chain(BIO *in)
524 BIO *ret=NULL,*eoc=NULL,*bio,*new;
526 for (bio=in; bio != NULL; bio=bio->next_bio)
528 if ((new=BIO_new(bio->method)) == NULL) goto err;
529 new->callback=bio->callback;
530 new->cb_arg=bio->cb_arg;
531 new->init=bio->init;
532 new->shutdown=bio->shutdown;
533 new->flags=bio->flags;
536 new->num=bio->num;
538 if (!BIO_dup_state(bio,(char *)new))
546 &bio->ex_data))
567 void BIO_copy_next_retry(BIO *b)
580 int BIO_set_ex_data(BIO *bio, int idx, void *data)
582 return(CRYPTO_set_ex_data(&(bio->ex_data),idx,data));
585 void *BIO_get_ex_data(BIO *bio, int idx)
587 return(CRYPTO_get_ex_data(&(bio->ex_data),idx));
590 unsigned long BIO_number_read(BIO *bio)
592 if(bio) return bio->num_read;
596 unsigned long BIO_number_written(BIO *bio)
598 if(bio) return bio->num_write;
602 IMPLEMENT_STACK_OF(BIO)