summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-22 09:01:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-22 09:01:42 +0000
commit8be4814cca3be42be785da6a366f3da978a4ab72 (patch)
tree2f21fb9ec763c8e7ca6eb16e09aaf7191868a0b1 /plugins/MirLua/src/m_core.cpp
parent655ac8423ddf001b8d3021e41e7297d7e3e20510 (diff)
MirLua: refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@14321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp12
1 files changed, 11 insertions, 1 deletions
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