1 #ifndef _STRING_H 2 #define _STRING_H 3 4 #ifdef __ICCARM__ /* for iar */ 5 #include_next <string.h> 6 #else 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #include <features.h> 13 14 #ifdef __cplusplus 15 #define NULL 0L 16 #else 17 #define NULL ((void*)0) 18 #endif 19 20 #define __NEED_size_t 21 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 22 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 23 || defined(_BSD_SOURCE) 24 #define __NEED_locale_t 25 #endif 26 27 #include <bits/alltypes.h> 28 29 void *memcpy (void *__restrict, const void *__restrict, size_t); 30 void *memmove (void *, const void *, size_t); 31 void *memset (void *, int, size_t); 32 int memcmp (const void *, const void *, size_t); 33 void *memchr (const void *, int, size_t); 34 35 char *strcpy (char *__restrict, const char *__restrict); 36 char *strncpy (char *__restrict, const char *__restrict, size_t); 37 38 char *strcat (char *__restrict, const char *__restrict); 39 char *strncat (char *__restrict, const char *__restrict, size_t); 40 41 int strcmp (const char *, const char *); 42 int strncmp (const char *, const char *, size_t); 43 44 int strcoll (const char *, const char *); 45 size_t strxfrm (char *__restrict, const char *__restrict, size_t); 46 47 char *strchr (const char *, int); 48 char *strrchr (const char *, int); 49 50 size_t strcspn (const char *, const char *); 51 size_t strspn (const char *, const char *); 52 char *strpbrk (const char *, const char *); 53 char *strstr (const char *, const char *); 54 char *strtok (char *__restrict, const char *__restrict); 55 56 size_t strlen (const char *); 57 58 char *strerror (int); 59 60 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 61 #include <strings.h> 62 #endif 63 64 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 65 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 66 || defined(_BSD_SOURCE) 67 char *strtok_r (char *__restrict, const char *__restrict, char **__restrict); 68 int strerror_r (int, char *, size_t); 69 char *stpcpy(char *__restrict, const char *__restrict); 70 char *stpncpy(char *__restrict, const char *__restrict, size_t); 71 size_t strnlen (const char *, size_t); 72 char *strdup (const char *); 73 char *strndup (const char *, size_t); 74 char *strsignal(int); 75 char *strerror_l (int, locale_t); 76 int strcoll_l (const char *, const char *, locale_t); 77 size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); 78 #endif 79 80 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 81 || defined(_BSD_SOURCE) 82 void *memccpy (void *__restrict, const void *__restrict, int, size_t); 83 #endif 84 85 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 86 char *strsep(char **, const char *); 87 size_t strlcat (char *, const char *, size_t); 88 size_t strlcpy (char *, const char *, size_t); 89 void explicit_bzero (void *, size_t); 90 #endif 91 92 #ifdef _GNU_SOURCE 93 #define strdupa(x) strcpy(alloca(strlen(x)+1),x) 94 int strverscmp (const char *, const char *); 95 char *strchrnul(const char *, int); 96 char *strcasestr(const char *, const char *); 97 void *memmem(const void *, size_t, const void *, size_t); 98 void *memrchr(const void *, int, size_t); 99 void *mempcpy(void *, const void *, size_t); 100 #ifndef __cplusplus 101 char *basename(); 102 #endif 103 #endif 104 105 #ifdef __cplusplus 106 } 107 #endif 108 109 #endif /* __ICCARM__ */ 110 #endif