* rename luax_initpreload() to luax_exts()

This commit is contained in:
YuLei Liao 2011-11-23 13:55:07 +08:00
parent a8240abbe2
commit 0ec47ddf38
3 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ LuaEngine::LuaEngine()
tolua_SimpleAudioEngine_open(m_state); tolua_SimpleAudioEngine_open(m_state);
tolua_prepare_ccobject_table(m_state); tolua_prepare_ccobject_table(m_state);
tolua_LuaGameInterfaces_open(m_state); tolua_LuaGameInterfaces_open(m_state);
luax_initpreload(m_state); luax_loadexts(m_state);
} }
LuaEngine::~LuaEngine() LuaEngine::~LuaEngine()

View File

@ -13,7 +13,7 @@
#include "mime.h" #include "mime.h"
#include "luasocketscripts.h" #include "luasocketscripts.h"
static luaL_Reg luax_preload_list[] = { static luaL_Reg luax_exts[] = {
{"socket.core", luaopen_socket_core}, {"socket.core", luaopen_socket_core},
{"mime.core", luaopen_mime_core}, {"mime.core", luaopen_mime_core},
{"socket", luaopen_socket}, {"socket", luaopen_socket},
@ -27,10 +27,10 @@ static luaL_Reg luax_preload_list[] = {
{NULL, NULL} {NULL, NULL}
}; };
void luax_initpreload(lua_State *L) void luax_loadexts(lua_State *L)
{ {
luaL_Reg* lib = luax_preload_list; luaL_Reg* lib = luax_exts;
luaL_findtable(L, LUA_GLOBALSINDEX, "package.preload", sizeof(luax_preload_list)/sizeof(luax_preload_list[0])-1); luaL_findtable(L, LUA_GLOBALSINDEX, "package.preload", sizeof(luax_exts)/sizeof(luax_exts[0])-1);
for (; lib->func; lib++) { for (; lib->func; lib++) {
lua_pushstring(L, lib->name); lua_pushstring(L, lib->name);
lua_pushcfunction(L, lib->func); lua_pushcfunction(L, lib->func);

View File

@ -11,6 +11,6 @@
#include "lauxlib.h" #include "lauxlib.h"
void luax_initpreload(lua_State *L); void luax_loadexts(lua_State *L);
#endif // __LUALOADEXTS_H_ #endif // __LUALOADEXTS_H_