From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Authentication.cpp | 6 +- plugins/NewsAggregator/Src/CheckFeed.cpp | 184 +++++++++++++------------- plugins/NewsAggregator/Src/ExportImport.cpp | 42 +++--- plugins/NewsAggregator/Src/Options.cpp | 34 ++--- plugins/NewsAggregator/Src/Services.cpp | 2 +- plugins/NewsAggregator/Src/Utils.cpp | 58 ++++---- 6 files changed, 163 insertions(+), 163 deletions(-) (limited to 'plugins/NewsAggregator') diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index f72bee89fc..8b587f8779 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -29,11 +29,11 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) else if (hwndDlg && IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) { wchar_t buf[MAX_PATH] = {0}; GetDlgItemText(hwndDlg, IDC_LOGIN, buf, _countof(buf)); - tlogin = mir_tstrdup(buf); + tlogin = mir_wstrdup(buf); GetDlgItemText(hwndDlg, IDC_PASSWORD, buf, _countof(buf)); - tpass = mir_tstrdup(buf); + tpass = mir_wstrdup(buf); } - char *user = mir_t2a(tlogin), *pass = mir_t2a(tpass); + char *user = mir_u2a(tlogin), *pass = mir_u2a(tpass); char str[MAX_PATH]; int len = mir_snprintf(str, "%s:%s", user, pass); diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 4abe1c0395..8586d20477 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -25,9 +25,9 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) char *szData = NULL; GetNewsData(tszURL, &szData, NULL, hwndDlg); if (szData) { - wchar_t *tszData = mir_utf8decodeT(szData); + wchar_t *tszData = mir_utf8decodeW(szData); if (!tszData) - tszData = mir_a2t(szData); + tszData = mir_a2u(szData); int bytesParsed = 0; HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); @@ -36,11 +36,11 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) LPCTSTR codepage = NULL; int childcount = 0; HXML node; - if (!mir_tstrcmpi(xmlGetName(hXml), L"xml")) { + if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) { int attrcount = xmlGetAttrCount(hXml); for (int i = 0; i < attrcount; i++) { LPCTSTR szAttrName = xmlGetAttrName(hXml, i); - if (!mir_tstrcmpi(szAttrName, L"encoding")) { + if (!mir_wstrcmpi(szAttrName, L"encoding")) { codepage = xmlGetAttrValue(hXml, szAttrName); break; } @@ -51,38 +51,38 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) node = hXml; while (node) { LPCTSTR szNodeName = xmlGetName(node); - if (!mir_tstrcmpi(szNodeName, L"rss") || !mir_tstrcmpi(szNodeName, L"rdf")) { + if (!mir_wstrcmpi(szNodeName, L"rss") || !mir_wstrcmpi(szNodeName, L"rdf")) { HXML chan = xmlGetChild(node, 0); for (int j = 0; j < xmlGetChildCount(chan); j++) { HXML child = xmlGetChild(chan, j); - if (!mir_tstrcmpi(xmlGetName(child), L"title")) { + if (!mir_wstrcmpi(xmlGetName(child), L"title")) { wchar_t mes[MAX_PATH]; - mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL); + mir_snwprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION); - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); - return mir_tstrdup(buf); + return mir_wstrdup(buf); } else - return mir_tstrdup(xmlGetText(child)); + return mir_wstrdup(xmlGetText(child)); } } } - else if (!mir_tstrcmpi(szNodeName, L"feed")) { + else if (!mir_wstrcmpi(szNodeName, L"feed")) { for (int j = 0; j < xmlGetChildCount(node); j++) { HXML child = xmlGetChild(node, j); - if (!mir_tstrcmpi(xmlGetName(child), L"title")) { + if (!mir_wstrcmpi(xmlGetName(child), L"title")) { wchar_t mes[MAX_PATH]; - mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL); + mir_snwprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION); - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); - return mir_tstrdup(buf); + return mir_wstrdup(buf); } else - return mir_tstrdup(xmlGetText(child)); + return mir_wstrdup(xmlGetText(child)); } } } @@ -93,7 +93,7 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) } Netlib_LogfT(hNetlibUser, L"%s is not a valid feed's address.", tszURL); wchar_t mes[MAX_PATH]; - mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL); + mir_snwprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR); return NULL; } @@ -194,9 +194,9 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(szURL); if (szData) { - wchar_t *tszData = mir_utf8decodeT(szData); + wchar_t *tszData = mir_utf8decodeW(szData); if (!tszData) - tszData = mir_a2t(szData); + tszData = mir_a2u(szData); int bytesParsed = 0; HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); @@ -207,11 +207,11 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR codepage = NULL; int childcount = 0; HXML node; - if (!mir_tstrcmpi(xmlGetName(hXml), L"xml")) { + if (!mir_wstrcmpi(xmlGetName(hXml), L"xml")) { int attrcount = xmlGetAttrCount(hXml); for (int i = 0; i < attrcount; i++) { LPCTSTR szAttrName = xmlGetAttrName(hXml, i); - if (!mir_tstrcmpi(szAttrName, L"encoding")) { + if (!mir_wstrcmpi(szAttrName, L"encoding")) { codepage = xmlGetAttrValue(hXml, szAttrName); break; } @@ -222,14 +222,14 @@ void CheckCurrentFeed(MCONTACT hContact) node = hXml; while (node) { LPCTSTR szNodeName = xmlGetName(node); - bool isRSS = !mir_tstrcmpi(szNodeName, L"rss"), isAtom = !mir_tstrcmpi(szNodeName, L"rdf"); + bool isRSS = !mir_wstrcmpi(szNodeName, L"rss"), isAtom = !mir_wstrcmpi(szNodeName, L"rdf"); if (isRSS || isAtom) { if (isRSS) { for (int i = 0; i < xmlGetAttrCount(node); i++) { LPCTSTR szAttrName = xmlGetAttrName(node, i); - if (!mir_tstrcmpi(szAttrName, L"version")) { + if (!mir_wstrcmpi(szAttrName, L"version")) { wchar_t ver[MAX_PATH]; - mir_sntprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName)); + mir_snwprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName)); db_set_ts(hContact, MODULE, "MirVer", ver); break; } @@ -242,9 +242,9 @@ void CheckCurrentFeed(MCONTACT hContact) for (int j = 0; j < xmlGetChildCount(chan); j++) { HXML child = xmlGetChild(chan, j); LPCTSTR childName = xmlGetName(child); - if (!mir_tstrcmpi(childName, L"title")) { + if (!mir_wstrcmpi(childName, L"title")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -254,9 +254,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(childName, L"link")) { + else if (!mir_wstrcmpi(childName, L"link")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -266,9 +266,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(childName, L"description")) { + else if (!mir_wstrcmpi(childName, L"description")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -281,9 +281,9 @@ void CheckCurrentFeed(MCONTACT hContact) db_set_ts(hContact, "CList", "StatusMsg", szValue); } } - else if (!mir_tstrcmpi(childName, L"language")) { + else if (!mir_wstrcmpi(childName, L"language")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -293,9 +293,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(childName, L"managingEditor")) { + else if (!mir_wstrcmpi(childName, L"managingEditor")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -305,9 +305,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(childName, L"category")) { + else if (!mir_wstrcmpi(childName, L"category")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -317,9 +317,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(childName, L"copyright")) { + else if (!mir_wstrcmpi(childName, L"copyright")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -329,10 +329,10 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) db_set_s(hContact, "UserInfo", "MyNotes", _T2A(ClearText(szValue, szChildText))); } - else if (!mir_tstrcmpi(childName, L"image")) { + else if (!mir_wstrcmpi(childName, L"image")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML imageval = xmlGetChild(child, x); - if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) { + if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); @@ -346,7 +346,7 @@ void CheckCurrentFeed(MCONTACT hContact) CMString filename = szNick; filename.Replace(L"/", L"_"); - mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext); + mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext); CreateDirectoryTreeT(tszRoot); if (DownloadFile(url, ai.filename)) { db_set_ts(hContact, MODULE, "ImagePath", ai.filename); @@ -359,9 +359,9 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(childName, L"lastBuildDate")) { + else if (!mir_wstrcmpi(childName, L"lastBuildDate")) { LPCTSTR szChildText = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf)); szChildText = buf; @@ -379,14 +379,14 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(childName, L"item")) { + else if (!mir_wstrcmpi(childName, L"item")) { CMString title, link, descr, author, comments, guid, category; time_t stamp = 0; for (int z = 0; z < xmlGetChildCount(child); z++) { HXML itemval = xmlGetChild(child, z); LPCTSTR itemName = xmlGetName(itemval); LPCTSTR value = NULL; - if (!mir_tstrcmpi(codepage, L"koi8-r")) { + if (!mir_wstrcmpi(codepage, L"koi8-r")) { wchar_t buf[MAX_PATH]; MultiByteToWideChar(20866, 0, _T2A(xmlGetText(itemval)), -1, buf, _countof(buf)); value = buf; @@ -395,29 +395,29 @@ void CheckCurrentFeed(MCONTACT hContact) value = xmlGetText(itemval); // We only use the first tag for now and ignore the rest. - if (!mir_tstrcmpi(itemName, L"title")) + if (!mir_wstrcmpi(itemName, L"title")) ClearText(title, value); - else if (!mir_tstrcmpi(itemName, L"link")) + else if (!mir_wstrcmpi(itemName, L"link")) ClearText(link, value); - else if (!mir_tstrcmpi(itemName, L"pubDate") || !mir_tstrcmpi(itemName, L"date")) { + else if (!mir_wstrcmpi(itemName, L"pubDate") || !mir_wstrcmpi(itemName, L"date")) { if (stamp == 0) stamp = DateToUnixTime(value, 0); } - else if (!mir_tstrcmpi(itemName, L"description") || !mir_tstrcmpi(itemName, L"encoded")) + else if (!mir_wstrcmpi(itemName, L"description") || !mir_wstrcmpi(itemName, L"encoded")) ClearText(descr, value); - else if (!mir_tstrcmpi(itemName, L"author") || !mir_tstrcmpi(itemName, L"creator")) + else if (!mir_wstrcmpi(itemName, L"author") || !mir_wstrcmpi(itemName, L"creator")) ClearText(author, value); - else if (!mir_tstrcmpi(itemName, L"comments")) + else if (!mir_wstrcmpi(itemName, L"comments")) ClearText(comments, value); - else if (!mir_tstrcmpi(itemName, L"guid")) + else if (!mir_wstrcmpi(itemName, L"guid")) ClearText(guid, value); - else if (!mir_tstrcmpi(itemName, L"category")) + else if (!mir_wstrcmpi(itemName, L"category")) ClearText(category, value); } @@ -425,27 +425,27 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(szNodeName, L"feed")) { + else if (!mir_wstrcmpi(szNodeName, L"feed")) { db_set_ts(hContact, MODULE, "MirVer", L"Atom 3"); for (int j = 0; j < xmlGetChildCount(node); j++) { HXML child = xmlGetChild(node, j); LPCTSTR szChildName = xmlGetName(child); - if (!mir_tstrcmpi(szChildName, L"title")) { + if (!mir_wstrcmpi(szChildName, L"title")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(szChildName, L"link")) { + else if (!mir_wstrcmpi(szChildName, L"link")) { for (int x = 0; x < xmlGetAttrCount(child); x++) { - if (!mir_tstrcmpi(xmlGetAttrName(child, x), L"rel")) - if (!mir_tstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), L"self")) + if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"rel")) + if (!mir_wstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), L"self")) break; - if (!mir_tstrcmpi(xmlGetAttrName(child, x), L"href")) + if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"href")) db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x))); } } - else if (!mir_tstrcmpi(szChildName, L"subtitle")) { + else if (!mir_wstrcmpi(szChildName, L"subtitle")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) { ClearText(szValue, szChildText); @@ -453,33 +453,33 @@ void CheckCurrentFeed(MCONTACT hContact) db_set_ts(hContact, "CList", "StatusMsg", szValue); } } - else if (!mir_tstrcmpi(szChildName, L"language")) { + else if (!mir_wstrcmpi(szChildName, L"language")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(szChildName, L"author")) { + else if (!mir_wstrcmpi(szChildName, L"author")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML authorval = xmlGetChild(child, x); - if (!mir_tstrcmpi(xmlGetName(authorval), L"email")) { + if (!mir_wstrcmpi(xmlGetName(authorval), L"email")) { db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval)); break; } } } - else if (!mir_tstrcmpi(szChildName, L"category")) { + else if (!mir_wstrcmpi(szChildName, L"category")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } - else if (!mir_tstrcmpi(szChildName, L"icon")) { + else if (!mir_wstrcmpi(szChildName, L"icon")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML imageval = xmlGetChild(child, x); - if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) { + if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); - ptrT szNick(db_get_tsa(hContact, MODULE, "Nick")); + ptrW szNick(db_get_tsa(hContact, MODULE, "Nick")); if (szNick) { PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; @@ -487,7 +487,7 @@ void CheckCurrentFeed(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext); wchar_t *filename = szNick; - mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); + mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { db_set_ts(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); @@ -498,7 +498,7 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(szChildName, L"updated")) { + else if (!mir_wstrcmpi(szChildName, L"updated")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) { wchar_t *lastupdtime = (wchar_t *)szChildText; @@ -512,57 +512,57 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(szChildName, L"entry")) { + else if (!mir_wstrcmpi(szChildName, L"entry")) { CMString title, link, descr, author, comments, guid, category; time_t stamp = 0; for (int z = 0; z < xmlGetChildCount(child); z++) { HXML itemval = xmlGetChild(child, z); LPCTSTR szItemName = xmlGetName(itemval); - if (!mir_tstrcmpi(szItemName, L"title")) { + if (!mir_wstrcmpi(szItemName, L"title")) { LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(title, szItemText); } - else if (!mir_tstrcmpi(szItemName, L"link")) { + else if (!mir_wstrcmpi(szItemName, L"link")) { for (int x = 0; x < xmlGetAttrCount(itemval); x++) { - if (!mir_tstrcmpi(xmlGetAttrName(itemval, x), L"href")) { + if (!mir_wstrcmpi(xmlGetAttrName(itemval, x), L"href")) { ClearText(link, xmlGetAttrValue(itemval, xmlGetAttrName(itemval, x))); break; } } } - else if (!mir_tstrcmpi(szItemName, L"updated")) { + else if (!mir_wstrcmpi(szItemName, L"updated")) { if (stamp == 0) stamp = DateToUnixTime(xmlGetText(itemval), 0); } - else if (!mir_tstrcmpi(szItemName, L"summary") || !mir_tstrcmpi(szItemName, L"content")) { + else if (!mir_wstrcmpi(szItemName, L"summary") || !mir_wstrcmpi(szItemName, L"content")) { LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(descr, szItemText); } - else if (!mir_tstrcmpi(szItemName, L"author")) { + else if (!mir_wstrcmpi(szItemName, L"author")) { for (int x = 0; x < xmlGetChildCount(itemval); x++) { HXML authorval = xmlGetChild(itemval, x); - if (!mir_tstrcmpi(xmlGetName(authorval), L"name") && xmlGetText(authorval)) { + if (!mir_wstrcmpi(xmlGetName(authorval), L"name") && xmlGetText(authorval)) { ClearText(author, xmlGetText(authorval)); break; } } } - else if (!mir_tstrcmpi(szItemName, L"comments")) { + else if (!mir_wstrcmpi(szItemName, L"comments")) { LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(comments, szItemText); } - else if (!mir_tstrcmpi(szItemName, L"id")) { + else if (!mir_wstrcmpi(szItemName, L"id")) { LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(guid, xmlGetText(itemval)); } - else if (!mir_tstrcmpi(szItemName, L"category")) { + else if (!mir_wstrcmpi(szItemName, L"category")) { for (int x = 0; x < xmlGetAttrCount(itemval); x++) { LPCTSTR szAttrName = xmlGetAttrName(itemval, x); - if (!mir_tstrcmpi(szAttrName, L"term") && xmlGetText(itemval)) { + if (!mir_wstrcmpi(szAttrName, L"term") && xmlGetText(itemval)) { ClearText(category, xmlGetAttrValue(itemval, szAttrName)); break; } @@ -598,9 +598,9 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (szData == NULL) return; - wchar_t *tszData = mir_utf8decodeT(szData); + wchar_t *tszData = mir_utf8decodeW(szData); if (!tszData) - tszData = mir_a2t(szData); + tszData = mir_a2u(szData); int bytesParsed = 0; HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); @@ -612,14 +612,14 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML node = xmlGetChild(hXml, childcount); while (node) { LPCTSTR szNodeName = xmlGetName(node); - if (!mir_tstrcmpi(szNodeName, L"rss") || !mir_tstrcmpi(szNodeName, L"rdf")) { + if (!mir_wstrcmpi(szNodeName, L"rss") || !mir_wstrcmpi(szNodeName, L"rdf")) { HXML chan = xmlGetChild(node, 0); for (int j = 0; j < xmlGetChildCount(chan); j++) { HXML child = xmlGetChild(chan, j); - if (!mir_tstrcmpi(xmlGetName(child), L"image")) { + if (!mir_wstrcmpi(xmlGetName(child), L"image")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML imageval = xmlGetChild(child, x); - if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) { + if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); @@ -632,7 +632,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext); wchar_t *filename = szNick; - mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); + mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { db_set_ts(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); @@ -646,17 +646,17 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) } } } - else if (!mir_tstrcmpi(szNodeName, L"feed")) { + else if (!mir_wstrcmpi(szNodeName, L"feed")) { for (int j = 0; j < xmlGetChildCount(node); j++) { HXML child = xmlGetChild(node, j); - if (!mir_tstrcmpi(xmlGetName(child), L"icon")) { + if (!mir_wstrcmpi(xmlGetName(child), L"icon")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML imageval = xmlGetChild(child, x); - if (!mir_tstrcmpi(xmlGetName(imageval), L"url")) { + if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); - ptrT szNick(db_get_tsa(hContact, MODULE, "Nick")); + ptrW szNick(db_get_tsa(hContact, MODULE, "Nick")); if (szNick) { PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; @@ -665,7 +665,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext); wchar_t *filename = szNick; - mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); + mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { db_set_ts(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 0943dcd303..e1a5b18e85 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -68,7 +68,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xmlGetName(node), L"body")); + } while (mir_wstrcmpi(xmlGetName(node), L"body")); } } else if (!xmlUrl && outlineChildsCount) @@ -77,8 +77,8 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM wchar_t *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL; BYTE NeedToImport = FALSE; for (int i = 0; i < outlineAttr; i++) { - if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) { - text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); + if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"text")) { + text = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if (!text) { isTextUTF = 0; text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); @@ -88,15 +88,15 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int j = 0; j < count; j++) { wchar_t item[MAX_PATH]; SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)j, (LPARAM)item); - if (!mir_tstrcmpi(item, text)) { + if (!mir_wstrcmpi(item, text)) { NeedToImport = TRUE; break; } } continue; } - if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"xmlUrl")) { - url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); + if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"xmlUrl")) { + url = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if ( !url) { isURLUTF = false; url = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); @@ -108,8 +108,8 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } continue; } - if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"htmlUrl")) { - siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); + if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"htmlUrl")) { + siteurl = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if ( !siteurl) { isSiteURLUTF = false; siteurl = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); @@ -124,13 +124,13 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (NeedToImport) { HXML parent = xmlGetParent(node); wchar_t tmpgroup[1024]; - while (mir_tstrcmpi(xmlGetName(parent), L"body")) { + while (mir_wstrcmpi(xmlGetName(parent), L"body")) { for (int i = 0; i < xmlGetAttrCount(parent); i++) { - if (!mir_tstrcmpi(xmlGetAttrName(parent, i), L"text")) { + if (!mir_wstrcmpi(xmlGetAttrName(parent, i), L"text")) { if ( !group) group = (wchar_t *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i)); else { - mir_sntprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group); + mir_snwprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group); group = tmpgroup; } break; @@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM wchar_t *ptszGroup = NULL; if (group) { - ptszGroup = mir_utf8decodeT(_T2A(group)); + ptszGroup = mir_utf8decodeW(_T2A(group)); if ( !ptszGroup) { isGroupUTF = false; ptszGroup = group; @@ -183,7 +183,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (node) break; } - while (mir_tstrcmpi(xmlGetName(tmpnode), L"body")); + while (mir_wstrcmpi(xmlGetName(tmpnode), L"body")); } } } @@ -195,9 +195,9 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } wchar_t mes[MAX_PATH]; if (DUPES) - mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES); + mir_snwprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES); else - mir_sntprintf(mes, TranslateT("Imported %d feed(s)."), count); + mir_snwprintf(mes, TranslateT("Imported %d feed(s)."), count); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION); } } @@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0}; ofn.lStructSize = sizeof(ofn); wchar_t tmp[MAX_PATH]; - mir_sntprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0); + mir_snwprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0); ofn.lpstrFilter = tmp; ofn.hwndOwner = 0; ofn.lpstrFile = FileName; @@ -248,15 +248,15 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xmlGetName(node), L"body")); + } while (mir_wstrcmpi(xmlGetName(node), L"body")); } } else if (!xmlUrl && outlineChildsCount) node = xmlGetFirstChild(node); else if (xmlUrl) { for (int i = 0; i < outlineAttr; i++) { - if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) { - wchar_t *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); + if (!mir_wstrcmpi(xmlGetAttrName(node, i), L"text")) { + wchar_t *text = mir_utf8decodeW(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); bool isTextUTF; if (!text) { isTextUTF = false; @@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xmlGetName(tmpnode), L"body")); + } while (mir_wstrcmpi(xmlGetName(tmpnode), L"body")); } } } @@ -477,7 +477,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0}; ofn.lStructSize = sizeof(ofn); wchar_t tmp[MAX_PATH]; - mir_sntprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0); + mir_snwprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0); ofn.lpstrFilter = tmp; ofn.hwndOwner = 0; ofn.lpstrFile = FileName; diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index e27cd761d9..fb3deb5320 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -44,7 +44,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK); break; } - if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) { + if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) { MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK); break; } @@ -95,7 +95,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TAGHELP: wchar_t tszTagHelp[1024]; - mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", + mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", L"##", TranslateT("The title of the item."), L"#<description>#", TranslateT("The item synopsis."), L"#<link>#", TranslateT("The URL of the item."), @@ -116,7 +116,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); wchar_t tszURL[MAX_PATH] = { 0 }; wchar_t *tszTitle = NULL; - if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) + if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0) tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg); else MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK); @@ -152,12 +152,12 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999); for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { - ptrT dbNick(db_get_tsa(hContact, MODULE, "Nick")); - if ((dbNick == NULL) || (mir_tstrcmp(dbNick, SelItem.nick) != 0)) + ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick")); + if ((dbNick == NULL) || (mir_wstrcmp(dbNick, SelItem.nick) != 0)) continue; - ptrT dbURL(db_get_tsa(hContact, MODULE, "URL")); - if ((dbURL == NULL) || (mir_tstrcmp(dbURL, SelItem.url) != 0)) + ptrW dbURL(db_get_tsa(hContact, MODULE, "URL")); + if ((dbURL == NULL) || (mir_wstrcmp(dbURL, SelItem.url) != 0)) continue; ItemInfo *nSelItem = new ItemInfo(SelItem); @@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK); break; } - if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) { + if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) { MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK); break; } @@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP: wchar_t tszTagHelp[1024]; - mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", + mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", L"#<title>#", TranslateT("The title of the item."), L"#<description>#", TranslateT("The item synopsis."), L"#<link>#", TranslateT("The URL of the item."), @@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_DISCOVERY: wchar_t tszURL[MAX_PATH] = { 0 }; - if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) { + if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0) { EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg); @@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP MessageBox(hwndDlg, TranslateT("Enter Feed name"), TranslateT("Error"), MB_OK); break; } - if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_tstrcmp(str, L"http://") == 0) { + if (!GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str)) || mir_wstrcmp(str, L"http://") == 0) { MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK); break; } @@ -411,7 +411,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP: wchar_t tszTagHelp[1024]; - mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", + mir_snwprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", L"#<title>#", TranslateT("The title of the item."), L"#<description>#", TranslateT("The item synopsis."), L"#<link>#", TranslateT("The URL of the item."), @@ -429,7 +429,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_DISCOVERY: wchar_t tszURL[MAX_PATH] = { 0 }; - if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) { + if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_wstrcmp(tszURL, L"http://") != 0) { EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg); @@ -498,16 +498,16 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 1, url, _countof(url)); for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { - ptrT dbNick(db_get_tsa(hContact, MODULE, "Nick")); + ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick")); if (dbNick == NULL) break; - if (mir_tstrcmp(dbNick, nick)) + if (mir_wstrcmp(dbNick, nick)) continue; - ptrT dbURL(db_get_tsa(hContact, MODULE, "URL")); + ptrW dbURL(db_get_tsa(hContact, MODULE, "URL")); if (dbURL == NULL) break; - if (mir_tstrcmp(dbURL, url)) + if (mir_wstrcmp(dbURL, url)) continue; CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index d3cdfb6839..6b613a231d 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -40,7 +40,7 @@ int NewsAggrInit(WPARAM, LPARAM) if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER))) FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, L""); else - mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot)); + mir_wstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot)); for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1)) diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 6a7558ba34..8c6ba7e73b 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -54,7 +54,7 @@ void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11 | NLHRF_REDIRECT; if (wcsstr(tszUrl, L"https://") != NULL) nlhr.flags |= NLHRF_SSL; - char *szUrl = mir_t2a(tszUrl); + char *szUrl = mir_u2a(tszUrl); nlhr.szUrl = szUrl; nlhr.nlc = hNetlibHttp; @@ -197,52 +197,52 @@ time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType) weekday = wcstok(p, L","); p = wcstok(NULL, L","); swscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem); - if (!mir_tstrcmpi(monthstr, L"Jan")) + if (!mir_wstrcmpi(monthstr, L"Jan")) month = 1; - if (!mir_tstrcmpi(monthstr, L"Feb")) + if (!mir_wstrcmpi(monthstr, L"Feb")) month = 2; - if (!mir_tstrcmpi(monthstr, L"Mar")) + if (!mir_wstrcmpi(monthstr, L"Mar")) month = 3; - if (!mir_tstrcmpi(monthstr, L"Apr")) + if (!mir_wstrcmpi(monthstr, L"Apr")) month = 4; - if (!mir_tstrcmpi(monthstr, L"May")) + if (!mir_wstrcmpi(monthstr, L"May")) month = 5; - if (!mir_tstrcmpi(monthstr, L"Jun")) + if (!mir_wstrcmpi(monthstr, L"Jun")) month = 6; - if (!mir_tstrcmpi(monthstr, L"Jul")) + if (!mir_wstrcmpi(monthstr, L"Jul")) month = 7; - if (!mir_tstrcmpi(monthstr, L"Aug")) + if (!mir_wstrcmpi(monthstr, L"Aug")) month = 8; - if (!mir_tstrcmpi(monthstr, L"Sep")) + if (!mir_wstrcmpi(monthstr, L"Sep")) month = 9; - if (!mir_tstrcmpi(monthstr, L"Oct")) + if (!mir_wstrcmpi(monthstr, L"Oct")) month = 10; - if (!mir_tstrcmpi(monthstr, L"Nov")) + if (!mir_wstrcmpi(monthstr, L"Nov")) month = 11; - if (!mir_tstrcmpi(monthstr, L"Dec")) + if (!mir_wstrcmpi(monthstr, L"Dec")) month = 12; if (year < 2000) year += 2000; - if (!mir_tstrcmp(timezonesign, L"+")) - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec); - else if (!mir_tstrcmp(timezonesign, L"-")) - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec); + if (!mir_wstrcmp(timezonesign, L"+")) + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec); + else if (!mir_wstrcmp(timezonesign, L"-")) + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec); else - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); } else if (wcsstr(p, L"T")) { swscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec); - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); } else { swscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem); - if (!mir_tstrcmp(timezonesign, L"+")) - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec); - else if (!mir_tstrcmp(timezonesign, L"-")) - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec); + if (!mir_wstrcmp(timezonesign, L"+")) + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec); + else if (!mir_wstrcmp(timezonesign, L"-")) + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour + timezoneh, min + timezonem, sec); else - mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); + mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec); } } // Get the date part @@ -290,7 +290,7 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) nlhr.cbSize = sizeof(nlhr); nlhr.requestType = REQUEST_GET; nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11; - char *szUrl = mir_t2a(tszURL); + char *szUrl = mir_u2a(tszURL); nlhr.szUrl = szUrl; NETLIBHTTPHEADER headers[4]; nlhr.headersCount = 4; @@ -320,8 +320,8 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) } } if (date != NULL && size != NULL) { - wchar_t *tdate = mir_a2t(date); - wchar_t *tsize = mir_a2t(size); + wchar_t *tdate = mir_a2u(date); + wchar_t *tsize = mir_a2u(size); struct _stat buf; int fh = _wopen(tszLocal, _O_RDONLY); @@ -471,7 +471,7 @@ MCONTACT GetContactByNick(const wchar_t *nick) for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick")); - if (!mir_tstrcmpi(contactNick, nick)) + if (!mir_wstrcmpi(contactNick, nick)) break; } return hContact; @@ -483,7 +483,7 @@ MCONTACT GetContactByURL(const wchar_t *url) for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL")); - if (!mir_tstrcmpi(contactURL, url)) + if (!mir_wstrcmpi(contactURL, url)) break; } return hContact; -- cgit v1.2.3