1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
|
---|
6 | ERR_func_error_string, ERR_reason_error_string - obtain human-readable
|
---|
7 | error message
|
---|
8 |
|
---|
9 | =head1 SYNOPSIS
|
---|
10 |
|
---|
11 | #include <openssl/err.h>
|
---|
12 |
|
---|
13 | char *ERR_error_string(unsigned long e, char *buf);
|
---|
14 | void ERR_error_string_n(unsigned long e, char *buf, size_t len);
|
---|
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 |
|
---|
22 | ERR_error_string() generates a human-readable string representing the
|
---|
23 | error code I<e>, and places it at I<buf>. I<buf> must be at least 256
|
---|
24 | bytes long. If I<buf> is B<NULL>, the error string is placed in a
|
---|
25 | static buffer.
|
---|
26 | Note that this function is not thread-safe and does no checks on the size
|
---|
27 | of the buffer; use ERR_error_string_n() instead.
|
---|
28 |
|
---|
29 | ERR_error_string_n() is a variant of ERR_error_string() that writes
|
---|
30 | at most I<len> characters (including the terminating 0)
|
---|
31 | and truncates the string if necessary.
|
---|
32 | For ERR_error_string_n(), I<buf> may not be B<NULL>.
|
---|
33 |
|
---|
34 | The string will have the following format:
|
---|
35 |
|
---|
36 | error:[error code]:[library name]:[function name]:[reason string]
|
---|
37 |
|
---|
38 | I<error code> is an 8 digit hexadecimal number, I<library name>,
|
---|
39 | I<function name> and I<reason string> are ASCII text.
|
---|
40 |
|
---|
41 | ERR_lib_error_string(), ERR_func_error_string() and
|
---|
42 | ERR_reason_error_string() return the library name, function
|
---|
43 | name and reason string respectively.
|
---|
44 |
|
---|
45 | If there is no text string registered for the given error code,
|
---|
46 | the error string will contain the numeric code.
|
---|
47 |
|
---|
48 | L<ERR_print_errors(3)> can be used to print
|
---|
49 | all error codes currently in the queue.
|
---|
50 |
|
---|
51 | =head1 RETURN VALUES
|
---|
52 |
|
---|
53 | ERR_error_string() returns a pointer to a static buffer containing the
|
---|
54 | string if I<buf> B<== NULL>, I<buf> otherwise.
|
---|
55 |
|
---|
56 | ERR_lib_error_string(), ERR_func_error_string() and
|
---|
57 | ERR_reason_error_string() return the strings, and B<NULL> if
|
---|
58 | none is registered for the error code.
|
---|
59 |
|
---|
60 | =head1 SEE ALSO
|
---|
61 |
|
---|
62 | L<ERR_get_error(3)>,
|
---|
63 | L<ERR_print_errors(3)>
|
---|
64 |
|
---|
65 | =head1 COPYRIGHT
|
---|
66 |
|
---|
67 | Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
|
---|
68 |
|
---|
69 | Licensed under the OpenSSL license (the "License"). You may not use
|
---|
70 | this file except in compliance with the License. You can obtain a copy
|
---|
71 | in the file LICENSE in the source distribution or at
|
---|
72 | L<https://www.openssl.org/source/license.html>.
|
---|
73 |
|
---|
74 | =cut
|
---|