diff options
Diffstat (limited to 'plugins/Ping/src')
-rw-r--r-- | plugins/Ping/src/log.cpp | 4 | ||||
-rw-r--r-- | plugins/Ping/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/Ping/src/pinggraph.cpp | 22 | ||||
-rw-r--r-- | plugins/Ping/src/pinglist.cpp | 12 | ||||
-rw-r--r-- | plugins/Ping/src/pingthread.cpp | 46 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 16 |
6 files changed, 51 insertions, 51 deletions
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 01bb07e671..c99af91c06 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -34,10 +34,10 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { wchar_t *filename = (wchar_t *)lParam;
if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
- mir_tstrncat(filename, L"\\ping_log.txt", wParam - mir_tstrlen(filename));
+ mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename));
}
else {
- mir_tstrncpy(filename, dbv.ptszVal, wParam);
+ mir_wstrncpy(filename, dbv.ptszVal, wParam);
db_free(&dbv);
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 853473e3cc..1f77da46d2 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_LOGBROWSE:
{
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_snwprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile = options.log_filename;
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index f8a5fef2c5..1b95e95649 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -190,20 +190,20 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar wchar_t buff[64];
if (wd->show_grid)
{
- mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME);
- TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("%d ms"), MARK_TIME);
+ TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_wstrlen(buff));
}
if (wd->show_stat)
{
SetTextColor(hdc, RGB(255, 0, 0));
- mir_sntprintf(buff, TranslateT("AVG %.1lf ms"), avg);
- TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("AVG %.1lf ms"), avg);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
if (max_value != avg) {
- mir_sntprintf(buff, TranslateT("MAX %hd ms"), max_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
- mir_sntprintf(buff, TranslateT("MIN %hd ms"), min_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
+ mir_snwprintf(buff, TranslateT("MAX %hd ms"), max_value);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
+ mir_snwprintf(buff, TranslateT("MIN %hd ms"), min_value);
+ TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_wstrlen(buff));
}
}
@@ -276,10 +276,10 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { RegisterClass(&wndclass);
wchar_t title[256];
- mir_tstrncpy(title, TranslateT("Ping Graph"), _countof(title));
+ mir_wstrncpy(title, TranslateT("Ping Graph"), _countof(title));
if (lParam) {
- mir_tstrncat(title, L" - ", _countof(title) - mir_tstrlen(title));
- mir_tstrncat(title, (wchar_t *)lParam, _countof(title) - mir_tstrlen(title));
+ mir_wstrncat(title, L" - ", _countof(title) - mir_wstrlen(title));
+ mir_wstrncat(title, (wchar_t *)lParam, _countof(title) - mir_wstrlen(title));
}
HWND parent = 0;
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index c08d279610..9ba42dad03 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -68,11 +68,11 @@ void write_ping_address(PINGADDRESS &i) db_set_w(0, buff, "Status", i.status);
db_set_dw(0, buff, "Port", i.port);
db_set_s(0, buff, "Proto", i.pszProto);
- if (mir_tstrlen(i.pszCommand))
+ if (mir_wstrlen(i.pszCommand))
db_set_ts(0, buff, "Command", i.pszCommand);
else
db_unset(0, buff, "Command");
- if (mir_tstrlen(i.pszParams))
+ if (mir_wstrlen(i.pszParams))
db_set_ts(0, buff, "CommandParams", i.pszParams);
else
db_unset(0, buff, "CommandParams");
@@ -116,13 +116,13 @@ bool read_ping_address(PINGADDRESS &pa) { DBVARIANT dbv;
if (!db_get_ts(0, buff, "Address", &dbv)) {
- mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else return false;
if (!db_get_ts(0, buff, "Label", &dbv)) {
- mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else return false;
@@ -139,13 +139,13 @@ bool read_ping_address(PINGADDRESS &pa) { else pa.pszProto[0] = '\0';
if (!db_get_ts(0, buff, "Command", &dbv)) {
- mir_tstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
+ mir_wstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
db_free(&dbv);
}
else
pa.pszCommand[0] = '\0';
if (!db_get_ts(0, buff, "CommandParams", &dbv)) {
- mir_tstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
+ mir_wstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
db_free(&dbv);
}
else
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 0381c05b35..7e6ccdbfc4 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -70,7 +70,7 @@ void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_st if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
if (options.logging) {
wchar_t buf[1024];
- mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
+ mir_snwprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
@@ -118,8 +118,8 @@ void __cdecl sttCheckStatusThreadProc(void*) pa.item_id = i->item_id;
pa.miss_count = i->miss_count;
pa.port = i->port;
- mir_tstrncpy(pa.pszLabel, i->pszLabel, _countof(pa.pszLabel));
- mir_tstrncpy(pa.pszName, i->pszName, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszLabel, i->pszLabel, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszName, i->pszName, _countof(pa.pszName));
mir_strncpy(pa.pszProto, i->pszProto, _countof(pa.pszProto));
pa.set_status = i->set_status;
pa.status = i->status;
@@ -195,7 +195,7 @@ void __cdecl sttCheckStatusThreadProc(void*) }
if (pa.miss_count == -1 - options.retries && options.logging) {
wchar_t buf[512];
- mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
+ mir_snwprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status);
@@ -209,7 +209,7 @@ void __cdecl sttCheckStatusThreadProc(void*) }
if (pa.miss_count == 1 + options.retries && options.logging) {
wchar_t buf[512];
- mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
+ mir_snwprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
}
@@ -308,9 +308,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
wchar_t TBcapt[255];
if (total > 0)
- mir_sntprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
+ mir_snwprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
else
- mir_sntprintf(TBcapt, L"Ping");
+ mir_snwprintf(TBcapt, L"Ping");
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
@@ -384,20 +384,20 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar dis->rcItem.left += options.indent;
DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top + ((options.row_height - 16) >> 1), hIcon, 0, 0, 0, NULL, DI_NORMAL);
- GetTextExtentPoint32(dis->hDC, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel), &textSize);
- TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel));
+ GetTextExtentPoint32(dis->hDC, itemData.pszLabel, (int)mir_wstrlen(itemData.pszLabel), &textSize);
+ TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_wstrlen(itemData.pszLabel));
if (itemData.status != PS_DISABLED) {
wchar_t buf[256];
if (itemData.responding) {
- mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
- GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
- TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
+ mir_snwprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
+ GetTextExtentPoint32(dis->hDC, buf, (int)mir_wstrlen(buf), &textSize);
+ TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_wstrlen(buf));
}
else if (itemData.miss_count > 0) {
- mir_sntprintf(buf, L"[%d]", itemData.miss_count);
- GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
- TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
+ mir_snwprintf(buf, L"[%d]", itemData.miss_count);
+ GetTextExtentPoint32(dis->hDC, buf, (int)mir_wstrlen(buf), &textSize);
+ TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_wstrlen(buf));
}
}
SetBkMode(dis->hDC, OPAQUE);
@@ -717,7 +717,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (options.logging) {
wchar_t buf[1024];
- mir_sntprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
+ mir_snwprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
}
@@ -917,25 +917,25 @@ void InitList() }
font_id.cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
- mir_tstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
+ mir_wstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
+ mir_wstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
- mir_tstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
- mir_tstrncpy(font_id.backgroundName, L"Background", _countof(font_id.backgroundName));
+ mir_wstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
+ mir_wstrncpy(font_id.backgroundName, L"Background", _countof(font_id.backgroundName));
font_id.order = 0;
font_id.flags = FIDF_DEFAULTVALID;
font_id.deffontsettings.charset = DEFAULT_CHARSET;
font_id.deffontsettings.size = -14;
font_id.deffontsettings.style = 0;
font_id.deffontsettings.colour = RGB(255, 255, 255);
- mir_tstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
+ mir_wstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
FontRegisterT(&font_id);
bk_col_id.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
- mir_tstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name));
+ mir_wstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
+ mir_wstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name));
mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
bk_col_id.defcolour = RGB(0, 0, 0);
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index db10527710..37c01d0d28 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -38,8 +38,8 @@ void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags) ppd->lchContact = NULL;
ppd->lchIcon = (flags ? hIconResponding : hIconNotResponding);
- mir_tstrncpy(ppd->lptzContactName, line1, _countof(ppd->lptzContactName));
- mir_tstrncpy(ppd->lptzText, line2, _countof(ppd->lptzText));
+ mir_wstrncpy(ppd->lptzContactName, line1, _countof(ppd->lptzContactName));
+ mir_wstrncpy(ppd->lptzText, line2, _countof(ppd->lptzText));
ppd->colorBack = GetSysColor(COLOR_BTNFACE);
ppd->colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -89,7 +89,7 @@ INT_PTR PluginPing(WPARAM, LPARAM lParam) //GetLocalTime(&systime);
NETLIBOPENCONNECTION conn = { 0 };
conn.cbSize = sizeof(NETLIBOPENCONNECTION);
- conn.szHost = mir_t2a(pa->pszName);
+ conn.szHost = mir_u2a(pa->pszName);
conn.wPort = pa->port;
conn.timeout = options.ping_timeout;
@@ -205,7 +205,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM) { CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->item_id == (DWORD)wParam) {
- if (mir_tstrlen(i->pszCommand)) {
+ if (mir_wstrlen(i->pszCommand)) {
ShellExecute(0, L"open", i->pszCommand, i->pszParams, 0, SW_SHOW);
}
else {
@@ -222,19 +222,19 @@ void import_ping_address(int index, PINGADDRESS &pa) { char buf[256];
mir_snprintf(buf, "Address%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
- mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else
- mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
mir_snprintf(buf, "Label%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
- mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else
- mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel));
mir_snprintf(buf, "Port%d", index);
pa.port = (int)db_get_dw(0, "PingPlug", buf, -1);
|