1 |
/* Declaration for error-reporting function |
/* Declaration for error-reporting function |
2 |
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. |
Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. |
3 |
|
This file is part of the GNU C Library. |
4 |
|
|
5 |
|
This program is free software; you can redistribute it and/or modify |
6 |
NOTE: The canonical source of this file is maintained with the GNU C Library. |
it under the terms of the GNU General Public License as published by |
7 |
Bugs can be reported to bug-glibc@prep.ai.mit.edu. |
the Free Software Foundation; either version 2, or (at your option) |
8 |
|
any later version. |
|
This program is free software; you can redistribute it and/or modify it |
|
|
under the terms of the GNU General Public License as published by the |
|
|
Free Software Foundation; either version 2, or (at your option) any |
|
|
later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
This program is distributed in the hope that it will be useful, |
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
GNU General Public License for more details. |
GNU General Public License for more details. |
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License along |
16 |
along with this program; if not, write to the Free Software |
with this program; if not, write to the Free Software Foundation, |
17 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
|
USA. */ |
|
18 |
|
|
19 |
#ifndef _ERROR_H |
#ifndef _ERROR_H |
20 |
#define _ERROR_H 1 |
#define _ERROR_H 1 |
36 |
extern "C" { |
extern "C" { |
37 |
#endif |
#endif |
38 |
|
|
|
#if defined (__STDC__) && __STDC__ |
|
|
|
|
39 |
/* Print a message with `fprintf (stderr, FORMAT, ...)'; |
/* Print a message with `fprintf (stderr, FORMAT, ...)'; |
40 |
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). |
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). |
41 |
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ |
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ |
42 |
|
|
43 |
extern void error (int status, int errnum, const char *format, ...) |
extern void error (int __status, int __errnum, const char *__format, ...) |
44 |
__attribute__ ((__format__ (__printf__, 3, 4))); |
__attribute__ ((__format__ (__printf__, 3, 4))); |
45 |
|
|
46 |
extern void error_at_line (int status, int errnum, const char *fname, |
extern void error_at_line (int __status, int __errnum, const char *__fname, |
47 |
unsigned int lineno, const char *format, ...) |
unsigned int __lineno, const char *__format, ...) |
48 |
__attribute__ ((__format__ (__printf__, 5, 6))); |
__attribute__ ((__format__ (__printf__, 5, 6))); |
49 |
|
|
50 |
/* If NULL, error will flush stdout, then print on stderr the program |
/* If NULL, error will flush stdout, then print on stderr the program |
52 |
function without parameters instead. */ |
function without parameters instead. */ |
53 |
extern void (*error_print_progname) (void); |
extern void (*error_print_progname) (void); |
54 |
|
|
|
#else |
|
|
void error (); |
|
|
void error_at_line (); |
|
|
extern void (*error_print_progname) (); |
|
|
#endif |
|
|
|
|
55 |
/* This variable is incremented each time `error' is called. */ |
/* This variable is incremented each time `error' is called. */ |
56 |
extern unsigned int error_message_count; |
extern unsigned int error_message_count; |
57 |
|
|