Back to index

glibc  2.9
error.h
Go to the documentation of this file.
00001 /* Declaration for error-reporting function
00002    Copyright (C) 1995,1996,1997,2003,2006,2007 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _ERROR_H
00021 #define _ERROR_H 1
00022 
00023 #include <features.h>
00024 
00025 
00026 __BEGIN_DECLS
00027 
00028 /* Print a message with `fprintf (stderr, FORMAT, ...)';
00029    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
00030    If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */
00031 
00032 extern void error (int __status, int __errnum, __const char *__format, ...)
00033      __attribute__ ((__format__ (__printf__, 3, 4)));
00034 
00035 extern void error_at_line (int __status, int __errnum, __const char *__fname,
00036                         unsigned int __lineno, __const char *__format, ...)
00037      __attribute__ ((__format__ (__printf__, 5, 6)));
00038 
00039 /* If NULL, error will flush stdout, then print on stderr the program
00040    name, a colon and a space.  Otherwise, error will call this
00041    function without parameters instead.  */
00042 extern void (*error_print_progname) (void);
00043 
00044 /* This variable is incremented each time `error' is called.  */
00045 extern unsigned int error_message_count;
00046 
00047 /* Sometimes we want to have at most one error per line.  This
00048    variable controls whether this mode is selected or not.  */
00049 extern int error_one_per_line;
00050 
00051 
00052 #if defined __extern_always_inline && defined __va_arg_pack
00053 # include <bits/error.h>
00054 #endif
00055 
00056 __END_DECLS
00057 
00058 #endif /* error.h */