1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | ERR_new, ERR_set_debug, ERR_set_error, ERR_vset_error
|
---|
6 | - Error recording building blocks
|
---|
7 |
|
---|
8 | =head1 SYNOPSIS
|
---|
9 |
|
---|
10 | #include <openssl/err.h>
|
---|
11 |
|
---|
12 | void ERR_new(void);
|
---|
13 | void ERR_set_debug(const char *file, int line, const char *func);
|
---|
14 | void ERR_set_error(int lib, int reason, const char *fmt, ...);
|
---|
15 | void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
|
---|
16 |
|
---|
17 | =head1 DESCRIPTION
|
---|
18 |
|
---|
19 | The functions described here are generally not used directly, but
|
---|
20 | rather through macros such as L<ERR_raise(3)>.
|
---|
21 | They can still be useful for anyone that wants to make their own
|
---|
22 | macros.
|
---|
23 |
|
---|
24 | ERR_new() allocates a new slot in the thread's error queue.
|
---|
25 |
|
---|
26 | ERR_set_debug() sets the debug information related to the current
|
---|
27 | error in the thread's error queue.
|
---|
28 | The values that can be given are the filename I<file>, line in the
|
---|
29 | file I<line> and the name of the function I<func> where the error
|
---|
30 | occurred.
|
---|
31 | The names must be constant, this function will only save away the
|
---|
32 | pointers, not copy the strings.
|
---|
33 |
|
---|
34 | ERR_set_error() sets the error information, which are the library
|
---|
35 | number I<lib> and the reason code I<reason>, and additional data as a
|
---|
36 | format string I<fmt> and an arbitrary number of arguments.
|
---|
37 | The additional data is processed with L<BIO_snprintf(3)> to form the
|
---|
38 | additional data string, which is allocated and store in the error
|
---|
39 | record.
|
---|
40 |
|
---|
41 | ERR_vset_error() works like ERR_set_error(), but takes a B<va_list>
|
---|
42 | argument instead of a variable number of arguments.
|
---|
43 |
|
---|
44 | =head1 RETURN VALUES
|
---|
45 |
|
---|
46 | ERR_new, ERR_set_debug, ERR_set_error and ERR_vset_error
|
---|
47 | do not return any values.
|
---|
48 |
|
---|
49 | =head1 NOTES
|
---|
50 |
|
---|
51 | The library number is unique to each unit that records errors.
|
---|
52 | OpenSSL has a number of preallocated ones for its own uses, but
|
---|
53 | others may allocate their own library number dynamically with
|
---|
54 | L<ERR_get_next_error_library(3)>.
|
---|
55 |
|
---|
56 | Reason codes are unique within each library, and may have an
|
---|
57 | associated set of strings as a short description of the reason.
|
---|
58 | For dynamically allocated library numbers, reason strings are recorded
|
---|
59 | with L<ERR_load_strings(3)>.
|
---|
60 |
|
---|
61 | Provider authors are supplied with core versions of these functions,
|
---|
62 | see L<provider-base(7)>.
|
---|
63 |
|
---|
64 | =head1 SEE ALSO
|
---|
65 |
|
---|
66 | L<ERR_raise(3)>, L<ERR_get_next_error_library(3)>,
|
---|
67 | L<ERR_load_strings(3)>, L<BIO_snprintf(3)>, L<provider-base(7)>
|
---|
68 |
|
---|
69 | =head1 COPYRIGHT
|
---|
70 |
|
---|
71 | Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
---|
72 |
|
---|
73 | Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
74 | this file except in compliance with the License. You can obtain a copy
|
---|
75 | in the file LICENSE in the source distribution or at
|
---|
76 | L<https://www.openssl.org/source/license.html>.
|
---|
77 |
|
---|
78 | =cut
|
---|