source: trunk/src/emx/include/error.h@ 1272

Last change on this file since 1272 was 1044, checked in by bird, 22 years ago

GLIBC error stuff.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.7 KB
Line 
1/* Declaration for error-reporting function
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
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.
5
6 The GNU C Library is free software; you can redistribute it and/or
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.
10
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
14 Lesser General Public License for more details.
15
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. */
20
21/** @file
22 * GLIBC v2.3.2
23 */
24
25#ifndef _ERROR_H
26#define _ERROR_H 1
27
28#ifndef __attribute__
29/* This feature is available in gcc versions 2.5 and later. */
30# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
31# define __attribute__(Spec) /* empty */
32# endif
33/* The __-protected variants of `format' and `printf' attributes
34 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
35# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
36# define __format__ format
37# define __printf__ printf
38# endif
39#endif
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#if defined (__STDC__) && __STDC__
46
47/* Print a message with `fprintf (stderr, FORMAT, ...)';
48 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
49 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
50
51extern void error (int status, int errnum, const char *format, ...)
52 __attribute__ ((__format__ (__printf__, 3, 4)));
53
54extern void error_at_line (int status, int errnum, const char *fname,
55 unsigned int lineno, const char *format, ...)
56 __attribute__ ((__format__ (__printf__, 5, 6)));
57
58/* If NULL, error will flush stdout, then print on stderr the program
59 name, a colon and a space. Otherwise, error will call this
60 function without parameters instead. */
61extern void (*error_print_progname) (void);
62
63#else
64void error ();
65void error_at_line ();
66extern void (*error_print_progname) ();
67#endif
68
69/* This variable is incremented each time `error' is called. */
70extern unsigned int error_message_count;
71
72/* Sometimes we want to have at most one error per line. This
73 variable controls whether this mode is selected or not. */
74extern int error_one_per_line;
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* error.h */
Note: See TracBrowser for help on using the repository browser.