failures.h revision ce103d6bbe240c5e9251247825b74356a5421dc9
#ifndef __FAILURES_H
#define __FAILURES_H
/* Default exit status codes that we could use. */
enum fatal_exit_status {
FATAL_DEFAULT = 89
};
#define DEFAULT_FAILURE_STAMP_FORMAT "%b %d %H:%M:%S "
typedef void failure_callback_t(const char *, va_list);
/* Change failure handlers. Make sure they don't modify errno. */
/* Send failures to syslog() */
__attr_format__(1, 0);
__attr_format__(1, 0);
__attr_format__(1, 0);
/* Send failures to specified log file instead of stderr. */
/* Send errors to stderr using internal error protocol. */
void i_set_failure_internal(void);
/* Send informational messages to specified log file. i_set_failure_*()
functions modify the info file too, so call this function after them. */
void i_set_info_file(const char *path);
/* Prefix failures with a timestamp. fmt is in strftime() format. */
void i_set_failure_timestamp_format(const char *fmt);
/* Call the callback before exit()ing. The callback may update the status. */
void failures_deinit(void);
#endif