diff options
author | George Hazan <ghazan@miranda.im> | 2017-09-19 22:20:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-09-19 22:20:01 +0300 |
commit | 2763040215137717c01e3b170e44b8b55cf38593 (patch) | |
tree | 7296d5acff252034706a58acae91d078c6d3060e /plugins/PluginUpdater/src/Compat/compat.cpp | |
parent | 23445f29860da2ebec3ba021f79f860e128e9113 (diff) |
update for PluginUpdater_IM
Diffstat (limited to 'plugins/PluginUpdater/src/Compat/compat.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Compat/compat.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/Compat/compat.cpp b/plugins/PluginUpdater/src/Compat/compat.cpp index 2cd1a58815..1da442ee41 100644 --- a/plugins/PluginUpdater/src/Compat/compat.cpp +++ b/plugins/PluginUpdater/src/Compat/compat.cpp @@ -69,17 +69,53 @@ char *rtrim(char *str) return str;
}
-void CreatePathToFileT(TCHAR *tszFilePath)
+wchar_t* strdelw(wchar_t *str, size_t len)
+{
+ wchar_t* p;
+ for (p = str + len; *p != 0; p++)
+ *(p - len) = *p;
+
+ *(p - len) = '\0';
+ return str;
+}
+
+void CreatePathToFileW(WCHAR *tszFilePath)
{
TCHAR *pszLastBackslash = _tcsrchr(tszFilePath, '\\');
if (pszLastBackslash != NULL){
*pszLastBackslash = '\0';
- CreateDirectoryTreeT(tszFilePath);
+ CreateDirectoryTreeW(tszFilePath);
*pszLastBackslash = '\\';
}
}
-int wildcmpit(const WCHAR *name, const WCHAR *mask)
+int mir_snwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, ...)
+{
+ va_list va;
+ va_start(va, fmt);
+ int len = _vsntprintf(buffer, count-1, fmt, va);
+ va_end(va);
+ buffer[count-1] = 0;
+ return len;
+}
+
+int mir_vsnwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, va_list va)
+{
+ int len = _vsntprintf(buffer, count-1, fmt, va);
+ buffer[count-1] = 0;
+ return len;
+}
+
+int mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : -1;
+ if (p2 == NULL)
+ return 1;
+ return _wcsicmp(p1, p2);
+}
+
+int wildcmpiw(const WCHAR *name, const WCHAR *mask)
{
if (name == NULL || mask == NULL)
return false;
|