diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-07-12 13:45:28 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-07-12 13:45:28 +0000 |
commit | 71a88c6d8c4578ca24e02a5c6f4860c206e7c6da (patch) | |
tree | ab596227ee86c40b39d846cd6de47ee13504c5b2 /plugins/MirLua/src/m_database.cpp | |
parent | 9677b394a0977382ed4a406de039ef370cfd29a2 (diff) |
oops
git-svn-id: http://svn.miranda-ng.org/main/trunk@14542 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_database.cpp')
-rw-r--r-- | plugins/MirLua/src/m_database.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index 3f553c983f..8d05a605f3 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -291,7 +291,39 @@ static int SettingsChangedHookEventObjParam(void *obj, WPARAM wParam, LPARAM lPa lua_pushnumber(L, wParam);
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
-
+ lua_newtable(L);
+ lua_pushstring(L, "Module");
+ lua_pushstring(L, dbcws->szModule);
+ lua_settable(L, -3);
+ lua_pushstring(L, "Setting");
+ lua_pushstring(L, dbcws->szSetting);
+ lua_settable(L, -3);
+ lua_pushstring(L, "Value");
+ switch (dbcws->value.type)
+ {
+ case DBVT_BYTE:
+ lua_pushinteger(L, dbcws->value.bVal);
+ break;
+ case DBVT_WORD:
+ lua_pushinteger(L, dbcws->value.wVal);
+ break;
+ case DBVT_DWORD:
+ lua_pushnumber(L, dbcws->value.dVal);
+ break;
+ case DBVT_ASCIIZ:
+ lua_pushstring(L, ptrA(mir_utf8encode(dbcws->value.pszVal)));
+ break;
+ case DBVT_UTF8:
+ lua_pushstring(L, dbcws->value.pszVal);
+ break;
+ case DBVT_WCHAR:
+ lua_pushstring(L, ptrA(mir_utf8encodeW(dbcws->value.pwszVal)));
+ break;
+ default:
+ lua_pushvalue(L, 4);
+ return 1;
+ }
+ lua_settable(L, -3);
if (lua_pcall(L, 2, 1, 0))
printf("%s\n", lua_tostring(L, -1));
|