From 2c2b13b63e510af16d3806843a022853f0740ed7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 9 Jun 2015 16:16:16 +0000 Subject: 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 --- plugins/MirLua/src/mlua.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/MirLua/src/mlua.cpp') 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) -- cgit v1.2.3