diff options
author | Vlad Mironov <mironych@googlemail.com> | 2015-07-11 11:43:26 +0000 |
---|---|---|
committer | Vlad Mironov <mironych@googlemail.com> | 2015-07-11 11:43:26 +0000 |
commit | 063b64c33b6c11db04d760a5bf0f451650e2b867 (patch) | |
tree | 13bf0bdd76d6b2033225c6dcb12e8381b96275dd /plugins/MirLua | |
parent | ef145ec232ee4453092e7479b2dee73af96a9b11 (diff) |
MirLua:
more features
git-svn-id: http://svn.miranda-ng.org/main/trunk@14535 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/src/m_database.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index bb903db1aa..2410dec01f 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -98,6 +98,9 @@ static int lua_GetEvent(lua_State *L) lua_pushstring(L, "Type");
lua_pushinteger(L, dbei.eventType);
lua_settable(L, -3);
+ lua_pushstring(L, "Flags");
+ lua_pushinteger(L, dbei.flags);
+ lua_settable(L, -3);
lua_pushstring(L, "Length");
lua_pushnumber(L, dbei.cbBlob);
lua_settable(L, -3);
@@ -218,6 +221,47 @@ static int lua_DeleteModule(lua_State *L) return 1;
}
+static int lua_DecodeDBCONTACTWRITESETTING(lua_State *L)
+{
+ DBCONTACTWRITESETTING *pDBCWS = (DBCONTACTWRITESETTING*)lua_tointeger(L, 1);
+
+ lua_newtable(L);
+ lua_pushstring(L, "Module");
+ lua_pushstring(L, pDBCWS->szModule);
+ lua_settable(L, -3);
+ lua_pushstring(L, "Setting");
+ lua_pushstring(L, pDBCWS->szSetting);
+ lua_settable(L, -3);
+ lua_pushstring(L, "Value");
+ switch (pDBCWS->value.type)
+ {
+ case DBVT_BYTE:
+ lua_pushinteger(L, pDBCWS->value.bVal);
+ break;
+ case DBVT_WORD:
+ lua_pushinteger(L, pDBCWS->value.wVal);
+ break;
+ case DBVT_DWORD:
+ lua_pushnumber(L, pDBCWS->value.dVal);
+ break;
+ case DBVT_ASCIIZ:
+ lua_pushstring(L, ptrA(mir_utf8encode(pDBCWS->value.pszVal)));
+ break;
+ case DBVT_UTF8:
+ lua_pushstring(L, pDBCWS->value.pszVal);
+ break;
+ case DBVT_WCHAR:
+ lua_pushstring(L, ptrA(mir_utf8encodeW(pDBCWS->value.pwszVal)));
+ break;
+ default:
+ lua_pushvalue(L, 4);
+ return 1;
+ }
+ lua_settable(L, -3);
+
+ return 1;
+}
+
typedef struct
{
int arrlen;
@@ -300,6 +344,8 @@ static luaL_Reg databaseApi[] = { "EnumSettings", lua_EnumSettings },
+ { "DecodeDBCONTACTWRITESETTING", lua_DecodeDBCONTACTWRITESETTING },
+
{ NULL, NULL }
};
|