summaryrefslogtreecommitdiffstats
path: root/bindings/tutorial/tuto-1.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-06-07 18:40:00 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-06-13 00:10:51 +0200
commitf6bc48698587758fb764bae66302002fe148e978 (patch)
treea637013529c705e2c812119f9fee3005a6b2d53e /bindings/tutorial/tuto-1.c
parent279ac0a77b8689c71812af2e5e67ee9b6e4994ff (diff)
Refactor of the documentation
Diffstat (limited to 'bindings/tutorial/tuto-1.c')
-rw-r--r--bindings/tutorial/tuto-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bindings/tutorial/tuto-1.c b/bindings/tutorial/tuto-1.c
new file mode 100644
index 00000000..433a4ebb
--- /dev/null
+++ b/bindings/tutorial/tuto-1.c
@@ -0,0 +1,19 @@
+#define AFB_BINDING_VERSION 2
+#include <afb/afb-binding.h>
+
+void hello(afb_req req)
+{
+ AFB_REQ_DEBUG(req, "hello world");
+ afb_req_success(req, NULL, "hello world");
+}
+
+const afb_verb_v2 verbs[] = {
+ { .verb="hello", .callback=hello },
+ { .verb=NULL }
+};
+
+const afb_binding_v2 afbBindingV2 = {
+ .api = "tuto-1",
+ .verbs = verbs
+};
+