From 1b9f36054bddeef87d4f9c139877d28c4e6b1702 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 1 Sep 2015 15:17:39 +0000 Subject: - strdel()/strdelw() moved to the core; - custom implementations removed git-svn-id: http://svn.miranda-ng.org/main/trunk@15135 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/src/mir_core.def | 2 ++ src/mir_core/src/mir_core64.def | 2 ++ src/mir_core/src/utils.cpp | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+) (limited to 'src/mir_core') diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 57f8bfcfd9..6ec2a2e42e 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -981,3 +981,5 @@ mir_strncmp @1138 mir_strncmpi @1139 mir_wstrncmp @1140 mir_wstrncmpi @1141 +strdel @1142 +strdelw @1143 diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index c44c595634..07fe41af64 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -981,3 +981,5 @@ mir_strncmp @1138 mir_strncmpi @1139 mir_wstrncmp @1140 mir_wstrncmpi @1141 +strdel @1142 +strdelw @1143 diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp index 5f4d0d063b..7ef78fd593 100644 --- a/src/mir_core/src/utils.cpp +++ b/src/mir_core/src/utils.cpp @@ -142,6 +142,28 @@ MIR_CORE_DLL(WCHAR*) ltrimpw(WCHAR *str) ///////////////////////////////////////////////////////////////////////////////////////// +MIR_CORE_DLL(char*) strdel(char *str, size_t len) +{ + char* p; + for (p = str + len; *p != 0; p++) + p[-len] = *p; + + p[-len] = '\0'; + return str; +} + +MIR_CORE_DLL(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; +} + +///////////////////////////////////////////////////////////////////////////////////////// + MIR_CORE_DLL(int) wildcmp(const char *name, const char *mask) { if (name == NULL || mask == NULL) -- cgit v1.2.3