Add strxfrm_l(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2013-07-11 20:29:11 +02:00
parent 5bda12c8fc
commit 2518e4fc40
3 changed files with 33 additions and 1 deletions

View File

@ -132,6 +132,7 @@ string/strstr.o \
string/strtok.o \
string/strtok_r.o \
string/strverscmp.o \
string/strxfrm_l.o \
string/strxfrm.o \
time/asctime.o \
time/asctime_r.o \

View File

@ -64,12 +64,12 @@ char* strtok(char* __restrict, const char* __restrict);
char* strtok_r(char* __restrict, const char* __restrict, char** __restrict);
int strverscmp(const char*, const char*);
size_t strxfrm(char* __restrict, const char* __restrict, size_t);
size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t);
/* TODO: These are not implemented in sortix libc yet. */
#if defined(__SORTIX_SHOW_UNIMPLEMENTED)
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);
#endif
#if defined(_SORTIX_SOURCE) || defined(_GNU_SOURCE)

31
libc/string/strxfrm_l.cpp Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
string/strxfrm_l.cpp
Transform a string such that the result of strcmp is the same as strcoll_l.
*******************************************************************************/
#include <string.h>
extern "C"
size_t strxfrm_l(char* dest, const char* src, size_t n, locale_t /*locale*/)
{
return strxfrm(dest, src, n);
}