From 0ec47ddf38417d1760722c207496d25d0a0380ef Mon Sep 17 00:00:00 2001 From: YuLei Liao Date: Wed, 23 Nov 2011 13:55:07 +0800 Subject: [PATCH] * rename luax_initpreload() to luax_exts() --- lua/cocos2dx_support/LuaEngine.cpp | 2 +- lua/exts/lualoadexts.c | 8 ++++---- lua/exts/lualoadexts.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/cocos2dx_support/LuaEngine.cpp b/lua/cocos2dx_support/LuaEngine.cpp index 7d4bc9ca8a..e864711cb6 100644 --- a/lua/cocos2dx_support/LuaEngine.cpp +++ b/lua/cocos2dx_support/LuaEngine.cpp @@ -49,7 +49,7 @@ LuaEngine::LuaEngine() tolua_SimpleAudioEngine_open(m_state); tolua_prepare_ccobject_table(m_state); tolua_LuaGameInterfaces_open(m_state); - luax_initpreload(m_state); + luax_loadexts(m_state); } LuaEngine::~LuaEngine() diff --git a/lua/exts/lualoadexts.c b/lua/exts/lualoadexts.c index 4b18f5f18a..556f1be806 100644 --- a/lua/exts/lualoadexts.c +++ b/lua/exts/lualoadexts.c @@ -13,7 +13,7 @@ #include "mime.h" #include "luasocketscripts.h" -static luaL_Reg luax_preload_list[] = { +static luaL_Reg luax_exts[] = { {"socket.core", luaopen_socket_core}, {"mime.core", luaopen_mime_core}, {"socket", luaopen_socket}, @@ -27,10 +27,10 @@ static luaL_Reg luax_preload_list[] = { {NULL, NULL} }; -void luax_initpreload(lua_State *L) +void luax_loadexts(lua_State *L) { - luaL_Reg* lib = luax_preload_list; - luaL_findtable(L, LUA_GLOBALSINDEX, "package.preload", sizeof(luax_preload_list)/sizeof(luax_preload_list[0])-1); + luaL_Reg* lib = luax_exts; + luaL_findtable(L, LUA_GLOBALSINDEX, "package.preload", sizeof(luax_exts)/sizeof(luax_exts[0])-1); for (; lib->func; lib++) { lua_pushstring(L, lib->name); lua_pushcfunction(L, lib->func); diff --git a/lua/exts/lualoadexts.h b/lua/exts/lualoadexts.h index 78972f5494..c693cdcfd6 100644 --- a/lua/exts/lualoadexts.h +++ b/lua/exts/lualoadexts.h @@ -11,6 +11,6 @@ #include "lauxlib.h" -void luax_initpreload(lua_State *L); +void luax_loadexts(lua_State *L); #endif // __LUALOADEXTS_H_