ERR_error_string.pod 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 256
  16. bytes long. If I<buf> is B<NULL>, the error string is placed in a
  17. static buffer.
  18. Note that this function is not thread-safe and does no checks on the size
  19. of the buffer; use ERR_error_string_n() instead.
  20. ERR_error_string_n() is a variant of ERR_error_string() that writes
  21. at most I<len> characters (including the terminating 0)
  22. and truncates the string if necessary.
  23. For ERR_error_string_n(), I<buf> may not be B<NULL>.
  24. The string will have the following format:
  25. error:[error code]:[library name]:[function name]:[reason string]
  26. I<error code> is an 8 digit hexadecimal number, I<library name>,
  27. I<function name> and I<reason string> are ASCII text.
  28. ERR_lib_error_string(), ERR_func_error_string() and
  29. ERR_reason_error_string() return the library name, function
  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(), ERR_func_error_string() and
  39. ERR_reason_error_string() return the strings, and B<NULL> if
  40. none is registered for the error code.
  41. =head1 SEE ALSO
  42. L<ERR_get_error(3)>,
  43. L<ERR_print_errors(3)>
  44. =head1 COPYRIGHT
  45. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  46. Licensed under the Apache License 2.0 (the "License"). You may not use
  47. this file except in compliance with the License. You can obtain a copy
  48. in the file LICENSE in the source distribution or at
  49. L<https://www.openssl.org/source/license.html>.
  50. =cut