ERR_get_error.pod 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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)> for obtaining information about
  30. location and reason of the error, and
  31. L<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_peek_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> is true.
  42. An application B<MUST NOT> free the *B<data> pointer (or any other pointers
  43. returned by these functions) with OPENSSL_free() as freeing is handled
  44. automatically by the error library.
  45. =head1 RETURN VALUES
  46. The error code, or 0 if there is no error in the queue.
  47. =head1 SEE ALSO
  48. L<ERR_error_string(3)>,
  49. L<ERR_GET_LIB(3)>
  50. =head1 COPYRIGHT
  51. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  52. Licensed under the OpenSSL license (the "License"). You may not use
  53. this file except in compliance with the License. You can obtain a copy
  54. in the file LICENSE in the source distribution or at
  55. L<https://www.openssl.org/source/license.html>.
  56. =cut