summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src/Xfire_base.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-10-18 14:34:21 +0000
committerRobert Pösel <robyer@seznam.cz>2013-10-18 14:34:21 +0000
commit1e7f13db4500b6eb520651b44439d9ae78ca532c (patch)
tree927a0a7d51477ddc7d442221726562c858dc90c4 /protocols/Xfire/src/Xfire_base.cpp
parentc225876c8534502f20d55f22f2d07ce729590bcd (diff)
XFire: compile plugin as unicode, various fixes and cleanup, version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@6516 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src/Xfire_base.cpp')
-rw-r--r--protocols/Xfire/src/Xfire_base.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp
index 13f7c49afa..860096e325 100644
--- a/protocols/Xfire/src/Xfire_base.cpp
+++ b/protocols/Xfire/src/Xfire_base.cpp
@@ -33,6 +33,19 @@ void Xfire_base::strtolower(char*str)
}
}
+void Xfire_base::strtolowerT(TCHAR*str)
+{
+ //keins tirng? bye bye
+ if(str==NULL)
+ return;
+
+ //lowercase it :)
+ for(unsigned int i=0;i<(int)_tcslen(str);i++)
+ {
+ str[i]=tolower(str[i]);
+ }
+}
+
//uppercased einen string
void Xfire_base::strtoupper(char*str)
{
@@ -355,8 +368,11 @@ BOOL Xfire_base::inString(char*str,char*search,char**pos) {
}
void Xfire_base::strreplace(char*search,char*replace,char**data) {
+ if (replace == NULL)
+ replace = "";
+
//leere pointer?, dann zurück
- if(replace==NULL||search==NULL||data==NULL||*data==NULL)
+ if (search == NULL || data == NULL || *data == NULL)
{
return;
}
@@ -387,7 +403,7 @@ void Xfire_base::strreplace(char*search,char*replace,char**data) {
}
//stringvergleich mit wildcards
-BOOL Xfire_base::wildcmp(const char*search,const char *text) {
+BOOL Xfire_base::wildcmp(const TCHAR *search,const TCHAR *text) {
//keine gültigen strings, dann abbruch
if(search==NULL || text==NULL || *text==0 || *search==0)
return FALSE;
@@ -600,7 +616,7 @@ BOOL Xfire_base::isValidPid(DWORD pid) {
}
//sucht nach einen process und liefert die pid
-BOOL Xfire_base::getPidByProcessName(char*name,DWORD*pid) {
+BOOL Xfire_base::getPidByProcessName(TCHAR *name, DWORD *pid) {
if(pid==NULL||name==NULL)
return FALSE;
@@ -611,14 +627,14 @@ BOOL Xfire_base::getPidByProcessName(char*name,DWORD*pid) {
while ( Process32Next ( hSnapShot,processInfo ) != FALSE)
{
if(processInfo->th32ProcessID!=0) {
- if(_stricmp(processInfo->szExeFile,name)==0)
+ if(_tcsicmp(processInfo->szExeFile,name)==0)
{
*pid=processInfo->th32ProcessID;
- CloseHandle ( hSnapShot);
+ CloseHandle(hSnapShot);
return TRUE;
}
}
}
- CloseHandle ( hSnapShot);
+ CloseHandle(hSnapShot);
return FALSE;
}