]>
Commit | Line | Data |
---|---|---|
388f2f56 UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
a14e2d9d BM |
5 | ERR_get_error, ERR_peek_error, ERR_peek_last_error, |
6 | ERR_get_error_line, ERR_peek_error_line, ERR_peek_last_error_line, | |
7 | ERR_get_error_line_data, ERR_peek_error_line_data, | |
5e4a75e7 | 8 | ERR_peek_last_error_line_data - obtain error code and data |
388f2f56 UM |
9 | |
10 | =head1 SYNOPSIS | |
11 | ||
12 | #include <openssl/err.h> | |
13 | ||
14 | unsigned long ERR_get_error(void); | |
15 | unsigned long ERR_peek_error(void); | |
a14e2d9d | 16 | unsigned long ERR_peek_last_error(void); |
388f2f56 UM |
17 | |
18 | unsigned long ERR_get_error_line(const char **file, int *line); | |
19 | unsigned long ERR_peek_error_line(const char **file, int *line); | |
a14e2d9d | 20 | unsigned long ERR_peek_last_error_line(const char **file, int *line); |
388f2f56 UM |
21 | |
22 | unsigned long ERR_get_error_line_data(const char **file, int *line, | |
e9b77246 | 23 | const char **data, int *flags); |
388f2f56 | 24 | unsigned long ERR_peek_error_line_data(const char **file, int *line, |
e9b77246 | 25 | const char **data, int *flags); |
a14e2d9d | 26 | unsigned long ERR_peek_last_error_line_data(const char **file, int *line, |
e9b77246 | 27 | const char **data, int *flags); |
388f2f56 UM |
28 | |
29 | =head1 DESCRIPTION | |
30 | ||
a14e2d9d | 31 | ERR_get_error() returns the earliest error code from the thread's error |
388f2f56 UM |
32 | queue and removes the entry. This function can be called repeatedly |
33 | until there are no more error codes to return. | |
34 | ||
a14e2d9d BM |
35 | ERR_peek_error() returns the earliest error code from the thread's |
36 | error queue without modifying it. | |
37 | ||
38 | ERR_peek_last_error() returns the latest error code from the thread's | |
388f2f56 UM |
39 | error queue without modifying it. |
40 | ||
9b86974e | 41 | See L<ERR_GET_LIB(3)> for obtaining information about |
388f2f56 | 42 | location and reason of the error, and |
9b86974e | 43 | L<ERR_error_string(3)> for human-readable error |
388f2f56 UM |
44 | messages. |
45 | ||
a14e2d9d BM |
46 | ERR_get_error_line(), ERR_peek_error_line() and |
47 | ERR_peek_last_error_line() are the same as the above, but they | |
48 | additionally store the file name and line number where | |
388f2f56 UM |
49 | the error occurred in *B<file> and *B<line>, unless these are B<NULL>. |
50 | ||
a14e2d9d | 51 | ERR_get_error_line_data(), ERR_peek_error_line_data() and |
5cc99c6c | 52 | ERR_peek_last_error_line_data() store additional data and flags |
a14e2d9d | 53 | associated with the error code in *B<data> |
388f2f56 | 54 | and *B<flags>, unless these are B<NULL>. *B<data> contains a string |
5cc99c6c | 55 | if *B<flags>&B<ERR_TXT_STRING> is true. |
30ea570f DSH |
56 | |
57 | An application B<MUST NOT> free the *B<data> pointer (or any other pointers | |
58 | returned by these functions) with OPENSSL_free() as freeing is handled | |
59 | automatically by the error library. | |
388f2f56 UM |
60 | |
61 | =head1 RETURN VALUES | |
62 | ||
63 | The error code, or 0 if there is no error in the queue. | |
64 | ||
65 | =head1 SEE ALSO | |
66 | ||
73fb82b7 | 67 | L<ERR_error_string(3)>, |
9b86974e | 68 | L<ERR_GET_LIB(3)> |
388f2f56 | 69 | |
e2f92610 RS |
70 | =head1 COPYRIGHT |
71 | ||
73fb82b7 | 72 | Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 73 | |
4746f25a | 74 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
75 | this file except in compliance with the License. You can obtain a copy |
76 | in the file LICENSE in the source distribution or at | |
77 | L<https://www.openssl.org/source/license.html>. | |
78 | ||
79 | =cut |