Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _STRING_H |
| 2 | #define _STRING_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #undef NULL |
| 9 | #ifdef __cplusplus |
| 10 | #define NULL 0 |
| 11 | #else |
| 12 | #define NULL ((void*)0) |
| 13 | #endif |
| 14 | |
| 15 | #define __NEED_size_t |
Rich Felker | 36bf569 | 2012-02-06 21:51:02 -0500 | [diff] [blame^] | 16 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 17 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 18 | #define __NEED_locale_t |
| 19 | #endif |
| 20 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 21 | #include <bits/alltypes.h> |
| 22 | |
| 23 | void *memcpy (void *, const void *, size_t); |
| 24 | void *memmove (void *, const void *, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 25 | void *memset (void *, int, size_t); |
| 26 | int memcmp (const void *, const void *, size_t); |
| 27 | void *memchr (const void *, int, size_t); |
| 28 | |
| 29 | char *strcpy (char *, const char *); |
| 30 | char *strncpy (char *, const char *, size_t); |
| 31 | |
| 32 | char *strcat (char *, const char *); |
| 33 | char *strncat (char *, const char *, size_t); |
| 34 | |
| 35 | int strcmp (const char *, const char *); |
| 36 | int strncmp (const char *, const char *, size_t); |
| 37 | |
| 38 | int strcoll (const char *, const char *); |
| 39 | size_t strxfrm (char *, const char *, size_t); |
| 40 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 41 | char *strchr (const char *, int); |
| 42 | char *strrchr (const char *, int); |
| 43 | |
| 44 | size_t strcspn (const char *, const char *); |
| 45 | size_t strspn (const char *, const char *); |
| 46 | char *strpbrk (const char *, const char *); |
| 47 | char *strstr (const char *, const char *); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 48 | char *strtok (char *, const char *); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 49 | |
| 50 | size_t strlen (const char *); |
| 51 | |
| 52 | char *strerror (int); |
Rich Felker | ca1aa5b | 2011-02-14 20:53:15 -0500 | [diff] [blame] | 53 | |
| 54 | |
| 55 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 56 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 57 | char *strtok_r (char *, const char *, char **); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 58 | int strerror_r (int, char *, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 59 | char *stpcpy(char *, const char *); |
| 60 | char *stpncpy(char *, const char *, size_t); |
| 61 | size_t strnlen (const char *, size_t); |
Rich Felker | ca1aa5b | 2011-02-14 20:53:15 -0500 | [diff] [blame] | 62 | char *strdup (const char *); |
| 63 | char *strndup (const char *, size_t); |
Rich Felker | 2a195dd | 2011-02-26 23:50:26 -0500 | [diff] [blame] | 64 | char *strsignal(int); |
Rich Felker | 36bf569 | 2012-02-06 21:51:02 -0500 | [diff] [blame^] | 65 | char *strerror_l (int, locale_t); |
| 66 | int strcoll_l (const char *, const char *, locale_t); |
| 67 | size_t strxfrm_l (char *, const char *, size_t, locale_t); |
Rich Felker | ca1aa5b | 2011-02-14 20:53:15 -0500 | [diff] [blame] | 68 | #endif |
| 69 | |
Rich Felker | 73d310e | 2011-02-24 12:36:04 -0500 | [diff] [blame] | 70 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 71 | void *memccpy (void *, const void *, int, size_t); |
| 72 | #endif |
| 73 | |
Rich Felker | ca1aa5b | 2011-02-14 20:53:15 -0500 | [diff] [blame] | 74 | #ifdef _BSD_SOURCE |
| 75 | size_t strlcat (char *, const char *, size_t); |
| 76 | size_t strlcpy (char *, const char *, size_t); |
| 77 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 78 | |
| 79 | #ifdef _GNU_SOURCE |
Rich Felker | a654017 | 2011-09-11 22:45:56 -0400 | [diff] [blame] | 80 | int strverscmp (const char *, const char *); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 81 | int strcasecmp (const char *, const char *); |
| 82 | int strncasecmp (const char *, const char *, size_t); |
| 83 | char *strchrnul(const char *, int); |
Rich Felker | 26f3551 | 2011-02-15 16:08:19 -0500 | [diff] [blame] | 84 | char *strcasestr(const char *, const char *); |
Rich Felker | 1fee618 | 2011-04-06 14:28:29 -0400 | [diff] [blame] | 85 | char *strsep(char **, const char *); |
Rich Felker | 6597f9a | 2011-04-13 08:36:29 -0400 | [diff] [blame] | 86 | void *memrchr(const void *, int, size_t); |
Rich Felker | b5b4121 | 2011-04-26 12:28:41 -0400 | [diff] [blame] | 87 | void *mempcpy(void *, const void *, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 88 | #endif |
| 89 | |
| 90 | #ifdef __cplusplus |
| 91 | } |
| 92 | #endif |
| 93 | |
| 94 | #endif |