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

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

<h1>ERR_load_strings(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_VALUE">RETURN VALUE</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_load_strings, ERR_PACK, ERR_get_next_error_library - load arbitrary
error strings

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/err.h&gt;
</PRE>
<PRE> void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
</PRE>
<PRE> int ERR_get_next_error_library(void);
</PRE>
<PRE> unsigned long ERR_PACK(int lib, int func, int reason);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>ERR_load_strings()</CODE> registers error strings for library number <STRONG>lib</STRONG>.

</P>
<P>
<STRONG>str</STRONG> is an array of error string data:

</P>
<PRE> typedef struct ERR_string_data_st
 {
        unsigned long error;
        char *string;
 } ERR_STRING_DATA;
</PRE>
<P>
The error code is generated from the library number and a function and
reason code: <STRONG>error</STRONG> = <CODE>ERR_PACK(</CODE><STRONG>lib</STRONG>, <STRONG>func</STRONG>, <STRONG>reason</STRONG>). <CODE>ERR_PACK()</CODE> is a macro.

</P>
<P>
The last entry in the array is {0,0}.

</P>
<P>
<CODE>ERR_get_next_error_library()</CODE> can be used to assign library
numbers to user libraries at runtime.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUE">RETURN VALUE</A></H1>
<P>
<CODE>ERR_load_strings()</CODE> returns no value. <CODE>ERR_PACK()</CODE>
return the error code. <CODE>ERR_get_next_error_library()</CODE> returns a
new library number.

</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_load_strings.html#">ERR_load_strings(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>ERR_load_error_strings()</CODE> and <CODE>ERR_PACK()</CODE> are
available in all versions of SSLeay and OpenSSL.
<CODE>ERR_get_next_error_library()</CODE> was added in SSLeay 0.9.0.

</P>
:}


