BIO_get_data.pod 2.2 KB

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