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