Fix rpm packaging following review 20926
[src/app-framework-binder.git] / bindings / tutorials / tuto-4.c
1 #define AFB_BINDING_VERSION 3
2 #include <afb/afb-binding.h>
3
4 void hello(afb_req_t req)
5 {
6         AFB_REQ_DEBUG(req, "hello world");
7         afb_req_reply(req, NULL, NULL, "hello world");
8 }
9
10 const afb_verb_t verbs[] = {
11         { .verb="hello", .callback=hello },
12         { .verb=NULL }
13 };
14
15
16 static int init(afb_api_t api)
17 {
18         int rc = afb_api_require_api(api, "hello", 1);
19         if (!rc)
20                 rc = afb_api_call_sync(api, "hello", "ping", NULL, NULL, NULL, NULL);
21         return rc;
22 }
23
24 const afb_binding_t afbBindingExport = {
25         .api = "tuto-4",
26         .verbs = verbs,
27         .init = init
28 };
29