From 1a1043fcf64dc9b9424b94cbf3bf36758e4c95b9 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 14 Jun 2018 17:16:56 +0200 Subject: Adjust to compile with incoming bindings v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0a3a1db6dacf017ecea5b91dc35eb3ec2d86515d Signed-off-by: José Bollo --- ctl-lib/afb-definitions.h | 10 +++++----- ctl-lib/ctl-lua.c | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ctl-lib') diff --git a/ctl-lib/afb-definitions.h b/ctl-lib/afb-definitions.h index c85bed2..d621f27 100644 --- a/ctl-lib/afb-definitions.h +++ b/ctl-lib/afb-definitions.h @@ -28,10 +28,10 @@ #define AFB_BINDING_PREV3 #define AFB_ReqNone NULL - typedef afb_request* AFB_ReqT; - typedef afb_dynapi* AFB_ApiT; + typedef struct afb_request* AFB_ReqT; + typedef struct afb_dynapi* AFB_ApiT; - typedef afb_eventid* AFB_EventT; + typedef struct afb_eventid* AFB_EventT; #define AFB_EventIsValid(eventid) eventid #define AFB_EventPush afb_eventid_push #define AFB_ReqSubscribe afb_request_subscribe @@ -86,11 +86,11 @@ #define AFB_BINDING_VERSION 2 #include - typedef afb_req AFB_ReqT; + typedef struct afb_req AFB_ReqT; typedef void* AFB_ApiT; #define AFB_ReqNone (struct afb_req){0,0} - typedef afb_event AFB_EventT; + typedef struct afb_event AFB_EventT; #define AFB_EventPush afb_event_push #define AFB_ReqSubscribe afb_req_subscribe #define AFB_EventIsValid(event) afb_event_is_valid(event) diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c index 7e66e2c..cd3838f 100644 --- a/ctl-lib/ctl-lua.c +++ b/ctl-lib/ctl-lua.c @@ -277,10 +277,12 @@ static int LuaFormatMessage(lua_State* luaState, int verbosity, int level) { return 1; // if log level low then silently ignore message -#ifdef AFB_BINDING_PREV3 +#ifndef AFB_BINDING_PREV3 + if (afb_get_verbosity() < verbosity) return 0; +#elif !defined(AFB_BINDING_INTERFACE_VERSION) if (source->api->verbosity < verbosity) return 0; #else - if (afb_get_verbosity() < verbosity) return 0; + if (!afb_dynapi_wants_log_level(source->api, level)) return 0; #endif json_object *responseJ = LuaPopArgs(source, luaState, LUA_FIST_ARG + 1); -- cgit 1.2.3-korg