diff options
-rw-r--r-- | controller/ctl-config.h | 3 | ||||
-rw-r--r-- | controller/ctl-plugin.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/controller/ctl-config.h b/controller/ctl-config.h index 7c3631c..590a265 100644 --- a/controller/ctl-config.h +++ b/controller/ctl-config.h @@ -49,8 +49,6 @@ extern "C" { #define CTL_PLUGIN_EXT ".ctlso" #endif - - typedef enum { CTL_TYPE_NONE=0, CTL_TYPE_API, @@ -58,7 +56,6 @@ typedef enum { CTL_TYPE_LUA, } CtlActionTypeT; - typedef struct { CtlActionTypeT type; const char* api; diff --git a/controller/ctl-plugin.c b/controller/ctl-plugin.c index 69f0f09..d982b79 100644 --- a/controller/ctl-plugin.c +++ b/controller/ctl-plugin.c @@ -35,7 +35,7 @@ typedef void *Lua2cWrapperT; #include "ctl-config.h" -static CtlPluginT *ctlPlugins=NULL; +static CtlPluginT *ctlPlugins=NULL; int PluginGetCB (CtlActionT *action , json_object *callbackJ) { const char *plugin=NULL, *function=NULL; @@ -221,12 +221,12 @@ int PluginConfig(CtlSectionT *section, json_object *pluginsJ) { if (ctlPlugins) { - int pluginsCount = (sizeof(ctlPlugins) / sizeof(CtlPluginT)) + 1; - for(int idx = 0; idx < pluginsCount; idx++) + int idx = 0; + while(ctlPlugins[idx].label != NULL) { // Jose hack to make verbosity visible from sharedlib and // be able to call verb from others api inside the binder - struct afb_binding_data_v2 *afbHidenData = dlsym(ctlPlugins[idx].dlHandle, "afbBindingV2data"); + struct afb_binding_data_v2 *afbHidenData = dlsym(ctlPlugins[idx++].dlHandle, "afbBindingV2data"); if (afbHidenData) *afbHidenData = afbBindingV2data; } return 0; |