From 325e6a7f034c80562096d60ab01f2e4532eea98c Mon Sep 17 00:00:00 2001 From: José Bollo Date: Fri, 22 Sep 2017 14:42:14 +0200 Subject: Make single afb_request_subcall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8cc96ef9c05781069f07b807bc6632d13668ac69 Signed-off-by: José Bollo --- include/afb/afb-request-itf.h | 9 +++++++++ include/afb/afb-request.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/afb/afb-request-itf.h b/include/afb/afb-request-itf.h index a5c3f82a..9e55a361 100644 --- a/include/afb/afb-request-itf.h +++ b/include/afb/afb-request-itf.h @@ -171,5 +171,14 @@ struct afb_request_itf int (*unsubscribe_eventid)( struct afb_request *request, struct afb_eventid *eventid); + + void (*subcall_request)( + struct afb_request *request, + const char *api, + const char *verb, + struct json_object *args, + void (*callback)(void*, int, struct json_object*, struct afb_request *request), + void *cb_closure); + }; diff --git a/include/afb/afb-request.h b/include/afb/afb-request.h index acfb7ea1..26b2ef11 100644 --- a/include/afb/afb-request.h +++ b/include/afb/afb-request.h @@ -274,9 +274,9 @@ static inline int afb_request_unsubscribe(struct afb_request *request, struct af * - 'afb_request_subcall_req' that is convenient to keep request alive automatically. * - 'afb_request_subcall_sync' the synchronous version */ -static inline void afb_request_subcall(struct afb_request *request, const char *api, const char *verb, struct json_object *args, void (*callback)(void *closure, int iserror, struct json_object *result), void *closure) +static inline void afb_request_subcall(struct afb_request *request, const char *api, const char *verb, struct json_object *args, void (*callback)(void *closure, int iserror, struct json_object *result, struct afb_request *request), void *closure) { - request->itf->subcall(request, api, verb, args, callback, closure); + request->itf->subcall_request(request, api, verb, args, callback, closure); } /* -- cgit 1.2.3-korg