void *memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#endif
#if !HAVE_MEMRCHR
void *memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#endif
#if !HAVE_MEMRCHR
void *mempbrkm(const void *data, size_t len, const void *accept, size_t accept_len);
/**
void *mempbrkm(const void *data, size_t len, const void *accept, size_t accept_len);
/**
static inline char *mempbrk(const void *data, size_t len, const char *accept)
{
return mempbrkm(data, len, accept, strlen(accept));
static inline char *mempbrk(const void *data, size_t len, const char *accept)
{
return mempbrkm(data, len, accept, strlen(accept));
static inline bool memeq(const void *a, size_t al, const void *b, size_t bl)
{
return al == bl && !memcmp(a, b, bl);
static inline bool memeq(const void *a, size_t al, const void *b, size_t bl)
{
return al == bl && !memcmp(a, b, bl);
static inline bool memstarts(void const *data, size_t data_len,
void const *prefix, size_t prefix_len)
{
static inline bool memstarts(void const *data, size_t data_len,
void const *prefix, size_t prefix_len)
{
static inline bool memeqstr(const void *data, size_t length, const char *string)
{
return memeq(data, length, string, strlen(string));
static inline bool memeqstr(const void *data, size_t length, const char *string)
{
return memeq(data, length, string, strlen(string));
static inline bool memstarts_str(const void *a, size_t al, const char *s)
{
return memstarts(a, al, s, strlen(s));
static inline bool memstarts_str(const void *a, size_t al, const char *s)
{
return memstarts(a, al, s, strlen(s));
static inline bool memends(const void *s, size_t s_len, const void *suffix, size_t suffix_len)
{
return (s_len >= suffix_len) && (memcmp((const char *)s + s_len - suffix_len,
static inline bool memends(const void *s, size_t s_len, const void *suffix, size_t suffix_len)
{
return (s_len >= suffix_len) && (memcmp((const char *)s + s_len - suffix_len,