aboutsummaryrefslogtreecommitdiffstats
path: root/controller/ctl-lua.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-12 00:29:28 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commitd663f702c0e4fa562783504a483dce8f362d628e (patch)
treefdb656d0467a935aa6790dd9e05d3e373606a3e1 /controller/ctl-lua.h
parent75cfbf3d0206f12422091e6479c508c69445bf4a (diff)
Progression on config parsing.
Change-Id: Idd8d8987ccabef381f6d79c1d508930a2d4bae3c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'controller/ctl-lua.h')
-rw-r--r--controller/ctl-lua.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/controller/ctl-lua.h b/controller/ctl-lua.h
index 6f2ce7d..628db7f 100644
--- a/controller/ctl-lua.h
+++ b/controller/ctl-lua.h
@@ -21,7 +21,9 @@
#ifndef _LUA_CTL_INCLUDE_
#define _LUA_CTL_INCLUDE_
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
// prefix start debug script
#ifndef CONTROL_DOSCRIPT_PRE
@@ -38,16 +40,19 @@
#define CONTROL_LUA_PATH CONTROL_CONFIG_PATH
#endif
+#define AFB_BINDING_VERSION 2
+#include <afb/afb-binding.h>
+
+#include <json-c/json.h>
// standard lua include file
-#ifdef CONTROL_SUPPORT_LUA
-#include "lua.h"
-#include "lauxlib.h"
-#include "lualib.h"
-#endif
+#include <lua.h>
+#include <lauxlib.h>
+#include <lualib.h>
#include "ctl-timer.h"
+#include "ctl-config.h"
-PUBLIC int LuaLibInit ();
+int LuaLibInit ();
typedef int (*Lua2cFunctionT)(char *funcname, json_object *argsJ);
typedef int (*Lua2cWrapperT) (lua_State* luaState, char *funcname, Lua2cFunctionT callback);
@@ -64,14 +69,14 @@ typedef enum {
} LuaDoActionT;
-PUBLIC int LuaConfigLoad();
-PUBLIC int LuaConfigExec();
-PUBLIC void LuaL2cNewLib(const char *label, luaL_Reg *l2cFunc, int count);
-PUBLIC int Lua2cWrapper(lua_State* luaState, char *funcname, Lua2cFunctionT callback);
-PUBLIC int LuaCallFunc (CtlActionT *action, json_object *queryJ) ;
-PUBLIC void ctlapi_lua_docall (afb_req request);
-PUBLIC void ctlapi_lua_dostring (afb_req request);
-PUBLIC void ctlapi_lua_doscript (afb_req request);
+int LuaConfigLoad();
+int LuaConfigExec();
+void LuaL2cNewLib(const char *label, luaL_Reg *l2cFunc, int count);
+int Lua2cWrapper(lua_State* luaState, char *funcname, Lua2cFunctionT callback);
+int LuaCallFunc (CtlActionT *action, json_object *queryJ) ;
+void ctlapi_lua_docall (afb_req request);
+void ctlapi_lua_dostring (afb_req request);
+void ctlapi_lua_doscript (afb_req request);
-#endif \ No newline at end of file
+#endif