1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Added strpbrk(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-04 17:44:24 +01:00
parent b1b123109a
commit 38f27a45fc
2 changed files with 8 additions and 1 deletions

View file

@ -50,6 +50,7 @@ char* strerror(int);
size_t strlen(const char*);
int strncmp(const char*, const char*, size_t);
char* strncpy(char* restrict, const char* restrict, size_t);
char* strpbrk(const char*, const char*);
char* strrchr(const char*, int);
size_t strspn(const char*, const char*);
char* strstr(const char*, const char*);
@ -66,7 +67,6 @@ int strerror_r(int, char*, size_t);
char* strncat(char* restrict, const char* restrict, size_t);
char* strndup(const char*, size_t);
size_t strnlen(const char*, size_t);
char* strpbrk(const char*, const char*);
char* strsignal(int);
size_t strxfrm(char* restrict, const char* restrict, size_t);
size_t strxfrm_l(char* restrict, const char* restrict, size_t, locale_t);

View file

@ -146,6 +146,13 @@ namespace Maxsi
}
}
char* strpbrk(const char* str, const char* accept)
{
size_t rejectlen = Reject(str, accept);
if ( !str[rejectlen] ) { return NULL; }
return (char*) str + rejectlen;
}
DUAL_FUNCTION(char*, strtok_r, TokenizeR, (char* str, const char* delim, char** saveptr))
{
if ( !str && !*saveptr ) { return NULL; }