aboutsummaryrefslogtreecommitdiff
path: root/src/event.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-04 16:13:52 -0400
committerDeterminant <[email protected]>2019-06-04 16:13:52 -0400
commitebada91a1327da99f1827c7e4c15fc3bee527d58 (patch)
tree904aeb2afbc54612b704f89a80c7a48953943220 /src/event.cpp
parent9f294eb2e0ae0bed8120fc34fd9782f2f0a9ac74 (diff)
more bindings
Diffstat (limited to 'src/event.cpp')
-rw-r--r--src/event.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/event.cpp b/src/event.cpp
new file mode 100644
index 0000000..050914c
--- /dev/null
+++ b/src/event.cpp
@@ -0,0 +1,24 @@
+#ifdef SALTICIDAE_CBINDINGS
+#include "salticidae/event.h"
+
+extern "C" {
+
+eventcontext_t *eventcontext_new() { return new eventcontext_t(); }
+
+void eventcontext_dispatch(eventcontext_t *self) { return self->dispatch(); }
+
+void eventcontext_stop(eventcontext_t *self) { return self->stop(); }
+
+void eventcontext_free(eventcontext_t *self) { delete self; }
+
+void sigev_new(const eventcontext_t *self, sigev_callback_t cb) {
+ return new SigEvent(*self, cb);
+}
+
+void sigev_add(sigev_t *self, int sig) { self->add(sig); }
+
+void sigev_delete() { delete self; }
+
+}
+
+#endif