Path: blob/main/system/lib/llvm-libc/src/string/memmem.cpp
6175 views
//===-- Implementation of memmem ------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "src/string/memmem.h"9#include "src/__support/common.h"10#include "src/__support/macros/config.h"11#include "src/string/memory_utils/inline_memmem.h"1213namespace LIBC_NAMESPACE_DECL {1415LLVM_LIBC_FUNCTION(void *, memmem,16(const void *haystack, size_t haystack_len,17const void *needle, size_t needle_len)) {18constexpr auto COMP = [](unsigned char l, unsigned char r) -> int {19return l - r;20};21return inline_memmem(haystack, haystack_len, needle, needle_len, COMP);22}2324} // namespace LIBC_NAMESPACE_DECL252627