From 1815e1619cdcbb3957183ab4b8fc52157d5e9111 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 5 Sep 2015 18:32:39 +0000 Subject: MirLua: added GetFullPath to m_core git-svn-id: http://svn.miranda-ng.org/main/trunk@15278 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_core.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins/MirLua') diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 91fe4df070..6a5b4cb2d0 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -201,6 +201,16 @@ static int lua_ReplaceVariables(lua_State *L) return 1; } +static int lua_GetFullPath(lua_State *L) +{ + TCHAR path[MAX_PATH]; + GetModuleFileName(NULL, path, MAX_PATH); + + lua_pushstring(L, ptrA(mir_utf8encodeT(path))); + + return 1; +} + luaL_Reg coreApi[] = { { "CreateHookableEvent", lua_CreateHookableEvent }, @@ -225,6 +235,8 @@ luaL_Reg coreApi[] = { "Translate", lua_Translate }, { "ReplaceVariables", lua_ReplaceVariables }, + { "GetFullPath", lua_GetFullPath }, + { "NULL", NULL }, { "INVALID_HANDLE_VALUE", NULL }, -- cgit v1.2.3