diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-22 18:35:13 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:33 +0200 |
commit | 2b037bbfd58046219d9cd083ae9422b9fc200ad4 (patch) | |
tree | 20670c3ed14dfc86b65ff64ff7f53e32aa6d7d8f /include/afb/afb-dynapi.h | |
parent | a4dcf977a6b9e517a0b32949b5967a6de5064f13 (diff) |
Add wrappers for accesses to internals
Change-Id: I6144b0ab21418dc98792f0eeef695f3df0fc11d3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include/afb/afb-dynapi.h')
-rw-r--r-- | include/afb/afb-dynapi.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/afb/afb-dynapi.h b/include/afb/afb-dynapi.h index edae4915..dfdcdb24 100644 --- a/include/afb/afb-dynapi.h +++ b/include/afb/afb-dynapi.h @@ -19,6 +19,21 @@ #include "afb-dynapi-itf.h" +static inline const char *afb_dynapi_name(struct afb_dynapi *dynapi) +{ + return dynapi->apiname; +} + +static inline void *afb_dynapi_get_userdata(struct afb_dynapi *dynapi) +{ + return dynapi->userdata; +} + +static inline void afb_dynapi_set_userdata(struct afb_dynapi *dynapi, void *userdata) +{ + dynapi->userdata = userdata; +} + /* * Send a message described by 'fmt' and following parameters * to the journal for the verbosity 'level'. @@ -188,7 +203,7 @@ static inline void afb_dynapi_call( const char *api, const char *verb, struct json_object *args, - void (*callback)(void*closure, int status, struct json_object *result, struct afb_dynapi *dynapi), + void (*callback)(void *closure, int status, struct json_object *result, struct afb_dynapi *dynapi), void *callback_closure) { dynapi->itf->call(dynapi, api, verb, args, callback, callback_closure); |