5 ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
6 ERR_func_error_string, ERR_reason_error_string - obtain human-readable
11 #include <openssl/err.h>
13 char *ERR_error_string(unsigned long e, char *buf);
14 void ERR_error_string_n(unsigned long e, char *buf, size_t len);
16 const char *ERR_lib_error_string(unsigned long e);
17 const char *ERR_reason_error_string(unsigned long e);
19 Deprecated in OpenSSL 3.0:
21 const char *ERR_func_error_string(unsigned long e);
25 ERR_error_string() generates a human-readable string representing the
26 error code I<e>, and places it at I<buf>. I<buf> must be at least 256
27 bytes long. If I<buf> is B<NULL>, the error string is placed in a
29 Note that this function is not thread-safe and does no checks on the size
30 of the buffer; use ERR_error_string_n() instead.
32 ERR_error_string_n() is a variant of ERR_error_string() that writes
33 at most I<len> characters (including the terminating 0)
34 and truncates the string if necessary.
35 For ERR_error_string_n(), I<buf> may not be B<NULL>.
37 The string will have the following format:
39 error:[error code]:[library name]::[reason string]
41 I<error code> is an 8 digit hexadecimal number, I<library name> and
42 I<reason string> are ASCII text.
44 ERR_lib_error_string() and ERR_reason_error_string() return the library
45 name and reason string respectively.
47 If there is no text string registered for the given error code,
48 the error string will contain the numeric code.
50 L<ERR_print_errors(3)> can be used to print
51 all error codes currently in the queue.
55 ERR_error_string() returns a pointer to a static buffer containing the
56 string if I<buf> B<== NULL>, I<buf> otherwise.
58 ERR_lib_error_string() and ERR_reason_error_string() return the strings,
59 and B<NULL> if none is registered for the error code.
61 ERR_func_error_string() returns NULL.
66 L<ERR_print_errors(3)>
70 ERR_func_error_string() became deprecated in OpenSSL 3.0.
74 Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
76 Licensed under the Apache License 2.0 (the "License"). You may not use
77 this file except in compliance with the License. You can obtain a copy
78 in the file LICENSE in the source distribution or at
79 L<https://www.openssl.org/source/license.html>.