diff options
Diffstat (limited to 'src/string')
-rw-r--r-- | src/string/new.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/string/new.c b/src/string/new.c index 2434659..6c035e0 100644 --- a/src/string/new.c +++ b/src/string/new.c @@ -416,3 +416,25 @@ char* (strnprcbrk)(const char* string, const char* skipset, size_t maxlen) /* sl return r; } +char* memmemmove(char* whither, const char* whence, const char* restrict str, + size_t strsize, size_t size) /* slibc: completeness */ +{ + char* stop = (memmem)(whence, size, str, strsize); + void* r = NULL; + if (stop != NULL) + size = (size_t)(stop - (const char*)whence), r = whither + size; + memmove(whither, whence, size); + return r; +} + +char* memmemcpy(void* whither, const void* whence, const char* restrict str, + size_t strsize, size_t size) /* slibc: completeness */ +{ + char* stop = (memmem)(whence, size, str, strsize); + void* r = NULL; + if (stop != NULL) + size = (size_t)(stop - (const char*)whence), r = whither + size; + memcpy(whither, whence, size); + return r; +} + |