Following the license change, modify the boilerplates in doc/man3/
[openssl.git] / doc / man3 / BIO_find_type.pod
1 =pod
2
3 =head1 NAME
4
5 BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
6
7 =head1 SYNOPSIS
8
9  #include <openssl/bio.h>
10
11  BIO *BIO_find_type(BIO *b, int bio_type);
12  BIO *BIO_next(BIO *b);
13  int BIO_method_type(const BIO *b);
14
15 =head1 DESCRIPTION
16
17 The BIO_find_type() searches for a BIO of a given type in a chain, starting
18 at BIO B<b>. If B<type> is a specific type (such as B<BIO_TYPE_MEM>) then a search
19 is made for a BIO of that type. If B<type> is a general type (such as
20 B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
21 searched for. BIO_find_type() returns the next matching BIO or NULL if none is
22 found.
23
24 The following general types are defined:
25 B<BIO_TYPE_DESCRIPTOR>, B<BIO_TYPE_FILTER>, and B<BIO_TYPE_SOURCE_SINK>.
26
27 For a list of the specific types, see the B<openssl/bio.h> header file.
28
29 BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
30 in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
31 certain type.
32
33 BIO_method_type() returns the type of a BIO.
34
35 =head1 RETURN VALUES
36
37 BIO_find_type() returns a matching BIO or NULL for no match.
38
39 BIO_next() returns the next BIO in a chain.
40
41 BIO_method_type() returns the type of the BIO B<b>.
42
43 =head1 EXAMPLE
44
45 Traverse a chain looking for digest BIOs:
46
47  BIO *btmp;
48
49  btmp = in_bio; /* in_bio is chain to search through */
50  do {
51      btmp = BIO_find_type(btmp, BIO_TYPE_MD);
52      if (btmp == NULL)
53          break; /* Not found */
54      /* btmp is a digest BIO, do something with it ...*/
55      ...
56
57      btmp = BIO_next(btmp);
58  } while (btmp);
59
60
61 =head1 COPYRIGHT
62
63 Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
64
65 Licensed under the Apache License 2.0 (the "License").  You may not use
66 this file except in compliance with the License.  You can obtain a copy
67 in the file LICENSE in the source distribution or at
68 L<https://www.openssl.org/source/license.html>.
69
70 =cut