From 6b2b09db8ee3cf88b09b59696d50b4fa2de79a72 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 11 Apr 2019 13:09:56 +0200 Subject: Reordering of sample and tutorial bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bindings/tutorials/tuto-4.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bindings/tutorials/tuto-4.c (limited to 'bindings/tutorials/tuto-4.c') diff --git a/bindings/tutorials/tuto-4.c b/bindings/tutorials/tuto-4.c new file mode 100644 index 00000000..cb909fd0 --- /dev/null +++ b/bindings/tutorials/tuto-4.c @@ -0,0 +1,29 @@ +#define AFB_BINDING_VERSION 3 +#include + +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 } +}; + + +static int init(afb_api_t api) +{ + int rc = afb_api_require_api(api, "hello", 1); + if (!rc) + rc = afb_api_call_sync(api, "hello", "ping", NULL, NULL, NULL, NULL); + return rc; +} + +const afb_binding_t afbBindingExport = { + .api = "tuto-4", + .verbs = verbs, + .init = init +}; + -- cgit 1.2.3-korg