summaryrefslogtreecommitdiff
path: root/src/lua-interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua-interface.cpp')
-rw-r--r--src/lua-interface.cpp73
1 files changed, 45 insertions, 28 deletions
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp
index f296351..3958ddb 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.8 2008-08-05 11:33:13 pixel Exp $ */
+/* $Id: lua-interface.cpp,v 1.9 2008-08-05 15:03:54 pixel Exp $ */
#define WIP
@@ -48,7 +48,8 @@
#include "lua-interface-hc.h"
-extern void static_mode (void) __attribute__ ((weak));
+extern "C" {
+
extern void luaconfigfiles_init(Lua * L) __attribute__ ((weak));
extern void luaftgl_init(Lua * L) __attribute__ ((weak));
extern void luagl_init(Lua * L) __attribute__ ((weak));
@@ -60,6 +61,9 @@ 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));
+extern void luaosmesa_init(Lua * L) __attribute__ ((weak));
+
+}
#ifdef _WIN32
@@ -293,32 +297,30 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in
break;
case BASELUA_INTERFACE_LOADMODULE:
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.");
- }
+ if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) {
+ luaconfigfiles_init(L);
+ } else if ((filename == "luaftgl") && (luaftgl_init != NULL)) {
+ luaftgl_init(L);
+ } else if ((filename == "luagl") && (luagl_init != NULL)) {
+ luagl_init(L);
+ } else if ((filename == "luahandle") && (luahandle_init != NULL)) {
+ luahandle_init(L);
+ } else if ((filename == "luahttp") && (luahttp_init != NULL)) {
+ luahttp_init(L);
+ } else if ((filename == "lualibs") && (lualibs_init != NULL)) {
+ lualibs_init(L);
+ } else if ((filename == "luaocci") && (luaocci_init != NULL)) {
+ luaocci_init(L);
+ } else if ((filename == "luaregex") && (luaregex_init != NULL)) {
+ luaregex_init(L);
+ } else if ((filename == "luasql") && (luasql_init != NULL)) {
+ luasql_init(L);
+ } else if ((filename == "luatask") && (luatask_init != NULL)) {
+ luatask_init(L);
+ } else if ((filename == "luaxml") && (luaxml_init != NULL)) {
+ luaxml_init(L);
+ } else if ((filename == "luaosmesa") && (luaosmesa_init != NULL)) {
+ luaosmesa_init(L);
} else {
LuaLoadPlugin(L->tostring(1), L);
}
@@ -657,6 +659,21 @@ static void * interactive_prompt(void * __L) {
return NULL;
}
+void check_exports(void) {
+ printm(M_INFO, "luaconfigfiles = %p\n", luaconfigfiles_init);
+ printm(M_INFO, "luaftgl = %p\n", luaftgl_init);
+ printm(M_INFO, "luagl = %p\n", luagl_init);
+ printm(M_INFO, "luahandle = %p\n", luahandle_init);
+ printm(M_INFO, "luahttp = %p\n", luahttp_init);
+ printm(M_INFO, "lualibs = %p\n", lualibs_init);
+ printm(M_INFO, "luaocci = %p\n", luaocci_init);
+ printm(M_INFO, "luaregex = %p\n", luaregex_init);
+ printm(M_INFO, "luasql = %p\n", luasql_init);
+ printm(M_INFO, "luatask = %p\n", luatask_init);
+ printm(M_INFO, "luaxml = %p\n", luaxml_init);
+ printm(M_INFO, "luaosmesa = %p\n", luaosmesa_init);
+}
+
virtual int startup() throw (GeneralException) {
char c;