/******************************************/ /* warnf.h 5.0.0 (1999-Oct-02-Sat) */ /* Adam M. Costello */ /******************************************/ /* This is ANSI C code. */ /************************************/ /* Synopsis: */ /* */ /* #include "warnf.h" */ /* */ /* warnf(format, ...); */ /* warnf(code_ref, format, ...); */ /* failf(format, ...); */ /* failf(code_ref, format, ...); */ /* abortf(format, ...); */ /* abortf(code_ref, format, ...); */ /************************************/ #ifndef WARNF_H #define WARNF_H int warnf(const char *format, ...); /* Like printf, but prints to stderr and flushes it. The format */ /* may be preceeded by the identifier code_ref, in which case the */ /* format is effectively appended with " at %s line %d\n" and the */ /* argument list is effectively appended with __FILE__, __LINE__. */ void failf(const char *format, ...); /* Like warnf, but then calls exit(EXIT_FAILURE). */ void abortf(const char *format, ...); /* Like warnf, but then calls abort(). */ extern const char * const warnf_code_ref_hook; #define code_ref warnf_code_ref_hook, __FILE__, __LINE__ /* A common error message: */ extern const char *out_of_memory; /* "out of memory\n" */ #endif /* WARNF_H */