err.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _ERR_H
  17. #define _ERR_H 1
  18. #include <features.h>
  19. #define __need___va_list
  20. #include <stdarg.h>
  21. #ifndef __GNUC_VA_LIST
  22. # define __gnuc_va_list __ptr_t
  23. #endif
  24. __BEGIN_DECLS
  25. /* Print "program: ", FORMAT, ": ", the standard error string for errno,
  26. and a newline, on stderr. */
  27. extern void warn (__const char *__format, ...)
  28. __attribute__ ((__format__ (__printf__, 1, 2)));
  29. extern void vwarn (__const char *__format, __gnuc_va_list)
  30. __attribute__ ((__format__ (__printf__, 1, 0)));
  31. libc_hidden_proto(vwarn)
  32. /* Likewise, but without ": " and the standard error string. */
  33. extern void warnx (__const char *__format, ...)
  34. __attribute__ ((__format__ (__printf__, 1, 2)));
  35. extern void vwarnx (__const char *__format, __gnuc_va_list)
  36. __attribute__ ((__format__ (__printf__, 1, 0)));
  37. libc_hidden_proto(vwarnx)
  38. /* Likewise, and then exit with STATUS. */
  39. extern void err (int __status, __const char *__format, ...)
  40. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
  41. extern void verr (int __status, __const char *__format, __gnuc_va_list)
  42. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
  43. libc_hidden_proto(verr)
  44. extern void errx (int __status, __const char *__format, ...)
  45. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
  46. extern void verrx (int __status, __const char *, __gnuc_va_list)
  47. __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
  48. libc_hidden_proto(verrx)
  49. __END_DECLS
  50. #endif /* err.h */