diff --git a/libc/Makefile b/libc/Makefile index ce34e9c5..9981ae7a 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -164,6 +164,7 @@ wchar/wcscat.o \ wchar/wcschrnul.o \ wchar/wcschr.o \ wchar/wcscmp.o \ +wchar/wcscoll.o \ wchar/wcscpy.o \ wchar/wcscspn.o \ wchar/wcslen.o \ diff --git a/libc/include/wchar.h b/libc/include/wchar.h index 6fad3036..a076c114 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -69,6 +69,7 @@ wchar_t* wcscat(wchar_t* __restrict, const wchar_t* __restrict); wchar_t* wcschr(const wchar_t*, wchar_t); wchar_t* wcschrnul(const wchar_t*, wchar_t); int wcscmp(const wchar_t*, const wchar_t*); +int wcscoll(const wchar_t*, const wchar_t*); wchar_t* wcscpy(wchar_t* __restrict, const wchar_t* __restrict); size_t wcscspn(const wchar_t*, const wchar_t*); size_t wcslen(const wchar_t*); @@ -101,7 +102,6 @@ int vswprintf(wchar_t* __restrict, size_t, const wchar_t* __restrict, va_list); int vswscanf(const wchar_t* __restrict, const wchar_t* __restrict, va_list); int vwprintf(const wchar_t* __restrict, va_list); int vwscanf(const wchar_t* __restrict, va_list); -int wcscoll(const wchar_t*, const wchar_t*); int wcsncmp(const wchar_t*, const wchar_t*, size_t); int wcswidth(const wchar_t*, size_t); int wctob(wint_t); diff --git a/libc/wchar/wcscoll.cpp b/libc/wchar/wcscoll.cpp new file mode 100644 index 00000000..a51d39ca --- /dev/null +++ b/libc/wchar/wcscoll.cpp @@ -0,0 +1,31 @@ +/******************************************************************************* + + Copyright(C) Jonas 'Sortie' Termansen 2013. + + This file is part of the Sortix C Library. + + The Sortix C Library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + The Sortix C Library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with the Sortix C Library. If not, see . + + wchar/wcscoll.cpp + Compare two strings using the current locale. + +*******************************************************************************/ + +#include + +extern "C" int wcscoll(const wchar_t* s1, const wchar_t* s2) +{ + // TODO: Pay attention to locales. + return wcscmp(s1, s2); +}