+void set_no_chdir(void);
+void ignore_existing_pidfile(void);
+pid_t read_pidfile(const char *name);
+#else
+#define DAEMON_OPTION_ENUMS \
+ OPT_DETACH, \
+ OPT_NO_CHDIR, \
+ OPT_PIDFILE, \
+ OPT_PIPE_HANDLE, \
+ OPT_SERVICE, \
+ OPT_SERVICE_MONITOR
+
+#define DAEMON_LONG_OPTIONS \
+ {"detach", no_argument, NULL, OPT_DETACH}, \
+ {"no-chdir", no_argument, NULL, OPT_NO_CHDIR}, \
+ {"pidfile", optional_argument, NULL, OPT_PIDFILE}, \
+ {"pipe-handle", required_argument, NULL, OPT_PIPE_HANDLE}, \
+ {"service", no_argument, NULL, OPT_SERVICE}, \
+ {"service-monitor", no_argument, NULL, OPT_SERVICE_MONITOR}
+
+#define DAEMON_OPTION_HANDLERS \
+ case OPT_DETACH: \
+ break; \
+ \
+ case OPT_NO_CHDIR: \
+ break; \
+ \
+ case OPT_PIDFILE: \
+ set_pidfile(optarg); \
+ break; \
+ \
+ case OPT_PIPE_HANDLE: \
+ set_pipe_handle(optarg); \
+ break; \
+ \
+ case OPT_SERVICE: \
+ break; \
+ \
+ case OPT_SERVICE_MONITOR: \
+ break;
+
+void control_handler(DWORD request);
+void set_pipe_handle(const char *pipe_handle);
+#endif /* _WIN32 */
+
+bool get_detach(void);
+void daemon_save_fd(int fd);