diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-11-07 18:42:19 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-11-07 18:42:19 +0000 |
commit | e29fd4d0ead4353ff2e03fcd793400d8e0779481 (patch) | |
tree | de0d47e86f816ea6cfca63ab8b394c09daf0725a /plugins/MirLua/src/m_database.cpp | |
parent | a50edcaccf9c335a8b4fd6dc144916f3aed9ca8f (diff) |
MirLua: added metatables wrapper
git-svn-id: http://svn.miranda-ng.org/main/trunk@15697 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_database.cpp')
-rw-r--r-- | plugins/MirLua/src/m_database.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index ab9224bb1e..63fb270bfd 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -345,8 +345,6 @@ static int lua_SettingIterator(lua_State *L) static int lua_AllSettings(lua_State *L)
{
MCONTACT hContact = lua_tointeger(L, 1);
- int tp = lua_type(L, 2);
- const char *type = lua_typename(L, tp);
const char* szModule = luaL_checkstring(L, 2);
enumDBSettingsParam* param = (enumDBSettingsParam*)mir_alloc(sizeof(enumDBSettingsParam));
@@ -618,15 +616,7 @@ static int dbei__index(lua_State *L) else if (mir_strcmpi(key, "Length") == 0)
lua_pushnumber(L, dbei->cbBlob);
else if (mir_strcmpi(key, "Blob") == 0)
- {
- lua_newtable(L);
- for (DWORD i = 0; i < dbei->cbBlob; i++)
- {
- lua_pushinteger(L, i + 1);
- lua_pushinteger(L, dbei->pBlob[i]);
- lua_settable(L, -3);
- }
- }
+ lua_pushlightuserdata(L, dbei->pBlob);
else
lua_pushnil(L);
@@ -644,7 +634,7 @@ static int dbei__gc(lua_State *L) static const luaL_Reg dbeiMeta[] =
{
- { "__init", dbei__init },
+ { "MT_DBEVENTINFO", dbei__init },
{ "__index", dbei__index },
{ "__gc", dbei__gc },
{ NULL, NULL }
@@ -712,7 +702,7 @@ static int dbcw__index(lua_State *L) static const luaL_Reg dbcwMeta[] =
{
- { "__init", dbcw__init },
+ { MT_DBCONTACTWRITESETTING, dbcw__init },
{ "__index", dbcw__index },
{ NULL, NULL }
};
|