aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-30 17:09:23 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-31 10:16:41 +0100
commit809495144f97fbc9e6dc98fdf71af6a413577982 (patch)
tree9498eec2d0504aacb3d796b85aa52137f47a7078 /ctl-lib/ctl-plugin.c
parent871bd64410e2a1a2b20d6d89a456a951e0370dd2 (diff)
Retrieve plugin list from api rather than a global
Change-Id: Iba7c564eea48495c76de8ca919725a2e4b332fd6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index a632450..8eea0e0 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -37,6 +37,9 @@ int PluginGetCB (AFB_ApiT apiHandle, CtlActionT *action , json_object *callbackJ
json_object *argsJ;
int idx;
+ CtlConfigT *ctlConfig = (CtlConfigT *) AFB_ApiGetUserData(apiHandle);
+ CtlPluginT *ctlPlugins = ctlConfig->ctlPlugins;
+
if (!ctlPlugins) {
AFB_ApiError(apiHandle, "PluginGetCB plugin section missing cannot call '%s'", json_object_get_string(callbackJ));
return 1;
@@ -415,6 +418,8 @@ int PluginConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pluginsJ
int idx = 0, jdx = 0;
int pluginNb = 0, newPluginsNb = 0, totalPluginNb = 0;
+ CtlConfigT *ctlConfig = (CtlConfigT *) AFB_ApiGetUserData(apiHandle);
+ CtlPluginT *ctlPlugins = ctlConfig->ctlPlugins;
if (ctlPlugins)
{
// There is something to add let that happens