aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-action.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-14 23:21:32 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 23:34:15 +0100
commite241d7fd03df9f2c8813f3da10a3f3970c601de9 (patch)
tree8cedc7321a1d5346ee5b3968ec3a86e031686160 /ctl-lib/ctl-action.c
parent7eba3c57c97aa4cae102f4f13eaa1cfa939719c7 (diff)
Get back on track l2c functions.
Change-Id: I8425f0de60a35b4e287c8829fe72cbca80bc55df Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-action.c')
-rw-r--r--ctl-lib/ctl-action.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c
index fc25d5b..e4306f9 100644
--- a/ctl-lib/ctl-action.c
+++ b/ctl-lib/ctl-action.c
@@ -24,6 +24,8 @@
#include "ctl-config.h"
+extern CtlLua2cFuncT *ctlLua2cFunc;
+
PUBLIC int ActionLabelToIndex(CtlActionT*actions, const char* actionLabel) {
for (int idx = 0; actions[idx].uid; idx++) {
if (!strcasecmp(actionLabel, actions[idx].uid)) return idx;
@@ -56,6 +58,10 @@ PUBLIC void ActionExecUID(AFB_ReqT request, CtlConfigT *ctlConfig, const char *u
PUBLIC void ActionExecOne(CtlSourceT *source, CtlActionT* action, json_object *queryJ) {
int err = 0;
+ if(action->type == CTL_TYPE_LUA && ctlLua2cFunc->l2cCount) {
+ LuaL2cNewLib (ctlLua2cFunc->l2cFunc, ctlLua2cFunc->l2cCount);
+ }
+
switch (action->type) {
case CTL_TYPE_API:
{