blob: c2dc7e35efb6137f67c5e07196f1719132e84487 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _STRING_H
2#define _STRING_H
3
4#ifdef __cplusplus
5extern "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 Felker36bf5692012-02-06 21:51:02 -050016#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
17 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
18#define __NEED_locale_t
19#endif
20
Rich Felker0b44a032011-02-12 00:22:29 -050021#include <bits/alltypes.h>
22
23void *memcpy (void *, const void *, size_t);
24void *memmove (void *, const void *, size_t);
Rich Felker0b44a032011-02-12 00:22:29 -050025void *memset (void *, int, size_t);
26int memcmp (const void *, const void *, size_t);
27void *memchr (const void *, int, size_t);
28
29char *strcpy (char *, const char *);
30char *strncpy (char *, const char *, size_t);
31
32char *strcat (char *, const char *);
33char *strncat (char *, const char *, size_t);
34
35int strcmp (const char *, const char *);
36int strncmp (const char *, const char *, size_t);
37
38int strcoll (const char *, const char *);
39size_t strxfrm (char *, const char *, size_t);
40
Rich Felker0b44a032011-02-12 00:22:29 -050041char *strchr (const char *, int);
42char *strrchr (const char *, int);
43
44size_t strcspn (const char *, const char *);
45size_t strspn (const char *, const char *);
46char *strpbrk (const char *, const char *);
47char *strstr (const char *, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050048char *strtok (char *, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050049
50size_t strlen (const char *);
51
52char *strerror (int);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050053
54
55#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
56 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
57char *strtok_r (char *, const char *, char **);
Rich Felker0b44a032011-02-12 00:22:29 -050058int strerror_r (int, char *, size_t);
Rich Felker0b44a032011-02-12 00:22:29 -050059char *stpcpy(char *, const char *);
60char *stpncpy(char *, const char *, size_t);
61size_t strnlen (const char *, size_t);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050062char *strdup (const char *);
63char *strndup (const char *, size_t);
Rich Felker2a195dd2011-02-26 23:50:26 -050064char *strsignal(int);
Rich Felker36bf5692012-02-06 21:51:02 -050065char *strerror_l (int, locale_t);
66int strcoll_l (const char *, const char *, locale_t);
67size_t strxfrm_l (char *, const char *, size_t, locale_t);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050068#endif
69
Rich Felker73d310e2011-02-24 12:36:04 -050070#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
71void *memccpy (void *, const void *, int, size_t);
72#endif
73
Rich Felkerca1aa5b2011-02-14 20:53:15 -050074#ifdef _BSD_SOURCE
75size_t strlcat (char *, const char *, size_t);
76size_t strlcpy (char *, const char *, size_t);
77#endif
Rich Felker0b44a032011-02-12 00:22:29 -050078
79#ifdef _GNU_SOURCE
Rich Felkera6540172011-09-11 22:45:56 -040080int strverscmp (const char *, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050081int strcasecmp (const char *, const char *);
82int strncasecmp (const char *, const char *, size_t);
83char *strchrnul(const char *, int);
Rich Felker26f35512011-02-15 16:08:19 -050084char *strcasestr(const char *, const char *);
Rich Felker1fee6182011-04-06 14:28:29 -040085char *strsep(char **, const char *);
Rich Felker6597f9a2011-04-13 08:36:29 -040086void *memrchr(const void *, int, size_t);
Rich Felkerb5b41212011-04-26 12:28:41 -040087void *mempcpy(void *, const void *, size_t);
Rich Felker0b44a032011-02-12 00:22:29 -050088#endif
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif