/* Declaration for error-reporting function1Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.2This file is part of the GNU C Library.34This program is free software; you can redistribute it and/or modify5it under the terms of the GNU General Public License as published by6the Free Software Foundation; either version 2, or (at your option)7any later version.89This program is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License along15with this program; if not, write to the Free Software Foundation,16Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */1718#ifndef _ERROR_H19#define _ERROR_H 12021#ifndef __attribute__22/* This feature is available in gcc versions 2.5 and later. */23# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)24# define __attribute__(Spec) /* empty */25# endif26/* The __-protected variants of `format' and `printf' attributes27are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */28# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)29# define __format__ format30# define __printf__ printf31# endif32#endif3334#ifdef __cplusplus35extern "C" {36#endif3738/* Print a message with `fprintf (stderr, FORMAT, ...)';39if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).40If STATUS is nonzero, terminate the program with `exit (STATUS)'. */4142extern void error (int __status, int __errnum, const char *__format, ...)43__attribute__ ((__format__ (__printf__, 3, 4)));4445extern void error_at_line (int __status, int __errnum, const char *__fname,46unsigned int __lineno, const char *__format, ...)47__attribute__ ((__format__ (__printf__, 5, 6)));4849/* If NULL, error will flush stdout, then print on stderr the program50name, a colon and a space. Otherwise, error will call this51function without parameters instead. */52extern void (*error_print_progname) (void);5354/* This variable is incremented each time `error' is called. */55extern unsigned int error_message_count;5657/* Sometimes we want to have at most one error per line. This58variable controls whether this mode is selected or not. */59extern int error_one_per_line;6061#ifdef __cplusplus62}63#endif6465#endif /* error.h */666768