summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-09 19:11:11 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-09 19:11:11 +0000
commit7f4f11f7e3358c24147e4e534cde33dffde1e590 (patch)
tree477b86b049a691b91b1eafb36fd4f9b1afcf87a2 /plugins
parent867f858237799e349290d98807adf1e06fee6fa6 (diff)
Mirlua: reading blobs from database
git-svn-id: http://svn.miranda-ng.org/main/trunk@16071 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirLua/src/m_database.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp
index a8d0a04388..4feab11e57 100644
--- a/plugins/MirLua/src/m_database.cpp
+++ b/plugins/MirLua/src/m_database.cpp
@@ -206,7 +206,17 @@ static int lua_GetSetting(lua_State *L)
case DBVT_WCHAR:
lua_pushstring(L, ptrA(mir_utf8encodeW(dbv.pwszVal)));
break;
-
+ case DBVT_BLOB:
+ {
+ lua_newtable(L);
+ for (size_t i = 0; i < dbv.cpbVal; i++)
+ {
+ lua_pushnumber(L, i + 1);
+ lua_pushnumber(L, dbv.pbVal[i]);
+ lua_settable(L, -3);
+ }
+ }
+ break;
default:
db_free(&dbv);
lua_pushvalue(L, 4);
@@ -305,7 +315,9 @@ static int lua_WriteSetting(lua_State *L)
dbv.pszVal = (char*)lua_tostring(L, 4);
dbv.type = DBVT_UTF8;
break;
-
+ case LUA_TTABLE:
+ //this is blob, should be converted to BYTE*
+ break;
default:
lua_pushinteger(L, 1);
return 1;