error.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Declaration for error-reporting function
  2. Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _ERROR_H
  17. #define _ERROR_H 1
  18. #include <features.h>
  19. __BEGIN_DECLS
  20. /* Print a message with `fprintf (stderr, FORMAT, ...)';
  21. if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
  22. If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
  23. extern void error (int __status, int __errnum, const char *__format, ...)
  24. __attribute__ ((__format__ (__printf__, 3, 4)));
  25. extern void error_at_line (int __status, int __errnum, const char *__fname,
  26. unsigned int __lineno, const char *__format, ...)
  27. __attribute__ ((__format__ (__printf__, 5, 6)));
  28. /* If NULL, error will flush stdout, then print on stderr the program
  29. name, a colon and a space. Otherwise, error will call this
  30. function without parameters instead. */
  31. extern void (*error_print_progname) (void);
  32. /* This variable is incremented each time `error' is called. */
  33. extern unsigned int error_message_count;
  34. /* Sometimes we want to have at most one error per line. This
  35. variable controls whether this mode is selected or not. */
  36. extern int error_one_per_line;
  37. __END_DECLS
  38. #endif /* error.h */