summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ERR_load_strings.3
blob: 691a4067d3fdb60d1bcf68f2ff348b47fc49a3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.Dd $Mdocdate: November 2 2016 $
.Dt ERR_LOAD_STRINGS 3
.Os
.Sh NAME
.Nm ERR_load_strings ,
.Nm ERR_PACK ,
.Nm ERR_get_next_error_library
.Nd load arbitrary OpenSSL error strings
.Sh SYNOPSIS
.In openssl/err.h
.Ft void
.Fo ERR_load_strings
.Fa "int lib"
.Fa "ERR_STRING_DATA str[]"
.Fc
.Ft int
.Fn ERR_get_next_error_library void
.Ft unsigned long
.Fo ERR_PACK
.Fa "int lib"
.Fa "int func"
.Fa "int reason"
.Fc
.Sh DESCRIPTION
.Fn ERR_load_strings
registers error strings for library number
.Fa lib .
.Pp
.Fa str
is an array of error string data:
.Bd -literal -offset indent
typedef struct ERR_string_data_st
{
        unsigned long error;
        char *string;
} ERR_STRING_DATA;
.Ed
.Pp
The error code is generated from the library number and a function and
reason code:
.Pp
.Dl error = ERR_PACK(lib, func, reason)
.Pp
.Fn ERR_PACK
is a macro.
.Pp
The last entry in the array is
.Brq 0 , Dv NULL .
.Pp
.Fn ERR_get_next_error_library
can be used to assign library numbers to user libraries at runtime.
.Sh RETURN VALUE
.Fn ERR_PACK
returns the error code.
.Fn ERR_get_next_error_library
returns a new library number.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_load_strings 3
.Sh HISTORY
.Xr ERR_load_error_strings 3
and
.Fn ERR_PACK
are available in all versions of SSLeay and OpenSSL.
.Fn ERR_get_next_error_library
was added in SSLeay 0.9.0.