]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/crypto/ERR_error_string.pod
Fix L<> content in manpages
[thirdparty/openssl.git] / doc / crypto / ERR_error_string.pod
CommitLineData
388f2f56
UM
1=pod
2
3=head1 NAME
4
e1b78bc6
RL
5ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
6ERR_func_error_string, ERR_reason_error_string - obtain human-readable
7error message
388f2f56
UM
8
9=head1 SYNOPSIS
10
11 #include <openssl/err.h>
12
13 char *ERR_error_string(unsigned long e, char *buf);
4451c255 14 void ERR_error_string_n(unsigned long e, char *buf, size_t len);
388f2f56
UM
15
16 const char *ERR_lib_error_string(unsigned long e);
17 const char *ERR_func_error_string(unsigned long e);
18 const char *ERR_reason_error_string(unsigned long e);
19
20=head1 DESCRIPTION
21
22ERR_error_string() generates a human-readable string representing the
e5c84d51
BM
23error code I<e>, and places it at I<buf>. I<buf> must be at least 120
24bytes long. If I<buf> is B<NULL>, the error string is placed in a
388f2f56 25static buffer.
e5c84d51
BM
26ERR_error_string_n() is a variant of ERR_error_string() that writes
27at most I<len> characters (including the terminating 0)
2c8c4ce2 28and truncates the string if necessary.
e5c84d51 29For ERR_error_string_n(), I<buf> may not be B<NULL>.
388f2f56
UM
30
31The string will have the following format:
32
33 error:[error code]:[library name]:[function name]:[reason string]
34
35I<error code> is an 8 digit hexadecimal number, I<library name>,
36I<function name> and I<reason string> are ASCII text.
37
38ERR_lib_error_string(), ERR_func_error_string() and
39ERR_reason_error_string() return the library name, function
40name and reason string respectively.
41
42The OpenSSL error strings should be loaded by calling
9b86974e
RS
43L<ERR_load_crypto_strings(3)> or, for SSL
44applications, L<SSL_load_error_strings(3)>
388f2f56
UM
45first.
46If there is no text string registered for the given error code,
47the error string will contain the numeric code.
48
9b86974e 49L<ERR_print_errors(3)> can be used to print
388f2f56
UM
50all error codes currently in the queue.
51
52=head1 RETURN VALUES
53
54ERR_error_string() returns a pointer to a static buffer containing the
e5c84d51 55string if I<buf> B<== NULL>, I<buf> otherwise.
388f2f56
UM
56
57ERR_lib_error_string(), ERR_func_error_string() and
58ERR_reason_error_string() return the strings, and B<NULL> if
59none is registered for the error code.
60
61=head1 SEE ALSO
62
9b86974e
RS
63L<err(3)>, L<ERR_get_error(3)>,
64L<ERR_load_crypto_strings(3)>,
65L<SSL_load_error_strings(3)>
66L<ERR_print_errors(3)>
388f2f56
UM
67
68=head1 HISTORY
69
70ERR_error_string() is available in all versions of SSLeay and OpenSSL.
e5c84d51 71ERR_error_string_n() was added in OpenSSL 0.9.6.
388f2f56
UM
72
73=cut