X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-req.h;h=af33108cafcb452f5912765e7b86997fa26c842b;hb=9d8929c12cb52809e03ba7dda2657a91124ff276;hp=71dd31d1d4bf08bd7bf3fc043dd9c477b4fcc6e0;hpb=e0fa1cdd56ffb97fedc3ba8df482a14323d876c7;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-req.h b/include/afb/afb-req.h index 71dd31d1..af33108c 100644 --- a/include/afb/afb-req.h +++ b/include/afb/afb-req.h @@ -30,6 +30,14 @@ struct afb_req struct afb_request *closure; /* the closure argument for functions of 'itf' */ }; +/* + * Converts the 'req' to an afb_request. + */ +static inline struct afb_request *afb_req_to_request(struct afb_req req) +{ + return req.closure; +} + /* * Checks whether the request 'req' is valid or not. * @@ -412,3 +420,14 @@ static inline char *afb_req_get_application_id(struct afb_req req) return req.itf->get_application_id(req.closure); } +/* + * Get the user identifier (UID) of the client application for the + * request 'req'. + * + * Returns -1 when the application can not be identified. + */ +static inline int afb_req_get_uid(struct afb_req req) +{ + return req.itf->get_uid(req.closure); +} +