From c3a60d631a6168b6f0d69daa6659c566eeb2b643 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 17 May 2018 14:51:32 +0200 Subject: Add AFB macros This adds a macro to be able to retrieve the rootdir fd from the binding using V2 or DynAPI version the same way. Change-Id: I4e9e805b729118944f07ccedae6cccc6b950058b Signed-off-by: Romain Forlot --- ctl-lib/ctl-plugin.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ctl-lib/ctl-plugin.h b/ctl-lib/ctl-plugin.h index 87261c5..ce310e4 100644 --- a/ctl-lib/ctl-plugin.h +++ b/ctl-lib/ctl-plugin.h @@ -74,11 +74,14 @@ extern "C" { #define AFB_RequireApi(api, ...) afb_dynapi_require_api(api, __VA_ARGS__) + #define AFB_GetEventLoop(api) afb_dynapi_get_event_loop(api) + #define AFB_RootDirGetFD(api) afb_dynapi_rootdir_get_fd(api) #define AFB_ClientCtxSet(request, replace, createCB, freeCB, handle) afb_request_context(request, replace, createCB, freeCB, handle) #define AFB_ClientCtxClear(request) afb_request_context_clear(request) + #define AFB_ReqSetLOA(request, level) afb_request_session_set_LOA(request, level) typedef struct { const char *verb; /* name of the verb, NULL only at end of the array */ @@ -130,6 +133,9 @@ extern "C" { #define AFB_RequireApi(api, ...) afb_daemon_require_api(__VA_ARGS__) #define AFB_GetEventLoop(api) afb_daemon_get_event_loop() + #define AFB_RootDirGetFD(api) afb_daemon_rootdir_get_fd() + + #define AFB_ReqSetLOA(request, level) afb_req_session_set_LOA(request, level) static inline void* AFB_ClientCtxSet(afb_req request, int replace, void *(*create_context)(void *closure), void (*free_context)(void*), void *closure) { -- cgit 1.2.3-korg