aboutsummaryrefslogtreecommitdiffstats
path: root/example/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/hello.c')
-rw-r--r--example/hello.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/example/hello.c b/example/hello.c
new file mode 100644
index 0000000..f192a52
--- /dev/null
+++ b/example/hello.c
@@ -0,0 +1,17 @@
+#include <stdlib.h>
+
+#include <cJSON.h>
+
+#include <dbs/event.h>
+#include <dbs/log.h>
+
+int hello(cJSON *data)
+{
+ char *string = cJSON_Print(data);
+ print("hello, world!");
+ print("hello data: %s", string);
+ free(string);
+
+ return 0;
+}
+declare_event(HELLO, hello);