xref: /minix3/external/bsd/libc++/dist/libcxx/include/cstring (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc// -*- C++ -*-
2*4684ddb6SLionel Sambuc//===--------------------------- cstring ----------------------------------===//
3*4684ddb6SLionel Sambuc//
4*4684ddb6SLionel Sambuc//                     The LLVM Compiler Infrastructure
5*4684ddb6SLionel Sambuc//
6*4684ddb6SLionel Sambuc// This file is distributed under the University of Illinois Open Source
7*4684ddb6SLionel Sambuc// License. See LICENSE.TXT for details.
8*4684ddb6SLionel Sambuc//
9*4684ddb6SLionel Sambuc//===----------------------------------------------------------------------===//
10*4684ddb6SLionel Sambuc
11*4684ddb6SLionel Sambuc#ifndef _LIBCPP_CSTRING
12*4684ddb6SLionel Sambuc#define _LIBCPP_CSTRING
13*4684ddb6SLionel Sambuc
14*4684ddb6SLionel Sambuc/*
15*4684ddb6SLionel Sambuc    cstring synopsis
16*4684ddb6SLionel Sambuc
17*4684ddb6SLionel SambucMacros:
18*4684ddb6SLionel Sambuc
19*4684ddb6SLionel Sambuc    NULL
20*4684ddb6SLionel Sambuc
21*4684ddb6SLionel Sambucnamespace std
22*4684ddb6SLionel Sambuc{
23*4684ddb6SLionel Sambuc
24*4684ddb6SLionel SambucTypes:
25*4684ddb6SLionel Sambuc
26*4684ddb6SLionel Sambuc    size_t
27*4684ddb6SLionel Sambuc
28*4684ddb6SLionel Sambucvoid* memcpy(void* restrict s1, const void* restrict s2, size_t n);
29*4684ddb6SLionel Sambucvoid* memmove(void* s1, const void* s2, size_t n);
30*4684ddb6SLionel Sambucchar* strcpy (char* restrict s1, const char* restrict s2);
31*4684ddb6SLionel Sambucchar* strncpy(char* restrict s1, const char* restrict s2, size_t n);
32*4684ddb6SLionel Sambucchar* strcat (char* restrict s1, const char* restrict s2);
33*4684ddb6SLionel Sambucchar* strncat(char* restrict s1, const char* restrict s2, size_t n);
34*4684ddb6SLionel Sambucint memcmp(const void* s1, const void* s2, size_t n);
35*4684ddb6SLionel Sambucint strcmp (const char* s1, const char* s2);
36*4684ddb6SLionel Sambucint strncmp(const char* s1, const char* s2, size_t n);
37*4684ddb6SLionel Sambucint strcoll(const char* s1, const char* s2);
38*4684ddb6SLionel Sambucsize_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);
39*4684ddb6SLionel Sambucconst void* memchr(const void* s, int c, size_t n);
40*4684ddb6SLionel Sambuc      void* memchr(      void* s, int c, size_t n);
41*4684ddb6SLionel Sambucconst char* strchr(const char* s, int c);
42*4684ddb6SLionel Sambuc      char* strchr(      char* s, int c);
43*4684ddb6SLionel Sambucsize_t strcspn(const char* s1, const char* s2);
44*4684ddb6SLionel Sambucconst char* strpbrk(const char* s1, const char* s2);
45*4684ddb6SLionel Sambuc      char* strpbrk(      char* s1, const char* s2);
46*4684ddb6SLionel Sambucconst char* strrchr(const char* s, int c);
47*4684ddb6SLionel Sambuc      char* strrchr(      char* s, int c);
48*4684ddb6SLionel Sambucsize_t strspn(const char* s1, const char* s2);
49*4684ddb6SLionel Sambucconst char* strstr(const char* s1, const char* s2);
50*4684ddb6SLionel Sambuc      char* strstr(      char* s1, const char* s2);
51*4684ddb6SLionel Sambucchar* strtok(char* restrict s1, const char* restrict s2);
52*4684ddb6SLionel Sambucvoid* memset(void* s, int c, size_t n);
53*4684ddb6SLionel Sambucchar* strerror(int errnum);
54*4684ddb6SLionel Sambucsize_t strlen(const char* s);
55*4684ddb6SLionel Sambuc
56*4684ddb6SLionel Sambuc}  // std
57*4684ddb6SLionel Sambuc
58*4684ddb6SLionel Sambuc*/
59*4684ddb6SLionel Sambuc
60*4684ddb6SLionel Sambuc#include <__config>
61*4684ddb6SLionel Sambuc#include <string.h>
62*4684ddb6SLionel Sambuc
63*4684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
64*4684ddb6SLionel Sambuc#pragma GCC system_header
65*4684ddb6SLionel Sambuc#endif
66*4684ddb6SLionel Sambuc
67*4684ddb6SLionel Sambuc_LIBCPP_BEGIN_NAMESPACE_STD
68*4684ddb6SLionel Sambuc
69*4684ddb6SLionel Sambucusing ::size_t;
70*4684ddb6SLionel Sambucusing ::memcpy;
71*4684ddb6SLionel Sambucusing ::memmove;
72*4684ddb6SLionel Sambucusing ::strcpy;
73*4684ddb6SLionel Sambucusing ::strncpy;
74*4684ddb6SLionel Sambucusing ::strcat;
75*4684ddb6SLionel Sambucusing ::strncat;
76*4684ddb6SLionel Sambucusing ::memcmp;
77*4684ddb6SLionel Sambucusing ::strcmp;
78*4684ddb6SLionel Sambucusing ::strncmp;
79*4684ddb6SLionel Sambucusing ::strcoll;
80*4684ddb6SLionel Sambucusing ::strxfrm;
81*4684ddb6SLionel Sambuc
82*4684ddb6SLionel Sambucusing ::memchr;
83*4684ddb6SLionel Sambuc
84*4684ddb6SLionel Sambucusing ::strchr;
85*4684ddb6SLionel Sambuc
86*4684ddb6SLionel Sambucusing ::strcspn;
87*4684ddb6SLionel Sambuc
88*4684ddb6SLionel Sambucusing ::strpbrk;
89*4684ddb6SLionel Sambuc
90*4684ddb6SLionel Sambucusing ::strrchr;
91*4684ddb6SLionel Sambuc
92*4684ddb6SLionel Sambucusing ::strspn;
93*4684ddb6SLionel Sambuc
94*4684ddb6SLionel Sambucusing ::strstr;
95*4684ddb6SLionel Sambuc
96*4684ddb6SLionel Sambuc// MSVCRT, GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
97*4684ddb6SLionel Sambuc#if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
98*4684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int __c) {return ::strchr(__s, __c);}
99*4684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
100*4684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s, int __c) {return ::strrchr(__s, __c);}
101*4684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
102*4684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
103*4684ddb6SLionel Sambuc#endif
104*4684ddb6SLionel Sambuc
105*4684ddb6SLionel Sambucusing ::strtok;
106*4684ddb6SLionel Sambucusing ::memset;
107*4684ddb6SLionel Sambucusing ::strerror;
108*4684ddb6SLionel Sambucusing ::strlen;
109*4684ddb6SLionel Sambuc
110*4684ddb6SLionel Sambuc_LIBCPP_END_NAMESPACE_STD
111*4684ddb6SLionel Sambuc
112*4684ddb6SLionel Sambuc#endif  // _LIBCPP_CSTRING
113