summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-11 21:40:06 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-11 21:40:06 +0000
commit42e279369af861f61b08919650c10749191328cb (patch)
treefe7a574fc7a2d38efbf808ad65b114175751ebb1 /plugins
parent11273c19170670e042fc1deebef7a3efbc31d5cf (diff)
MirLua: added MirLua: added ReplaceVariables to core module
git-svn-id: http://svn.miranda-ng.org/main/trunk@14128 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirLua/src/m_core.cpp17
-rw-r--r--plugins/MirLua/src/mlua.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 25d43a4964..e4c90da074 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -187,10 +187,20 @@ static int lua_CallService(lua_State *L)
static int lua_Translate(lua_State *L)
{
- char *value = (char*)luaL_checkstring(L, 1);
+ char *what = (char*)luaL_checkstring(L, 1);
- ptrT string(mir_utf8decodeT(value, NULL));
- lua_pushstring(L, T2Utf(TranslateTS(string)));
+ ptrT value(mir_utf8decodeT(what, NULL));
+ lua_pushstring(L, T2Utf(TranslateTS(value)));
+
+ return 1;
+}
+
+static int lua_ReplaceVariables(lua_State *L)
+{
+ char *what = (char*)luaL_checkstring(L, 1);
+
+ ptrT value(mir_utf8decodeT(what, NULL));
+ lua_pushstring(L, T2Utf(VARST(value)));
return 1;
}
@@ -214,6 +224,7 @@ luaL_Reg CMLua::coreLib[] =
{ "CallService", lua_CallService },
{ "Translate", lua_Translate },
+ { "ReplaceVariables", lua_ReplaceVariables },
{ NULL, NULL }
};
diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h
index 3f897e085a..5f061702ae 100644
--- a/plugins/MirLua/src/mlua.h
+++ b/plugins/MirLua/src/mlua.h
@@ -5,7 +5,7 @@ class CMLua
{
private:
lua_State *L;
- static luaL_Reg coreLib[13];
+ static luaL_Reg coreLib[14];
void Preload(const char *name, lua_CFunction func);