159191Skris=pod
259191Skris
359191Skris=head1 NAME
459191Skris
559191SkrisERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON - get library, function and
659191Skrisreason code
759191Skris
859191Skris=head1 SYNOPSIS
959191Skris
1059191Skris #include <openssl/err.h>
1159191Skris
1259191Skris int ERR_GET_LIB(unsigned long e);
1359191Skris
1459191Skris int ERR_GET_FUNC(unsigned long e);
1559191Skris
1659191Skris int ERR_GET_REASON(unsigned long e);
1759191Skris
1859191Skris=head1 DESCRIPTION
1959191Skris
2059191SkrisThe error code returned by ERR_get_error() consists of a library
2159191Skrisnumber, function code and reason code. ERR_GET_LIB(), ERR_GET_FUNC()
2259191Skrisand ERR_GET_REASON() can be used to extract these.
2359191Skris
2459191SkrisThe library number and function code describe where the error
2559191Skrisoccurred, the reason code is the information about what went wrong.
2659191Skris
2759191SkrisEach sub-library of OpenSSL has a unique library number; function and
2859191Skrisreason codes are unique within each sub-library.  Note that different
2959191Skrislibraries may use the same value to signal different functions and
3059191Skrisreasons.
3159191Skris
3259191SkrisB<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally
3359191Skrisunique. However, when checking for sub-library specific reason codes,
3459191Skrisbe sure to also compare the library number.
3559191Skris
3659191SkrisERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are macros.
3759191Skris
3859191Skris=head1 RETURN VALUES
3959191Skris
4059191SkrisThe library number, function code and reason code respectively.
4159191Skris
4259191Skris=head1 SEE ALSO
4359191Skris
4459191SkrisL<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
4559191Skris
4659191Skris=head1 HISTORY
4759191Skris
4859191SkrisERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are available in
4959191Skrisall versions of SSLeay and OpenSSL.
5059191Skris
5159191Skris=cut
52