Commit 652a506f authored by Thaodan's avatar Thaodan

[sb2] Port to lua >=5.2. Contributes to JB#52528

parent 08f1220f
......@@ -237,7 +237,7 @@ int lua_sb_readlink(lua_State *l)
}
/* mappings from c to lua */
static const luaL_reg reg[] =
static const luaL_Reg reg[] =
{
{"log", lua_sb_log},
{"path_exists", lua_sb_path_exists},
......@@ -250,10 +250,12 @@ static const luaL_reg reg[] =
int lua_bind_sblib_functions(lua_State *l)
{
luaL_register(l, "sblib", reg);
lua_newtable(l);
luaL_setfuncs(l, reg, 0);
lua_pushliteral(l,"version");
lua_pushstring(l, "2.0" );
lua_settable(l,-3);
lua_setglobal(l, "sblib");
return 0;
}
......@@ -493,7 +493,7 @@ static int lua_sb_add_net_rule_to_ruletree(lua_State *l)
}
/* mappings from c to lua */
static const luaL_reg reg[] =
static const luaL_Reg reg[] =
{
{"objectlist_create", lua_sb_ruletree_objectlist_create_list},
{"objectlist_set", lua_sb_ruletree_objectlist_set_item},
......@@ -537,10 +537,12 @@ static const luaL_reg reg[] =
int lua_bind_ruletree_functions(lua_State *l)
{
luaL_register(l, "ruletree", reg);
lua_newtable(l);
luaL_setfuncs(l, reg, 0);
lua_pushliteral(l,"version");
lua_pushstring(l, "2.0" );
lua_settable(l,-3);
lua_setglobal(l, "ruletree");
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment