X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-req.h;h=77153ef1bf11a97d3614fb4f31deb86d5c25329d;hb=a708fcbcb234af8ffe69d04786e44472b45f3559;hp=6f98e900c31c9d96653ed1c058236af050a864cc;hpb=be63003e3f1841b43614f0e11b0a291e11f1dad1;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-req.h b/include/afb/afb-req.h index 6f98e900..77153ef1 100644 --- a/include/afb/afb-req.h +++ b/include/afb/afb-req.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,19 +17,9 @@ #pragma once -#include "afb-request-itf.h" - +#include "afb-req-itf.h" #include "afb-event.h" -/* - * Describes the request by bindings from afb-daemon - */ -struct afb_req -{ - const struct afb_request_itf *itf; /* the interface to use */ - struct afb_request *closure; /* the closure argument for functions of 'itf' */ -}; - /* * Converts the 'req' to an afb_request. */ @@ -420,3 +410,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); +} +