summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-11-23 19:00:23 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-19 16:36:30 +0100
commitb0aefc9f2a19a191cbd98645652ecb32603ee040 (patch)
tree2c5da3905257ad8a6e26540e684bc0350a12fc77 /ctl-lib/ctl-plugin.c
parentaf3ab411784f88f8f80dc1bb6b8ab17d6643bd91 (diff)
Get back lua2c functions parsed at plugin load
Format JSON unpack operations Change-Id: Iaed0988d8536ad1df60a32a610e69e35485fc9f8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index 11df1e3..557f85e 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -36,7 +36,10 @@ PUBLIC int PluginGetCB (AFB_ApiT apiHandle, CtlActionT *action , json_object *ca
goto OnErrorExit;
}
- int err = wrap_json_unpack(callbackJ, "{ss,ss,s?s,s?o!}", "plugin", &plugin, "function", &function, "args", &argsJ);
+ int err = wrap_json_unpack(callbackJ, "{ss,ss,s?s,s?o!}",
+ "plugin", &plugin,
+ "function", &function,
+ "args", &argsJ);
if (err) {
AFB_ApiError(apiHandle, "PluginGet missing plugin|function|[args] in %s", json_object_get_string(callbackJ));
goto OnErrorExit;
@@ -86,10 +89,14 @@ STATIC int PluginLoadOne (AFB_ApiT apiHandle, CtlPluginT *ctlPlugin, json_object
// plugin initialises at 1st load further init actions should be place into onload section
if (!pluginJ) return 0;
- int err = wrap_json_unpack(pluginJ, "{ss,s?s,s?s,s?s !}",
- "uid", &ctlPlugin->uid, "info", &ctlPlugin->info, "ldpath", &ldSearchPath, "basename", &basename);
+ int err = wrap_json_unpack(pluginJ, "{ss,s?s,s?s,s?s,s?o !}",
+ "uid", &ctlPlugin->uid,
+ "info", &ctlPlugin->info,
+ "ldpath", &ldSearchPath,
+ "basename", &basename,
+ "lua2c", &lua2csJ);
if (err) {
- AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing uid|[info]|[basename]|[ldpath] in:\n-- %s", json_object_get_string(pluginJ));
+ AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing uid|[info]|basename|ldpath|[lua2c] in:\n-- %s", json_object_get_string(pluginJ));
goto OnErrorExit;
}