2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 * NOTE: this file was auto generated by the mkerr.pl script: any changes
12 * made to it will be overwritten when the script next updates this file,
13 * only reason strings will be preserved.
17 #include <openssl/err.h>
18 #include "e_ossltest_err.h"
20 /* BEGIN ERROR CODES */
21 #ifndef OPENSSL_NO_ERR
23 # define ERR_FUNC(func) ERR_PACK(0,func,0)
24 # define ERR_REASON(reason) ERR_PACK(0,0,reason)
26 static ERR_STRING_DATA OSSLTEST_str_functs[] = {
27 {ERR_FUNC(OSSLTEST_F_BIND_OSSLTEST), "BIND_OSSLTEST"},
28 {ERR_FUNC(OSSLTEST_F_OSSLTEST_AES128_INIT_KEY),
29 "OSSLTEST_AES128_INIT_KEY"},
33 static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
34 {ERR_REASON(OSSLTEST_R_INIT_FAILED), "init failed"},
40 #ifdef OSSLTEST_LIB_NAME
41 static ERR_STRING_DATA OSSLTEST_lib_name[] = {
42 {0, OSSLTEST_LIB_NAME},
47 static int OSSLTEST_lib_error_code = 0;
48 static int OSSLTEST_error_init = 1;
50 static void ERR_load_OSSLTEST_strings(void)
52 if (OSSLTEST_lib_error_code == 0)
53 OSSLTEST_lib_error_code = ERR_get_next_error_library();
55 if (OSSLTEST_error_init) {
56 OSSLTEST_error_init = 0;
57 #ifndef OPENSSL_NO_ERR
58 ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs);
59 ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons);
62 #ifdef OSSLTEST_LIB_NAME
63 OSSLTEST_lib_name->error = ERR_PACK(OSSLTEST_lib_error_code, 0, 0);
64 ERR_load_strings(0, OSSLTEST_lib_name);
69 static void ERR_unload_OSSLTEST_strings(void)
71 if (OSSLTEST_error_init == 0) {
72 #ifndef OPENSSL_NO_ERR
73 ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs);
74 ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons);
77 #ifdef OSSLTEST_LIB_NAME
78 ERR_unload_strings(0, OSSLTEST_lib_name);
80 OSSLTEST_error_init = 1;
84 static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
86 if (OSSLTEST_lib_error_code == 0)
87 OSSLTEST_lib_error_code = ERR_get_next_error_library();
88 ERR_PUT_error(OSSLTEST_lib_error_code, function, reason, file, line);