aboutsummaryrefslogtreecommitdiff
path: root/ui_ipc.h
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2015-10-26 00:30:52 +0100
committertoni <toni@devlap.local>2015-11-02 13:10:59 +0100
commit1c8d37efdba437ab42d3d14257b7eb6adf7f2e4f (patch)
treee081f761a89ce2640c42c7e0649c0230c1651b7a /ui_ipc.h
parent659f5274b607a1d8da3e3b30662442de764e9d7a (diff)
exported UI IPC
Diffstat (limited to 'ui_ipc.h')
-rw-r--r--ui_ipc.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/ui_ipc.h b/ui_ipc.h
new file mode 100644
index 0000000..2c5bcb5
--- /dev/null
+++ b/ui_ipc.h
@@ -0,0 +1,52 @@
+#ifndef UI_IPC_H
+#define UI_IPC_H 1
+
+#include "status.h"
+#include "config.h"
+
+
+enum UI_IPC_SEM {
+ SEM_RD = 0, /* UI Init done? */
+ SEM_UI, /* TUI active? */
+ SEM_IN, /* Textfield has input avail */
+ SEM_BS, /* Master process busy */
+ SEM_NUM
+};
+
+enum UI_IPC_MSQ {
+ MQ_PW = 0,
+ MQ_IF,
+ MSQ_NUM
+};
+
+
+int
+ui_ipc_init(int is_master);
+
+void
+ui_ipc_free(int is_master);
+
+int
+ui_ipc_sempost(enum UI_IPC_SEM e_sp);
+
+int
+ui_ipc_semwait(enum UI_IPC_SEM e_sp);
+
+int
+ui_ipc_semtrywait(enum UI_IPC_SEM e_sp);
+
+int
+ui_ipc_getvalue(enum UI_IPC_SEM e_sp);
+
+#ifdef SEM_TIMEDWAIT
+int
+ui_ipc_semtimedwait(enum UI_IPC_MSQ e_sp, int timeout);
+#endif
+
+int
+ui_ipc_msgsend(enum UI_IPC_MSQ e_mq, const char *msg_ptr, size_t msg_len);
+
+ssize_t
+ui_ipc_msgrecv(enum UI_IPC_MSQ e_mq, char *msg_ptr, size_t msg_len);
+
+#endif