]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/include/string.h
WASI libc prototype implementation.
[wasi-libc.git] / libc-top-half / 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 #ifdef __wasilibc_unmodified_upstream
11 #ifdef __cplusplus
12 #define NULL 0L
13 #else
14 #define NULL ((void*)0)
15 #endif
16 #else
17 #include <__header_string.h>
18 #define __need_NULL
19 #include <stddef.h>
20 #endif
21
22 #define __NEED_size_t
23 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
24 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
25 || defined(_BSD_SOURCE)
26 #define __NEED_locale_t
27 #endif
28
29 #include <bits/alltypes.h>
30
31 void *memcpy (void *__restrict, const void *__restrict, size_t);
32 void *memmove (void *, const void *, size_t);
33 void *memset (void *, int, size_t);
34 int memcmp (const void *, const void *, size_t);
35 void *memchr (const void *, int, size_t);
36
37 char *strcpy (char *__restrict, const char *__restrict);
38 char *strncpy (char *__restrict, const char *__restrict, size_t);
39
40 char *strcat (char *__restrict, const char *__restrict);
41 char *strncat (char *__restrict, const char *__restrict, size_t);
42
43 int strcmp (const char *, const char *);
44 int strncmp (const char *, const char *, size_t);
45
46 int strcoll (const char *, const char *);
47 size_t strxfrm (char *__restrict, const char *__restrict, size_t);
48
49 char *strchr (const char *, int);
50 char *strrchr (const char *, int);
51
52 size_t strcspn (const char *, const char *);
53 size_t strspn (const char *, const char *);
54 char *strpbrk (const char *, const char *);
55 char *strstr (const char *, const char *);
56 char *strtok (char *__restrict, const char *__restrict);
57
58 size_t strlen (const char *);
59
60 char *strerror (int);
61
62 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
63 #include <strings.h>
64 #endif
65
66 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
67 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
68 || defined(_BSD_SOURCE)
69 char *strtok_r (char *__restrict, const char *__restrict, char **__restrict);
70 int strerror_r (int, char *, size_t);
71 char *stpcpy(char *__restrict, const char *__restrict);
72 char *stpncpy(char *__restrict, const char *__restrict, size_t);
73 size_t strnlen (const char *, size_t);
74 char *strdup (const char *);
75 char *strndup (const char *, size_t);
76 char *strsignal(int);
77 char *strerror_l (int, locale_t);
78 int strcoll_l (const char *, const char *, locale_t);
79 size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
80 #endif
81
82 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
83 || defined(_BSD_SOURCE)
84 void *memccpy (void *__restrict, const void *__restrict, int, size_t);
85 #endif
86
87 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
88 char *strsep(char **, const char *);
89 size_t strlcat (char *, const char *, size_t);
90 size_t strlcpy (char *, const char *, size_t);
91 void explicit_bzero (void *, size_t);
92 #endif
93
94 #ifdef _GNU_SOURCE
95 #define strdupa(x) strcpy(alloca(strlen(x)+1),x)
96 int strverscmp (const char *, const char *);
97 char *strchrnul(const char *, int);
98 char *strcasestr(const char *, const char *);
99 void *memmem(const void *, size_t, const void *, size_t);
100 void *memrchr(const void *, int, size_t);
101 void *mempcpy(void *, const void *, size_t);
102 #ifndef __cplusplus
103 #ifdef __wasilibc_unmodified_upstream
104 char *basename();
105 #else
106 /* Don't use unprototyped functions. */
107 char *basename(char *);
108 #endif
109 #endif
110 #endif
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif