Refactor of the documentation
[src/app-framework-binder.git] / bindings / tutorial / tuto-1.c
diff --git a/bindings/tutorial/tuto-1.c b/bindings/tutorial/tuto-1.c
new file mode 100644 (file)
index 0000000..433a4eb
--- /dev/null
@@ -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
+};
+