From 8be4814cca3be42be785da6a366f3da978a4ab72 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 22 Jun 2015 09:01:42 +0000 Subject: MirLua: refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@14321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_core.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins/MirLua/src/m_core.cpp') diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 917694e9e7..ed30486aad 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -185,7 +185,7 @@ static int lua_ReplaceVariables(lua_State *L) return 1; } -luaL_Reg CMLua::coreLib[] = +luaL_Reg coreApi[] = { { "CreateHookableEvent", lua_CreateHookableEvent }, { "DestroyHookableEvent", lua_DestroyHookableEvent }, @@ -210,3 +210,13 @@ luaL_Reg CMLua::coreLib[] = { NULL, NULL } }; + +LUAMOD_API int luaopen_m(lua_State *L) +{ + luaL_newlib(L, coreApi); + lua_pushlightuserdata(L, NULL); + lua_setfield(L, -2, "NULL"); + lua_setglobal(L, "m"); + + return 1; +} \ No newline at end of file -- cgit v1.2.3