ERR_new.pod 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. =pod
  2. =head1 NAME
  3. ERR_new, ERR_set_debug, ERR_set_error, ERR_vset_error
  4. - Error recording building blocks
  5. =head1 SYNOPSIS
  6. #include <openssl/err.h>
  7. void ERR_new(void);
  8. void ERR_set_debug(const char *file, int line, const char *func);
  9. void ERR_set_error(int lib, int reason, const char *fmt, ...);
  10. void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
  11. =head1 DESCRIPTION
  12. The functions described here are generally not used directly, but
  13. rather through macros such as L<ERR_raise(3)>.
  14. They can still be useful for anyone that wants to make their own
  15. macros.
  16. ERR_new() allocates a new slot in the thread's error queue.
  17. ERR_set_debug() sets the debug information related to the current
  18. error in the thread's error queue.
  19. The values that can be given are the filename I<file>, line in the
  20. file I<line> and the name of the function I<func> where the error
  21. occurred.
  22. The names must be constant, this function will only save away the
  23. pointers, not copy the strings.
  24. ERR_set_error() sets the error information, which are the library
  25. number I<lib> and the reason code I<reason>, and additional data as a
  26. format string I<fmt> and an arbitrary number of arguments.
  27. The additional data is processed with L<BIO_snprintf(3)> to form the
  28. additional data string, which is allocated and store in the error
  29. record.
  30. ERR_vset_error() works like ERR_set_error(), but takes a B<va_list>
  31. argument instead of a variable number of arguments.
  32. =head1 RETURN VALUES
  33. ERR_new, ERR_set_debug, ERR_set_error and ERR_vset_error
  34. do not return any values.
  35. =head1 NOTES
  36. The library number is unique to each unit that records errors.
  37. OpenSSL has a number of pre-allocated ones for its own uses, but
  38. others may allocate their own library number dynamically with
  39. L<ERR_get_next_error_library(3)>.
  40. Reason codes are unique within each library, and may have an
  41. associated set of strings as a short description of the reason.
  42. For dynamically allocated library numbers, reason strings are recorded
  43. with L<ERR_load_strings(3)>.
  44. Provider authors are supplied with core versions of these functions,
  45. see L<provider-base(7)>.
  46. =head1 SEE ALSO
  47. L<ERR_raise(3)>, L<ERR_get_next_error_library(3)>,
  48. L<ERR_load_strings(3)>, L<BIO_snprintf(3)>, L<provider-base(7)>
  49. =head1 COPYRIGHT
  50. Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
  51. Licensed under the Apache License 2.0 (the "License"). You may not use
  52. this file except in compliance with the License. You can obtain a copy
  53. in the file LICENSE in the source distribution or at
  54. L<https://www.openssl.org/source/license.html>.
  55. =cut