summaryrefslogtreecommitdiffstats
path: root/include/afb
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-05-27 23:43:24 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-05-27 23:43:24 +0200
commiteaab2fbbed4601415b5be052b39a0c0df11fdc38 (patch)
tree706090ded2817ee44c042f3d1dc0d9698de19876 /include/afb
parent13b6d9bb553e996f76bc5f9bb1d9f7094e0e104b (diff)
improves documentation
Change-Id: Ia86f95ee852ca0cc419b2fe6e796621e358c8b29 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include/afb')
-rw-r--r--include/afb/afb-plugin.h4
-rw-r--r--include/afb/afb-req-itf.h16
2 files changed, 20 insertions, 0 deletions
diff --git a/include/afb/afb-plugin.h b/include/afb/afb-plugin.h
index 3d16c7ad..2b065b08 100644
--- a/include/afb/afb-plugin.h
+++ b/include/afb/afb-plugin.h
@@ -212,6 +212,10 @@ static inline struct sd_bus *afb_daemon_get_system_bus(struct afb_daemon daemon)
* Broadcasts widely the event of 'name' with the data 'object'.
* 'object' can be NULL.
* 'daemon' MUST be the daemon given in interface when activating the plugin.
+ *
+ * For conveniency, 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.
*/
static inline void afb_daemon_broadcast_event(struct afb_daemon daemon, const char *name, struct json_object *object)
{
diff --git a/include/afb/afb-req-itf.h b/include/afb/afb-req-itf.h
index 5767c853..f4fab551 100644
--- a/include/afb/afb-req-itf.h
+++ b/include/afb/afb-req-itf.h
@@ -130,6 +130,10 @@ static inline struct json_object *afb_req_json(struct afb_req req)
* The status of the reply is automatically set to "success".
* 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'.
+ * Thus, in the case where 'obj' should remain available after
+ * the function returns, the function 'json_object_get' shall be used.
*/
static inline void afb_req_success(struct afb_req req, struct json_object *obj, const char *info)
{
@@ -139,6 +143,10 @@ static inline void afb_req_success(struct afb_req req, struct json_object *obj,
/*
* 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'.
+ * Thus, in the case where 'obj' should remain available after
+ * the function returns, the function 'json_object_get' shall be used.
*/
static inline void afb_req_success_f(struct afb_req req, struct json_object *obj, const char *info, ...)
{
@@ -160,6 +168,10 @@ static inline void afb_req_success_f(struct afb_req req, struct json_object *obj
* Note that calling afb_req_fail("success", info) is equivalent
* to call afb_req_success(NULL, info). Thus even if possible it
* is strongly recommanded to NEVER use "success" for status.
+ *
+ * For conveniency, 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.
*/
static inline void afb_req_fail(struct afb_req req, const char *status, const char *info)
{
@@ -169,6 +181,10 @@ static inline void afb_req_fail(struct afb_req req, const char *status, const ch
/*
* 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'.
+ * Thus, in the case where 'obj' should remain available after
+ * the function returns, the function 'json_object_get' shall be used.
*/
static inline void afb_req_fail_f(struct afb_req req, const char *status, const char *info, ...)
{