xref: /freebsd/crypto/openssl/doc/man3/ERR_load_strings.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimERR_load_strings, ERR_PACK, ERR_get_next_error_library - load
6e71b7053SJung-uk Kimarbitrary error strings
7e71b7053SJung-uk Kim
8e71b7053SJung-uk Kim=head1 SYNOPSIS
9e71b7053SJung-uk Kim
10e71b7053SJung-uk Kim #include <openssl/err.h>
11e71b7053SJung-uk Kim
12b2bf0c7eSJung-uk Kim int ERR_load_strings(int lib, ERR_STRING_DATA *str);
13e71b7053SJung-uk Kim
14e71b7053SJung-uk Kim int ERR_get_next_error_library(void);
15e71b7053SJung-uk Kim
16e71b7053SJung-uk Kim unsigned long ERR_PACK(int lib, int func, int reason);
17e71b7053SJung-uk Kim
18e71b7053SJung-uk Kim=head1 DESCRIPTION
19e71b7053SJung-uk Kim
20e71b7053SJung-uk KimERR_load_strings() registers error strings for library number B<lib>.
21e71b7053SJung-uk Kim
22e71b7053SJung-uk KimB<str> is an array of error string data:
23e71b7053SJung-uk Kim
24e71b7053SJung-uk Kim typedef struct ERR_string_data_st
25e71b7053SJung-uk Kim {
26e71b7053SJung-uk Kim     unsigned long error;
27e71b7053SJung-uk Kim     char *string;
28e71b7053SJung-uk Kim } ERR_STRING_DATA;
29e71b7053SJung-uk Kim
30e71b7053SJung-uk KimThe error code is generated from the library number and a function and
31e71b7053SJung-uk Kimreason code: B<error> = ERR_PACK(B<lib>, B<func>, B<reason>).
32e71b7053SJung-uk KimERR_PACK() is a macro.
33e71b7053SJung-uk Kim
34e71b7053SJung-uk KimThe last entry in the array is {0,0}.
35e71b7053SJung-uk Kim
36e71b7053SJung-uk KimERR_get_next_error_library() can be used to assign library numbers
37e71b7053SJung-uk Kimto user libraries at run time.
38e71b7053SJung-uk Kim
39e71b7053SJung-uk Kim=head1 RETURN VALUES
40e71b7053SJung-uk Kim
41b2bf0c7eSJung-uk KimERR_load_strings() returns 1 for success and 0 for failure. ERR_PACK() returns the error code.
42e71b7053SJung-uk KimERR_get_next_error_library() returns zero on failure, otherwise a new
43e71b7053SJung-uk Kimlibrary number.
44e71b7053SJung-uk Kim
45e71b7053SJung-uk Kim=head1 SEE ALSO
46e71b7053SJung-uk Kim
47e71b7053SJung-uk KimL<ERR_load_strings(3)>
48e71b7053SJung-uk Kim
49e71b7053SJung-uk Kim=head1 COPYRIGHT
50e71b7053SJung-uk Kim
51b2bf0c7eSJung-uk KimCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
52e71b7053SJung-uk Kim
53*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
54e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
55e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
56e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
57e71b7053SJung-uk Kim
58e71b7053SJung-uk Kim=cut
59