Caslyn Tonelli 718729e997 [libc] Add memmem implementation
Introduce the `memmem` libc string function.

`memmem_implementation` performs shared logic for `strstr`,
`strcasestr`, and `memmem`; essentially reconfiguring what was the
`strstr_implementation` to support length parameters.

Differential Revision: https://reviews.llvm.org/D147822
2023-04-11 20:49:25 +00:00

22 lines
685 B
C++

//===-- Implementation header for memmem ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_STRING_MEMMEM_H
#define LLVM_LIBC_SRC_STRING_MEMMEM_H
#include <stddef.h> // For size_t
namespace __llvm_libc {
void *memmem(const void *haystack, size_t haystack_len, const void *needle,
size_t needle_len);
} // namespace __llvm_libc
#endif // LLVM_LIBC_SRC_STRING_MEMMEM_H