summaryrefslogtreecommitdiff
path: root/plugins/TrafficCounter/src/vars.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TrafficCounter/src/vars.cpp')
-rw-r--r--plugins/TrafficCounter/src/vars.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp
index 5f55778802..62da3f32f7 100644
--- a/plugins/TrafficCounter/src/vars.cpp
+++ b/plugins/TrafficCounter/src/vars.cpp
@@ -30,7 +30,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
if (ai->argc != 5) return NULL;
- if (!mir_tstrcmp(ai->targv[1], _T("overall")))
+ if (!mir_tstrcmp(ai->targv[1], L"overall"))
{
tmpsn = OverallInfo.CurrentSentTraffic;
tmprn = OverallInfo.CurrentRecvTraffic;
@@ -38,7 +38,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
tmprt = OverallInfo.TotalRecvTraffic;
}
else
- if (!mir_tstrcmp(ai->targv[1], _T("summary")))
+ if (!mir_tstrcmp(ai->targv[1], L"summary"))
{
for (ed = 0; ed < NumberOfAccounts; ed++)
if (ProtoList[ed].Visible)
@@ -68,34 +68,34 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
if (tmp != 0xAA) return NULL;
}
- if (!mir_tstrcmp(ai->targv[2], _T("now")))
+ if (!mir_tstrcmp(ai->targv[2], L"now"))
{
- if (!mir_tstrcmp(ai->targv[3], _T("sent"))) tmp = tmpsn;
+ if (!mir_tstrcmp(ai->targv[3], L"sent")) tmp = tmpsn;
else
- if (!mir_tstrcmp(ai->targv[3], _T("received"))) tmp = tmprn;
+ if (!mir_tstrcmp(ai->targv[3], L"received")) tmp = tmprn;
else
- if (!mir_tstrcmp(ai->targv[3], _T("both"))) tmp = tmprn + tmpsn;
+ if (!mir_tstrcmp(ai->targv[3], L"both")) tmp = tmprn + tmpsn;
else return NULL;
}
else
- if (!mir_tstrcmp(ai->targv[2], _T("total")))
+ if (!mir_tstrcmp(ai->targv[2], L"total"))
{
- if (!mir_tstrcmp(ai->targv[3], _T("sent"))) tmp = tmpst;
+ if (!mir_tstrcmp(ai->targv[3], L"sent")) tmp = tmpst;
else
- if (!mir_tstrcmp(ai->targv[3], _T("received"))) tmp = tmprt;
+ if (!mir_tstrcmp(ai->targv[3], L"received")) tmp = tmprt;
else
- if (!mir_tstrcmp(ai->targv[3], _T("both"))) tmp = tmprt + tmpst;
+ if (!mir_tstrcmp(ai->targv[3], L"both")) tmp = tmprt + tmpst;
else return NULL;
}
else return NULL;
- if (!mir_tstrcmp(ai->targv[4], _T("b"))) ed = 0;
+ if (!mir_tstrcmp(ai->targv[4], L"b")) ed = 0;
else
- if (!mir_tstrcmp(ai->targv[4], _T("k"))) ed = 1;
+ if (!mir_tstrcmp(ai->targv[4], L"k")) ed = 1;
else
- if (!mir_tstrcmp(ai->targv[4], _T("m"))) ed = 2;
+ if (!mir_tstrcmp(ai->targv[4], L"m")) ed = 2;
else
- if (!mir_tstrcmp(ai->targv[4], _T("d"))) ed = 3;
+ if (!mir_tstrcmp(ai->targv[4], L"d")) ed = 3;
else return NULL;
// Получаем форматированную строку и возвращаем указатель на неё.
@@ -126,21 +126,21 @@ static TCHAR* GetTime(ARGUMENTSINFO *ai)
if (!mir_tstrcmp(buf, ai->targv[1]))
{
flag = 0xAA;
- if (!mir_tstrcmp(ai->targv[2], _T("now")))
+ if (!mir_tstrcmp(ai->targv[2], L"now"))
Duration = ProtoList[ed].Session.Timer;
- else if (!mir_tstrcmp(ai->targv[2], _T("total")))
+ else if (!mir_tstrcmp(ai->targv[2], L"total"))
Duration = ProtoList[ed].Total.Timer;
else flag = 0;
break;
}
mir_free(buf);
}
- if ( (flag != 0xAA) && !mir_tstrcmp(ai->targv[1], _T("summary")) )
+ if ( (flag != 0xAA) && !mir_tstrcmp(ai->targv[1], L"summary") )
{
flag = 0xAA;
- if (!mir_tstrcmp(ai->targv[2], _T("now")))
+ if (!mir_tstrcmp(ai->targv[2], L"now"))
Duration = OverallInfo.Session.Timer;
- else if (!mir_tstrcmp(ai->targv[2], _T("total")))
+ else if (!mir_tstrcmp(ai->targv[2], L"total"))
Duration = OverallInfo.Total.Timer;
else flag = 0;
}
@@ -167,14 +167,14 @@ void RegisterVariablesTokens(void)
trs.cbSize = sizeof(TOKENREGISTER);
// Функция, возвращающая трафик
- trs.tszTokenString = _T("tc_GetTraffic");
+ trs.tszTokenString = L"tc_GetTraffic";
trs.parseFunctionT = GetTraffic;
trs.szHelpText = "Traffic counter\t(A,B,C,D)\tGet traffic counter value. A: <ProtocolName> OR overall OR summary; B: now OR total; C: sent OR received OR both; D: b - in bytes, k - in kilobytes, m - in megabytes, d - dynamic";
trs.flags = TRF_TCHAR | TRF_PARSEFUNC | TRF_FUNCTION | TRF_FREEMEM;
trs.memType = TR_MEM_MIRANDA;
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&trs);
// Функция, возвращающая время
- trs.tszTokenString = _T("tc_GetTime");
+ trs.tszTokenString = L"tc_GetTime";
trs.parseFunctionT = GetTime;
trs.szHelpText = "Traffic counter\t(A,B,C)\tGet time counter value. A: <ProtocolName> OR summary; B: now OR total; C: format";
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&trs);