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-12-13 15:02:55 +0100
commitb647958190f979043ff44810507de4557dc73043 (patch)
tree9498eec2d0504aacb3d796b85aa52137f47a7078 /ctl-lib/ctl-plugin.c
parent3fc9254e06becfea47338ab1711600bdf4813666 (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