failures.h revision 52ec35a46b5f6bc5477a603a2bed6460d64868db
#ifndef FAILURES_H
#define FAILURES_H
/* Default exit status codes that we could use. */
enum fatal_exit_status {
FATAL_DEFAULT = 89
};
enum log_type {
};
#define DEFAULT_FAILURE_STAMP_FORMAT "%b %d %H:%M:%S "
const char *, va_list);
/* Change failure handlers. */
#ifndef __cplusplus
#else
/* Older g++ doesn't like attributes in parameters */
#endif
/* Send failures to syslog() */
ATTR_FORMAT(2, 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);
/* Set the failure prefix. This is used only when logging to a file. */
void i_set_failure_prefix(const char *prefix);
/* 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