Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:08

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_STRING_H
0011 #define _LIBCPP_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 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0055 #  include <__cxx03/string.h>
0056 #else
0057 #  include <__config>
0058 
0059 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0060 #    pragma GCC system_header
0061 #  endif
0062 
0063 #  if __has_include_next(<string.h>)
0064 #    include_next <string.h>
0065 #  endif
0066 
0067 // MSVCRT, GNU libc and its derivates may already have the correct prototype in
0068 // <string.h>. This macro can be defined by users if their C library provides
0069 // the right signature.
0070 #  if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) ||                                          \
0071       defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
0072 #    define _LIBCPP_STRING_H_HAS_CONST_OVERLOADS
0073 #  endif
0074 
0075 #  if defined(__cplusplus) && !defined(_LIBCPP_STRING_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
0076 extern "C++" {
0077 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strchr(const char* __s, int __c) {
0078   return __builtin_strchr(__s, __c);
0079 }
0080 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strchr(char* __s, int __c) {
0081   return __builtin_strchr(__s, __c);
0082 }
0083 
0084 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strpbrk(const char* __s1, const char* __s2) {
0085   return __builtin_strpbrk(__s1, __s2);
0086 }
0087 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strpbrk(char* __s1, const char* __s2) {
0088   return __builtin_strpbrk(__s1, __s2);
0089 }
0090 
0091 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strrchr(const char* __s, int __c) {
0092   return __builtin_strrchr(__s, __c);
0093 }
0094 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strrchr(char* __s, int __c) {
0095   return __builtin_strrchr(__s, __c);
0096 }
0097 
0098 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const void* memchr(const void* __s, int __c, size_t __n) {
0099   return __builtin_memchr(__s, __c, __n);
0100 }
0101 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD void* memchr(void* __s, int __c, size_t __n) {
0102   return __builtin_memchr(__s, __c, __n);
0103 }
0104 
0105 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const char* strstr(const char* __s1, const char* __s2) {
0106   return __builtin_strstr(__s1, __s2);
0107 }
0108 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strstr(char* __s1, const char* __s2) {
0109   return __builtin_strstr(__s1, __s2);
0110 }
0111 } // extern "C++"
0112 #  endif
0113 #endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0114 
0115 #endif // _LIBCPP_STRING_H