summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-17 16:11:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-19 19:24:16 +0300
commitc1b2166e6abf0d89217c684358b9d5b815e0df19 (patch)
tree080dc707ccb34518f7940a3d1a5738573089f2a8 /src
parent851d9b82b6cd6f16821897e10c2c577cd2998d14 (diff)
db_get_utfa -> new function to allocate utf strings dynamically
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/db.cpp11
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index 56500eaff2..aee2097ade 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -174,6 +174,17 @@ MIR_CORE_DLL(char*) db_get_sa(MCONTACT hContact, const char *szModule, const cha
return (szValue == nullptr) ? nullptr : mir_strdup(szValue);
}
+MIR_CORE_DLL(char*) db_get_utfa(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szValue)
+{
+ if (currDb) {
+ DBVARIANT dbv = { DBVT_UTF8 };
+ if (!currDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv))
+ return dbv.pszVal;
+ }
+
+ return (szValue == nullptr) ? nullptr : mir_strdup(szValue);
+}
+
MIR_CORE_DLL(wchar_t*) db_get_wsa(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szValue)
{
if (currDb) {
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 112500b679..a70c6493e0 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1415,3 +1415,4 @@ db_event_edit @1268
?SetAttribute@XMLElement@tinyxml2@@QAEXPBDPB_W@Z @1628 NONAME
??AXMLConstHandle@tinyxml2@@QBE?BV01@PBD@Z @1629 NONAME
??AXMLHandle@tinyxml2@@QAE?AV01@PBD@Z @1630 NONAME
+db_get_utfa @1631
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index eac6cc4c13..d4dced17cf 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1415,3 +1415,4 @@ db_event_edit @1268
?SetAttribute@XMLElement@tinyxml2@@QEAAXPEBDPEB_W@Z @1628 NONAME
??AXMLConstHandle@tinyxml2@@QEBA?BV01@PEBD@Z @1629 NONAME
??AXMLHandle@tinyxml2@@QEAA?AV01@PEBD@Z @1630 NONAME
+db_get_utfa @1631