diff --git a/lua/uloop.c b/lua/uloop.c index 7a73f16..9465bf4 100644 --- a/lua/uloop.c +++ b/lua/uloop.c @@ -67,7 +67,7 @@ ul_create_userdata(lua_State *L, size_t size, const luaL_Reg *reg, lua_CFunction lua_pushvalue(L, -1); lua_setmetatable(L, -3); lua_pushvalue(L, -2); - luaI_openlib(L, NULL, reg, 1); + luaL_openlib(L, NULL, reg, 1); lua_pushvalue(L, -2); return ret; @@ -351,8 +351,8 @@ static int ul_process(lua_State *L) if (pid == 0) { /* child */ - int argn = lua_objlen(L, -3); - int envn = lua_objlen(L, -2); + int argn = lua_rawlen(L, -3); + int envn = lua_rawlen(L, -2); char** argp = malloc(sizeof(char*) * (argn + 2)); char** envp = malloc(sizeof(char*) * (envn + 1)); int i = 1; @@ -597,7 +597,7 @@ static int ul_end(lua_State *L) return 1; } -static luaL_reg uloop_func[] = { +static luaL_Reg uloop_func[] = { {"init", ul_init}, {"run", ul_run}, {"timer", ul_timer},