aboutsummaryrefslogtreecommitdiff
path: root/plugin_client_header.h
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-05-09 22:39:16 +0200
committertomsmeding <tom.smeding@gmail.com>2017-05-09 22:39:16 +0200
commit24de2cd600a4e108c24f6f77a5a4d30111fd9918 (patch)
treeb27f97f511fb3d6fd5ce7f8a3fad9687867dbfda /plugin_client_header.h
parenta7a0ce278e661bf5d3f2b47556d8c30469d2bd6c (diff)
server: Add plugin framework
Diffstat (limited to 'plugin_client_header.h')
-rw-r--r--plugin_client_header.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugin_client_header.h b/plugin_client_header.h
new file mode 100644
index 0000000..4428b3c
--- /dev/null
+++ b/plugin_client_header.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <stdint.h>
+
+
+enum plugin_event_type{
+ PLUGIN_EVENT_MESSAGE, // message, user, room
+ PLUGIN_EVENT_ONLINE, // user, num
+ PLUGIN_EVENT_JOIN, // user, room
+};
+
+struct plugin_event{
+ enum plugin_event_type type;
+ int64_t timestamp; // always set
+ char *message,*user,*room;
+ int64_t num;
+};
+
+
+typedef void plugin_event_func_t(const struct plugin_event *event);
+
+
+// All plugins should export a function of type plugin_init_func_t with
+// name "plugin_init_func" that returns a pointer to a function that
+// receives all events.
+plugin_event_func_t* plugin_init_func(void);