e_ossltest_err.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Generated by util/mkerr.pl DO NOT EDIT
  3. * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
  4. *
  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
  9. */
  10. #include <openssl/err.h>
  11. #include "e_ossltest_err.h"
  12. #ifndef OPENSSL_NO_ERR
  13. static ERR_STRING_DATA OSSLTEST_str_functs[] = {
  14. {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
  15. {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0),
  16. "OSSLTEST_AES128_INIT_KEY"},
  17. {0, NULL}
  18. };
  19. static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
  20. {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
  21. {0, NULL}
  22. };
  23. #endif
  24. static int lib_code = 0;
  25. static int error_loaded = 0;
  26. static int ERR_load_OSSLTEST_strings(void)
  27. {
  28. if (lib_code == 0)
  29. lib_code = ERR_get_next_error_library();
  30. if (!error_loaded) {
  31. #ifndef OPENSSL_NO_ERR
  32. ERR_load_strings(lib_code, OSSLTEST_str_functs);
  33. ERR_load_strings(lib_code, OSSLTEST_str_reasons);
  34. #endif
  35. error_loaded = 1;
  36. }
  37. return 1;
  38. }
  39. static void ERR_unload_OSSLTEST_strings(void)
  40. {
  41. if (error_loaded) {
  42. #ifndef OPENSSL_NO_ERR
  43. ERR_unload_strings(lib_code, OSSLTEST_str_functs);
  44. ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
  45. #endif
  46. error_loaded = 0;
  47. }
  48. }
  49. static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
  50. {
  51. if (lib_code == 0)
  52. lib_code = ERR_get_next_error_library();
  53. ERR_PUT_error(lib_code, function, reason, file, line);
  54. }