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