implement inline 5- and 6-argument syscalls for mips
[musl.git] / include / string.h
blob795a2abcd990ac1ecd3b7592d6948b897ec9cb68
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 void explicit_bzero (void *, size_t);
86 #endif
88 #ifdef _GNU_SOURCE
89 #define strdupa(x) strcpy(alloca(strlen(x)+1),x)
90 int strverscmp (const char *, const char *);
91 char *strchrnul(const char *, int);
92 char *strcasestr(const char *, const char *);
93 void *memmem(const void *, size_t, const void *, size_t);
94 void *memrchr(const void *, int, size_t);
95 void *mempcpy(void *, const void *, size_t);
96 #ifndef __cplusplus
97 char *basename();
98 #endif
99 #endif
101 #ifdef __cplusplus
103 #endif
105 #endif