aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-09-04 10:20:18 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-09-04 10:20:18 +0200
commitc33c8c220fae362a86d747bb5d91d02a9116d2c5 (patch)
tree19525c64cb4c842cd71e4bf9a59f533b6372a22e /ctl-lib/ctl-plugin.c
parenta185e5cf960ec2083fc45048e93a3a22a02c094f (diff)
controller: compatibility with v2
build it with AFB_BINDING_VERSION=0 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index e57fb8a..71931b8 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -24,7 +24,7 @@
#include "ctl-config.h"
-int PluginGetCB (AFB_ApiT apiHandle, CtlActionT *action , json_object *callbackJ) {
+int PluginGetCB_V3(AFB_ApiT apiHandle, CtlActionT *action , json_object *callbackJ) {
const char *plugin=NULL, *function=NULL;
json_object *argsJ;
int idx;
@@ -94,11 +94,9 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec
// store dlopen handle to enable onload action at exec time
ctlPlugin->dlHandle = dlHandle;
-#if (defined(AFB_BINDING_PREV3) || (AFB_BINDING_VERSION == 3))
// Jose hack to make verbosity visible from sharelib with API-V2
struct afb_binding_data_v2 *afbHidenData = dlsym(dlHandle, "afbBindingV2data");
if (afbHidenData) *afbHidenData = afbBindingV2data;
-#endif
// Push lua2cWrapper @ into plugin
Lua2cWrapperT *lua2cInPlug = dlsym(dlHandle, "Lua2cWrap");
@@ -401,7 +399,7 @@ static int PluginParse(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pl
return err;
}
-int PluginConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pluginsJ) {
+int PluginConfig_V3(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pluginsJ) {
int err = 0;
int idx = 0, jdx = 0;
int pluginNb = 0, newPluginsNb = 0, totalPluginNb = 0;