lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Rodrigo Araújo wrote:

 19 static void openstdlibs( lua_State *l )
 20 {
 21     const luaL_reg *lib = lualibs;
 22     for (; lib->func; lib++)
 23     {
 24         lib->func(l);
 25         lua_settop(l, 0);
 26     }
 27 }
You shouldn't call the luaopen_* functions directly.. you need to do a lua_pushcfunction, lua_call (or lua_pcall) series...

You could use luaL_openlibs, which makes this function a one-liner...