Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
688 B

  1. #ifndef ERRMSG_H
  2. #define ERRMSG_H
  3. #ifdef __dietlibc__
  4. #include <sys/cdefs.h>
  5. #else
  6. #define __attribute__(x)
  7. #endif
  8. /* These use file descriptor 2, not buffer_2!
  9. * Call buffer_flush(buffer_2) before calling these! */
  10. extern const char* argv0;
  11. void errmsg_iam(const char* who); /* set argv0 */
  12. /* terminate with NULL. */
  13. /* newline is appended automatically. */
  14. void errmsg_warn(const char* message, ...);
  15. void errmsg_warnsys(const char* message, ...);
  16. #define carp(...) errmsg_warn(__VA_ARGS__,0)
  17. #define carpsys(...) errmsg_warnsys(__VA_ARGS__,0)
  18. #define die(n,...) { errmsg_warn(__VA_ARGS__,0); exit(n); }
  19. #define diesys(n,...) { errmsg_warnsys(__VA_ARGS__,0); exit(n); }
  20. #endif