diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-17 06:57:59 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-17 06:57:59 +0100 |
commit | 0a9ed0f9b84247b0dda23500b7ab301a1238736b (patch) | |
tree | c990f32ee3de20fe5756a8f5c111d47e43cf7606 /src/wchar/wcsspn.c | |
parent | add wcsset (diff) | |
download | slibc-0a9ed0f9b84247b0dda23500b7ab301a1238736b.tar.gz slibc-0a9ed0f9b84247b0dda23500b7ab301a1238736b.tar.bz2 slibc-0a9ed0f9b84247b0dda23500b7ab301a1238736b.tar.xz |
m + split wchar/*.c
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/wchar/wcsspn.c | 44 |
1 files changed, 0 insertions, 44 deletions
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; -} - |