2
0

ERR_get_error.pod 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. =pod
  2. =head1 NAME
  3. ERR_get_error, ERR_peek_error, ERR_peek_last_error,
  4. ERR_get_error_line, ERR_peek_error_line, ERR_peek_last_error_line,
  5. ERR_get_error_line_data, ERR_peek_error_line_data,
  6. ERR_peek_last_error_line_data - obtain error code and data
  7. =head1 SYNOPSIS
  8. #include <openssl/err.h>
  9. unsigned long ERR_get_error(void);
  10. unsigned long ERR_peek_error(void);
  11. unsigned long ERR_peek_last_error(void);
  12. unsigned long ERR_get_error_line(const char **file, int *line);
  13. unsigned long ERR_peek_error_line(const char **file, int *line);
  14. unsigned long ERR_peek_last_error_line(const char **file, int *line);
  15. unsigned long ERR_get_error_line_data(const char **file, int *line,
  16. const char **data, int *flags);
  17. unsigned long ERR_peek_error_line_data(const char **file, int *line,
  18. const char **data, int *flags);
  19. unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
  20. const char **data, int *flags);
  21. =head1 DESCRIPTION
  22. ERR_get_error() returns the earliest error code from the thread's error
  23. queue and removes the entry. This function can be called repeatedly
  24. until there are no more error codes to return.
  25. ERR_peek_error() returns the earliest error code from the thread's
  26. error queue without modifying it.
  27. ERR_peek_last_error() returns the latest error code from the thread's
  28. error queue without modifying it.
  29. See L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> for obtaining information about
  30. location and reason of the error, and
  31. L<ERR_error_string(3)|ERR_error_string(3)> for human-readable error
  32. messages.
  33. ERR_get_error_line(), ERR_peek_error_line() and
  34. ERR_peek_last_error_line() are the same as the above, but they
  35. additionally store the file name and line number where
  36. the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
  37. ERR_get_error_line_data(), ERR_peek_error_line_data() and
  38. ERR_get_last_error_line_data() store additional data and flags
  39. associated with the error code in *B<data>
  40. and *B<flags>, unless these are B<NULL>. *B<data> contains a string
  41. if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(),
  42. *B<flags>&B<ERR_TXT_MALLOCED> is true.
  43. =head1 RETURN VALUES
  44. The error code, or 0 if there is no error in the queue.
  45. =head1 SEE ALSO
  46. L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>,
  47. L<ERR_GET_LIB(3)|ERR_GET_LIB(3)>
  48. =head1 HISTORY
  49. ERR_get_error(), ERR_peek_error(), ERR_get_error_line() and
  50. ERR_peek_error_line() are available in all versions of SSLeay and
  51. OpenSSL. ERR_get_error_line_data() and ERR_peek_error_line_data()
  52. were added in SSLeay 0.9.0.
  53. ERR_peek_last_error(), ERR_peek_last_error_line() and
  54. ERR_peek_last_error_line_data() were added in OpenSSL 0.9.7.
  55. =cut