1BIO_new(3) OpenSSL BIO_new(3)
2
3
4
6 BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all - BIO allocation
7 and freeing functions
8
10 #include <openssl/bio.h>
11
12 BIO * BIO_new(BIO_METHOD *type);
13 int BIO_set(BIO *a,BIO_METHOD *type);
14 int BIO_free(BIO *a);
15 void BIO_vfree(BIO *a);
16 void BIO_free_all(BIO *a);
17
19 The BIO_new() function returns a new BIO using method type.
20
21 BIO_set() sets the method of an already existing BIO.
22
23 BIO_free() frees up a single BIO, BIO_vfree() also frees up a single
24 BIO but it does not return a value. Calling BIO_free() may also have
25 some effect on the underlying I/O structure, for example it may close
26 the file being referred to under certain circumstances. For more
27 details see the individual BIO_METHOD descriptions.
28
29 BIO_free_all() frees up an entire BIO chain, it does not halt if an
30 error occurs freeing up an individual BIO in the chain.
31
33 BIO_new() returns a newly created BIO or NULL if the call fails.
34
35 BIO_set(), BIO_free() return 1 for success and 0 for failure.
36
37 BIO_free_all() and BIO_vfree() do not return values.
38
40 Some BIOs (such as memory BIOs) can be used immediately after calling
41 BIO_new(). Others (such as file BIOs) need some additional
42 initialization, and frequently a utility function exists to create and
43 initialize such BIOs.
44
45 If BIO_free() is called on a BIO chain it will only free one BIO
46 resulting in a memory leak.
47
48 Calling BIO_free_all() a single BIO has the same effect as calling
49 BIO_free() on it other than the discarded return value.
50
51 Normally the type argument is supplied by a function which returns a
52 pointer to a BIO_METHOD. There is a naming convention for such
53 functions: a source/sink BIO is normally called BIO_s_*() and a filter
54 BIO BIO_f_*();
55
57 Create a memory BIO:
58
59 BIO *mem = BIO_new(BIO_s_mem());
60
62 TBA
63
64
65
661.0.2o 2018-03-27 BIO_new(3)