1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Kernel+LibC: Implement 'memmem'

This commit adds an implementation of memmem, using the Bitap text
search algorithm for needles smaller than 32 bytes, and a naive loop
search for longer needles.
This commit is contained in:
AnotherTest 2020-07-31 16:26:33 +04:30 committed by Andreas Kling
parent ad35436786
commit 1ad51325ad
5 changed files with 178 additions and 0 deletions

View file

@ -41,6 +41,7 @@ int memcmp(const void*, const void*, size_t);
void* memcpy(void*, const void*, size_t);
void* memmove(void*, const void*, size_t);
void* memchr(const void*, int c, size_t);
const void* memmem(const void* haystack, size_t, const void* needle, size_t);
void bzero(void*, size_t);
void bcopy(const void*, void*, size_t);
void* memset(void*, int, size_t);