Blame doc/man3/BIO_find_type.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/bio.h>
Packit c4476c
Packit c4476c
 BIO *BIO_find_type(BIO *b, int bio_type);
Packit c4476c
 BIO *BIO_next(BIO *b);
Packit c4476c
 int BIO_method_type(const BIO *b);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
The BIO_find_type() searches for a BIO of a given type in a chain, starting
Packit c4476c
at BIO B. If B<type> is a specific type (such as B<BIO_TYPE_MEM>) then a search
Packit c4476c
is made for a BIO of that type. If B<type> is a general type (such as
Packit c4476c
B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
Packit c4476c
searched for. BIO_find_type() returns the next matching BIO or NULL if none is
Packit c4476c
found.
Packit c4476c
Packit c4476c
The following general types are defined:
Packit c4476c
B<BIO_TYPE_DESCRIPTOR>, B<BIO_TYPE_FILTER>, and B<BIO_TYPE_SOURCE_SINK>.
Packit c4476c
Packit c4476c
For a list of the specific types, see the B<openssl/bio.h> header file.
Packit c4476c
Packit c4476c
BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
Packit c4476c
in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
Packit c4476c
certain type.
Packit c4476c
Packit c4476c
BIO_method_type() returns the type of a BIO.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
BIO_find_type() returns a matching BIO or NULL for no match.
Packit c4476c
Packit c4476c
BIO_next() returns the next BIO in a chain.
Packit c4476c
Packit c4476c
BIO_method_type() returns the type of the BIO B.
Packit c4476c
Packit c4476c
=head1 EXAMPLES
Packit c4476c
Packit c4476c
Traverse a chain looking for digest BIOs:
Packit c4476c
Packit c4476c
 BIO *btmp;
Packit c4476c
Packit c4476c
 btmp = in_bio; /* in_bio is chain to search through */
Packit c4476c
 do {
Packit c4476c
     btmp = BIO_find_type(btmp, BIO_TYPE_MD);
Packit c4476c
     if (btmp == NULL)
Packit c4476c
         break; /* Not found */
Packit c4476c
     /* btmp is a digest BIO, do something with it ...*/
Packit c4476c
     ...
Packit c4476c
Packit c4476c
     btmp = BIO_next(btmp);
Packit c4476c
 } while (btmp);
Packit c4476c
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut