]> git.ipfire.org Git - thirdparty/openssl.git/blame - engines/e_ossltest_err.c
make error tables const and separate header file
[thirdparty/openssl.git] / engines / e_ossltest_err.c
CommitLineData
b6cff313 1/*
52df25cf
RS
2 * Generated by util/mkerr.pl DO NOT EDIT
3 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
2d5d70b1 4 *
b6cff313
RS
5 * 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
2d5d70b1
MC
9 */
10
2d5d70b1
MC
11#include <openssl/err.h>
12#include "e_ossltest_err.h"
13
2d5d70b1
MC
14#ifndef OPENSSL_NO_ERR
15
2d5d70b1 16static ERR_STRING_DATA OSSLTEST_str_functs[] = {
52df25cf
RS
17 {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
18 {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0),
51a60817 19 "OSSLTEST_AES128_INIT_KEY"},
2d5d70b1
MC
20 {0, NULL}
21};
22
23static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
52df25cf 24 {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
2d5d70b1
MC
25 {0, NULL}
26};
27
28#endif
29
52df25cf
RS
30static int lib_code = 0;
31static int error_loaded = 0;
2d5d70b1 32
52df25cf 33static int ERR_load_OSSLTEST_strings(void)
2d5d70b1 34{
52df25cf
RS
35 if (lib_code == 0)
36 lib_code = ERR_get_next_error_library();
2d5d70b1 37
52df25cf 38 if (!error_loaded) {
2d5d70b1 39#ifndef OPENSSL_NO_ERR
52df25cf
RS
40 ERR_load_strings(lib_code, OSSLTEST_str_functs);
41 ERR_load_strings(lib_code, OSSLTEST_str_reasons);
2d5d70b1 42#endif
52df25cf 43 error_loaded = 1;
2d5d70b1 44 }
52df25cf 45 return 1;
2d5d70b1
MC
46}
47
48static void ERR_unload_OSSLTEST_strings(void)
49{
52df25cf 50 if (error_loaded) {
2d5d70b1 51#ifndef OPENSSL_NO_ERR
52df25cf
RS
52 ERR_unload_strings(lib_code, OSSLTEST_str_functs);
53 ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
2d5d70b1 54#endif
52df25cf 55 error_loaded = 0;
2d5d70b1
MC
56 }
57}
58
59static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
60{
52df25cf
RS
61 if (lib_code == 0)
62 lib_code = ERR_get_next_error_library();
63 ERR_PUT_error(lib_code, function, reason, file, line);
2d5d70b1 64}