summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp8
-rw-r--r--plugins/TabSRMM/src/chat/clist.cpp22
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp12
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp12
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp10
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp6
-rw-r--r--plugins/TabSRMM/src/container.cpp26
-rw-r--r--plugins/TabSRMM/src/controls.cpp2
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp2
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp14
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp2
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp6
-rw-r--r--plugins/TabSRMM/src/mim.cpp30
-rw-r--r--plugins/TabSRMM/src/modplus.cpp6
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp6
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp18
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp2
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp8
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp6
-rw-r--r--plugins/TabSRMM/src/templates.cpp2
-rw-r--r--plugins/TabSRMM/src/themeio.cpp10
-rw-r--r--plugins/TabSRMM/src/themes.cpp4
-rw-r--r--plugins/TabSRMM/src/utils.cpp10
28 files changed, 125 insertions, 125 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 8205a902dc..a7fcff7b36 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -141,7 +141,7 @@ void CB_InitCustomButtons()
InitializeCriticalSection(&ToolBarCS);
dwSepCount = M->GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
- //dwSepCount = DBGetContactSettingDword(NULL, "TabSRMM_Toolbar", "SeparatorsCount", 0);
+ //dwSepCount = db_get_dw(NULL, "TabSRMM_Toolbar", "SeparatorsCount", 0);
hButtonsBarAddButton = CreateServiceFunction(MS_BB_ADDBUTTON, CB_AddButton);
hButtonsBarRemoveButton = CreateServiceFunction(MS_BB_REMOVEBUTTON, CB_RemoveButton);
@@ -865,7 +865,7 @@ void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd)
mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
- if (!DBGetContactSettingString(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
+ if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
token = strtok(dbv.pszVal, "_");
cbd->dwPosition = (DWORD)atoi(token);
token = strtok(NULL, "_");
@@ -879,7 +879,7 @@ void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd)
token = strtok(NULL, "_");
cbd->bCanBeHidden = (BOOL)atoi(token);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -893,7 +893,7 @@ void CB_WriteButtonSettings(HANDLE hContact, CustomButtonData *cbd)
mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
mir_snprintf(SettingParameter, sizeof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden);
if (!(cbd->opFlags&BBSF_NTBDESTRUCT))
- DBWriteContactSettingString(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
+ db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
else
db_unset(hContact, "TabSRMM_Toolbar", SettingName);
}
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp
index 18172a2e01..fd0f232573 100644
--- a/plugins/TabSRMM/src/chat/clist.cpp
+++ b/plugins/TabSRMM/src/chat/clist.cpp
@@ -50,7 +50,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup)
result = M->GetTString(0, "CListGroups", str, &dbv);
if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (match)
return((HANDLE)(i + 1));
}
@@ -70,7 +70,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
if (!M->GetTString(NULL, "Chat", "AddToGroup", &dbv)) {
if (lstrlen(dbv.ptszVal) > 0)
lstrcpyn(pszGroup, dbv.ptszVal, 50);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
lstrcpyn(pszGroup, _T("Chat rooms"), 50);
@@ -94,7 +94,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
M->WriteTString(hContact, pszModule, "Nick", pszDisplayName);
M->WriteTString(hContact, pszModule, "ChatRoomID", pszRoom);
M->WriteByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
- DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
}
@@ -106,8 +106,8 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
return FALSE;
int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
- DBWriteContactSettingWord(hContact, szProto, "ApparentMode", (LPARAM)0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto, "ApparentMode", (LPARAM)0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return TRUE;
}
return FALSE;
@@ -125,8 +125,8 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
if (!pszModule || (pszModule && !strcmp(pszModule, szProto))) {
int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
if (i != 0) {
- DBWriteContactSettingWord(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
}
}
@@ -162,7 +162,7 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
&& IsWindowVisible(si->hWnd)
&& !IsIconic(si->pContainer->hwnd)) {
PostMessage(si->hWnd, GC_CLOSEWINDOW, 0, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
else
@@ -175,7 +175,7 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
SetForegroundWindow(si->dat->pContainer->hwnd);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
}
@@ -305,10 +305,10 @@ HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom)
DBVARIANT dbv;
if (!M->GetTString(hContact, szProto, "ChatRoomID", &dbv)) {
if (!lstrcmpi(dbv.ptszVal, pszRoom)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return hContact;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 1e8919e8c0..c3ffc5e0e9 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -76,8 +76,8 @@ int Chat_Unload(void)
if (!PluginConfig.m_chat_enabled)
return 0;
- DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
- DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
+ db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
CList_SetAllOffline(TRUE, NULL);
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index 2649cb2a24..4b706059d9 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -121,10 +121,10 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta
if (pTemp->hContact) {
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM ? TRUE : FALSE);
//if (pTemp->iType != GCW_SERVER)
- //DBWriteContactSettingByte(pTemp->hContact, "CList", "Hidden", 1);
+ //db_set_b(pTemp->hContact, "CList", "Hidden", 1);
}
- DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule , "Topic", "");
- DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
+ db_set_s(pTemp->hContact, pTemp->pszModule , "Topic", "");
+ db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
db_unset(pTemp->hContact, "CList", "StatusMsg");
if (removeContact)
@@ -610,7 +610,7 @@ BOOL SM_SetStatus(const TCHAR* pszID, const char* pszModule, int wStatus)
if (pTemp->iType != GCW_SERVER && wStatus != ID_STATUS_OFFLINE)
db_unset(pTemp->hContact, "CList", "Hidden");
- DBWriteContactSettingWord(pTemp->hContact, pTemp->pszModule, "Status", (WORD)wStatus);
+ db_set_w(pTemp->hContact, pTemp->pszModule, "Status", (WORD)wStatus);
}
if (pszID)
@@ -702,9 +702,9 @@ BOOL SM_RemoveAll(void)
DoEventHook(m_WndList->ptszID, m_WndList->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)m_WndList->dwItemData);
if (m_WndList->hContact)
CList_SetOffline(m_WndList->hContact, m_WndList->iType == GCW_CHATROOM ? TRUE : FALSE);
- DBWriteContactSettingString(m_WndList->hContact, m_WndList->pszModule , "Topic", "");
+ db_set_s(m_WndList->hContact, m_WndList->pszModule , "Topic", "");
db_unset(m_WndList->hContact, "CList", "StatusMsg");
- DBWriteContactSettingString(m_WndList->hContact, m_WndList->pszModule, "StatusBar", "");
+ db_set_s(m_WndList->hContact, m_WndList->pszModule, "StatusBar", "");
UM_RemoveAll(&m_WndList->pUsers);
TM_RemoveAll(&m_WndList->pStatuses);
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp
index 935d2e38d4..79752fa472 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/src/chat/muchighlight.cpp
@@ -269,12 +269,12 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBVARIANT dbv = {0};
if ( !M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
if ( !M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
DWORD dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 0590070abf..6011d8a194 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -1050,7 +1050,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SM_InvalidateLogDirectories();
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "Chat", "LoggingLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LoggingLimit", (WORD)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
@@ -1062,32 +1062,32 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "LogTimestamp", pszText);
+ db_set_s(NULL, "Chat", "LogTimestamp", pszText);
} else db_unset(NULL, "Chat", "LogTimestamp");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
+ db_set_s(NULL, "Chat", "HeaderTime", pszText);
} else db_unset(NULL, "Chat", "HeaderTime");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderIncoming", pszText);
+ db_set_s(NULL, "Chat", "HeaderIncoming", pszText);
} else db_unset(NULL, "Chat", "HeaderIncoming");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderOutgoing", pszText);
+ db_set_s(NULL, "Chat", "HeaderOutgoing", pszText);
} else db_unset(NULL, "Chat", "HeaderOutgoing");
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "Chat", "LogLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
}
if (pszText != NULL)
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index bcd2cc9452..59d4cd646f 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -246,12 +246,12 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
else
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s"), si->ptszName);
si->hContact = CList_AddRoom(gcw->pszModule, ptszID, szTemp, si->iType);
- DBWriteContactSettingString(si->hContact, si->pszModule , "Topic", "");
+ db_set_s(si->hContact, si->pszModule , "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hContact)
Chat_SetFilters(si);
}
@@ -371,7 +371,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
if (si->ptszStatusbarText)
M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATESTATUSBAR, 0, 0);
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 5e0b679f07..85167448e8 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -607,7 +607,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
params->sound = "ChatMessage";
if (params->bInactive && !(si->wState&STATE_TALK)) {
si->wState |= STATE_TALK;
- DBWriteContactSettingWord(si->hContact, si->pszModule, "ApparentMode", (LPARAM)(WORD) 40071);
+ db_set_w(si->hContact, si->pszModule, "ApparentMode", (LPARAM)(WORD) 40071);
}
break;
case GC_EVENT_ACTION:
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index d424e03f78..46e761e8cf 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -288,7 +288,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
if (dat->iTabID >= 0) {
if (db_get_w(si->hContact, si->pszModule , "ApparentMode", 0) != 0)
- DBWriteContactSettingWord(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
+ db_set_w(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)szChatIconString);
@@ -2484,7 +2484,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
si->wState &= ~STATE_TALK;
dat->bWasDeleted = 1;
- DBWriteContactSettingWord(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
+ db_set_w(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
SendMessage(hwndDlg, GC_CLOSEWINDOW, 0, lParam == 2 ? lParam : 1);
return TRUE;
@@ -3453,7 +3453,7 @@ LABEL_SHOWWINDOW:
if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -3735,10 +3735,10 @@ LABEL_SHOWWINDOW:
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING, 0);
if (!dat->fIsAutosizingInput)
- DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
if (dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
- DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
+ db_set_w(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
DM_FreeTheme(dat);
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 74238bb783..d93afc5fbd 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -483,7 +483,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
res = M->GetTString(m_hContact, "CList", "StatusMsg", &dbv);
if (res == 0) {
m_szStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? getNormalizedStatusMsg(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) {
@@ -493,7 +493,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
res = M->GetTString(m_hContact, m_szProto, "ListeningTo", &dbv);
if (res == 0) {
m_ListeningInfo = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (szKey == 0 || (szKey && !strcmp("XStatusMsg", szKey))) {
@@ -503,7 +503,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
res = M->GetTString(m_hContact, m_szProto, "XStatusMsg", &dbv);
if (res == 0) {
m_xStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
m_xStatus = M->GetByte(m_hContact, m_szProto, "XStatusId", 0);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 5e96b41fa4..e5e98c9a44 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -178,7 +178,7 @@ struct TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDL
else if (!_tcsncmp(dbv.ptszVal, _T("**free**"), CONTAINER_NAMELEN))
iFirstFree = i;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
while (++i && iFound == FALSE);
@@ -995,7 +995,7 @@ panel_found:
if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage((HWND)item.lParam, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 1;
@@ -1602,7 +1602,7 @@ panel_found:
if (szThemeName != NULL) {
M->pathToAbsolute(szThemeName, pContainer->szAbsThemeFile);
mir_sntprintf(pContainer->szRelThemeFile, MAX_PATH, _T("%s"), szThemeName);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
@@ -2364,7 +2364,7 @@ int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLe
dbv.ptszVal[CONTAINER_NAMELEN] = '\0';
_tcsncpy(szName, dbv.ptszVal, iNameLen);
szName[iNameLen] = '\0';
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return dbv.cchVal;
}
}
@@ -2375,10 +2375,10 @@ int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLe
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
_tcsncpy(szName, dbv.ptszVal, iNameLen);
szName[iNameLen] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return dbv.cpbVal;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -2405,7 +2405,7 @@ void TSAPI DeleteContainer(int iIndex)
TCHAR *wszString = dbv_c.ptszVal;
if (_tcscmp(wszString, wszContainerName) && lstrlen(wszString) == lstrlen(wszContainerName))
db_unset(hhContact, SRMSGMOD_T, "containerW");
- DBFreeVariant(&dbv_c);
+ db_free(&dbv_c);
}
hhContact = db_find_next(hhContact);
}
@@ -2422,7 +2422,7 @@ void TSAPI DeleteContainer(int iIndex)
_snprintf(szSetting, CONTAINER_NAMELEN + 15, "%s%dy", szSettingP, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -2451,11 +2451,11 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew)
M->WriteTString(hhContact, SRMSGMOD_T, szSubKey, szNew);
}
}
- DBFreeVariant(&dbv_c);
+ db_free(&dbv_c);
}
hhContact = db_find_next(hhContact);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -2490,7 +2490,7 @@ HMENU TSAPI BuildContainerMenu()
AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !_tcscmp(dbv.ptszVal, _T("default")) ?
TranslateT("Default container") : dbv.ptszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
i++;
}
while (TRUE);
@@ -2535,7 +2535,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
for (i=0; i < iNumProtos; i++) {
mir_snprintf(szTemp, sizeof(szTemp), "Protocol%d", i);
- if (DBGetContactSettingString(dat->hContact, PluginConfig.szMetaName, szTemp, &dbv))
+ if (db_get_s(dat->hContact, PluginConfig.szMetaName, szTemp, &dbv))
continue;
tzProtoName = dbv.pszVal;
@@ -2557,7 +2557,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
AppendMenu(hMCSubForce, MF_STRING | iChecked, 100 + i, szMenuLine);
AppendMenu(hMCSubDefault, MF_STRING | (i == iDefaultProtoByNum ? MF_CHECKED : MF_UNCHECKED), 1000 + i, szMenuLine);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
AppendMenu(hMCSubForce, MF_SEPARATOR, 900, _T(""));
AppendMenu(hMCSubForce, MF_STRING | ((isForced == -1) ? MF_CHECKED : MF_UNCHECKED), 999, TranslateT("Autoselect"));
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index d4be6530a2..eff180cab9 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -1138,7 +1138,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
tooltip_active = TRUE;
CallService(szTTService, (WPARAM)dbv.ptszVal, (LPARAM)&ti);
if (dbv.pszVal)
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index ee0bd16407..7173c598a9 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
}
M->WriteByte("Chat", "PopupStyle", (BYTE)g_Settings.iPopupStyle);
- DBWriteContactSettingWord(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
+ db_set_w(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
g_Settings.crPUBkgColour = SendDlgItemMessage(hWnd, IDC_COLBACK_MUC, CPM_GETCOLOUR, 0, 0);
M->WriteDword("Chat", "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 5cad2d5e0b..402301a9ff 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -434,11 +434,11 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
switch(iSelection) {
case ID_FAVORITES_ADDCONTACTTOFAVORITES:
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "isFavorite", 1);
+ db_set_b(dat->hContact, SRMSGMOD_T, "isFavorite", 1);
AddContactToFavorites(dat->hContact, dat->cache->getNick(), dat->cache->getActiveProto(), dat->szStatus, dat->wStatus, LoadSkinnedProtoIcon(dat->cache->getActiveProto(), dat->cache->getActiveStatus()), 1, PluginConfig.g_hMenuFavorites);
break;
case ID_FAVORITES_REMOVECONTACTFROMFAVORITES:
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "isFavorite", 0);
+ db_set_b(dat->hContact, SRMSGMOD_T, "isFavorite", 0);
DeleteMenu(PluginConfig.g_hMenuFavorites, (UINT_PTR)dat->hContact, MF_BYCOMMAND);
break;
}
@@ -1021,9 +1021,9 @@ void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat)
if (buttonItem->type == DBVT_ASCIIZ) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingString(hFinalContact, szModule, szSetting, &dbv)) {
+ if (!db_get_s(hFinalContact, szModule, szSetting, &dbv)) {
result = !strcmp((char *)buttonItem->bValuePush, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
} else {
switch (buttonItem->type) {
@@ -1098,7 +1098,7 @@ static void LoadKLThread(LPVOID vParam)
if (res == 0) {
HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)hContact, (LPARAM)hkl);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1111,8 +1111,8 @@ void TSAPI DM_LoadLocale(TWindowData *dat)
return;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(dat->hContact, SRMSGMOD_T, "locale", &dbv))
- DBFreeVariant(&dbv);
+ if ( !db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv))
+ db_free(&dbv);
else {
TCHAR szKLName[KL_NAMELENGTH+1];
if (!PluginConfig.m_dontUseDefaultKbd) {
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 2c13a771a2..7a3a1b0bde 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -471,7 +471,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DBVARIANT dbv;
if (0 == M->GetTString(hContact, SRMSGMOD_T, "locale", &dbv)) {
GetLocaleID(dat, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
UpdateReadChars(dat);
}
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 771a8a3e53..5ec1268110 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -511,12 +511,12 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
}
else _tcscpy_s (szBuf, 256, tszUin);
- if(M->GetByte("ShowClientDescription",1)) {
+ if (M->GetByte("ShowClientDescription",1)) {
TCHAR temp[256];
DBVARIANT dbv = {0};
if ( !M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client: %s"), dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
else mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client not cached yet"));
_tcscat_s(szBuf, 256, temp);
@@ -957,7 +957,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
if (0 == M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, 1024, TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
str->append(temp);
}
str->append(_T("}"));
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index cc067fd278..cc3ee55392 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -82,7 +82,7 @@ void CMimAPI::timerMsg(const char *szMsg)
DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(hContact, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
}
/*
@@ -91,7 +91,7 @@ DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szModule = 0, con
DWORD CMimAPI::GetDword(const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(0, SRMSGMOD_T, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, SRMSGMOD_T, szSetting, uDefault));
}
/*
@@ -100,7 +100,7 @@ DWORD CMimAPI::GetDword(const char *szSetting = 0, DWORD uDefault = 0) const
DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(hContact, SRMSGMOD_T, szSetting, uDefault));
+ return((DWORD)db_get_dw(hContact, SRMSGMOD_T, szSetting, uDefault));
}
/*
@@ -109,7 +109,7 @@ DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szSetting = 0, DW
DWORD CMimAPI::GetDword(const char *szModule, const char *szSetting, DWORD uDefault) const
{
- return((DWORD)DBGetContactSettingDword(0, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
}
/*
@@ -117,32 +117,32 @@ DWORD CMimAPI::GetDword(const char *szModule, const char *szSetting, DWORD uDefa
*/
int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(hContact, szModule, szSetting, uDefault));
+ return(db_get_b(hContact, szModule, szSetting, uDefault));
}
int CMimAPI::GetByte(const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(0, SRMSGMOD_T, szSetting, uDefault));
+ return(db_get_b(0, SRMSGMOD_T, szSetting, uDefault));
}
int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(hContact, SRMSGMOD_T, szSetting, uDefault));
+ return(db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault));
}
int CMimAPI::GetByte(const char *szModule, const char *szSetting, int uDefault) const
{
- return(DBGetContactSettingByte(0, szModule, szSetting, uDefault));
+ return(db_get_b(0, szModule, szSetting, uDefault));
}
INT_PTR CMimAPI::GetTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
{
- return(DBGetContactSettingTString(hContact, szModule, szSetting, dbv));
+ return(db_get_ts(hContact, szModule, szSetting, dbv));
}
INT_PTR CMimAPI::GetString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
{
- return(DBGetContactSettingString(hContact, szModule, szSetting, dbv));
+ return(db_get_s(hContact, szModule, szSetting, dbv));
}
/*
@@ -151,7 +151,7 @@ INT_PTR CMimAPI::GetString(const HANDLE hContact, const char *szModule, const ch
INT_PTR CMimAPI::WriteDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
{
- return(DBWriteContactSettingDword(hContact, szModule, szSetting, value));
+ return(db_set_dw(hContact, szModule, szSetting, value));
}
/*
@@ -160,22 +160,22 @@ INT_PTR CMimAPI::WriteDword(const HANDLE hContact = 0, const char *szModule = 0,
INT_PTR CMimAPI::WriteDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
{
- return(DBWriteContactSettingDword(0, szModule, szSetting, value));
+ return(db_set_dw(0, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
{
- return(DBWriteContactSettingByte(hContact, szModule, szSetting, value));
+ return(db_set_b(hContact, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
{
- return(DBWriteContactSettingByte(0, szModule, szSetting, value));
+ return(db_set_b(0, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteTString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0) const
{
- return(DBWriteContactSettingTString(hContact, szModule, szSetting, str));
+ return(db_set_ts(hContact, szModule, szSetting, str));
}
/**
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index f3430b4f28..aade81051f 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -59,9 +59,9 @@ static char* getMirVer(HANDLE hContact)
if ( !szProto )
return (NULL);
- if ( !DBGetContactSettingString(hContact, szProto, "MirVer", &dbv)) {
+ if ( !db_get_s(hContact, szProto, "MirVer", &dbv)) {
msg=mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return (msg);
}
@@ -74,7 +74,7 @@ static TCHAR* getMenuEntry(int i) {
mir_snprintf(MEntry, 255, "MenuEntry_%u", i);
if ( !M->GetTString(NULL, "tabmodplus",MEntry, &dbv)) {
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return (msg);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 10c5b6fbbb..eafbe66f2c 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1504,12 +1504,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
*/
if (dat->hContact) {
DBVARIANT dbv;
- if (!DBGetContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", &dbv)) {
+ if (!db_get_s(dat->hContact, SRMSGMOD, "SavedMsg", &dbv)) {
SETTEXTEX stx = {ST_DEFAULT, CP_UTF8};
if (dbv.type == DBVT_ASCIIZ && lstrlenA(dbv.pszVal) > 0)
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendQueue::UpdateSaveAndSendButton(dat);
if (m_pContainer->hwndActive == hwndDlg)
UpdateReadChars(dat);
@@ -2891,7 +2891,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -3655,10 +3655,10 @@ quote_from_last:
if (!dat->fEditNotesActive) {
char *msg = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
if (msg) {
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", msg);
+ db_set_s(dat->hContact, SRMSGMOD, "SavedMsg", msg);
free(msg);
} else
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", "");
+ db_set_s(dat->hContact, SRMSGMOD, "SavedMsg", "");
}
else
SendMessage(hwndDlg, WM_COMMAND, IDC_PIC, 0);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index c6ba4665cf..3193b37a21 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -864,7 +864,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic)
AdjustBottomAvatarDisplay(dat);
} else {
dat->showPic = dat->showPic ? 0 : 1;
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "MOD_ShowPic", (BYTE)dat->showPic);
+ db_set_b(dat->hContact, SRMSGMOD_T, "MOD_ShowPic", (BYTE)dat->showPic);
}
GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rc);
if (dat->minEditBoxSize.cy + DPISCALEY_S(3)> dat->splitterY)
@@ -2191,9 +2191,9 @@ void TSAPI GetClientIcon(TWindowData *dat)
dat->hClientIcon = 0;
if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!DBGetContactSettingString(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if (!db_get_s(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer", &dbv)) {
dat->hClientIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 4392e11dc6..419863cb75 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -200,7 +200,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
}
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -421,7 +421,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TVINSERTSTRUCT tvi = {0};
int i;
- DWORD dwFlags = DBGetContactSettingDword(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = db_get_dw(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
@@ -779,8 +779,8 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
M->WriteDword(SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
M->WriteDword(SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
@@ -885,7 +885,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- DBWriteContactSettingByte(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
}
} while (hContact = db_find_next(hContact));
}
@@ -1120,7 +1120,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
case PSN_APPLY: {
TVITEM item = {0};
M->WriteByte(SRMSGMOD_T, "cuttitle", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CUT_TABTITLE));
- DBWriteContactSettingWord(NULL, SRMSGMOD_T, "cut_at", (WORD)SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD_T, "cut_at", (WORD)SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_GETPOS, 0, 0));
/*
* scan the tree view and obtain the options...
@@ -1441,7 +1441,7 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb)
M->WriteByte(cb->dbModule, cb->dbSetting, (BYTE)value);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
+ db_set_w(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
break;
case DBVT_DWORD:
M->WriteDword(cb->dbModule, cb->dbSetting, (DWORD)value);
@@ -1590,8 +1590,8 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index eb6c66f1ad..6936dc4d1b 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -198,7 +198,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iItemNew != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETITEMDATA, (WPARAM)iItemNew, (LPARAM)iCounter);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
} while (++iCounter);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 5b740bb503..596ce729d3 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -328,7 +328,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
}
if (szSetting[0] == 'S') {
- if (0 == DBGetContactSettingString(hContact, "SendLater", szSetting, &dbv))
+ if (0 == db_get_s(hContact, "SendLater", szSetting, &dbv))
szOrig_Utf = dbv.pszVal;
else
return 0;
@@ -378,7 +378,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, lstrlenW(szWchar));
if (szSetting[0] == 'S')
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(szWchar);
job->readFlags();
@@ -711,7 +711,7 @@ void CSendLater::qMgrSetupColumns()
if (0 == M->GetString(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
sscanf(dbv.pszVal, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
sscanf(szColDefault, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
@@ -755,7 +755,7 @@ void CSendLater::qMgrSaveColumns()
nWidths[i] = max(col.cx, 10);
}
mir_snprintf(szColFormatNew, 100, "%d;%d;%d;%d;%d", nWidths[0], nWidths[1], nWidths[2], nWidths[3], nWidths[4]);
- ::DBWriteContactSettingString(0, SRMSGMOD_T, "qmgrListColumns", szColFormatNew);
+ ::db_set_s(0, SRMSGMOD_T, "qmgrListColumns", szColFormatNew);
}
INT_PTR CALLBACK CSendLater::DlgProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 530a53dc0b..fdfda626b7 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -174,7 +174,7 @@ static int SendChunkW(WCHAR *chunk, HANDLE hContact, char *szSvc, DWORD dwFlags)
BYTE *pBuf = NULL;
int wLen = lstrlenW(chunk), id;
DWORD memRequired = (wLen + 1) * sizeof(WCHAR);
- DWORD codePage = DBGetContactSettingDword(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP);
+ DWORD codePage = db_get_dw(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP);
int mbcsSize = WideCharToMultiByte(codePage, 0, chunk, -1, (char *)pBuf, 0, 0, 0);
memRequired += mbcsSize;
@@ -942,7 +942,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
if (fIsSendLater) {
mir_snprintf(tszMsg, required, "%s%s", job->sendBuffer, utf_header);
- DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, tszMsg);
+ db_set_s(hContact ? hContact : job->hOwner, "SendLater", szKeyName, tszMsg);
}
else {
mir_snprintf(tszMsg, required, "%s%s", utf_header, job->sendBuffer);
@@ -964,7 +964,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
mir_sntprintf(tszMsg, required, _T("%s%s"), tszHeader, wszMsg);
char *utf = mir_utf8encodeT(tszMsg);
if (fIsSendLater)
- DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, utf);
+ db_set_s(hContact ? hContact : job->hOwner, "SendLater", szKeyName, utf);
else
sendLater->addJob(utf, (LPARAM)hContact);
mir_free(utf);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 1cb01dccb5..215be250c6 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -91,7 +91,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl)
continue;
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR)
mir_sntprintf(tSet->szTemplates[i], TEMPLATE_LENGTH, _T("%s"), dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 0a0d32197a..8165b5432d 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -194,9 +194,9 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat)
for (i=0; i < fontBlocks[n].iCount; i++) {
sprintf(szTemp, "Font%d", firstIndex + i);
sprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
- if (!DBGetContactSettingString(NULL, szModule, szTemp, &dbv)) {
+ if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Color", _itoa(M->GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
@@ -288,7 +288,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
lstrcpynA(szBuf, "Arial", sizeof(szBuf));
- DBWriteContactSettingString(NULL, szModule, szTemp, szBuf);
+ db_set_s(NULL, szModule, szTemp, szBuf);
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
@@ -398,7 +398,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
if (strcmp(szTemplateBuffer, "[undef]")) {
if (dat == 0)
- DBWriteContactSettingStringUtf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
+ db_set_utf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
mir_sntprintf(LTR_Active.szTemplates[i], TEMPLATE_LENGTH, L"%s", decoded);
@@ -411,7 +411,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
if (strcmp(szTemplateBuffer, "[undef]")) {
if (dat == 0)
- DBWriteContactSettingStringUtf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
+ db_set_utf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
mir_sntprintf(RTL_Active.szTemplates[i], TEMPLATE_LENGTH, L"%s", decoded);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 8d828a3910..09ed80222b 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1050,7 +1050,7 @@ void CSkin::setFileName()
if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
M->pathToAbsolute(dbv.ptszVal, m_tszFileName, M->getSkinPath());
m_tszFileName[MAX_PATH - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
m_tszFileName[0] = 0;
@@ -1430,7 +1430,7 @@ void CSkin::Load(void)
M->WriteDword(SRMSGMOD_T, _tagSettings[i].szSetting, data);
break;
case 2:
- DBWriteContactSettingWord(NULL, SRMSGMOD_T, _tagSettings[i].szSetting, (WORD)data);
+ db_set_w(NULL, SRMSGMOD_T, _tagSettings[i].szSetting, (WORD)data);
break;
case 5:
GetPrivateProfileString(_tagSettings[i].szIniKey, _tagSettings[i].szIniName, _T("000000"),
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 7248588213..d572cafc2a 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -409,7 +409,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
title.insert(tempmark + 2, szTemp);
curpos = tempmark + lstrlen(szTemp);
}
@@ -431,7 +431,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
title.insert(tempmark + 2, szTemp);
} else
szFinalStatus = xStatusDescr[xStatus - 1];
@@ -721,16 +721,16 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings
CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
- if (0 == DBGetContactSetting(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
+ if (0 == db_get(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
::CopyMemory((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
if (hContact == 0 && szKey == 0)
cs->fPrivate = false;
return 0;
}
cs->fPrivate = false;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
else {