blob: 24cb1ca3f4ec6b5120ccd71fbff6d203e57ca676 [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) \
Rich Felker419ae6d2012-05-22 21:52:08 -040017 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
18 || defined(_BSD_SOURCE)
Rich Felker36bf5692012-02-06 21:51:02 -050019#define __NEED_locale_t
20#endif
21
Rich Felker0b44a032011-02-12 00:22:29 -050022#include <bits/alltypes.h>
23
24void *memcpy (void *, const void *, size_t);
25void *memmove (void *, const void *, size_t);
Rich Felker0b44a032011-02-12 00:22:29 -050026void *memset (void *, int, size_t);
27int memcmp (const void *, const void *, size_t);
28void *memchr (const void *, int, size_t);
29
30char *strcpy (char *, const char *);
31char *strncpy (char *, const char *, size_t);
32
33char *strcat (char *, const char *);
34char *strncat (char *, const char *, size_t);
35
36int strcmp (const char *, const char *);
37int strncmp (const char *, const char *, size_t);
38
39int strcoll (const char *, const char *);
40size_t strxfrm (char *, const char *, size_t);
41
Rich Felker0b44a032011-02-12 00:22:29 -050042char *strchr (const char *, int);
43char *strrchr (const char *, int);
44
45size_t strcspn (const char *, const char *);
46size_t strspn (const char *, const char *);
47char *strpbrk (const char *, const char *);
48char *strstr (const char *, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050049char *strtok (char *, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050050
51size_t strlen (const char *);
52
53char *strerror (int);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050054
Rich Felker419ae6d2012-05-22 21:52:08 -040055#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
56#include <strings.h>
57#endif
Rich Felkerca1aa5b2011-02-14 20:53:15 -050058
59#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
Rich Felker419ae6d2012-05-22 21:52:08 -040060 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
61 || defined(_BSD_SOURCE)
Rich Felkerca1aa5b2011-02-14 20:53:15 -050062char *strtok_r (char *, const char *, char **);
Rich Felker0b44a032011-02-12 00:22:29 -050063int strerror_r (int, char *, size_t);
Rich Felker0b44a032011-02-12 00:22:29 -050064char *stpcpy(char *, const char *);
65char *stpncpy(char *, const char *, size_t);
66size_t strnlen (const char *, size_t);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050067char *strdup (const char *);
68char *strndup (const char *, size_t);
Rich Felker2a195dd2011-02-26 23:50:26 -050069char *strsignal(int);
Rich Felker36bf5692012-02-06 21:51:02 -050070char *strerror_l (int, locale_t);
71int strcoll_l (const char *, const char *, locale_t);
72size_t strxfrm_l (char *, const char *, size_t, locale_t);
Rich Felkerca1aa5b2011-02-14 20:53:15 -050073#endif
74
Rich Felker419ae6d2012-05-22 21:52:08 -040075#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
76 || defined(_BSD_SOURCE)
Rich Felker73d310e2011-02-24 12:36:04 -050077void *memccpy (void *, const void *, int, size_t);
78#endif
79
Rich Felkerca1aa5b2011-02-14 20:53:15 -050080#ifdef _BSD_SOURCE
81size_t strlcat (char *, const char *, size_t);
82size_t strlcpy (char *, const char *, size_t);
83#endif
Rich Felker0b44a032011-02-12 00:22:29 -050084
85#ifdef _GNU_SOURCE
Rich Felker419ae6d2012-05-22 21:52:08 -040086#define strdupa(x) strcpy(alloca(strlen(x)+1),x)
Rich Felkera6540172011-09-11 22:45:56 -040087int strverscmp (const char *, const char *);
Rich Felker419ae6d2012-05-22 21:52:08 -040088int strcasecmp_l (const char *, const char *, locale_t);
89int strncasecmp_l (const char *, const char *, size_t, locale_t);
Rich Felker0b44a032011-02-12 00:22:29 -050090char *strchrnul(const char *, int);
Rich Felker26f35512011-02-15 16:08:19 -050091char *strcasestr(const char *, const char *);
Rich Felker1fee6182011-04-06 14:28:29 -040092char *strsep(char **, const char *);
Rich Felker6597f9a2011-04-13 08:36:29 -040093void *memrchr(const void *, int, size_t);
Rich Felkerb5b41212011-04-26 12:28:41 -040094void *mempcpy(void *, const void *, size_t);
Rich Felker37bb3cc2012-05-09 11:47:06 -040095#ifndef __cplusplus
Rich Felker06aec8d2012-02-24 23:23:47 -050096char *basename();
Rich Felker0b44a032011-02-12 00:22:29 -050097#endif
Rich Felker37bb3cc2012-05-09 11:47:06 -040098#endif
Rich Felker0b44a032011-02-12 00:22:29 -050099
100#ifdef __cplusplus
101}
102#endif
103
104#endif