diff options
author | unknown <b0ris@b0ris-satellite.(none)> | 2012-01-16 02:21:03 +0200 |
---|---|---|
committer | unknown <b0ris@b0ris-satellite.(none)> | 2012-01-16 02:21:03 +0200 |
commit | d3f5a1e20f159287764d3090ad0024ef42812709 (patch) | |
tree | 8ba8415256c2c5dd8f62378b177fb5303b4497e6 /client/Utility.cpp | |
parent | 0822cf0b82aff2e265a78f61fcb976c300c44ace (diff) |
Proxifier's config lookup
Diffstat (limited to 'client/Utility.cpp')
-rw-r--r-- | client/Utility.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/client/Utility.cpp b/client/Utility.cpp index 2faed74..547a56a 100644 --- a/client/Utility.cpp +++ b/client/Utility.cpp @@ -27,3 +27,29 @@ QByteArray md5_sum(QString &filename) Logger::Debug("MD5 sum for %s is: %s\n", filename.toStdString().c_str(), res.data()); return res; } + +#ifdef WIN32 + +int wstrlen(_TCHAR * wstr) +{ + int l_idx = 0; + while (((char*)wstr)[l_idx]!=0) l_idx+=2; + return l_idx; +} + +char* wstrdup(_TCHAR* wSrc) +{ + int l_idx=0; + int l_len = wstrlen(wSrc); + char * l_nstr = (char*)malloc(l_len); + if (l_nstr) { + do { + l_nstr[l_idx] = (char)wSrc[l_idx]; + l_idx++; + } while ((char)wSrc[l_idx]!=0); + } + l_nstr[l_idx] = 0; + return l_nstr; +} + +#endif
\ No newline at end of file |