Fix.
[shishi.git] / gl / error.h
blob471a4d2c9bc387f37a0afd390b6a847398c74edd
1 /* Declaration for error-reporting function
2 Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
5 NOTE: The canonical source of this file is maintained with the GNU C Library.
6 Bugs can be reported to bug-glibc@prep.ai.mit.edu.
8 This program is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 2, or (at your option) any
11 later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 USA. */
23 #ifndef _ERROR_H
24 #define _ERROR_H 1
26 #ifndef __attribute__
27 /* This feature is available in gcc versions 2.5 and later. */
28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
29 # define __attribute__(Spec) /* empty */
30 # endif
31 /* The __-protected variants of `format' and `printf' attributes
32 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
33 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
34 # define __format__ format
35 # define __printf__ printf
36 # endif
37 #endif
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
43 /* Print a message with `fprintf (stderr, FORMAT, ...)';
44 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
45 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
47 extern void error (int status, int errnum, const char *format, ...)
48 __attribute__ ((__format__ (__printf__, 3, 4)));
50 extern void error_at_line (int status, int errnum, const char *fname,
51 unsigned int lineno, const char *format, ...)
52 __attribute__ ((__format__ (__printf__, 5, 6)));
54 /* If NULL, error will flush stdout, then print on stderr the program
55 name, a colon and a space. Otherwise, error will call this
56 function without parameters instead. */
57 extern void (*error_print_progname) (void);
59 /* This variable is incremented each time `error' is called. */
60 extern unsigned int error_message_count;
62 /* Sometimes we want to have at most one error per line. This
63 variable controls whether this mode is selected or not. */
64 extern int error_one_per_line;
66 #ifdef __cplusplus
68 #endif
70 #endif /* error.h */