Reordering of sample and tutorial bindings
[src/app-framework-binder.git] / bindings / tutorials / tuto-app1.c
1 #include <stdio.h>
2
3 #define AFB_BINDING_VERSION 3
4 #include <afb/afb-binding.h>
5
6 static int appmain(void *arg)
7 {
8         const char *name = arg;
9         char buffer[50];
10
11         AFB_API_NOTICE(afbBindingV3root, "Entering Application main");
12         printf("Hello, I'm %s!\n", name);
13         printf("What's your name? ");
14         scanf("%s", buffer);
15         printf("Hi %s! Nice to meet you. OOOOPS I'm late bye bye\n", buffer);
16         return 0;
17 }
18
19 static void application(int signum, void *arg)
20 {
21         if (signum)
22                 exit(127);
23         exit(appmain(arg));
24 }
25
26 int afbBindingV3entry(struct afb_api_x3 *rootapi)
27 {
28         return afb_api_queue_job(rootapi, application, "BOB", NULL, 0);
29 }
30