Mercurial > hg > octave-kai > gnulib-hg
annotate lib/error.h @ 653:b63f146fd963
indent cpp-directives
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Mon, 15 Jul 1996 03:56:06 +0000 (1996-07-15) |
parents | e5d48e9f9bcc |
children | ea86caa7c2cc |
rev | line source |
---|---|
402 | 1 /* error.h -- declaration for error-reporting function |
577 | 2 Copyright (C) 1995, 1996 Free Software Foundation, Inc. |
402 | 3 |
577 | 4 This program is free software; you can redistribute it and/or modify |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
402 | 8 |
577 | 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. | |
572 | 13 |
577 | 14 You should have received a copy of the GNU General Public License |
15 along with this program; if not, write to the Free Software | |
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
402 | 17 |
367 | 18 #ifndef _error_h_ |
653 | 19 # define _error_h_ |
367 | 20 |
653 | 21 # ifndef __attribute__ |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
22 /* This feature is available in gcc versions 2.5 and later. */ |
653 | 23 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ |
24 # define __attribute__(Spec) /* empty */ | |
25 # endif | |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
26 /* The __-protected variants of `format' and `printf' attributes |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
27 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ |
653 | 28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) |
29 # define __format__ format | |
30 # define __printf__ printf | |
31 # endif | |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
32 # endif |
402 | 33 |
653 | 34 # if defined (__STDC__) && __STDC__ |
572 | 35 |
36 /* Print a message with `fprintf (stderr, FORMAT, ...)'; | |
37 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). | |
38 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ | |
39 | |
40 extern void error (int status, int errnum, const char *format, ...) | |
41 __attribute__ ((__format__ (__printf__, 3, 4))); | |
42 | |
43 extern void error_at_line (int status, int errnum, const char *fname, | |
44 unsigned int lineno, const char *format, ...) | |
45 __attribute__ ((__format__ (__printf__, 5, 6))); | |
46 | |
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); | |
51 | |
653 | 52 # else |
367 | 53 void error (); |
572 | 54 void error_at_line (); |
55 extern void (*error_print_progname) (); | |
653 | 56 # endif |
367 | 57 |
440 | 58 /* This variable is incremented each time `error' is called. */ |
59 extern unsigned int error_message_count; | |
60 | |
572 | 61 /* Sometimes we want to have at most one error per line. This |
62 variable controls whether this mode is selected or not. */ | |
63 extern int error_one_per_line; | |
64 | |
367 | 65 #endif /* _error_h_ */ |