xref: /freebsd/crypto/openssl/doc/man3/BIO_get_data.pod (revision 2f513db72b034fd5ef7f080b11be5c711c15186a)
1=pod
2
3=head1 NAME
4
5BIO_set_data, BIO_get_data, BIO_set_init, BIO_get_init, BIO_set_shutdown,
6BIO_get_shutdown - functions for managing BIO state information
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11
12 void BIO_set_data(BIO *a, void *ptr);
13 void *BIO_get_data(BIO *a);
14 void BIO_set_init(BIO *a, int init);
15 int BIO_get_init(BIO *a);
16 void BIO_set_shutdown(BIO *a, int shut);
17 int BIO_get_shutdown(BIO *a);
18
19=head1 DESCRIPTION
20
21These functions are mainly useful when implementing a custom BIO.
22
23The BIO_set_data() function associates the custom data pointed to by B<ptr> with
24the BIO. This data can subsequently be retrieved via a call to BIO_get_data().
25This can be used by custom BIOs for storing implementation specific information.
26
27The BIO_set_init() function sets the value of the BIO's "init" flag to indicate
28whether initialisation has been completed for this BIO or not. A non-zero value
29indicates that initialisation is complete, whilst zero indicates that it is not.
30Often initialisation will complete during initial construction of the BIO. For
31some BIOs however, initialisation may not complete until after additional steps
32have occurred (for example through calling custom ctrls). The BIO_get_init()
33function returns the value of the "init" flag.
34
35The BIO_set_shutdown() and BIO_get_shutdown() functions set and get the state of
36this BIO's shutdown (i.e. BIO_CLOSE) flag. If set then the underlying resource
37is also closed when the BIO is freed.
38
39=head1 RETURN VALUES
40
41BIO_get_data() returns a pointer to the implementation specific custom data
42associated with this BIO, or NULL if none has been set.
43
44BIO_get_init() returns the state of the BIO's init flag.
45
46BIO_get_shutdown() returns the stat of the BIO's shutdown (i.e. BIO_CLOSE) flag.
47
48=head1 SEE ALSO
49
50L<bio>, L<BIO_meth_new>
51
52=head1 HISTORY
53
54The functions described here were added in OpenSSL 1.1.0.
55
56=head1 COPYRIGHT
57
58Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
59
60Licensed under the OpenSSL license (the "License").  You may not use
61this file except in compliance with the License.  You can obtain a copy
62in the file LICENSE in the source distribution or at
63L<https://www.openssl.org/source/license.html>.
64
65=cut
66