blob: 920a13a6922a67692149c2564a87d93a4935e2b0 [file] [log] [blame]
Rich Salzb6cff312016-05-17 17:38:18 -04001/*
Rich Salz52df25c2017-06-07 15:12:03 -04002 * Generated by util/mkerr.pl DO NOT EDIT
3 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
Matt Caswell2d5d70b2015-06-16 12:59:37 +01004 *
Rich Salzb6cff312016-05-17 17:38:18 -04005 * Licensed under the OpenSSL license (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
Matt Caswell2d5d70b2015-06-16 12:59:37 +01009 */
10
Matt Caswell2d5d70b2015-06-16 12:59:37 +010011#include <openssl/err.h>
12#include "e_ossltest_err.h"
13
Matt Caswell2d5d70b2015-06-16 12:59:37 +010014#ifndef OPENSSL_NO_ERR
15
Matt Caswell2d5d70b2015-06-16 12:59:37 +010016static ERR_STRING_DATA OSSLTEST_str_functs[] = {
Rich Salz52df25c2017-06-07 15:12:03 -040017 {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
Rich Salz58165862017-06-07 16:29:15 -040018 {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), ""},
Matt Caswell2d5d70b2015-06-16 12:59:37 +010019 {0, NULL}
20};
21
22static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
Rich Salz52df25c2017-06-07 15:12:03 -040023 {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
Matt Caswell2d5d70b2015-06-16 12:59:37 +010024 {0, NULL}
25};
26
27#endif
28
Rich Salz52df25c2017-06-07 15:12:03 -040029static int lib_code = 0;
30static int error_loaded = 0;
Matt Caswell2d5d70b2015-06-16 12:59:37 +010031
Rich Salz52df25c2017-06-07 15:12:03 -040032static int ERR_load_OSSLTEST_strings(void)
Matt Caswell2d5d70b2015-06-16 12:59:37 +010033{
Rich Salz52df25c2017-06-07 15:12:03 -040034 if (lib_code == 0)
35 lib_code = ERR_get_next_error_library();
Matt Caswell2d5d70b2015-06-16 12:59:37 +010036
Rich Salz52df25c2017-06-07 15:12:03 -040037 if (!error_loaded) {
Matt Caswell2d5d70b2015-06-16 12:59:37 +010038#ifndef OPENSSL_NO_ERR
Rich Salz52df25c2017-06-07 15:12:03 -040039 ERR_load_strings(lib_code, OSSLTEST_str_functs);
40 ERR_load_strings(lib_code, OSSLTEST_str_reasons);
Matt Caswell2d5d70b2015-06-16 12:59:37 +010041#endif
Rich Salz52df25c2017-06-07 15:12:03 -040042 error_loaded = 1;
Matt Caswell2d5d70b2015-06-16 12:59:37 +010043 }
Rich Salz52df25c2017-06-07 15:12:03 -040044 return 1;
Matt Caswell2d5d70b2015-06-16 12:59:37 +010045}
46
47static void ERR_unload_OSSLTEST_strings(void)
48{
Rich Salz52df25c2017-06-07 15:12:03 -040049 if (error_loaded) {
Matt Caswell2d5d70b2015-06-16 12:59:37 +010050#ifndef OPENSSL_NO_ERR
Rich Salz52df25c2017-06-07 15:12:03 -040051 ERR_unload_strings(lib_code, OSSLTEST_str_functs);
52 ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
Matt Caswell2d5d70b2015-06-16 12:59:37 +010053#endif
Rich Salz52df25c2017-06-07 15:12:03 -040054 error_loaded = 0;
Matt Caswell2d5d70b2015-06-16 12:59:37 +010055 }
56}
57
58static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
59{
Rich Salz52df25c2017-06-07 15:12:03 -040060 if (lib_code == 0)
61 lib_code = ERR_get_next_error_library();
62 ERR_PUT_error(lib_code, function, reason, file, line);
Matt Caswell2d5d70b2015-06-16 12:59:37 +010063}