X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-binding.hpp;h=5942f76c9ef616d20a0abde55d7ee125651ab9f4;hb=a3245aed48dca435b437089bc81353da352fc0ce;hp=6e062b2ec20a92426aa8db50d5c368883ca225d0;hpb=271bb6fc606fc5068a7b7a8f22b0052aca2fb900;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-binding.hpp b/include/afb/afb-binding.hpp index 6e062b2e..5942f76c 100644 --- a/include/afb/afb-binding.hpp +++ b/include/afb/afb-binding.hpp @@ -220,6 +220,8 @@ public: bool has_permission(const char *permission) const; char *get_application_id() const; + + int get_uid() const; }; /*************************************************************************/ @@ -403,6 +405,11 @@ inline char *req::get_application_id() const return req_.itf->get_application_id(req_.closure); } +inline int req::get_uid() const +{ + return req_.itf->get_uid(req_.closure); +} + /* commons */ inline struct sd_event *get_event_loop() { return afb_daemon_get_event_loop_v2(); } @@ -578,7 +585,7 @@ constexpr afb_verb_v2 verbend() return r; } -const afb_binding_v2 binding(const char *name, const struct afb_verb_v2 *verbs, const char *info = nullptr, int (*init)() = nullptr, const char *specification = nullptr, void (*onevent)(const char*, struct json_object*) = nullptr, bool noconcurrency = false, int (*preinit)() = nullptr) +constexpr afb_binding_v2 binding(const char *name, const struct afb_verb_v2 *verbs, const char *info = nullptr, int (*init)() = nullptr, const char *specification = nullptr, void (*onevent)(const char*, struct json_object*) = nullptr, bool noconcurrency = false, int (*preinit)() = nullptr) { afb_binding_v2 r = { 0, 0, 0, 0, 0, 0, 0, 0 }; r.api = name;