err.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* 4.4BSD utility functions for error messages.
  2. Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _ERR_H
  16. #define _ERR_H 1
  17. #include <features.h>
  18. #define __need___va_list
  19. #include <stdarg.h>
  20. #ifndef __GNUC_VA_LIST
  21. # define __gnuc_va_list __ptr_t
  22. #endif
  23. __BEGIN_DECLS
  24. /* Print "program: ", FORMAT, ": ", the standard error string for errno,
  25. and a newline, on stderr. */
  26. extern void warn (const char *__format, ...)
  27. __attribute__ ((__format__ (__printf__, 1, 2)));
  28. extern void vwarn (const char *__format, __gnuc_va_list)
  29. __attribute__ ((__format__ (__printf__, 1, 0)));
  30. /* Likewise, but without ": " and the standard error string. */
  31. extern void warnx (const char *__format, ...)
  32. __attribute__ ((__format__ (__printf__, 1, 2)));
  33. extern void vwarnx (const char *__format, __gnuc_va_list)
  34. __attribute__ ((__format__ (__printf__, 1, 0)));
  35. /* Likewise, and then exit with STATUS. */
  36. extern void err (int __status, const char *__format, ...)
  37. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
  38. extern void verr (int __status, const char *__format, __gnuc_va_list)
  39. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
  40. extern void errx (int __status, const char *__format, ...)
  41. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
  42. extern void verrx (int __status, const char *, __gnuc_va_list)
  43. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
  44. __END_DECLS
  45. #endif /* err.h */