summaryrefslogtreecommitdiff
path: root/daemon.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.h')
-rw-r--r--daemon.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/daemon.h b/daemon.h
new file mode 100644
index 0000000..d3ea5d0
--- /dev/null
+++ b/daemon.h
@@ -0,0 +1,29 @@
+#ifndef DAEMON_H_
+#define DAEMON_H_
+
+#include "common.h"
+
+/**
+ * Functions related to client-daemon IPC over a unix-domain socket.
+ */
+
+/* Servers symbols */
+extern int daemon_run;
+
+/**
+ * Allocate a cybd streamer and kickstart the cybd daemon even loop. This
+ * function is blocking and thread-unsafe due to its interaction with the global
+ * daemon_run variable. This function returns 0 on success or -1 on failure.
+ */
+int daemon_start (int fd, const struct StreamerOpt *opts);
+
+/* Client symbols */
+int daemon_push (int fd, const char *track, unsigned int index);
+int daemon_pop (int fd, unsigned int index);
+int daemon_skip (int fd);
+int daemon_pause (int fd);
+int daemon_resume (int fd);
+int daemon_kill (int fd);
+int daemon_query (int fd, struct StateInfo *entries);
+
+#endif // DAEMON_H_