root/libutil/die.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003
   3  *      Tama Communications Corporation
   4  *
   5  * This file is part of GNU GLOBAL.
   6  *
   7  * This program is free software: you can redistribute it and/or modify
   8  * it under the terms of the GNU General Public License as published by
   9  * the Free Software Foundation, either version 3 of the License, or
  10  * (at your option) any later version.
  11  * 
  12  * This program 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
  15  * GNU General Public License for more details.
  16  * 
  17  * You should have received a copy of the GNU General Public License
  18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19  */
  20 
  21 #ifndef _DIE_H_
  22 #define _DIE_H_
  23 
  24 #ifdef HAVE_CONFIG_H
  25 #include <config.h>
  26 #endif
  27 #include <stdarg.h>
  28 
  29 #ifndef __attribute__
  30 /* This feature is available in gcc versions 2.5 and later.  */
  31 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
  32 #  define __attribute__(x)
  33 # endif
  34 /* The __-protected variants of `format' and `printf' attributes
  35    are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
  36 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
  37 #  define __format__ format
  38 #  define __printf__ printf
  39 # endif
  40 #endif
  41 
  42 extern  const char *progname;
  43 
  44 void setquiet(void);
  45 void setverbose(void);
  46 void setdebug(void);
  47 void sethandler(void (*proc)(void));
  48 void die(const char *s, ...)
  49         __attribute__ ((__noreturn__, __format__ (__printf__, 1, 2)));
  50 void die_with_code(int n, const char *s, ...)
  51         __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
  52 void message(const char *s, ...)
  53         __attribute__ ((__format__ (__printf__, 1, 2)));
  54 void warning(const char *s, ...)
  55         __attribute__ ((__format__ (__printf__, 1, 2)));
  56 
  57 #endif /* ! _DIE_H_ */

/* [previous][next][first][last][top][bottom][index][help] */