diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lua-interface.cpp | 46 | ||||
-rw-r--r-- | src/luaidbg.c | 1 |
2 files changed, 45 insertions, 2 deletions
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp index 9da24d9..6a773f1 100644 --- a/src/lua-interface.cpp +++ b/src/lua-interface.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: lua-interface.cpp,v 1.5 2008-07-16 09:38:03 pixel Exp $ */ +/* $Id: lua-interface.cpp,v 1.6 2008-08-04 09:36:35 pixel Exp $ */ #define WIP @@ -48,6 +48,19 @@ #include "lua-interface-hc.h" +extern void static_mode (void) __attribute__ ((weak)); +extern void luaconfigfiles_init(Lua * L) __attribute__ ((weak)); +extern void luaftgl_init(Lua * L) __attribute__ ((weak)); +extern void luagl_init(Lua * L) __attribute__ ((weak)); +extern void luahandle_init(Lua * L) __attribute__ ((weak)); +extern void luahttp_init(Lua * L) __attribute__ ((weak)); +extern void lualibs_init(Lua * L) __attribute__ ((weak)); +extern void luaocci_init(Lua * L) __attribute__ ((weak)); +extern void luaregex_init(Lua * L) __attribute__ ((weak)); +extern void luasql_init(Lua * L) __attribute__ ((weak)); +extern void luatask_init(Lua * L) __attribute__ ((weak)); +extern void luaxml_init(Lua * L) __attribute__ ((weak)); + #ifdef _WIN32 #include <windows.h> @@ -279,7 +292,36 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in } break; case BASELUA_INTERFACE_LOADMODULE: - LuaLoadPlugin(L->tostring(1), L); + filename = L->tostring(); + if (static_mode) { + if (filename == "luaconfigfiles") { + luaconfigfiles_init(L); + } else if (filename == "luaftgl") { + luaftgl_init(L); + } else if (filename == "luagl") { + luagl_init(L); + } else if (filename == "luahandle") { + luahandle_init(L); + } else if (filename == "luahttp") { + luahttp_init(L); + } else if (filename == "lualibs") { + lualibs_init(L); + } else if (filename == "luaocci") { + luaocci_init(L); + } else if (filename == "luaregex") { + luaregex_init(L); + } else if (filename == "luasql") { + luasql_init(L); + } else if (filename == "luatask") { + luatask_init(L); + } else if (filename == "luaxml") { + luaxml_init(L); + } else { + L->error("lua-interface in static mode, and module unknown."); + } + } else { + LuaLoadPlugin(L->tostring(1), L); + } break; case BASELUA_INTERFACE_UNLINK: filename = L->tostring(1); diff --git a/src/luaidbg.c b/src/luaidbg.c new file mode 100644 index 0000000..f0ebee4 --- /dev/null +++ b/src/luaidbg.c @@ -0,0 +1 @@ +int static_mode = 1; |