Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- cstring ----------------------------------===// |
| 3 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 | [diff] [blame] | 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-exception |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_CSTRING |
| 11 | #define _LIBCPP_CSTRING |
| 12 | |
| 13 | /* |
| 14 | cstring synopsis |
| 15 | |
| 16 | Macros: |
| 17 | |
| 18 | NULL |
Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 | [diff] [blame] | 19 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 20 | namespace std |
| 21 | { |
| 22 | |
| 23 | Types: |
| 24 | |
| 25 | size_t |
| 26 | |
| 27 | void* memcpy(void* restrict s1, const void* restrict s2, size_t n); |
| 28 | void* memmove(void* s1, const void* s2, size_t n); |
| 29 | char* strcpy (char* restrict s1, const char* restrict s2); |
| 30 | char* strncpy(char* restrict s1, const char* restrict s2, size_t n); |
| 31 | char* strcat (char* restrict s1, const char* restrict s2); |
| 32 | char* strncat(char* restrict s1, const char* restrict s2, size_t n); |
| 33 | int memcmp(const void* s1, const void* s2, size_t n); |
| 34 | int strcmp (const char* s1, const char* s2); |
| 35 | int strncmp(const char* s1, const char* s2, size_t n); |
| 36 | int strcoll(const char* s1, const char* s2); |
| 37 | size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n); |
| 38 | const void* memchr(const void* s, int c, size_t n); |
| 39 | void* memchr( void* s, int c, size_t n); |
| 40 | const char* strchr(const char* s, int c); |
| 41 | char* strchr( char* s, int c); |
| 42 | size_t strcspn(const char* s1, const char* s2); |
| 43 | const char* strpbrk(const char* s1, const char* s2); |
| 44 | char* strpbrk( char* s1, const char* s2); |
| 45 | const char* strrchr(const char* s, int c); |
| 46 | char* strrchr( char* s, int c); |
| 47 | size_t strspn(const char* s1, const char* s2); |
| 48 | const char* strstr(const char* s1, const char* s2); |
| 49 | char* strstr( char* s1, const char* s2); |
| 50 | char* strtok(char* restrict s1, const char* restrict s2); |
| 51 | void* memset(void* s, int c, size_t n); |
| 52 | char* strerror(int errnum); |
| 53 | size_t strlen(const char* s); |
| 54 | |
| 55 | } // std |
| 56 | |
| 57 | */ |
| 58 | |
| 59 | #include <__config> |
| 60 | #include <string.h> |
| 61 | |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 62 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 63 | #pragma GCC system_header |
Howard Hinnant | 073458b | 2011-10-17 20:05:10 | [diff] [blame] | 64 | #endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 65 | |
| 66 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 67 | |
| 68 | using ::size_t; |
Marshall Clow | 3ca2099 | 2015-06-02 22:26:29 | [diff] [blame] | 69 | using ::memcpy; |
| 70 | using ::memmove; |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 71 | using ::strcpy; |
| 72 | using ::strncpy; |
| 73 | using ::strcat; |
| 74 | using ::strncat; |
Marshall Clow | 3ca2099 | 2015-06-02 22:26:29 | [diff] [blame] | 75 | using ::memcmp; |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 76 | using ::strcmp; |
Marshall Clow | 3ca2099 | 2015-06-02 22:26:29 | [diff] [blame] | 77 | using ::strncmp; |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 78 | using ::strcoll; |
| 79 | using ::strxfrm; |
Richard Smith | 25cb320 | 2015-10-29 23:32:29 | [diff] [blame] | 80 | using ::memchr; |
Richard Smith | 25cb320 | 2015-10-29 23:32:29 | [diff] [blame] | 81 | using ::strchr; |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 82 | using ::strcspn; |
Richard Smith | 25cb320 | 2015-10-29 23:32:29 | [diff] [blame] | 83 | using ::strpbrk; |
Richard Smith | 25cb320 | 2015-10-29 23:32:29 | [diff] [blame] | 84 | using ::strrchr; |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 85 | using ::strspn; |
Richard Smith | 25cb320 | 2015-10-29 23:32:29 | [diff] [blame] | 86 | using ::strstr; |
Ed Schouten | e0cf3b9 | 2015-06-24 08:44:38 | [diff] [blame] | 87 | #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 88 | using ::strtok; |
Ed Schouten | e0cf3b9 | 2015-06-24 08:44:38 | [diff] [blame] | 89 | #endif |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 90 | using ::memset; |
| 91 | using ::strerror; |
| 92 | using ::strlen; |
| 93 | |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 94 | _LIBCPP_END_NAMESPACE_STD |
| 95 | |
| 96 | #endif // _LIBCPP_CSTRING |