projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify some logic in scanf and remove redundant invalid-format check
[musl]
/
include
/
string.h
diff --git
a/include/string.h
b/include/string.h
index
1ca02a4
..
d441233
100644
(file)
--- a/
include/string.h
+++ b/
include/string.h
@@
-5,34
+5,36
@@
extern "C" {
#endif
extern "C" {
#endif
-#undef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void*)0)
-#endif
+#include <features.h>
+
+#define NULL 0L
#define __NEED_size_t
#define __NEED_size_t
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+#define __NEED_locale_t
+#endif
+
#include <bits/alltypes.h>
#include <bits/alltypes.h>
-void *memcpy (void *
, const void *
, size_t);
+void *memcpy (void *
__restrict, const void *__restrict
, size_t);
void *memmove (void *, const void *, size_t);
void *memmove (void *, const void *, size_t);
-void *memccpy (void *, const void *, int, size_t);
void *memset (void *, int, size_t);
int memcmp (const void *, const void *, size_t);
void *memchr (const void *, int, size_t);
void *memset (void *, int, size_t);
int memcmp (const void *, const void *, size_t);
void *memchr (const void *, int, size_t);
-char *strcpy (char *
, const char *
);
-char *strncpy (char *
, const char *
, size_t);
+char *strcpy (char *
__restrict, const char *__restrict
);
+char *strncpy (char *
__restrict, const char *__restrict
, size_t);
-char *strcat (char *
, const char *
);
-char *strncat (char *
, const char *
, size_t);
+char *strcat (char *
__restrict, const char *__restrict
);
+char *strncat (char *
__restrict, const char *__restrict
, size_t);
int strcmp (const char *, const char *);
int strncmp (const char *, const char *, size_t);
int strcoll (const char *, const char *);
int strcmp (const char *, const char *);
int strncmp (const char *, const char *, size_t);
int strcoll (const char *, const char *);
-size_t strxfrm (char *
, const char *
, size_t);
+size_t strxfrm (char *
__restrict, const char *__restrict
, size_t);
char *strchr (const char *, int);
char *strrchr (const char *, int);
char *strchr (const char *, int);
char *strrchr (const char *, int);
@@
-41,33
+43,56
@@
size_t strcspn (const char *, const char *);
size_t strspn (const char *, const char *);
char *strpbrk (const char *, const char *);
char *strstr (const char *, const char *);
size_t strspn (const char *, const char *);
char *strpbrk (const char *, const char *);
char *strstr (const char *, const char *);
-char *strtok (char *
, const char *
);
+char *strtok (char *
__restrict, const char *__restrict
);
size_t strlen (const char *);
char *strerror (int);
size_t strlen (const char *);
char *strerror (int);
+#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
+#include <strings.h>
+#endif
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
-char *strtok_r (char *, const char *, char **);
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+char *strtok_r (char *__restrict, const char *__restrict, char **__restrict);
int strerror_r (int, char *, size_t);
int strerror_r (int, char *, size_t);
-char *stpcpy(char *
, const char *
);
-char *stpncpy(char *
, const char *
, size_t);
+char *stpcpy(char *
__restrict, const char *__restrict
);
+char *stpncpy(char *
__restrict, const char *__restrict
, size_t);
size_t strnlen (const char *, size_t);
char *strdup (const char *);
char *strndup (const char *, size_t);
size_t strnlen (const char *, size_t);
char *strdup (const char *);
char *strndup (const char *, size_t);
+char *strsignal(int);
+char *strerror_l (int, locale_t);
+int strcoll_l (const char *, const char *, locale_t);
+size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
#endif
#endif
-#ifdef _BSD_SOURCE
+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+void *memccpy (void *__restrict, const void *__restrict, int, size_t);
+#endif
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+char *strsep(char **, const char *);
size_t strlcat (char *, const char *, size_t);
size_t strlcpy (char *, const char *, size_t);
#endif
#ifdef _GNU_SOURCE
size_t strlcat (char *, const char *, size_t);
size_t strlcpy (char *, const char *, size_t);
#endif
#ifdef _GNU_SOURCE
-int strcasecmp (const char *, const char *);
-int strncasecmp (const char *, const char *, size_t);
+#define strdupa(x) strcpy(alloca(strlen(x)+1),x)
+int strverscmp (const char *, const char *);
+int strcasecmp_l (const char *, const char *, locale_t);
+int strncasecmp_l (const char *, const char *, size_t, locale_t);
char *strchrnul(const char *, int);
char *strchrnul(const char *, int);
+char *strcasestr(const char *, const char *);
+void *memmem(const void *, size_t, const void *, size_t);
+void *memrchr(const void *, int, size_t);
+void *mempcpy(void *, const void *, size_t);
+#ifndef __cplusplus
+char *basename();
+#endif
#endif
#ifdef __cplusplus
#endif
#ifdef __cplusplus