summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-07-12 20:40:10 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-07-12 20:40:10 +0000
commitf1f08af4d7a1b4bedf55fb25af974276e5eb858c (patch)
tree70387cab585ac782ae7da679d95991f7403b3e39 /plugins/MirLua/src/m_core.cpp
parent4bf1f71a53fb90e8c87f0e0a19af6e82b280867a (diff)
MirLua:
- Utf8Decode? functions are returns strings (thx to Mironych) - added DecodeCustomButtonClickData to m_msg_buttonsbar - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@14546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 2a5564a07b..7fcbe1c2f5 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -162,30 +162,21 @@ static int lua_CallService(lua_State *L)
static int lua_Utf8DecodeA(lua_State *L)
{
- const char *string = luaL_checkstring(L, 1);
-
- char *res = mir_utf8decodeA(string);
- lua_pushlightuserdata(L, res);
-
- return 1;
+ return luaM_toansi(L);
}
static int lua_Utf8DecodeW(lua_State *L)
{
- const char *string = luaL_checkstring(L, 1);
-
- wchar_t *res = mir_utf8decodeW(string);
- lua_pushlightuserdata(L, res);
-
- return 1;
+ return luaM_toucs2(L);
}
static int lua_Free(lua_State *L)
{
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
- void *ptr = lua_touserdata(L, 1);
-
- mir_free(ptr);
+ if (lua_type(L, 1) == LUA_TLIGHTUSERDATA)
+ {
+ void *ptr = lua_touserdata(L, 1);
+ mir_free(ptr);
+ }
return 0;
}