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