mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-29 13:03:38 +01:00
string: add stubs for strcoll and strxfrm (TEST)
These extend the stub locale; strcoll is simply strcmp and strxfrm is simply strncpy.
This commit is contained in:
parent
cda27ac2db
commit
d105b1d60a
4 changed files with 21 additions and 3 deletions
|
@ -139,6 +139,7 @@ set(SOURCES
|
||||||
src/libc/string/strchr.c
|
src/libc/string/strchr.c
|
||||||
src/libc/string/strchrnul.c
|
src/libc/string/strchrnul.c
|
||||||
src/libc/string/strcmp.c
|
src/libc/string/strcmp.c
|
||||||
|
src/libc/string/strcoll.c
|
||||||
src/libc/string/strcpy.c
|
src/libc/string/strcpy.c
|
||||||
src/libc/string/strcspn.c
|
src/libc/string/strcspn.c
|
||||||
src/libc/string/strdup.c
|
src/libc/string/strdup.c
|
||||||
|
@ -150,7 +151,8 @@ set(SOURCES
|
||||||
src/libc/string/strndup.c
|
src/libc/string/strndup.c
|
||||||
src/libc/string/strnlen.c
|
src/libc/string/strnlen.c
|
||||||
src/libc/string/strrchr.c
|
src/libc/string/strrchr.c
|
||||||
src/libc/string/strspn.c)
|
src/libc/string/strspn.c
|
||||||
|
src/libc/string/strxfrm.c)
|
||||||
|
|
||||||
if(vhex-generic IN_LIST TARGET_FOLDERS)
|
if(vhex-generic IN_LIST TARGET_FOLDERS)
|
||||||
# TODO
|
# TODO
|
||||||
|
|
4
STATUS
4
STATUS
|
@ -117,9 +117,9 @@ DONE: Function/symbol/macro is defined, builds, links, and is tested
|
||||||
7.21.3.2 strncat: DONE
|
7.21.3.2 strncat: DONE
|
||||||
7.21.4.1 memcmp: DONE
|
7.21.4.1 memcmp: DONE
|
||||||
7.21.4.2 strcmp: DONE
|
7.21.4.2 strcmp: DONE
|
||||||
! 7.21.4.3 strcoll: TODO
|
! 7.21.4.3 strcoll: TEST
|
||||||
7.21.4.4 strncmp: DONE
|
7.21.4.4 strncmp: DONE
|
||||||
! 7.21.4.5 strxfrm: TODO
|
! 7.21.4.5 strxfrm: TEST
|
||||||
7.21.5.1 memchr: DONE
|
7.21.5.1 memchr: DONE
|
||||||
7.21.5.2 strchr: DONE
|
7.21.5.2 strchr: DONE
|
||||||
7.21.5.3 strcspn: DONE
|
7.21.5.3 strcspn: DONE
|
||||||
|
|
8
src/libc/string/strcoll.c
Normal file
8
src/libc/string/strcoll.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
/* Stub locale: use strcmp. */
|
||||||
|
int strcoll(char const *s1, char const *s2)
|
||||||
|
{
|
||||||
|
return strcmp(s1, s2);
|
||||||
|
}
|
8
src/libc/string/strxfrm.c
Normal file
8
src/libc/string/strxfrm.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
size_t strxfrm(char * restrict dest, char const * restrict src, size_t n)
|
||||||
|
{
|
||||||
|
if(dest) strncpy(dest, src, n);
|
||||||
|
return strlen(src);
|
||||||
|
}
|
Loading…
Reference in a new issue