]> sourceware.org Git - glibc.git/blame - misc/error.h
Update.
[glibc.git] / misc / error.h
CommitLineData
19361cb7
UD
1/* Declaration for error-reporting function
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
54d79e99
UD
3 This file is part of the GNU C Library. Its master source is NOT part of
4 the C library, however. The master source lives in /gd/gnu/lib.
196980f5 5
54d79e99 6 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
196980f5 10
54d79e99
UD
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 14 Lesser General Public License for more details.
196980f5 15
41bdb6e2
AJ
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
196980f5 20
5107cf1d
UD
21#ifndef _ERROR_H
22#define _ERROR_H 1
196980f5
RM
23
24#ifndef __attribute__
25/* This feature is available in gcc versions 2.5 and later. */
26# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
27# define __attribute__(Spec) /* empty */
28# endif
29/* The __-protected variants of `format' and `printf' attributes
30 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
31# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
32# define __format__ format
33# define __printf__ printf
34# endif
35#endif
36
54d79e99
UD
37#ifdef __cplusplus
38extern "C" {
39#endif
40
19c3f208
RM
41#if defined (__STDC__) && __STDC__
42
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)'. */
46
47extern void error (int status, int errnum, const char *format, ...)
48 __attribute__ ((__format__ (__printf__, 3, 4)));
49
19bc17a9
RM
50extern void error_at_line (int status, int errnum, const char *fname,
51 unsigned int lineno, const char *format, ...)
52 __attribute__ ((__format__ (__printf__, 5, 6)));
53
19c3f208
RM
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. */
57extern void (*error_print_progname) (void);
58
196980f5
RM
59#else
60void error ();
19bc17a9 61void error_at_line ();
19c3f208 62extern void (*error_print_progname) ();
196980f5
RM
63#endif
64
65/* This variable is incremented each time `error' is called. */
66extern unsigned int error_message_count;
67
19bc17a9
RM
68/* Sometimes we want to have at most one error per line. This
69 variable controls whether this mode is selected or not. */
70extern int error_one_per_line;
71
54d79e99
UD
72#ifdef __cplusplus
73}
74#endif
75
5107cf1d 76#endif /* error.h */
This page took 0.160978 seconds and 5 git commands to generate.