Blame doc/man3/ERR_error_string.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
Packit c4476c
ERR_func_error_string, ERR_reason_error_string - obtain human-readable
Packit c4476c
error message
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/err.h>
Packit c4476c
Packit c4476c
 char *ERR_error_string(unsigned long e, char *buf);
Packit c4476c
 void ERR_error_string_n(unsigned long e, char *buf, size_t len);
Packit c4476c
Packit c4476c
 const char *ERR_lib_error_string(unsigned long e);
Packit c4476c
 const char *ERR_func_error_string(unsigned long e);
Packit c4476c
 const char *ERR_reason_error_string(unsigned long e);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
ERR_error_string() generates a human-readable string representing the
Packit c4476c
error code I<e>, and places it at I<buf>. I<buf> must be at least 256
Packit c4476c
bytes long. If I<buf> is B<NULL>, the error string is placed in a
Packit c4476c
static buffer.
Packit c4476c
Note that this function is not thread-safe and does no checks on the size
Packit c4476c
of the buffer; use ERR_error_string_n() instead.
Packit c4476c
Packit c4476c
ERR_error_string_n() is a variant of ERR_error_string() that writes
Packit c4476c
at most I<len> characters (including the terminating 0)
Packit c4476c
and truncates the string if necessary.
Packit c4476c
For ERR_error_string_n(), I<buf> may not be B<NULL>.
Packit c4476c
Packit c4476c
The string will have the following format:
Packit c4476c
Packit c4476c
 error:[error code]:[library name]:[function name]:[reason string]
Packit c4476c
Packit c4476c
I<error code> is an 8 digit hexadecimal number, I<library name>,
Packit c4476c
I<function name> and I<reason string> are ASCII text.
Packit c4476c
Packit c4476c
ERR_lib_error_string(), ERR_func_error_string() and
Packit c4476c
ERR_reason_error_string() return the library name, function
Packit c4476c
name and reason string respectively.
Packit c4476c
Packit c4476c
If there is no text string registered for the given error code,
Packit c4476c
the error string will contain the numeric code.
Packit c4476c
Packit c4476c
L<ERR_print_errors(3)> can be used to print
Packit c4476c
all error codes currently in the queue.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
ERR_error_string() returns a pointer to a static buffer containing the
Packit c4476c
string if I<buf> B<== NULL>, I<buf> otherwise.
Packit c4476c
Packit c4476c
ERR_lib_error_string(), ERR_func_error_string() and
Packit c4476c
ERR_reason_error_string() return the strings, and B<NULL> if
Packit c4476c
none is registered for the error code.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ERR_get_error(3)>,
Packit c4476c
L<ERR_print_errors(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut