diff options
author | schwarze <> | 2015-02-14 14:09:01 +0000 |
---|---|---|
committer | schwarze <> | 2015-02-14 14:09:01 +0000 |
commit | 88853a20be023939d14cfde9e86a81bfcc75ef7b (patch) | |
tree | 14e96de4625e6c5d8612c27a513ebf5ed519b352 /src/lib/libcrypto/man/BIO_new.3 | |
parent | 948b14a55ded39aea589e34e23c19085fd99cac5 (diff) | |
download | openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.gz openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.bz2 openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.zip |
second batch of perlpod(1) to mdoc(7) conversion
Diffstat (limited to 'src/lib/libcrypto/man/BIO_new.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_new.3 | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BIO_new.3 b/src/lib/libcrypto/man/BIO_new.3 new file mode 100644 index 0000000000..5f5030cdfa --- /dev/null +++ b/src/lib/libcrypto/man/BIO_new.3 | |||
@@ -0,0 +1,104 @@ | |||
1 | .Dd July 17, 2014 | ||
2 | .Dt BIO_NEW 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BIO_new , | ||
6 | .Nm BIO_set , | ||
7 | .Nm BIO_free , | ||
8 | .Nm BIO_vfree , | ||
9 | .Nm BIO_free_all | ||
10 | .Nd BIO allocation and freeing functions | ||
11 | .Sh SYNOPSIS | ||
12 | .In openssl/bio.h | ||
13 | .Ft BIO * | ||
14 | .Fo BIO_new | ||
15 | .Fa "BIO_METHOD *type" | ||
16 | .Fc | ||
17 | .Ft int | ||
18 | .Fo BIO_set | ||
19 | .Fa "BIO *a" | ||
20 | .Fa "BIO_METHOD *type" | ||
21 | .Fc | ||
22 | .Ft int | ||
23 | .Fo BIO_free | ||
24 | .Fa "BIO *a" | ||
25 | .Fc | ||
26 | .Ft void | ||
27 | .Fo BIO_vfree | ||
28 | .Fa "BIO *a" | ||
29 | .Fc | ||
30 | .Ft void | ||
31 | .Fo BIO_free_all | ||
32 | .Fa "BIO *a" | ||
33 | .Fc | ||
34 | .Sh DESCRIPTION | ||
35 | The | ||
36 | .Fn BIO_new | ||
37 | function returns a new BIO using method | ||
38 | .Fa type . | ||
39 | .Pp | ||
40 | .Fn BIO_set | ||
41 | sets the method of an already existing BIO. | ||
42 | .Pp | ||
43 | .Fn BIO_free | ||
44 | frees up a single BIO, | ||
45 | .Fn BIO_vfree | ||
46 | also frees up a single BIO, but it does not return a value. | ||
47 | Calling | ||
48 | .Fn BIO_free | ||
49 | may also have some effect on the underlying I/O structure, | ||
50 | for example it may close the file being | ||
51 | referred to under certain circumstances. | ||
52 | For more details see the individual | ||
53 | .Vt BIO_METHOD | ||
54 | descriptions. | ||
55 | .Pp | ||
56 | .Fn BIO_free_all | ||
57 | frees up an entire BIO chain. | ||
58 | It does not halt if an error occurs | ||
59 | freeing up an individual BIO in the chain. | ||
60 | .Sh RETURN VALUES | ||
61 | .Fn BIO_new | ||
62 | returns a newly created BIO or | ||
63 | .Dv NULL | ||
64 | if the call fails. | ||
65 | .Pp | ||
66 | .Fn BIO_set | ||
67 | and | ||
68 | .Fn BIO_free | ||
69 | return 1 for success and 0 for failure. | ||
70 | .Pp | ||
71 | .Fn BIO_free_all | ||
72 | and | ||
73 | .Fn BIO_vfree | ||
74 | do not return values. | ||
75 | .Sh NOTES | ||
76 | Some BIOs (such as memory BIOs) can be used immediately after calling | ||
77 | .Fn BIO_new . | ||
78 | Others (such as file BIOs) need some additional initialization, and | ||
79 | frequently a utility function exists to create and initialize such BIOs. | ||
80 | .Pp | ||
81 | If | ||
82 | .Fn BIO_free | ||
83 | is called on a BIO chain, it will only free one BIO, | ||
84 | resulting in a memory leak. | ||
85 | .Pp | ||
86 | Calling | ||
87 | .Fn BIO_free_all | ||
88 | on a single BIO has the same effect as calling | ||
89 | .Fn BIO_free | ||
90 | on it other than the discarded return value. | ||
91 | .Pp | ||
92 | Normally the | ||
93 | .Fa type | ||
94 | argument is supplied by a function which returns a pointer to a | ||
95 | .Vt BIO_METHOD . | ||
96 | There is a naming convention for such functions: | ||
97 | a source/sink BIO is normally called | ||
98 | .Fn BIO_s_* | ||
99 | and a filter BIO | ||
100 | .Fn BIO_f_* . | ||
101 | .Sh EXAMPLES | ||
102 | Create a memory BIO: | ||
103 | .Pp | ||
104 | .Dl BIO *mem = BIO_new(BIO_s_mem()); | ||