Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

59 рядки
1.9 KiB

  1. /* Copyright (c) 2017, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #ifndef OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H
  15. #define OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H
  16. #include <openssl/err.h>
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. // Private error queue functions.
  21. // ERR_SAVE_STATE contains a saved representation of the error queue. It is
  22. // slightly more compact than |ERR_STATE| as the error queue will typically not
  23. // contain |ERR_NUM_ERRORS| entries.
  24. typedef struct err_save_state_st ERR_SAVE_STATE;
  25. // ERR_SAVE_STATE_free releases all memory associated with |state|.
  26. OPENSSL_EXPORT void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state);
  27. // ERR_save_state returns a newly-allocated |ERR_SAVE_STATE| structure
  28. // containing the current state of the error queue or NULL on allocation
  29. // error. It should be released with |ERR_SAVE_STATE_free|.
  30. OPENSSL_EXPORT ERR_SAVE_STATE *ERR_save_state(void);
  31. // ERR_restore_state clears the error queue and replaces it with |state|.
  32. OPENSSL_EXPORT void ERR_restore_state(const ERR_SAVE_STATE *state);
  33. #if defined(__cplusplus)
  34. } // extern C
  35. extern "C++" {
  36. namespace bssl {
  37. BORINGSSL_MAKE_DELETER(ERR_SAVE_STATE, ERR_SAVE_STATE_free)
  38. } // namespace bssl
  39. } // extern C++
  40. #endif
  41. #endif // OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H