diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-06-16 15:58:53 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-06-16 15:58:53 +0000 |
commit | 35205b9114784ff8f9f40b04f9ec8e14a250e467 (patch) | |
tree | ae8cde6b6c520e9131a980577a2ec594218ecda6 /plugins/MirLua/src/m_variables.cpp | |
parent | 6dc20e70f308daee742372a7978c1f65668186f3 (diff) |
oops
git-svn-id: http://svn.miranda-ng.org/main/trunk@14208 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_variables.cpp')
-rw-r--r-- | plugins/MirLua/src/m_variables.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_variables.cpp b/plugins/MirLua/src/m_variables.cpp new file mode 100644 index 0000000000..bb0b0d908e --- /dev/null +++ b/plugins/MirLua/src/m_variables.cpp @@ -0,0 +1,26 @@ +#include "stdafx.h"
+
+static int lua_FormatString(lua_State *L)
+{
+ ptrT format(mir_utf8decodeT(luaL_checkstring(L, 1)));
+ MCONTACT hContact = lua_tointeger(L, 2);
+
+ TCHAR *res = variables_parse(format, NULL, hContact);
+ lua_pushstring(L, T2Utf(res));
+
+ return 1;
+}
+
+static luaL_Reg variablesApi[] =
+{
+ { "FormatString", lua_FormatString },
+
+ { NULL, NULL }
+};
+
+LUAMOD_API int luaopen_m_variables(lua_State *L)
+{
+ luaL_newlib(L, variablesApi);
+
+ return 1;
+}
|