diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-11-23 19:00:23 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 15:02:54 +0100 |
commit | 6a8c9e3c36ae507eeec4176d456ae5f0ab2b2c5e (patch) | |
tree | a1022e9bd413a1832d80fb958c2ce03bdcdb24ce /ctl-lib/ctl-lua.c | |
parent | bbc7fc4588ba23bdcdb585f340d83dbbf30b994f (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-lua.c')
-rw-r--r-- | ctl-lib/ctl-lua.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c index 07b26bf..add4c0d 100644 --- a/ctl-lib/ctl-lua.c +++ b/ctl-lib/ctl-lua.c @@ -796,7 +796,11 @@ STATIC void LuaDoAction (LuaDoActionT action, AFB_ReqT request) { // extract value from query const char *target=NULL,*func=NULL; json_object *argsJ=NULL; - err= wrap_json_unpack (queryJ, "{s:s,s?s,s?s,s?o !}","target", &target,"path",&luaScriptPathJ,"function",&func,"args",&argsJ); + err= wrap_json_unpack (queryJ, "{s:s,s?s,s?s,s?o !}", + "target", &target, + "path",&luaScriptPathJ, + "function",&func, + "args",&argsJ); if (err) { AFB_ApiError(source->api, "LUA-DOSCRIPT-SYNTAX:missing target|[path]|[function]|[args] query=%s", json_object_get_string(queryJ)); goto OnErrorExit; @@ -1023,7 +1027,11 @@ STATIC int LuaTimerSet(lua_State* luaState) { goto OnErrorExit; } - int err = wrap_json_unpack(timerJ, "{ss, s?s si, si !}", "uid", &uid, "info", &info, "delay", &delay, "count", &count); + int err = wrap_json_unpack(timerJ, "{ss, s?s si, si !}", + "uid", &uid, + "info", &info, + "delay", &delay, + "count", &count); if (err) { lua_pushliteral(luaState, "LuaTimerSet: Syntax timerT={uid:xxx delay:ms, count:xx}"); |