X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=doc%2Fafb-bindings-writing.html;h=b32912b6cd0c9ce43f6b0951dbf92be34df92708;hb=b950a20afde7f8dff4b38db214120b3d1de2e10f;hp=8017e190ff69815d1ef8add128a63d60a650aaab;hpb=7059e59cddc1c81321639875636e88895bc14309;p=src%2Fapp-framework-binder.git diff --git a/doc/afb-bindings-writing.html b/doc/afb-bindings-writing.html index 8017e190..b32912b6 100644 --- a/doc/afb-bindings-writing.html +++ b/doc/afb-bindings-writing.html @@ -35,7 +35,7 @@ code > span.er { color: #ff0000; font-weight: bold; }

HOWTO WRITE a BINDING for AFB-DAEMON

José Bollo

-

23 juin 2016

+

24 juin 2016

HOWTO WRITE a BINDING for AFB-DAEMON

-
version: 1
-Date:    09 juin 2016
-Author:  José Bollo

Summary

Afb-daemon binders serve files through HTTP protocol and offers to developers the capability to expose application API methods through HTTP or WebSocket protocol.

Binder bindings are used to add API to afb-daemon. This part describes how to write a binding for afb-daemon.

@@ -321,7 +318,7 @@ Author: José Bollo * Its send the object 'obj' (can be NULL) with an * informationnal comment 'info (can also be NULL). * - * For conveniency, the function calls 'json_object_put' for 'obj'. + * For convenience, the function calls 'json_object_put' for 'obj'. * Thus, in the case where 'obj' should remain available after * the function returns, the function 'json_object_get' shall be used. */ @@ -331,7 +328,7 @@ Author: José Bollo * Same as 'afb_req_success' but the 'info' is a formatting * string followed by arguments. * - * For conveniency, the function calls 'json_object_put' for 'obj'. + * For convenience, the function calls 'json_object_put' for 'obj'. * Thus, in the case where 'obj' should remain available after * the function returns, the function 'json_object_get' shall be used. */ @@ -346,7 +343,7 @@ Author: José Bollo * to call afb_req_success(NULL, info). Thus even if possible it * is strongly recommended to NEVER use "success" for status. * - * For conveniency, the function calls 'json_object_put' for 'obj'. + * For convenience, the function calls 'json_object_put' for 'obj'. * Thus, in the case where 'obj' should remain available after * the function returns, the function 'json_object_get' shall be used. */ @@ -356,13 +353,13 @@ Author: José Bollo * Same as 'afb_req_fail' but the 'info' is a formatting * string followed by arguments. * - * For conveniency, the function calls 'json_object_put' for 'obj'. + * For convenience, the function calls 'json_object_put' for 'obj'. * Thus, in the case where 'obj' should remain available after * the function returns, the function 'json_object_get' shall be used. */ void afb_req_fail_f(struct afb_req req, const char *status, const char *info, ...);
-

For conveniency, these functions automatically call json_object_put to release obj. Because obj usage count is null after being passed to a reply function, it SHOULD not be used anymore. If exceptionally obj needs to remain usable after reply function then using json_object_get on obj to increase usage count and cancels the effect the json_object_put is possible.

+

For convenience, these functions automatically call json_object_put to release obj. Because obj usage count is null after being passed to a reply function, it SHOULD not be used anymore. If exceptionally obj needs to remain usable after reply function then using json_object_get on obj to increase usage count and cancels the effect the json_object_put is possible.

Getting argument of invocation

Many methods expect arguments. Afb-daemon's bindings retrieve arguments by name and not by position.

@@ -784,7 +781,7 @@ Author: José Bollo * 'object' can be NULL. * 'daemon' MUST be the daemon given in interface when activating the binding. * - * For conveniency, the function calls 'json_object_put' for 'object'. + * For convenience, the function calls 'json_object_put' for 'object'. * Thus, in the case where 'object' should remain available after * the function returns, the function 'json_object_get' shall be used. */