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