diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-22 15:59:48 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:33 +0200 |
commit | f30be1ca9ce04cfab55b9e6ce25cec6952f7e21d (patch) | |
tree | 88a0d681faa3604202cfbda4a94584b950ec4a74 /include/afb | |
parent | 9a304ebddac4deb4992ea931ea1131b639798b3b (diff) |
Add a closure argument to dynamic verbs
Also demonstrate the mix of api v2 with dynapi.
Change-Id: I95e8d32ac836590ce3f7b3f0b5f29e5574808976
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include/afb')
-rw-r--r-- | include/afb/afb-dynapi-itf.h | 1 | ||||
-rw-r--r-- | include/afb/afb-dynapi.h | 3 | ||||
-rw-r--r-- | include/afb/afb-request-itf.h | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/include/afb/afb-dynapi-itf.h b/include/afb/afb-dynapi-itf.h index dd291ae8..38978a29 100644 --- a/include/afb/afb-dynapi-itf.h +++ b/include/afb/afb-dynapi-itf.h @@ -140,6 +140,7 @@ struct afb_dynapi_itf const char *verb, const char *info, void (*callback)(struct afb_request *request), + void *vcbdata, const struct afb_auth *auth, uint32_t session); diff --git a/include/afb/afb-dynapi.h b/include/afb/afb-dynapi.h index 3d7c1469..edae4915 100644 --- a/include/afb/afb-dynapi.h +++ b/include/afb/afb-dynapi.h @@ -245,10 +245,11 @@ static inline int afb_dynapi_add_verb( const char *verb, const char *info, void (*callback)(struct afb_request *request), + void *vcbdata, const struct afb_auth *auth, uint32_t session) { - return dynapi->itf->api_add_verb(dynapi, verb, info, callback, auth, session); + return dynapi->itf->api_add_verb(dynapi, verb, info, callback, vcbdata, auth, session); } diff --git a/include/afb/afb-request-itf.h b/include/afb/afb-request-itf.h index b9e4366a..eb7c5347 100644 --- a/include/afb/afb-request-itf.h +++ b/include/afb/afb-request-itf.h @@ -53,6 +53,10 @@ struct afb_request /* current dynapi if dynapi (is NULL for bindings v1 and v2) */ struct afb_dynapi *dynapi; + + /* closure associated with the callback processing the verb of the request + * as given at its declaration */ + void *vcbdata; }; /* |