From 789a8ae5080bc91ab9ec3bd7760f88b5d214001c Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 8 Aug 2018 15:53:22 +0200 Subject: Adds v3 function to get binding settings Adds v3 function to get binding settings waiting the real migration of the controller to v3 Change-Id: Iece3fcbcb81de807927765097c964e3272165947 Signed-off-by: Romain Forlot --- ctl-lib/afb-definitions.h | 8 ++++++++ ctl-lib/ctl-plugin.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'ctl-lib') diff --git a/ctl-lib/afb-definitions.h b/ctl-lib/afb-definitions.h index cf84fa4..4b0f35c 100644 --- a/ctl-lib/afb-definitions.h +++ b/ctl-lib/afb-definitions.h @@ -55,6 +55,12 @@ #define AFB_ApiError(api, ...) AFB_DYNAPI_ERROR (api, __VA_ARGS__) #define AFB_ApiInfo(api, ...) AFB_DYNAPI_INFO (api, __VA_ARGS__) +#if(AFB_BINDING_VERSION == 3) + #define AFB_GetApiSettings afb_api_settings +#else + #define AFB_GetApiSettings(api) json_object_new_object() +#endif + #define AFB_ReqIsValid(request) request #define AFB_EvtIsValid(evtHandle) evtHandle @@ -112,6 +118,8 @@ #define AFB_ApiError(api, ...) AFB_ERROR (__VA_ARGS__) #define AFB_ApiInfo(api, ...) AFB_INFO (__VA_ARGS__) + #define AFB_GetApiSettings(api) json_object_new_object() + #define AFB_ReqIsValid(request) afb_req_is_valid(request) #define AFB_EvtIsValid(evtHandle) afb_event_is_valid(evtHandle) diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c index 7755f4a..cefd593 100644 --- a/ctl-lib/ctl-plugin.c +++ b/ctl-lib/ctl-plugin.c @@ -243,7 +243,7 @@ char *GetDefaultPluginSearchPath(AFB_ApiT apiHandle, const char *prefix) const char *bindingPath; const char *envDirList; size_t envDirList_len; - json_object *settings = afb_api_settings(apiHandle); + json_object *settings = AFB_GetApiSettings(apiHandle); json_object *bpath; if(json_object_object_get_ex(settings, "binding-path", &bpath)) { -- cgit 1.2.3-korg