xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/engines/e_ossltest_err.c (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos /*
2*4724848cSchristos  * Generated by util/mkerr.pl DO NOT EDIT
3*4724848cSchristos  * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
4*4724848cSchristos  *
5*4724848cSchristos  * Licensed under the OpenSSL license (the "License").  You may not use
6*4724848cSchristos  * this file except in compliance with the License.  You can obtain a copy
7*4724848cSchristos  * in the file LICENSE in the source distribution or at
8*4724848cSchristos  * https://www.openssl.org/source/license.html
9*4724848cSchristos  */
10*4724848cSchristos 
11*4724848cSchristos #include <openssl/err.h>
12*4724848cSchristos #include "e_ossltest_err.h"
13*4724848cSchristos 
14*4724848cSchristos #ifndef OPENSSL_NO_ERR
15*4724848cSchristos 
16*4724848cSchristos static ERR_STRING_DATA OSSLTEST_str_functs[] = {
17*4724848cSchristos     {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
18*4724848cSchristos     {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), ""},
19*4724848cSchristos     {0, NULL}
20*4724848cSchristos };
21*4724848cSchristos 
22*4724848cSchristos static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
23*4724848cSchristos     {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
24*4724848cSchristos     {0, NULL}
25*4724848cSchristos };
26*4724848cSchristos 
27*4724848cSchristos #endif
28*4724848cSchristos 
29*4724848cSchristos static int lib_code = 0;
30*4724848cSchristos static int error_loaded = 0;
31*4724848cSchristos 
ERR_load_OSSLTEST_strings(void)32*4724848cSchristos static int ERR_load_OSSLTEST_strings(void)
33*4724848cSchristos {
34*4724848cSchristos     if (lib_code == 0)
35*4724848cSchristos         lib_code = ERR_get_next_error_library();
36*4724848cSchristos 
37*4724848cSchristos     if (!error_loaded) {
38*4724848cSchristos #ifndef OPENSSL_NO_ERR
39*4724848cSchristos         ERR_load_strings(lib_code, OSSLTEST_str_functs);
40*4724848cSchristos         ERR_load_strings(lib_code, OSSLTEST_str_reasons);
41*4724848cSchristos #endif
42*4724848cSchristos         error_loaded = 1;
43*4724848cSchristos     }
44*4724848cSchristos     return 1;
45*4724848cSchristos }
46*4724848cSchristos 
ERR_unload_OSSLTEST_strings(void)47*4724848cSchristos static void ERR_unload_OSSLTEST_strings(void)
48*4724848cSchristos {
49*4724848cSchristos     if (error_loaded) {
50*4724848cSchristos #ifndef OPENSSL_NO_ERR
51*4724848cSchristos         ERR_unload_strings(lib_code, OSSLTEST_str_functs);
52*4724848cSchristos         ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
53*4724848cSchristos #endif
54*4724848cSchristos         error_loaded = 0;
55*4724848cSchristos     }
56*4724848cSchristos }
57*4724848cSchristos 
ERR_OSSLTEST_error(int function,int reason,char * file,int line)58*4724848cSchristos static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
59*4724848cSchristos {
60*4724848cSchristos     if (lib_code == 0)
61*4724848cSchristos         lib_code = ERR_get_next_error_library();
62*4724848cSchristos     ERR_PUT_error(lib_code, function, reason, file, line);
63*4724848cSchristos }
64