From 55ca0ecfa502004ebb473cb5997d9985c0547d33 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 14 Jan 2016 18:32:22 +0000 Subject: MirLua: - added Version in m_core - reworked m_schedule, pt.2 git-svn-id: http://svn.miranda-ng.org/main/trunk@16090 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_core.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (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 1c39729333..d75f0435a0 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -283,6 +283,8 @@ luaL_Reg coreApi[] = { "GetFullPath", core_GetFullPath }, + { "Version", NULL }, + { "NULL", NULL }, { "INVALID_HANDLE_VALUE", NULL }, { "CALLSERVICE_NOTFOUND", NULL }, @@ -299,6 +301,12 @@ LUAMOD_API int luaopen_m_core(lua_State *L) lua_setfield(L, -2, "INVALID_HANDLE_VALUE"); lua_pushinteger(L, CALLSERVICE_NOTFOUND); lua_setfield(L, -2, "CALLSERVICE_NOTFOUND"); + + char version[128]; + CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(version), (LPARAM)version); + lua_pushstring(L, ptrA(mir_utf8encode(version))); + lua_setfield(L, -2, "Version"); + // set copy to global variable m lua_pushvalue(L, -1); lua_setglobal(L, "m"); -- cgit v1.2.3