include sys/sysmacros.h from sys/types.h when _GNU_SOURCE is defined
[musl] / include / string.h
1 #ifndef _STRING_H
2 #define _STRING_H
3
4 #ifdef __cplusplus
5 extern "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
16 #include <bits/alltypes.h>
17
18 void *memcpy (void *, const void *, size_t);
19 void *memmove (void *, const void *, size_t);
20 void *memccpy (void *, const void *, int, size_t);
21 void *memset (void *, int, size_t);
22 int memcmp (const void *, const void *, size_t);
23 void *memchr (const void *, int, size_t);
24
25 char *strcpy (char *, const char *);
26 char *strncpy (char *, const char *, size_t);
27
28 char *strcat (char *, const char *);
29 char *strncat (char *, const char *, size_t);
30
31 int strcmp (const char *, const char *);
32 int strncmp (const char *, const char *, size_t);
33
34 int strcoll (const char *, const char *);
35 size_t strxfrm (char *, const char *, size_t);
36
37 char *strchr (const char *, int);
38 char *strrchr (const char *, int);
39
40 size_t strcspn (const char *, const char *);
41 size_t strspn (const char *, const char *);
42 char *strpbrk (const char *, const char *);
43 char *strstr (const char *, const char *);
44 char *strtok (char *, const char *);
45
46 size_t strlen (const char *);
47
48 char *strerror (int);
49
50
51 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
52  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
53 char *strtok_r (char *, const char *, char **);
54 int strerror_r (int, char *, size_t);
55 char *stpcpy(char *, const char *);
56 char *stpncpy(char *, const char *, size_t);
57 size_t strnlen (const char *, size_t);
58 char *strdup (const char *);
59 char *strndup (const char *, size_t);
60 #endif
61
62 #ifdef _BSD_SOURCE
63 size_t strlcat (char *, const char *, size_t);
64 size_t strlcpy (char *, const char *, size_t);
65 #endif
66
67 #ifdef _GNU_SOURCE
68 int strcasecmp (const char *, const char *);
69 int strncasecmp (const char *, const char *, size_t);
70 char *strchrnul(const char *, int);
71 char *strcasestr(const char *, const char *);
72 #endif
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif