MPD
daemon.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003-2010 The Music Player Daemon Project
3  * http://www.musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef DAEMON_H
21 #define DAEMON_H
22 
23 #include "mpd_error.h"
24 
25 #include <stdbool.h>
26 
27 #ifndef WIN32
28 void
29 daemonize_init(const char *user, const char *group, const char *pidfile);
30 #else
31 static inline void
32 daemonize_init(const char *user, const char *group, const char *pidfile)
33 { (void)user; (void)group; (void)pidfile; }
34 #endif
35 
36 #ifndef WIN32
37 void
38 daemonize_finish(void);
39 #else
40 static inline void
41 daemonize_finish(void)
42 { /* nop */ }
43 #endif
44 
49 #ifndef WIN32
50 void
51 daemonize_kill(void);
52 #else
53 #include <glib.h>
54 static inline void
55 daemonize_kill(void)
56 { MPD_ERROR("--kill is not available on WIN32"); }
57 #endif
58 
62 #ifndef WIN32
63 void
65 #else
66 static inline void
67 daemonize_close_stdin(void) {}
68 #endif
69 
73 #ifndef WIN32
74 void
75 daemonize_set_user(void);
76 #else
77 static inline void
79 { /* nop */ }
80 #endif
81 
82 #ifndef WIN32
83 void
84 daemonize(bool detach);
85 #else
86 static inline void
87 daemonize(bool detach)
88 { (void)detach; }
89 #endif
90 
91 #endif