xref: /minix3/external/bsd/libc++/dist/libcxx/include/cstring (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
14684ddb6SLionel Sambuc// -*- C++ -*-
24684ddb6SLionel Sambuc//===--------------------------- cstring ----------------------------------===//
34684ddb6SLionel Sambuc//
44684ddb6SLionel Sambuc//                     The LLVM Compiler Infrastructure
54684ddb6SLionel Sambuc//
64684ddb6SLionel Sambuc// This file is distributed under the University of Illinois Open Source
74684ddb6SLionel Sambuc// License. See LICENSE.TXT for details.
84684ddb6SLionel Sambuc//
94684ddb6SLionel Sambuc//===----------------------------------------------------------------------===//
104684ddb6SLionel Sambuc
114684ddb6SLionel Sambuc#ifndef _LIBCPP_CSTRING
124684ddb6SLionel Sambuc#define _LIBCPP_CSTRING
134684ddb6SLionel Sambuc
144684ddb6SLionel Sambuc/*
154684ddb6SLionel Sambuc    cstring synopsis
164684ddb6SLionel Sambuc
174684ddb6SLionel SambucMacros:
184684ddb6SLionel Sambuc
194684ddb6SLionel Sambuc    NULL
204684ddb6SLionel Sambuc
214684ddb6SLionel Sambucnamespace std
224684ddb6SLionel Sambuc{
234684ddb6SLionel Sambuc
244684ddb6SLionel SambucTypes:
254684ddb6SLionel Sambuc
264684ddb6SLionel Sambuc    size_t
274684ddb6SLionel Sambuc
284684ddb6SLionel Sambucvoid* memcpy(void* restrict s1, const void* restrict s2, size_t n);
294684ddb6SLionel Sambucvoid* memmove(void* s1, const void* s2, size_t n);
304684ddb6SLionel Sambucchar* strcpy (char* restrict s1, const char* restrict s2);
314684ddb6SLionel Sambucchar* strncpy(char* restrict s1, const char* restrict s2, size_t n);
324684ddb6SLionel Sambucchar* strcat (char* restrict s1, const char* restrict s2);
334684ddb6SLionel Sambucchar* strncat(char* restrict s1, const char* restrict s2, size_t n);
344684ddb6SLionel Sambucint memcmp(const void* s1, const void* s2, size_t n);
354684ddb6SLionel Sambucint strcmp (const char* s1, const char* s2);
364684ddb6SLionel Sambucint strncmp(const char* s1, const char* s2, size_t n);
374684ddb6SLionel Sambucint strcoll(const char* s1, const char* s2);
384684ddb6SLionel Sambucsize_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);
394684ddb6SLionel Sambucconst void* memchr(const void* s, int c, size_t n);
404684ddb6SLionel Sambuc      void* memchr(      void* s, int c, size_t n);
414684ddb6SLionel Sambucconst char* strchr(const char* s, int c);
424684ddb6SLionel Sambuc      char* strchr(      char* s, int c);
434684ddb6SLionel Sambucsize_t strcspn(const char* s1, const char* s2);
444684ddb6SLionel Sambucconst char* strpbrk(const char* s1, const char* s2);
454684ddb6SLionel Sambuc      char* strpbrk(      char* s1, const char* s2);
464684ddb6SLionel Sambucconst char* strrchr(const char* s, int c);
474684ddb6SLionel Sambuc      char* strrchr(      char* s, int c);
484684ddb6SLionel Sambucsize_t strspn(const char* s1, const char* s2);
494684ddb6SLionel Sambucconst char* strstr(const char* s1, const char* s2);
504684ddb6SLionel Sambuc      char* strstr(      char* s1, const char* s2);
514684ddb6SLionel Sambucchar* strtok(char* restrict s1, const char* restrict s2);
524684ddb6SLionel Sambucvoid* memset(void* s, int c, size_t n);
534684ddb6SLionel Sambucchar* strerror(int errnum);
544684ddb6SLionel Sambucsize_t strlen(const char* s);
554684ddb6SLionel Sambuc
564684ddb6SLionel Sambuc}  // std
574684ddb6SLionel Sambuc
584684ddb6SLionel Sambuc*/
594684ddb6SLionel Sambuc
604684ddb6SLionel Sambuc#include <__config>
614684ddb6SLionel Sambuc#include <string.h>
624684ddb6SLionel Sambuc
634684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
644684ddb6SLionel Sambuc#pragma GCC system_header
654684ddb6SLionel Sambuc#endif
664684ddb6SLionel Sambuc
674684ddb6SLionel Sambuc_LIBCPP_BEGIN_NAMESPACE_STD
684684ddb6SLionel Sambuc
694684ddb6SLionel Sambucusing ::size_t;
704684ddb6SLionel Sambucusing ::memcpy;
714684ddb6SLionel Sambucusing ::memmove;
724684ddb6SLionel Sambucusing ::strcpy;
734684ddb6SLionel Sambucusing ::strncpy;
744684ddb6SLionel Sambucusing ::strcat;
754684ddb6SLionel Sambucusing ::strncat;
764684ddb6SLionel Sambucusing ::memcmp;
774684ddb6SLionel Sambucusing ::strcmp;
784684ddb6SLionel Sambucusing ::strncmp;
794684ddb6SLionel Sambucusing ::strcoll;
804684ddb6SLionel Sambucusing ::strxfrm;
814684ddb6SLionel Sambuc
824684ddb6SLionel Sambucusing ::memchr;
834684ddb6SLionel Sambuc
844684ddb6SLionel Sambucusing ::strchr;
854684ddb6SLionel Sambuc
864684ddb6SLionel Sambucusing ::strcspn;
874684ddb6SLionel Sambuc
884684ddb6SLionel Sambucusing ::strpbrk;
894684ddb6SLionel Sambuc
904684ddb6SLionel Sambucusing ::strrchr;
914684ddb6SLionel Sambuc
924684ddb6SLionel Sambucusing ::strspn;
934684ddb6SLionel Sambuc
944684ddb6SLionel Sambucusing ::strstr;
954684ddb6SLionel Sambuc
964684ddb6SLionel Sambuc// MSVCRT, GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
974684ddb6SLionel Sambuc#if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
984684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int __c) {return ::strchr(__s, __c);}
994684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
1004684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s, int __c) {return ::strrchr(__s, __c);}
1014684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
1024684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
1034684ddb6SLionel Sambuc#endif
1044684ddb6SLionel Sambuc
105*0a6a1f1dSLionel Sambuc#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
1064684ddb6SLionel Sambucusing ::strtok;
107*0a6a1f1dSLionel Sambuc#endif
1084684ddb6SLionel Sambucusing ::memset;
1094684ddb6SLionel Sambucusing ::strerror;
1104684ddb6SLionel Sambucusing ::strlen;
1114684ddb6SLionel Sambuc
1124684ddb6SLionel Sambuc_LIBCPP_END_NAMESPACE_STD
1134684ddb6SLionel Sambuc
1144684ddb6SLionel Sambuc#endif  // _LIBCPP_CSTRING
115