Mercurial > hg > octave-kai > gnulib-hg
comparison lib/error.h @ 1268:a6946b537568
update from fsf
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sun, 15 Mar 1998 08:11:02 +0000 |
parents | 2dad6606dddb |
children | e8c38fd6fbe0 |
comparison
equal
deleted
inserted
replaced
1267:c382cf24676b | 1268:a6946b537568 |
---|---|
1 /* error.h -- declaration for error-reporting function | 1 /* Declaration for error-reporting function |
2 Copyright (C) 1995, 1996 Free Software Foundation, Inc. | 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. |
3 | 3 |
4 This program is free software; you can redistribute it and/or modify | 4 |
5 it under the terms of the GNU General Public License as published by | 5 NOTE: The canonical source of this file is maintained with the GNU C Library. |
6 the Free Software Foundation; either version 2, or (at your option) | 6 Bugs can be reported to bug-glibc@prep.ai.mit.edu. |
7 any later version. | 7 |
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. | |
8 | 12 |
9 This program is distributed in the hope that it will be useful, | 13 This program is distributed in the hope that it will be useful, |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 GNU General Public License for more details. | 16 GNU General Public License for more details. |
13 | 17 |
14 You should have received a copy of the GNU General Public License | 18 You should have received a copy of the GNU General Public License |
15 along with this program; if not, write to the Free Software Foundation, | 19 along with this program; if not, write to the Free Software |
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21 USA. */ | |
17 | 22 |
18 #ifndef ERROR_H_ | 23 #ifndef _ERROR_H |
19 # define ERROR_H_ | 24 #define _ERROR_H 1 |
20 | 25 |
21 # ifndef __attribute__ | 26 #ifndef __attribute__ |
22 /* This feature is available in gcc versions 2.5 and later. */ | 27 /* This feature is available in gcc versions 2.5 and later. */ |
23 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ | 28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ |
24 # define __attribute__(Spec) /* empty */ | 29 # define __attribute__(Spec) /* empty */ |
25 # endif | 30 # endif |
26 /* The __-protected variants of `format' and `printf' attributes | 31 /* The __-protected variants of `format' and `printf' attributes |
27 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ | 32 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ |
28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) | 33 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) |
29 # define __format__ format | 34 # define __format__ format |
30 # define __printf__ printf | 35 # define __printf__ printf |
31 # endif | |
32 # endif | 36 # endif |
37 #endif | |
33 | 38 |
34 # if defined (__STDC__) && __STDC__ | 39 #ifdef __cplusplus |
40 extern "C" { | |
41 #endif | |
42 | |
43 #if defined (__STDC__) && __STDC__ | |
35 | 44 |
36 /* Print a message with `fprintf (stderr, FORMAT, ...)'; | 45 /* Print a message with `fprintf (stderr, FORMAT, ...)'; |
37 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). | 46 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). |
38 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ | 47 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ |
39 | 48 |
47 /* If NULL, error will flush stdout, then print on stderr the program | 56 /* If NULL, error will flush stdout, then print on stderr the program |
48 name, a colon and a space. Otherwise, error will call this | 57 name, a colon and a space. Otherwise, error will call this |
49 function without parameters instead. */ | 58 function without parameters instead. */ |
50 extern void (*error_print_progname) (void); | 59 extern void (*error_print_progname) (void); |
51 | 60 |
52 # else | 61 #else |
53 void error (); | 62 void error (); |
54 void error_at_line (); | 63 void error_at_line (); |
55 extern void (*error_print_progname) (); | 64 extern void (*error_print_progname) (); |
56 # endif | 65 #endif |
57 | 66 |
58 /* This variable is incremented each time `error' is called. */ | 67 /* This variable is incremented each time `error' is called. */ |
59 extern unsigned int error_message_count; | 68 extern unsigned int error_message_count; |
60 | 69 |
61 /* Sometimes we want to have at most one error per line. This | 70 /* Sometimes we want to have at most one error per line. This |
62 variable controls whether this mode is selected or not. */ | 71 variable controls whether this mode is selected or not. */ |
63 extern int error_one_per_line; | 72 extern int error_one_per_line; |
64 | 73 |
65 #endif /* not ERROR_H_ */ | 74 #ifdef __cplusplus |
75 } | |
76 #endif | |
77 | |
78 #endif /* error.h */ |