Mercurial > hg > octave-kai > gnulib-hg
comparison lib/error.h @ 572:55f487a8aeab
Update from libc.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 30 Mar 1996 12:39:36 +0000 |
parents | 4f90813976b1 |
children | 8a90f3b04017 |
comparison
equal
deleted
inserted
replaced
571:0c13834b147d | 572:55f487a8aeab |
---|---|
1 /* error.h -- declaration for error-reporting function | 1 /* error.h -- declaration for error-reporting function |
2 Copyright (C) 1995 Free Software Foundation, Inc. | 2 Copyright (C) 1995, 1996 Software Foundation, Inc. |
3 | 3 |
4 This program is free software; you can redistribute it and/or modify | 4 This file is part of the GNU C Library. Its master source is NOT part of |
5 it under the terms of the GNU General Public License as published by | 5 the C library, however. The master source lives in /gd/gnu/lib. |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | 6 |
9 This program is distributed in the hope that it will be useful, | 7 The GNU C Library is free software; you can redistribute it and/or |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 modify it under the terms of the GNU Library General Public License as |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 published by the Free Software Foundation; either version 2 of the |
12 GNU General Public License for more details. | 10 License, or (at your option) any later version. |
13 | 11 |
14 You should have received a copy of the GNU General Public License | 12 The GNU C Library is distributed in the hope that it will be useful, |
15 along with this program; if not, write to the Free Software | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 Library General Public License for more details. | |
16 | |
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. */ | |
17 | 21 |
18 #ifndef _error_h_ | 22 #ifndef _error_h_ |
19 #define _error_h_ | 23 #define _error_h_ |
20 | 24 |
21 #ifndef __attribute__ | 25 #ifndef __attribute__ |
29 # define __format__ format | 33 # define __format__ format |
30 # define __printf__ printf | 34 # define __printf__ printf |
31 # endif | 35 # endif |
32 #endif | 36 #endif |
33 | 37 |
34 #if __STDC__ | 38 #if defined (__STDC__) && __STDC__ |
35 void error (int, int, const char *, ...) \ | 39 |
36 __attribute__ ((__format__ (__printf__, 3, 4))); | 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)'. */ | |
43 | |
44 extern void error (int status, int errnum, const char *format, ...) | |
45 __attribute__ ((__format__ (__printf__, 3, 4))); | |
46 | |
47 extern void error_at_line (int status, int errnum, const char *fname, | |
48 unsigned int lineno, const char *format, ...) | |
49 __attribute__ ((__format__ (__printf__, 5, 6))); | |
50 | |
51 /* If NULL, error will flush stdout, then print on stderr the program | |
52 name, a colon and a space. Otherwise, error will call this | |
53 function without parameters instead. */ | |
54 extern void (*error_print_progname) (void); | |
55 | |
37 #else | 56 #else |
38 void error (); | 57 void error (); |
58 void error_at_line (); | |
59 extern void (*error_print_progname) (); | |
39 #endif | 60 #endif |
40 | 61 |
41 /* This variable is incremented each time `error' is called. */ | 62 /* This variable is incremented each time `error' is called. */ |
42 extern unsigned int error_message_count; | 63 extern unsigned int error_message_count; |
43 | 64 |
65 /* Sometimes we want to have at most one error per line. This | |
66 variable controls whether this mode is selected or not. */ | |
67 extern int error_one_per_line; | |
68 | |
44 #endif /* _error_h_ */ | 69 #endif /* _error_h_ */ |