aboutsummaryrefslogtreecommitdiff
path: root/src/ipc.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-21 20:16:43 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-21 20:16:43 +0100
commitd2f5deb27816889cdc9b25e868557f0bcd23e163 (patch)
treeb5709f59f5b5d0fe7c2735f01e79ffe5d6df2844 /src/ipc.h
parentcf7f3127cbde7354f1b592af0d23de4d7cd1123f (diff)
downloadimv-d2f5deb27816889cdc9b25e868557f0bcd23e163.tar.gz
Improve header commenting
Diffstat (limited to 'src/ipc.h')
-rw-r--r--src/ipc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ipc.h b/src/ipc.h
index 539b684..3b93bc3 100644
--- a/src/ipc.h
+++ b/src/ipc.h
@@ -3,17 +3,29 @@
#include <unistd.h>
+/* imv_ipc provides a listener on a unix socket that listens for commands.
+ * When a command is received, a callback function is called.
+ */
struct imv_ipc;
+/* Creates an imv_ipc instance */
struct imv_ipc *imv_ipc_create(void);
+/* Cleans up an imv_ipc instance */
void imv_ipc_free(struct imv_ipc *ipc);
typedef void (*imv_ipc_callback)(const char *command, void *data);
+/* When a command is received, imv_ipc will call the callback function passed
+ * in. Only one callback function at a time can be connected. The data argument
+ * is passed back to the callback to allow for context passing
+ */
void imv_ipc_set_command_callback(struct imv_ipc *ipc,
imv_ipc_callback callback, void *data);
+/* Given a pid, emits the path of the unix socket that would connect to an imv
+ * instance with that pid
+ */
void imv_ipc_path(char *buf, size_t len, int pid);
#endif