com_ff(): Depreciate "n-" syntax.
[paraslash.git] / daemon.h
1 /** \file daemon.h exported symbols from daemon.c */
2
3
4 int daemonize(bool parent_waits);
5 void daemon_open_log_or_die(void);
6 void daemon_close_log(void);
7 void daemon_log_welcome(const char *whoami);
8 void daemon_set_priority(int prio);
9 void daemon_drop_privileges_or_die(const char *username, const char *groupname);
10 void daemon_set_start_time(void);
11 time_t daemon_get_uptime(const struct timeval *current_time);
12 __malloc char *daemon_get_uptime_str(const struct timeval *current_time);
13 void daemon_set_logfile(const char *logfile_name);
14 void daemon_set_hooks(void (*pre_log_hook)(void), void (*post_log_hook)(void));
15 void daemon_set_flag(unsigned flag);
16 void daemon_set_loglevel(const char *loglevel);
17 bool daemon_init_colors_or_die(int color_arg, int color_arg_auto,
18 int color_arg_no, bool logfile_given);
19 void daemon_set_log_color_or_die(const char *arg);
20 __printf_2_3 void daemon_log(int ll, const char* fmt,...);
21
22 /** Daemon log configuration flags. */
23 enum daemon_flags {
24 /** Whether the hostname should be logged. */
25 DF_LOG_HOSTNAME = 1,
26 /** Whether the PID should be logged. */
27 DF_LOG_PID = 2,
28 /** Prepend log message with date and time. */
29 DF_LOG_TIME = 4,
30 /** Also print the loglevel for each message. */
31 DF_LOG_LL = 8,
32 /** Use colored output. */
33 DF_COLOR_LOG = 16,
34 /** Include milliseconds in log output. */
35 DF_LOG_TIMING = 32
36 };