mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-29 13:03:38 +01:00
string: add and test strpbrk (DONE)
This commit is contained in:
parent
d105b1d60a
commit
8ffc104798
3 changed files with 12 additions and 1 deletions
|
@ -150,6 +150,7 @@ set(SOURCES
|
||||||
src/libc/string/strncpy.c
|
src/libc/string/strncpy.c
|
||||||
src/libc/string/strndup.c
|
src/libc/string/strndup.c
|
||||||
src/libc/string/strnlen.c
|
src/libc/string/strnlen.c
|
||||||
|
src/libc/string/strpbrk.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)
|
src/libc/string/strxfrm.c)
|
||||||
|
|
2
STATUS
2
STATUS
|
@ -123,7 +123,7 @@ DONE: Function/symbol/macro is defined, builds, links, and is tested
|
||||||
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
|
||||||
! 7.21.5.4 strpbrk: TODO
|
7.21.5.4 strpbrk: DONE
|
||||||
7.21.5.5 strrchr: DONE
|
7.21.5.5 strrchr: DONE
|
||||||
7.21.5.6 strspn: DONE
|
7.21.5.6 strspn: DONE
|
||||||
! 7.21.5.7 strstr: TODO
|
! 7.21.5.7 strstr: TODO
|
||||||
|
|
10
src/libc/string/strpbrk.c
Normal file
10
src/libc/string/strpbrk.c
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
char *strpbrk(char const *str, char const *accept)
|
||||||
|
{
|
||||||
|
for(size_t i = 0; str[i]; i++) {
|
||||||
|
if(strchr(accept, str[i])) return (char *)&str[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
Loading…
Reference in a new issue