Back to index

glibc  2.9
err.h
Go to the documentation of this file.
00001 /* 4.4BSD utility functions for error messages.
00002    Copyright (C) 1995,1996,1997,1998,1999,2003 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       _ERR_H
00021 #define       _ERR_H 1
00022 
00023 #include <features.h>
00024 
00025 #define       __need___va_list
00026 #include <stdarg.h>
00027 #ifndef       __GNUC_VA_LIST
00028 # define __gnuc_va_list     __ptr_t
00029 #endif
00030 
00031 __BEGIN_DECLS
00032 
00033 /* Print "program: ", FORMAT, ": ", the standard error string for errno,
00034    and a newline, on stderr.  */
00035 extern void warn (__const char *__format, ...)
00036      __attribute__ ((__format__ (__printf__, 1, 2)));
00037 extern void vwarn (__const char *__format, __gnuc_va_list)
00038      __attribute__ ((__format__ (__printf__, 1, 0)));
00039 
00040 /* Likewise, but without ": " and the standard error string.  */
00041 extern void warnx (__const char *__format, ...)
00042      __attribute__ ((__format__ (__printf__, 1, 2)));
00043 extern void vwarnx (__const char *__format, __gnuc_va_list)
00044      __attribute__ ((__format__ (__printf__, 1, 0)));
00045 
00046 /* Likewise, and then exit with STATUS.  */
00047 extern void err (int __status, __const char *__format, ...)
00048      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
00049 extern void verr (int __status, __const char *__format, __gnuc_va_list)
00050      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
00051 extern void errx (int __status, __const char *__format, ...)
00052      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
00053 extern void verrx (int __status, __const char *, __gnuc_va_list)
00054      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
00055 
00056 __END_DECLS
00057 
00058 #endif /* err.h */