error.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Declaration for error-reporting function
  2. Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
  3. NOTE: The canonical source of this file is maintained with the GNU C
  4. Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
  5. This program is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published by the
  7. Free Software Foundation; either version 2, or (at your option) any
  8. later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. USA. */
  17. #ifndef _ERROR_H
  18. #define _ERROR_H 1
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #if defined (__STDC__) && __STDC__
  23. /* Print a message with `fprintf (stderr, FORMAT, ...)';
  24. if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
  25. If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
  26. extern void error (int status, int errnum, const char *format, ...);
  27. extern void error_at_line (int status, int errnum, const char *fname,
  28. unsigned int lineno, const char *format, ...);
  29. /* If NULL, error will flush stdout, then print on stderr the program
  30. name, a colon and a space. Otherwise, error will call this
  31. function without parameters instead. */
  32. extern void (*error_print_progname) (void);
  33. #else
  34. void error ();
  35. void error_at_line ();
  36. extern void (*error_print_progname) ();
  37. #endif
  38. /* This variable is incremented each time `error' is called. */
  39. extern unsigned int error_message_count;
  40. /* Sometimes we want to have at most one error per line. This
  41. variable controls whether this mode is selected or not. */
  42. extern int error_one_per_line;
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif /* error.h */