MPD 0.17~git
|
00001 /* 00002 * Copyright (C) 2003-2011 The Music Player Daemon Project 00003 * http://www.musicpd.org 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef DAEMON_H 00021 #define DAEMON_H 00022 00023 #include "mpd_error.h" 00024 00025 #include <stdbool.h> 00026 00027 #ifndef WIN32 00028 void 00029 daemonize_init(const char *user, const char *group, const char *pidfile); 00030 #else 00031 static inline void 00032 daemonize_init(const char *user, const char *group, const char *pidfile) 00033 { (void)user; (void)group; (void)pidfile; } 00034 #endif 00035 00036 #ifndef WIN32 00037 void 00038 daemonize_finish(void); 00039 #else 00040 static inline void 00041 daemonize_finish(void) 00042 { /* nop */ } 00043 #endif 00044 00049 #ifndef WIN32 00050 void 00051 daemonize_kill(void); 00052 #else 00053 #include <glib.h> 00054 static inline void 00055 daemonize_kill(void) 00056 { MPD_ERROR("--kill is not available on WIN32"); } 00057 #endif 00058 00062 #ifndef WIN32 00063 void 00064 daemonize_close_stdin(void); 00065 #else 00066 static inline void 00067 daemonize_close_stdin(void) {} 00068 #endif 00069 00073 #ifndef WIN32 00074 void 00075 daemonize_set_user(void); 00076 #else 00077 static inline void 00078 daemonize_set_user(void) 00079 { /* nop */ } 00080 #endif 00081 00082 #ifndef WIN32 00083 void 00084 daemonize(bool detach); 00085 #else 00086 static inline void 00087 daemonize(bool detach) 00088 { (void)detach; } 00089 #endif 00090 00091 #endif