1 /* error.h -- declaration for error-reporting function
2 Copyright (C) 1995, 1996 Software Foundation, Inc.
4 This file is part of the GNU C Library. Its master source is NOT part of
5 the C library, however. The master source lives in /gd/gnu/lib.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If
19 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
20 Cambridge, MA 02139, USA. */
26 /* This feature is available in gcc versions 2.5 and later. */
27 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
28 # define __attribute__(Spec) /* empty */
30 /* The __-protected variants of `format' and `printf' attributes
31 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
32 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
33 # define __format__ format
34 # define __printf__ printf
38 #if defined (__STDC__) && __STDC__
40 /* Print a message with `fprintf (stderr, FORMAT, ...)';
41 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
42 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
44 extern void error (int status
, int errnum
, const char *format
, ...)
45 __attribute__ ((__format__ (__printf__
, 3, 4)));
47 /* If NULL, error will flush stdout, then print on stderr the program
48 name, a colon and a space. Otherwise, error will call this
49 function without parameters instead. */
50 extern void (*error_print_progname
) (void);
54 extern void (*error_print_progname
) ();
57 /* This variable is incremented each time `error' is called. */
58 extern unsigned int error_message_count
;
60 #endif /* _error_h_ */