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-app1.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 bindings/tutorials/tuto-app1.c (limited to 'bindings/tutorials/tuto-app1.c') diff --git a/bindings/tutorials/tuto-app1.c b/bindings/tutorials/tuto-app1.c new file mode 100644 index 00000000..93747cdd --- /dev/null +++ b/bindings/tutorials/tuto-app1.c @@ -0,0 +1,30 @@ +#include + +#define AFB_BINDING_VERSION 3 +#include + +static int appmain(void *arg) +{ + const char *name = arg; + char buffer[50]; + + AFB_API_NOTICE(afbBindingV3root, "Entering Application main"); + printf("Hello, I'm %s!\n", name); + printf("What's your name? "); + scanf("%s", buffer); + printf("Hi %s! Nice to meet you. OOOOPS I'm late bye bye\n", buffer); + return 0; +} + +static void application(int signum, void *arg) +{ + if (signum) + exit(127); + exit(appmain(arg)); +} + +int afbBindingV3entry(struct afb_api_x3 *rootapi) +{ + return afb_api_queue_job(rootapi, application, "BOB", NULL, 0); +} + -- cgit 1.2.3-korg