Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:46

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03_STRING_H
0011 #define _LIBCPP___CXX03_STRING_H
0012 
0013 /*
0014     string.h synopsis
0015 
0016 Macros:
0017 
0018     NULL
0019 
0020 Types:
0021 
0022     size_t
0023 
0024 void* memcpy(void* restrict s1, const void* restrict s2, size_t n);
0025 void* memmove(void* s1, const void* s2, size_t n);
0026 char* strcpy (char* restrict s1, const char* restrict s2);
0027 char* strncpy(char* restrict s1, const char* restrict s2, size_t n);
0028 char* strcat (char* restrict s1, const char* restrict s2);
0029 char* strncat(char* restrict s1, const char* restrict s2, size_t n);
0030 int memcmp(const void* s1, const void* s2, size_t n);
0031 int strcmp (const char* s1, const char* s2);
0032 int strncmp(const char* s1, const char* s2, size_t n);
0033 int strcoll(const char* s1, const char* s2);
0034 size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);
0035 const void* memchr(const void* s, int c, size_t n);
0036       void* memchr(      void* s, int c, size_t n);
0037 const char* strchr(const char* s, int c);
0038       char* strchr(      char* s, int c);
0039 size_t strcspn(const char* s1, const char* s2);
0040 const char* strpbrk(const char* s1, const char* s2);
0041       char* strpbrk(      char* s1, const char* s2);
0042 const char* strrchr(const char* s, int c);
0043       char* strrchr(      char* s, int c);
0044 size_t strspn(const char* s1, const char* s2);
0045 const char* strstr(const char* s1, const char* s2);
0046       char* strstr(      char* s1, const char* s2);
0047 char* strtok(char* restrict s1, const char* restrict s2);
0048 void* memset(void* s, int c, size_t n);
0049 char* strerror(int errnum);
0050 size_t strlen(const char* s);
0051 
0052 */
0053 
0054 #include <__cxx03/__config>
0055 
0056 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0057 #  pragma GCC system_header
0058 #endif
0059 
0060 #if __has_include_next(<string.h>)
0061 #  include_next <string.h>
0062 #endif
0063 
0064 // MSVCRT, GNU libc and its derivates may already have the correct prototype in
0065 // <string.h>. This macro can be defined by users if their C library provides
0066 // the right signature.
0067 #if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
0068 #  define _LIBCPP_STRING_H_HAS_CONST_OVERLOADS
0069 #endif
0070 
0071 #if defined(__cplusplus) && !defined(_LIBCPP_STRING_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
0072 extern "C++" {
0073 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strchr(const char* __s, int __c) {
0074   return __builtin_strchr(__s, __c);
0075 }
0076 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strchr(char* __s, int __c) {
0077   return __builtin_strchr(__s, __c);
0078 }
0079 
0080 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strpbrk(const char* __s1, const char* __s2) {
0081   return __builtin_strpbrk(__s1, __s2);
0082 }
0083 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strpbrk(char* __s1, const char* __s2) {
0084   return __builtin_strpbrk(__s1, __s2);
0085 }
0086 
0087 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strrchr(const char* __s, int __c) {
0088   return __builtin_strrchr(__s, __c);
0089 }
0090 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strrchr(char* __s, int __c) {
0091   return __builtin_strrchr(__s, __c);
0092 }
0093 
0094 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const void* memchr(const void* __s, int __c, size_t __n) {
0095   return __builtin_memchr(__s, __c, __n);
0096 }
0097 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD void* memchr(void* __s, int __c, size_t __n) {
0098   return __builtin_memchr(__s, __c, __n);
0099 }
0100 
0101 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strstr(const char* __s1, const char* __s2) {
0102   return __builtin_strstr(__s1, __s2);
0103 }
0104 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strstr(char* __s1, const char* __s2) {
0105   return __builtin_strstr(__s1, __s2);
0106 }
0107 } // extern "C++"
0108 #endif
0109 
0110 #endif // _LIBCPP___CXX03_STRING_H