openssl-prebuild/linux_amd64/share/doc/openssl/html/man3/BIO_new.html
2020-03-02 16:50:34 +00:00

107 lines
3.5 KiB
HTML
Executable File

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BIO_new</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#return_values">RETURN VALUES</a></li>
<li><a href="#notes">NOTES</a></li>
<li><a href="#history">HISTORY</a></li>
<li><a href="#examples">EXAMPLES</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>BIO_new, BIO_up_ref, BIO_free, BIO_vfree, BIO_free_all
- BIO allocation and freeing functions</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/bio.h&gt;</pre>
<pre>
BIO * BIO_new(const BIO_METHOD *type);
int BIO_up_ref(BIO *a);
int BIO_free(BIO *a);
void BIO_vfree(BIO *a);
void BIO_free_all(BIO *a);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The <code>BIO_new()</code> function returns a new BIO using method <strong>type</strong>.</p>
<p><code>BIO_up_ref()</code> increments the reference count associated with the BIO object.</p>
<p><code>BIO_free()</code> frees up a single BIO, <code>BIO_vfree()</code> also frees up a single BIO
but it does not return a value.
If <strong>a</strong> is NULL nothing is done.
Calling <code>BIO_free()</code> may also have some effect
on the underlying I/O structure, for example it may close the file being
referred to under certain circumstances. For more details see the individual
BIO_METHOD descriptions.</p>
<p><code>BIO_free_all()</code> frees up an entire BIO chain, it does not halt if an error
occurs freeing up an individual BIO in the chain.
If <strong>a</strong> is NULL nothing is done.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p><code>BIO_new()</code> returns a newly created BIO or NULL if the call fails.</p>
<p><code>BIO_up_ref()</code> and <code>BIO_free()</code> return 1 for success and 0 for failure.</p>
<p><code>BIO_free_all()</code> and <code>BIO_vfree()</code> do not return values.</p>
<p>
</p>
<hr />
<h1><a name="notes">NOTES</a></h1>
<p>If <code>BIO_free()</code> is called on a BIO chain it will only free one BIO resulting
in a memory leak.</p>
<p>Calling <code>BIO_free_all()</code> on a single BIO has the same effect as calling <code>BIO_free()</code>
on it other than the discarded return value.</p>
<p>
</p>
<hr />
<h1><a name="history">HISTORY</a></h1>
<p><code>BIO_set()</code> was removed in OpenSSL 1.1.0 as BIO type is now opaque.</p>
<p>
</p>
<hr />
<h1><a name="examples">EXAMPLES</a></h1>
<p>Create a memory BIO:</p>
<pre>
BIO *mem = BIO_new(BIO_s_mem());</pre>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the Apache License 2.0 (the &quot;License&quot;). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
</body>
</html>