
#use wml::openssl-macros area=docs page=ERR_GET_LIB

<title>Documents, ERR_GET_LIB(3)</title>

<h1>ERR_GET_LIB(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
ERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON - get library, function and
reason code

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/err.h&gt;
</PRE>
<PRE> int ERR_GET_LIB(unsigned long e);
</PRE>
<PRE> int ERR_GET_FUNC(unsigned long e);
</PRE>
<PRE> int ERR_GET_REASON(unsigned long e);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The error code returned by <CODE>ERR_get_error()</CODE> consists of a
library number, function code and reason code. <CODE>ERR_GET_LIB(),</CODE>
<CODE>ERR_GET_FUNC()</CODE> and <CODE>ERR_GET_REASON()</CODE> can be used
to extract these.

</P>
<P>
The library number and function code describe where the error occurred, the
reason code is the information about what went wrong.

</P>
<P>
Each sub-library of OpenSSL has a unique library number; function and
reason codes are unique within each sub-library. Note that different
libraries may use the same value to signal different functions and reasons.

</P>
<P>
<STRONG>ERR_R_...</STRONG> reason codes such as <STRONG>ERR_R_MALLOC_FAILURE</STRONG> are globally unique. However, when checking for sub-library specific reason
codes, be sure to also compare the library number.

</P>
<P>
<CODE>ERR_GET_LIB(),</CODE> <CODE>ERR_GET_FUNC()</CODE> and
<CODE>ERR_GET_REASON()</CODE> are macros.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
The library number, function code and reason code respectively.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/err.html#">err(3)</A>, <A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>ERR_GET_LIB(),</CODE> <CODE>ERR_GET_FUNC()</CODE> and
<CODE>ERR_GET_REASON()</CODE> are available in all versions of SSLeay and
OpenSSL.

</P>
:}


