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.
 
 
 
 

39 lines
1.0 KiB

  1. /* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
  2. #ifndef ERRMSG_H
  3. #define ERRMSG_H
  4. /* for exit(): */
  5. #include <stdlib.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /* These use file descriptor 2, not buffer_2!
  10. * Call buffer_flush(buffer_2) before calling these! */
  11. extern const char* argv0;
  12. void errmsg_iam(const char* who); /* set argv0 */
  13. /* terminate with NULL. */
  14. /* newline is appended automatically. */
  15. void errmsg_warn(const char* message, ...);
  16. void errmsg_warnsys(const char* message, ...);
  17. void errmsg_info(const char* message, ...);
  18. void errmsg_infosys(const char* message, ...);
  19. #define carp(...) errmsg_warn(__VA_ARGS__,(char*)0)
  20. #define carpsys(...) errmsg_warnsys(__VA_ARGS__,(char*)0)
  21. #define die(n,...) do { errmsg_warn(__VA_ARGS__,(char*)0); exit(n); } while (0)
  22. #define diesys(n,...) do { errmsg_warnsys(__VA_ARGS__,(char*)0); exit(n); } while (0)
  23. #define msg(...) errmsg_info(__VA_ARGS__,(char*)0);
  24. #define msgsys(...) errmsg_infosys(__VA_ARGS__,(char*)0);
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif