From 0a9ed0f9b84247b0dda23500b7ab301a1238736b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 17 Nov 2015 06:57:59 +0100 Subject: m + split wchar/*.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/wchar/wcsspn.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'src/wchar/wcsspn.c') diff --git a/src/wchar/wcsspn.c b/src/wchar/wcsspn.c index e4a1190..4a023d5 100644 --- a/src/wchar/wcsspn.c +++ b/src/wchar/wcsspn.c @@ -41,47 +41,3 @@ size_t wcsspn(const wchar_t* string, const wchar_t* skipset) return (size_t)(s - 1 - string); } - -/** - * Returns length of the initial substring - * that consists entirely of the complement - * of a set of specified wide characters. - * - * @param string The string. - * @param stopset Characters disallowed in the substring. - * @return The length of the substring. - */ -size_t wcscspn(const wchar_t* string, const wchar_t* stopset) -{ - size_t i, end = wcslen(string); - wchar_t* s; - wchar_t c; - while ((c = *stopset++)) - for (i = 0, s = string; *s && (i < end); i++, s++) - if (*s == c) - { - end = (size_t)(s - string); - break; - } - return end; -} - - -/** - * This function works like `strcspn`, - * except it returns the pointer to the - * location of the first found non-matching - * wide character. - * - * @param string The string. - * @param stopset Bytes disallowed in the substring. - * @return A pointer to the first occurrence in - * `string` of a character found in `stopset`. - * `NULL` is returned if none is found. - */ -wchar_t* (wcspbrk)(const wchar_t* string, const wchar_t* stopset) -{ - string += wcscspn(string, stopset); - return *string ? string : NULL; -} - -- cgit v1.2.3-70-g09d2