aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/main.h b/src/main.h
index 8ed02bf5d..9b9cba018 100644
--- a/src/main.h
+++ b/src/main.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2009 The Music Player Daemon Project
+ * Copyright (C) 2003-2010 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,47 @@ extern GThread *main_task;
extern GMainLoop *main_loop;
-extern struct notify main_notify;
+extern GCond *main_cond;
+
+/**
+ * A entry point for application.
+ * On non-Windows platforms this is called directly from main()
+ * On Windows platform this is called from win32_main()
+ * after doing some initialization.
+ */
+int mpd_main(int argc, char *argv[]);
+
+#ifdef WIN32
+
+/**
+ * If program is run as windows service performs nessesary initialization
+ * and then calls mpd_main() with specified arguments.
+ * If program is run as a regular application calls mpd_main() immediately.
+ */
+int
+win32_main(int argc, char *argv[]);
+
+/**
+ * When running as a service reports to service control manager
+ * that our service is started.
+ * When running as a console application enables console handler that will
+ * trigger PIPE_EVENT_SHUTDOWN when user closes console window
+ * or presses Ctrl+C.
+ * This function should be called just before entering main loop.
+ */
+void
+win32_app_started(void);
+
+/**
+ * When running as a service reports to service control manager
+ * that our service is about to stop.
+ * When running as a console application enables console handler that will
+ * catch all shutdown requests and ignore them.
+ * This function should be called just after leaving main loop.
+ */
+void
+win32_app_stopping(void);
+
+#endif
#endif