gui: Shutdown scheduler after schedule() returns.
[paraslash.git] / daemon.h
1 /** \file daemon.h exported symbols from daemon.c */
2
3
4 void 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_drop_privileges_or_die(const char *username, const char *groupname);
9 void daemon_set_start_time(void);
10 time_t daemon_get_uptime(const struct timeval *current_time);
11 __malloc char *daemon_get_uptime_str(const struct timeval *current_time);
12 void daemon_set_logfile(char *logfile_name);
13 void daemon_set_flag(unsigned flag);
14 void daemon_set_loglevel(char *loglevel);
15 void daemon_set_default_log_colors(void);
16 void daemon_set_log_color_or_die(char const *arg);
17 __printf_2_3 void daemon_log(int ll, const char* fmt,...);
18
19 /** Daemon log configuration flags. */
20 enum daemon_flags {
21         /** Whether the hostname should be logged. */
22         DF_LOG_HOSTNAME = 1,
23         /** Whether the PID should be logged. */
24         DF_LOG_PID = 2,
25         /** Prepend log message with date and time. */
26         DF_LOG_TIME = 4,
27         /** Also print the loglevel for each message. */
28         DF_LOG_LL = 8,
29         /** Use colored output. */
30         DF_COLOR_LOG = 16,
31         /** Include milliseconds in log output. */
32         DF_LOG_TIMING = 32
33 };