void msg_printf(int level, const char *format,...) { va_list ap; va_start(ap, format); msg_vprintf(level, format, ap); va_end(ap); }
NORETURN vmsg_panic(const char *fmt, va_list ap) { if (msg_exiting++ == 0) { msg_vprintf(MSG_PANIC, fmt, ap); } sleep(1); abort(); /* Die! */ /* In case we're running as a signal handler. */ _exit(1); /* DIE!! */ }
NORETURN vmsg_fatal_status(int status, const char *fmt, va_list ap) { if (msg_exiting++ == 0) { msg_vprintf(MSG_FATAL, fmt, ap); if (msg_cleanup_fn) msg_cleanup_fn(); } sleep(1); /* In case we're running as a signal handler. */ _exit(status); }
void vmsg_error(const char *fmt, va_list ap) { msg_vprintf(MSG_ERROR, fmt, ap); if (++msg_error_count >= msg_error_bound) msg_fatal("too many errors - program terminated"); }
void vmsg_warn(const char *fmt, va_list ap) { msg_vprintf(MSG_WARN, fmt, ap); }
void vmsg_info(const char *fmt, va_list ap) { msg_vprintf(MSG_INFO, fmt, ap); }