Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- cstring ----------------------------------===// |
| 3 | // |
| 4 | // ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_CSTRING |
| 12 | #define _LIBCPP_CSTRING |
| 13 | |
| 14 | /* |
| 15 | cstring synopsis |
| 16 | |
| 17 | Macros: |
| 18 | |
| 19 | NULL |
| 20 | |
| 21 | namespace std |
| 22 | { |
| 23 | |
| 24 | Types: |
| 25 | |
| 26 | size_t |
| 27 | |
| 28 | void* memcpy(void* restrict s1, const void* restrict s2, size_t n); |
| 29 | void* memmove(void* s1, const void* s2, size_t n); |
| 30 | char* strcpy (char* restrict s1, const char* restrict s2); |
| 31 | char* strncpy(char* restrict s1, const char* restrict s2, size_t n); |
| 32 | char* strcat (char* restrict s1, const char* restrict s2); |
| 33 | char* strncat(char* restrict s1, const char* restrict s2, size_t n); |
| 34 | int memcmp(const void* s1, const void* s2, size_t n); |
| 35 | int strcmp (const char* s1, const char* s2); |
| 36 | int strncmp(const char* s1, const char* s2, size_t n); |
| 37 | int strcoll(const char* s1, const char* s2); |
| 38 | size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n); |
| 39 | const void* memchr(const void* s, int c, size_t n); |
| 40 | void* memchr( void* s, int c, size_t n); |
| 41 | const char* strchr(const char* s, int c); |
| 42 | char* strchr( char* s, int c); |
| 43 | size_t strcspn(const char* s1, const char* s2); |
| 44 | const char* strpbrk(const char* s1, const char* s2); |
| 45 | char* strpbrk( char* s1, const char* s2); |
| 46 | const char* strrchr(const char* s, int c); |
| 47 | char* strrchr( char* s, int c); |
| 48 | size_t strspn(const char* s1, const char* s2); |
| 49 | const char* strstr(const char* s1, const char* s2); |
| 50 | char* strstr( char* s1, const char* s2); |
| 51 | char* strtok(char* restrict s1, const char* restrict s2); |
| 52 | void* memset(void* s, int c, size_t n); |
| 53 | char* strerror(int errnum); |
| 54 | size_t strlen(const char* s); |
| 55 | |
| 56 | } // std |
| 57 | |
| 58 | */ |
| 59 | |
| 60 | #include <__config> |
| 61 | #include <string.h> |
| 62 | |
| 63 | #pragma GCC system_header |
| 64 | |
| 65 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 66 | |
| 67 | using ::size_t; |
| 68 | using ::memcpy; |
| 69 | using ::memmove; |
| 70 | using ::strcpy; |
| 71 | using ::strncpy; |
| 72 | using ::strcat; |
| 73 | using ::strncat; |
| 74 | using ::memcmp; |
| 75 | using ::strcmp; |
| 76 | using ::strncmp; |
| 77 | using ::strcoll; |
| 78 | using ::strxfrm; |
| 79 | |
| 80 | inline _LIBCPP_INLINE_VISIBILITY const void* memchr(const void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);} |
| 81 | inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);} |
| 82 | |
| 83 | inline _LIBCPP_INLINE_VISIBILITY const char* strchr(const char* __s, int __c) {return ::strchr(__s, __c);} |
| 84 | inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);} |
| 85 | |
| 86 | using ::strcspn; |
| 87 | |
| 88 | inline _LIBCPP_INLINE_VISIBILITY const char* strpbrk(const char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} |
| 89 | inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} |
| 90 | |
| 91 | inline _LIBCPP_INLINE_VISIBILITY const char* strrchr(const char* __s, int __c) {return ::strrchr(__s, __c);} |
| 92 | inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);} |
| 93 | |
| 94 | using ::strspn; |
| 95 | |
| 96 | inline _LIBCPP_INLINE_VISIBILITY const char* strstr(const char* __s1, const char* __s2) {return ::strstr(__s1, __s2);} |
| 97 | inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);} |
| 98 | |
| 99 | using ::strtok; |
| 100 | using ::memset; |
| 101 | using ::strerror; |
| 102 | using ::strlen; |
| 103 | |
| 104 | _LIBCPP_END_NAMESPACE_STD |
| 105 | |
| 106 | #endif // _LIBCPP_CSTRING |