Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
string.h114 linesDownload Raw Back to include
1// -*- C++ -*-2//===--------------------------- string.h ---------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCUDACXX_STRING_H11#define _LIBCUDACXX_STRING_H12 13/*14    string.h synopsis15 16Macros:17 18    NULL19 20Types:21 22    size_t23 24void* memcpy(void* restrict s1, const void* restrict s2, size_t n);25void* memmove(void* s1, const void* s2, size_t n);26char* strcpy (char* restrict s1, const char* restrict s2);27char* strncpy(char* restrict s1, const char* restrict s2, size_t n);28char* strcat (char* restrict s1, const char* restrict s2);29char* strncat(char* restrict s1, const char* restrict s2, size_t n);30int memcmp(const void* s1, const void* s2, size_t n);31int strcmp (const char* s1, const char* s2);32int strncmp(const char* s1, const char* s2, size_t n);33int strcoll(const char* s1, const char* s2);34size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);35const void* memchr(const void* s, int c, size_t n);36      void* memchr(      void* s, int c, size_t n);37const char* strchr(const char* s, int c);38      char* strchr(      char* s, int c);39size_t strcspn(const char* s1, const char* s2);40const char* strpbrk(const char* s1, const char* s2);41      char* strpbrk(      char* s1, const char* s2);42const char* strrchr(const char* s, int c);43      char* strrchr(      char* s, int c);44size_t strspn(const char* s1, const char* s2);45const char* strstr(const char* s1, const char* s2);46      char* strstr(      char* s1, const char* s2);47char* strtok(char* restrict s1, const char* restrict s2);48void* memset(void* s, int c, size_t n);49char* strerror(int errnum);50size_t strlen(const char* s);51 52*/53 54#include <__config>55 56#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)57#  pragma GCC system_header58#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)59#  pragma clang system_header60#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)61#  pragma system_header62#endif // no system header63 64#include_next <string.h>65 66// MSVCRT, GNU libc and its derivates may already have the correct prototype in67// <string.h>. This macro can be defined by users if their C library provides68// the right signature.69#if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCUDACXX_MSVCRT) || \70    defined(__sun__) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)71#define _LIBCUDACXX_STRING_H_HAS_CONST_OVERLOADS72#endif73 74#if defined(__cplusplus) && !defined(_LIBCUDACXX_STRING_H_HAS_CONST_OVERLOADS) && defined(_LIBCUDACXX_PREFERRED_OVERLOAD)75extern "C++" {76inline _LIBCUDACXX_INLINE_VISIBILITY77char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}78inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD79const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}80inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD81      char* strchr(      char* __s, int __c) {return __libcpp_strchr(__s, __c);}82 83inline _LIBCUDACXX_INLINE_VISIBILITY84char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}85inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD86const char* strpbrk(const char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);}87inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD88      char* strpbrk(      char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);}89 90inline _LIBCUDACXX_INLINE_VISIBILITY91char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}92inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD93const char* strrchr(const char* __s, int __c) {return __libcpp_strrchr(__s, __c);}94inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD95      char* strrchr(      char* __s, int __c) {return __libcpp_strrchr(__s, __c);}96 97inline _LIBCUDACXX_INLINE_VISIBILITY98void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}99inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD100const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}101inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD102      void* memchr(      void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}103 104inline _LIBCUDACXX_INLINE_VISIBILITY105char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}106inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD107const char* strstr(const char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);}108inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD109      char* strstr(      char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);}110}111#endif112 113#endif  // _LIBCUDACXX_STRING_H114 
codekingpro/portable-devtools · Team Ai