ERR_error_string.pod 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. =pod
  2. =head1 NAME
  3. ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
  4. ERR_func_error_string, ERR_reason_error_string - obtain human-readable
  5. error message
  6. =head1 SYNOPSIS
  7. #include <openssl/err.h>
  8. char *ERR_error_string(unsigned long e, char *buf);
  9. void ERR_error_string_n(unsigned long e, char *buf, size_t len);
  10. const char *ERR_lib_error_string(unsigned long e);
  11. const char *ERR_reason_error_string(unsigned long e);
  12. Deprecated in OpenSSL 3.0:
  13. const char *ERR_func_error_string(unsigned long e);
  14. =head1 DESCRIPTION
  15. ERR_error_string() generates a human-readable string representing the
  16. error code I<e>, and places it at I<buf>. I<buf> must be at least 256
  17. bytes long. If I<buf> is B<NULL>, the error string is placed in a
  18. static buffer.
  19. Note that this function is not thread-safe and does no checks on the size
  20. of the buffer; use ERR_error_string_n() instead.
  21. ERR_error_string_n() is a variant of ERR_error_string() that writes
  22. at most I<len> characters (including the terminating 0)
  23. and truncates the string if necessary.
  24. For ERR_error_string_n(), I<buf> may not be B<NULL>.
  25. The string will have the following format:
  26. error:[error code]:[library name]::[reason string]
  27. I<error code> is an 8 digit hexadecimal number, I<library name> and
  28. I<reason string> are ASCII text.
  29. ERR_lib_error_string() and ERR_reason_error_string() return the library
  30. name and reason string respectively.
  31. If there is no text string registered for the given error code,
  32. the error string will contain the numeric code.
  33. L<ERR_print_errors(3)> can be used to print
  34. all error codes currently in the queue.
  35. =head1 RETURN VALUES
  36. ERR_error_string() returns a pointer to a static buffer containing the
  37. string if I<buf> B<== NULL>, I<buf> otherwise.
  38. ERR_lib_error_string() and ERR_reason_error_string() return the strings,
  39. and B<NULL> if none is registered for the error code.
  40. ERR_func_error_string() returns NULL.
  41. =head1 SEE ALSO
  42. L<ERR_get_error(3)>,
  43. L<ERR_print_errors(3)>
  44. =head1 HISTORY
  45. ERR_func_error_string() became deprecated in OpenSSL 3.0.
  46. =head1 COPYRIGHT
  47. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  48. Licensed under the Apache License 2.0 (the "License"). You may not use
  49. this file except in compliance with the License. You can obtain a copy
  50. in the file LICENSE in the source distribution or at
  51. L<https://www.openssl.org/source/license.html>.
  52. =cut