ERR_error_string.pod 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_func_error_string(unsigned long e);
  12. const char *ERR_reason_error_string(unsigned long e);
  13. =head1 DESCRIPTION
  14. ERR_error_string() generates a human-readable string representing the
  15. error code I<e>, and places it at I<buf>. I<buf> must be at least 120
  16. bytes long. If I<buf> is B<NULL>, the error string is placed in a
  17. static buffer.
  18. ERR_error_string_n() is a variant of ERR_error_string() that writes
  19. at most I<len> characters (including the terminating 0)
  20. and truncates the string if necessary.
  21. For ERR_error_string_n(), I<buf> may not be B<NULL>.
  22. The string will have the following format:
  23. error:[error code]:[library name]:[function name]:[reason string]
  24. I<error code> is an 8 digit hexadecimal number, I<library name>,
  25. I<function name> and I<reason string> are ASCII text.
  26. ERR_lib_error_string(), ERR_func_error_string() and
  27. ERR_reason_error_string() return the library name, function
  28. name and reason string respectively.
  29. The OpenSSL error strings should be loaded by calling
  30. L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)> or, for SSL
  31. applications, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
  32. first.
  33. If there is no text string registered for the given error code,
  34. the error string will contain the numeric code.
  35. L<ERR_print_errors(3)|ERR_print_errors(3)> can be used to print
  36. all error codes currently in the queue.
  37. =head1 RETURN VALUES
  38. ERR_error_string() returns a pointer to a static buffer containing the
  39. string if I<buf> B<== NULL>, I<buf> otherwise.
  40. ERR_lib_error_string(), ERR_func_error_string() and
  41. ERR_reason_error_string() return the strings, and B<NULL> if
  42. none is registered for the error code.
  43. =head1 SEE ALSO
  44. L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
  45. L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
  46. L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
  47. L<ERR_print_errors(3)|ERR_print_errors(3)>
  48. =head1 HISTORY
  49. ERR_error_string() is available in all versions of SSLeay and OpenSSL.
  50. ERR_error_string_n() was added in OpenSSL 0.9.6.
  51. =cut