diff options
Diffstat (limited to 'src/gcsd.c')
-rw-r--r-- | src/gcsd.c | 39 |
1 files changed, 38 insertions, 1 deletions
@@ -71,6 +71,43 @@ static const luaL_Reg gcsd_lualibs[] = { {NULL, NULL} }; +int init_defines(lua_State *L) +{ + lua_newtable(L); + + lua_pushliteral(L, "OK"); + lua_pushinteger(L, 0); + lua_settable(L, -3); + lua_pushliteral(L, "KILL_CLIENT"); + lua_pushinteger(L, 1); + lua_settable(L, -3); + lua_pushliteral(L, "KILL_MODULE"); + lua_pushinteger(L, 2); + lua_settable(L, -3); + lua_pushliteral(L, "KILL_MODULE_CLASS"); + lua_pushinteger(L, 3); + lua_settable(L, -3); + lua_pushliteral(L, "KILL_DAEMON"); + lua_pushinteger(L, 4); + lua_settable(L, -3); + + lua_pushliteral(L, "IN_MODULE"); + lua_pushinteger(L, 1); + lua_settable(L, -3); + lua_pushliteral(L, "OUT_MODULE"); + lua_pushinteger(L, 2); + lua_settable(L, -3); + lua_pushliteral(L, "INOUT_MODULE"); + lua_pushinteger(L, 3); + lua_settable(L, -3); + lua_pushliteral(L, "MISC_MODULE"); + lua_pushinteger(L, 4); + lua_settable(L, -3); + + lua_setglobal(L, "defines"); + return 0; +} + int init_main_loop(lua_State *L) { const luaL_Reg *lib = gcsd_lualibs; @@ -102,7 +139,7 @@ int init_main_loop(lua_State *L) return -1; } - return 0; + return init_defines(L); } int call_main_loop(lua_State* L, options_t* opt) |