diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-17 14:51:32 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 15:02:54 +0100 |
commit | d33a2005d881c1363b3bf8b30a2e6488d245049d (patch) | |
tree | eea7479addec2dd6930d3d61714add86e8e73a3c /ctl-lib/ctl-plugin.h | |
parent | 259e48fe0e44b4ef47d2a13c37b67c063658a99c (diff) |
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.h')
-rw-r--r-- | ctl-lib/ctl-plugin.h | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |