1*0b57cec5SDimitry Andric// -*- C++ -*- 2349cc55cSDimitry Andric//===----------------------------------------------------------------------===// 3*0b57cec5SDimitry Andric// 4*0b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5*0b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 6*0b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7*0b57cec5SDimitry Andric// 8*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 9*0b57cec5SDimitry Andric 10*0b57cec5SDimitry Andric#ifndef _LIBCPP_CSTRING 11*0b57cec5SDimitry Andric#define _LIBCPP_CSTRING 12*0b57cec5SDimitry Andric 13*0b57cec5SDimitry Andric/* 14*0b57cec5SDimitry Andric cstring synopsis 15*0b57cec5SDimitry Andric 16*0b57cec5SDimitry AndricMacros: 17*0b57cec5SDimitry Andric 18*0b57cec5SDimitry Andric NULL 19*0b57cec5SDimitry Andric 20*0b57cec5SDimitry Andricnamespace std 21*0b57cec5SDimitry Andric{ 22*0b57cec5SDimitry Andric 23*0b57cec5SDimitry AndricTypes: 24*0b57cec5SDimitry Andric 25*0b57cec5SDimitry Andric size_t 26*0b57cec5SDimitry Andric 27*0b57cec5SDimitry Andricvoid* memcpy(void* restrict s1, const void* restrict s2, size_t n); 28*0b57cec5SDimitry Andricvoid* memmove(void* s1, const void* s2, size_t n); 29*0b57cec5SDimitry Andricchar* strcpy (char* restrict s1, const char* restrict s2); 30*0b57cec5SDimitry Andricchar* strncpy(char* restrict s1, const char* restrict s2, size_t n); 31*0b57cec5SDimitry Andricchar* strcat (char* restrict s1, const char* restrict s2); 32*0b57cec5SDimitry Andricchar* strncat(char* restrict s1, const char* restrict s2, size_t n); 33*0b57cec5SDimitry Andricint memcmp(const void* s1, const void* s2, size_t n); 34*0b57cec5SDimitry Andricint strcmp (const char* s1, const char* s2); 35*0b57cec5SDimitry Andricint strncmp(const char* s1, const char* s2, size_t n); 36*0b57cec5SDimitry Andricint strcoll(const char* s1, const char* s2); 37*0b57cec5SDimitry Andricsize_t strxfrm(char* restrict s1, const char* restrict s2, size_t n); 38*0b57cec5SDimitry Andricconst void* memchr(const void* s, int c, size_t n); 39*0b57cec5SDimitry Andric void* memchr( void* s, int c, size_t n); 40*0b57cec5SDimitry Andricconst char* strchr(const char* s, int c); 41*0b57cec5SDimitry Andric char* strchr( char* s, int c); 42*0b57cec5SDimitry Andricsize_t strcspn(const char* s1, const char* s2); 43*0b57cec5SDimitry Andricconst char* strpbrk(const char* s1, const char* s2); 44*0b57cec5SDimitry Andric char* strpbrk( char* s1, const char* s2); 45*0b57cec5SDimitry Andricconst char* strrchr(const char* s, int c); 46*0b57cec5SDimitry Andric char* strrchr( char* s, int c); 47*0b57cec5SDimitry Andricsize_t strspn(const char* s1, const char* s2); 48*0b57cec5SDimitry Andricconst char* strstr(const char* s1, const char* s2); 49*0b57cec5SDimitry Andric char* strstr( char* s1, const char* s2); 50*0b57cec5SDimitry Andricchar* strtok(char* restrict s1, const char* restrict s2); 51*0b57cec5SDimitry Andricvoid* memset(void* s, int c, size_t n); 52*0b57cec5SDimitry Andricchar* strerror(int errnum); 53*0b57cec5SDimitry Andricsize_t strlen(const char* s); 54*0b57cec5SDimitry Andric 55*0b57cec5SDimitry Andric} // std 56*0b57cec5SDimitry Andric 57*0b57cec5SDimitry Andric*/ 58*0b57cec5SDimitry Andric 5981ad6265SDimitry Andric#include <__assert> // all public C++ headers provide the assertion handler 60*0b57cec5SDimitry Andric#include <__config> 61bdd1243dSDimitry Andric#include <__type_traits/is_constant_evaluated.h> 62bdd1243dSDimitry Andric 63*0b57cec5SDimitry Andric#include <string.h> 64*0b57cec5SDimitry Andric 65bdd1243dSDimitry Andric#ifndef _LIBCPP_STRING_H 66bdd1243dSDimitry Andric# error <cstring> tried including <string.h> but didn't find libc++'s <string.h> header. \ 67bdd1243dSDimitry Andric This usually means that your header search paths are not configured properly. \ 68bdd1243dSDimitry Andric The header search paths should contain the C++ Standard Library headers before \ 69bdd1243dSDimitry Andric any C Standard Library, and you are probably using compiler flags that make that \ 70bdd1243dSDimitry Andric not be the case. 71bdd1243dSDimitry Andric#endif 72bdd1243dSDimitry Andric 73*0b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 74*0b57cec5SDimitry Andric# pragma GCC system_header 75*0b57cec5SDimitry Andric#endif 76*0b57cec5SDimitry Andric 77*0b57cec5SDimitry Andric_LIBCPP_BEGIN_NAMESPACE_STD 78*0b57cec5SDimitry Andric 79fe6060f1SDimitry Andricusing ::size_t _LIBCPP_USING_IF_EXISTS; 80fe6060f1SDimitry Andricusing ::memcpy _LIBCPP_USING_IF_EXISTS; 81fe6060f1SDimitry Andricusing ::memmove _LIBCPP_USING_IF_EXISTS; 82fe6060f1SDimitry Andricusing ::strcpy _LIBCPP_USING_IF_EXISTS; 83fe6060f1SDimitry Andricusing ::strncpy _LIBCPP_USING_IF_EXISTS; 84fe6060f1SDimitry Andricusing ::strcat _LIBCPP_USING_IF_EXISTS; 85fe6060f1SDimitry Andricusing ::strncat _LIBCPP_USING_IF_EXISTS; 86fe6060f1SDimitry Andricusing ::memcmp _LIBCPP_USING_IF_EXISTS; 87fe6060f1SDimitry Andricusing ::strcmp _LIBCPP_USING_IF_EXISTS; 88fe6060f1SDimitry Andricusing ::strncmp _LIBCPP_USING_IF_EXISTS; 89fe6060f1SDimitry Andricusing ::strcoll _LIBCPP_USING_IF_EXISTS; 90fe6060f1SDimitry Andricusing ::strxfrm _LIBCPP_USING_IF_EXISTS; 91fe6060f1SDimitry Andricusing ::memchr _LIBCPP_USING_IF_EXISTS; 92fe6060f1SDimitry Andricusing ::strchr _LIBCPP_USING_IF_EXISTS; 93fe6060f1SDimitry Andricusing ::strcspn _LIBCPP_USING_IF_EXISTS; 94fe6060f1SDimitry Andricusing ::strpbrk _LIBCPP_USING_IF_EXISTS; 95fe6060f1SDimitry Andricusing ::strrchr _LIBCPP_USING_IF_EXISTS; 96fe6060f1SDimitry Andricusing ::strspn _LIBCPP_USING_IF_EXISTS; 97fe6060f1SDimitry Andricusing ::strstr _LIBCPP_USING_IF_EXISTS; 98fe6060f1SDimitry Andricusing ::strtok _LIBCPP_USING_IF_EXISTS; 99fe6060f1SDimitry Andricusing ::memset _LIBCPP_USING_IF_EXISTS; 100fe6060f1SDimitry Andricusing ::strerror _LIBCPP_USING_IF_EXISTS; 101fe6060f1SDimitry Andricusing ::strlen _LIBCPP_USING_IF_EXISTS; 102*0b57cec5SDimitry Andric 103*0b57cec5SDimitry Andric_LIBCPP_END_NAMESPACE_STD 104*0b57cec5SDimitry Andric 105*0b57cec5SDimitry Andric#endif // _LIBCPP_CSTRING 106