1170754Sdelphij/* Declaration for error-reporting function
2170754Sdelphij   Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
3170754Sdelphij   This file is part of the GNU C Library.
4170754Sdelphij
5170754Sdelphij   This program is free software; you can redistribute it and/or modify
6170754Sdelphij   it under the terms of the GNU General Public License as published by
7170754Sdelphij   the Free Software Foundation; either version 2, or (at your option)
8170754Sdelphij   any later version.
9170754Sdelphij
10170754Sdelphij   This program is distributed in the hope that it will be useful,
11170754Sdelphij   but WITHOUT ANY WARRANTY; without even the implied warranty of
12170754Sdelphij   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13170754Sdelphij   GNU General Public License for more details.
14170754Sdelphij
15170754Sdelphij   You should have received a copy of the GNU General Public License along
16170754Sdelphij   with this program; if not, write to the Free Software Foundation,
17170754Sdelphij   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18170754Sdelphij
19170754Sdelphij#ifndef _ERROR_H
20170754Sdelphij#define _ERROR_H 1
21170754Sdelphij
22170754Sdelphij#ifndef __attribute__
23170754Sdelphij/* This feature is available in gcc versions 2.5 and later.  */
24170754Sdelphij# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
25170754Sdelphij#  define __attribute__(Spec) /* empty */
26170754Sdelphij# endif
27170754Sdelphij/* The __-protected variants of `format' and `printf' attributes
28170754Sdelphij   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
29170754Sdelphij# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
30170754Sdelphij#  define __format__ format
31170754Sdelphij#  define __printf__ printf
32170754Sdelphij# endif
33170754Sdelphij#endif
34170754Sdelphij
35170754Sdelphij#ifdef	__cplusplus
36170754Sdelphijextern "C" {
37170754Sdelphij#endif
38170754Sdelphij
39170754Sdelphij/* Print a message with `fprintf (stderr, FORMAT, ...)';
40170754Sdelphij   if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
41170754Sdelphij   If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */
42170754Sdelphij
43170754Sdelphijextern void error (int __status, int __errnum, const char *__format, ...)
44170754Sdelphij     __attribute__ ((__format__ (__printf__, 3, 4)));
45170754Sdelphij
46170754Sdelphijextern void error_at_line (int __status, int __errnum, const char *__fname,
47170754Sdelphij			   unsigned int __lineno, const char *__format, ...)
48170754Sdelphij     __attribute__ ((__format__ (__printf__, 5, 6)));
49170754Sdelphij
50170754Sdelphij/* If NULL, error will flush stdout, then print on stderr the program
51170754Sdelphij   name, a colon and a space.  Otherwise, error will call this
52170754Sdelphij   function without parameters instead.  */
53170754Sdelphijextern void (*error_print_progname) (void);
54170754Sdelphij
55170754Sdelphij/* This variable is incremented each time `error' is called.  */
56170754Sdelphijextern unsigned int error_message_count;
57170754Sdelphij
58170754Sdelphij/* Sometimes we want to have at most one error per line.  This
59170754Sdelphij   variable controls whether this mode is selected or not.  */
60170754Sdelphijextern int error_one_per_line;
61170754Sdelphij
62170754Sdelphij#ifdef	__cplusplus
63170754Sdelphij}
64170754Sdelphij#endif
65170754Sdelphij
66170754Sdelphij#endif /* error.h */
67