Blame gnulib/lib/error.h

Packit Service 51e54d
/* Declaration for error-reporting function
Packit Service 51e54d
   Copyright (C) 1995-1997, 2003, 2006, 2008-2014 Free Software Foundation,
Packit Service 51e54d
   Inc.
Packit Service 51e54d
   This file is part of the GNU C Library.
Packit Service 51e54d
Packit Service 51e54d
   This program is free software: you can redistribute it and/or modify
Packit Service 51e54d
   it under the terms of the GNU General Public License as published by
Packit Service 51e54d
   the Free Software Foundation; either version 3 of the License, or
Packit Service 51e54d
   (at your option) any later version.
Packit Service 51e54d
Packit Service 51e54d
   This program is distributed in the hope that it will be useful,
Packit Service 51e54d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 51e54d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 51e54d
   GNU General Public License for more details.
Packit Service 51e54d
Packit Service 51e54d
   You should have received a copy of the GNU General Public License
Packit Service 51e54d
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service 51e54d
Packit Service 51e54d
#ifndef _ERROR_H
Packit Service 51e54d
#define _ERROR_H 1
Packit Service 51e54d
Packit Service 51e54d
/* The __attribute__ feature is available in gcc versions 2.5 and later.
Packit Service 51e54d
   The __-protected variants of the attributes 'format' and 'printf' are
Packit Service 51e54d
   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
Packit Service 51e54d
   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
Packit Service 51e54d
   gnulib and libintl do '#define printf __printf__' when they override
Packit Service 51e54d
   the 'printf' function.  */
Packit Service 51e54d
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
Packit Service 51e54d
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
Packit Service 51e54d
#else
Packit Service 51e54d
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
Packit Service 51e54d
#endif
Packit Service 51e54d
Packit Service 51e54d
#ifdef __cplusplus
Packit Service 51e54d
extern "C" {
Packit Service 51e54d
#endif
Packit Service 51e54d
Packit Service 51e54d
/* Print a message with 'fprintf (stderr, FORMAT, ...)';
Packit Service 51e54d
   if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
Packit Service 51e54d
   If STATUS is nonzero, terminate the program with 'exit (STATUS)'.  */
Packit Service 51e54d
Packit Service 51e54d
extern void error (int __status, int __errnum, const char *__format, ...)
Packit Service 51e54d
     _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
Packit Service 51e54d
Packit Service 51e54d
extern void error_at_line (int __status, int __errnum, const char *__fname,
Packit Service 51e54d
                           unsigned int __lineno, const char *__format, ...)
Packit Service 51e54d
     _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
Packit Service 51e54d
Packit Service 51e54d
/* If NULL, error will flush stdout, then print on stderr the program
Packit Service 51e54d
   name, a colon and a space.  Otherwise, error will call this
Packit Service 51e54d
   function without parameters instead.  */
Packit Service 51e54d
extern void (*error_print_progname) (void);
Packit Service 51e54d
Packit Service 51e54d
/* This variable is incremented each time 'error' is called.  */
Packit Service 51e54d
extern unsigned int error_message_count;
Packit Service 51e54d
Packit Service 51e54d
/* Sometimes we want to have at most one error per line.  This
Packit Service 51e54d
   variable controls whether this mode is selected or not.  */
Packit Service 51e54d
extern int error_one_per_line;
Packit Service 51e54d
Packit Service 51e54d
#ifdef __cplusplus
Packit Service 51e54d
}
Packit Service 51e54d
#endif
Packit Service 51e54d
Packit Service 51e54d
#endif /* error.h */