Re: Lua C Require problem
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua C Require problem
- From: Thomas Harning <harningt@...>
- Date: 2007年12月19日 11:25:28 -0500
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...