diff --git a/libc/Makefile b/libc/Makefile index 1e3ec6ce..ba49b95f 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -111,6 +111,7 @@ string/strcat.o \ string/strchrnul.o \ string/strchr.o \ string/strcmp.o \ +string/strcoll_l.o \ string/strcoll.o \ string/strcpy.o \ string/strcspn.o \ diff --git a/libc/include/string.h b/libc/include/string.h index eaba8809..46b8308b 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -46,6 +46,7 @@ char* strcat(char* __restrict, const char* __restrict); char* strchr(const char*, int); int strcmp(const char*, const char*); int strcoll(const char*, const char*); +int strcoll_l(const char*, const char*, locale_t); size_t strcspn(const char*, const char*); char* strcpy(char* __restrict, const char* __restrict); char* strdup(const char*); @@ -66,7 +67,6 @@ size_t strxfrm(char* __restrict, const char* __restrict, size_t); /* TODO: These are not implemented in sortix libc yet. */ #if defined(__SORTIX_SHOW_UNIMPLEMENTED) -int strcoll_l(const char*, const char*, locale_t); char* strerror_l(int, locale_t); int strerror_r(int, char*, size_t); size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t); diff --git a/libc/string/strcoll_l.cpp b/libc/string/strcoll_l.cpp new file mode 100644 index 00000000..28c6f373 --- /dev/null +++ b/libc/string/strcoll_l.cpp @@ -0,0 +1,30 @@ +/******************************************************************************* + + 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 . + + string/strcoll_l.cpp + Compare two strings using the given locale. + +*******************************************************************************/ + +#include + +extern "C" int strcoll_l(const char* s1, const char* s2, locale_t /*locale*/) +{ + return strcoll(s1, s2); +}