X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-request.h;h=f9a1bbbba7899a2571c42bfd1ec6c6ec549cc346;hb=bd10bc4405f3777fe495cb9f62818d67ab584854;hp=acfb7ea1286df09ee2629619f424d0494945fc35;hpb=ce23b9e7ff8443c46ed21804277d8db90671a3b4;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-request.h b/include/afb/afb-request.h index acfb7ea1..f9a1bbbb 100644 --- a/include/afb/afb-request.h +++ b/include/afb/afb-request.h @@ -19,7 +19,25 @@ #include "afb-request-itf.h" -typedef struct afb_request afb_request; +static inline struct afb_dynapi *afb_request_get_dynapi(struct afb_request *request) +{ + return request->dynapi; +} + +static inline void *afb_request_get_vcbdata(struct afb_request *request) +{ + return request->vcbdata; +} + +static inline const char *afb_request_get_api(struct afb_request *request) +{ + return request->api; +} + +static inline const char *afb_request_get_verb(struct afb_request *request) +{ + return request->verb; +} /* * Gets from the request 'request' the argument of 'name'. @@ -274,9 +292,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); } /* @@ -358,3 +376,14 @@ static inline char *afb_request_get_application_id(struct afb_request *request) return request->itf->get_application_id(request); } +/* + * Get the user identifier (UID) of the client for the + * request 'request'. + * + * Returns -1 when the application can not be identified. + */ +static inline int afb_request_get_uid(struct afb_request *request) +{ + return request->itf->get_uid(request); +} +