summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-03-31 16:11:07 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-03-31 16:14:02 +0200
commit6797f9722dd3e5463e0f7c118397955bb59a40c7 (patch)
tree05f6aaf980d4080f871fc368509ff0156eaaec3b /bindings
parent20ea5089d0e5526afaa5231f30add7b25b2499bd (diff)
Factorize common code for handling requests
The common code for session handling is shared using struct afb_xreq. At the moment only hreq leverages the new feature. The objective is double: make the work of writing new internal requests more easy and prepare to check permissions. Change-Id: If3ca311d68c2d8c427d1125f31a2704b150c2c94 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/samples/HelloWorld.c6
-rw-r--r--bindings/samples/export.map2
2 files changed, 7 insertions, 1 deletions
diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c
index 9e14befa..cb4a5a4a 100644
--- a/bindings/samples/HelloWorld.c
+++ b/bindings/samples/HelloWorld.c
@@ -245,6 +245,11 @@ static void eventpush (struct afb_req request)
afb_req_success(request, NULL, NULL);
}
+static void exitnow (struct afb_req request)
+{
+ exit(0);
+}
+
// NOTE: this sample does not use session to keep test a basic as possible
// in real application most APIs should be protected with AFB_SESSION_CHECK
static const struct afb_verb_desc_v1 verbs[]= {
@@ -260,6 +265,7 @@ static const struct afb_verb_desc_v1 verbs[]= {
{"eventsub", AFB_SESSION_NONE, eventsub , "subscribes to the event of 'tag'"},
{"eventunsub",AFB_SESSION_NONE, eventunsub , "unsubscribes to the event of 'tag'"},
{"eventpush", AFB_SESSION_NONE, eventpush , "pushs the event of 'tag' with the 'data'"},
+ {"exit", AFB_SESSION_NONE, exitnow , "exits from afb-daemon"},
{NULL}
};
diff --git a/bindings/samples/export.map b/bindings/samples/export.map
index 0ef1ac79..ee2f4133 100644
--- a/bindings/samples/export.map
+++ b/bindings/samples/export.map
@@ -1 +1 @@
-{ global: afbBindingV1Register; local: *; };
+{ global: afbBindingV*; local: *; };