summaryrefslogtreecommitdiffstats
path: root/bindings/tutorials/tuto-1.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-04-11 13:09:56 +0200
committerJose Bollo <jose.bollo@iot.bzh>2019-04-12 10:55:54 +0200
commit6b2b09db8ee3cf88b09b59696d50b4fa2de79a72 (patch)
tree081c5ce2ad13790500dd14078d355796380539cf /bindings/tutorials/tuto-1.c
parent9cf1fcea338281f76eaac000930479b18dacef01 (diff)
Reordering of sample and tutorial bindings
The main idea here is to install the sample and tutorial bindings in specific directory. This will at the end help to package parts of the binder. It also includes a simplification of CMakeLists files. Also fix an error in packaging rpm. Bug-AGL: SPEC-2165 Change-Id: I494cc753796848cde849de1c3596893c78fa228f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'bindings/tutorials/tuto-1.c')
-rw-r--r--bindings/tutorials/tuto-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bindings/tutorials/tuto-1.c b/bindings/tutorials/tuto-1.c
new file mode 100644
index 00000000..1f58be6c
--- /dev/null
+++ b/bindings/tutorials/tuto-1.c
@@ -0,0 +1,19 @@
+#define AFB_BINDING_VERSION 3
+#include <afb/afb-binding.h>
+
+void hello(afb_req_t req)
+{
+ AFB_REQ_DEBUG(req, "hello world");
+ afb_req_reply(req, NULL, NULL, "hello world");
+}
+
+const afb_verb_t verbs[] = {
+ { .verb="hello", .callback=hello },
+ { .verb=NULL }
+};
+
+const afb_binding_t afbBindingExport = {
+ .api = "tuto-1",
+ .verbs = verbs
+};
+