BIO_new(3) OpenSSL BIO_new(3) NNAAMMEE BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all - BIO allocation and freeing functions SSYYNNOOPPSSIISS #include BIO * BIO_new(BIO_METHOD *type); int BIO_set(BIO *a,BIO_METHOD *type); int BIO_free(BIO *a); void BIO_vfree(BIO *a); void BIO_free_all(BIO *a); DDEESSCCRRIIPPTTIIOONN The _B_I_O___n_e_w_(_) function returns a new BIO using method ttyyppee. _B_I_O___s_e_t_(_) sets the method of an already existing BIO. _B_I_O___f_r_e_e_(_) frees up a single BIO, _B_I_O___v_f_r_e_e_(_) also frees up a single BIO but it does not return a value. Calling _B_I_O___f_r_e_e_(_) may also have some effect on the underlying I/O structure, for example it may close the file being referred to under certain circumstances. For more details see the individual BIO_METHOD descriptions. _B_I_O___f_r_e_e___a_l_l_(_) frees up an entire BIO chain, it does not halt if an error occurs freeing up an individual BIO in the chain. RREETTUURRNN VVAALLUUEESS _B_I_O___n_e_w_(_) returns a newly created BIO or NULL if the call fails. _B_I_O___s_e_t_(_), _B_I_O___f_r_e_e_(_) return 1 for success and 0 for failure. _B_I_O___f_r_e_e___a_l_l_(_) and _B_I_O___v_f_r_e_e_(_) do not return values. NNOOTTEESS Some BIOs (such as memory BIOs) can be used immediately after calling _B_I_O___n_e_w_(_). Others (such as file BIOs) need some additional initializa- tion, and frequently a utility function exists to create and initialize such BIOs. If _B_I_O___f_r_e_e_(_) is called on a BIO chain it will only free one BIO resulting in a memory leak. Calling _B_I_O___f_r_e_e___a_l_l_(_) a single BIO has the same effect as calling _B_I_O___f_r_e_e_(_) on it other than the discarded return value. Normally the ttyyppee argument is supplied by a function which returns a pointer to a BIO_METHOD. There is a naming convention for such func- tions: a source/sink BIO is normally called BIO_s_*() and a filter BIO BIO_f_*(); EEXXAAMMPPLLEE Create a memory BIO: BIO *mem = BIO_new(BIO_s_mem()); SSEEEE AALLSSOO TBA 1.0.2u 2019-12-20 BIO_new(3)