summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-09 16:16:16 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-09 16:16:16 +0000
commit2c2b13b63e510af16d3806843a022853f0740ed7 (patch)
tree1d0a97401251ce0f5c47ee4083b7c259e9ffc49a /plugins/MirLua/src/mlua.cpp
parent31aeb2d24674a29ea5810a7e5e2e5a7d36bf3300 (diff)
MirLua:
- added debug console - added m_clist module - added examples git-svn-id: http://svn.miranda-ng.org/main/trunk@14079 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r--plugins/MirLua/src/mlua.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp
index 04200e3777..382591e919 100644
--- a/plugins/MirLua/src/mlua.cpp
+++ b/plugins/MirLua/src/mlua.cpp
@@ -5,8 +5,9 @@ CMLua::CMLua()
L = luaL_newstate();
luaL_openlibs(L);
- luaL_newlib(L, CMLua::coreFunctions);
- lua_setglobal(L, "M");
+ luaopen_m(L);
+
+ Preload(LUA_CLISTLIBNAME, luaopen_m_clist);
}
CMLua::~CMLua()
@@ -16,7 +17,8 @@ CMLua::~CMLua()
void CMLua::Load(const char *path)
{
- luaL_dofile(L, path);
+ if (luaL_dofile(L, path))
+ printf("%s\n", lua_tostring(L, -1));
}
void CMLua::Preload(const char *name, lua_CFunction loader)