3 #if !defined _ISOMAC && !defined __cplusplus
6 extern void *__memccpy (void *__dest
, const void *__src
,
9 extern size_t __strnlen (const char *__string
, size_t __maxlen
)
12 extern char *__strsep (char **__stringp
, const char *__delim
);
14 extern int __strverscmp (const char *__s1
, const char *__s2
)
17 extern int __strncasecmp (const char *__s1
, const char *__s2
,
21 extern int __strcasecmp (const char *__s1
, const char *__s2
)
24 extern char *__strcasestr (const char *__haystack
, const char *__needle
)
27 extern char *__strdup (const char *__string
)
29 extern char *__strndup (const char *__string
, size_t __n
)
32 extern void *__rawmemchr (const void *__s
, int __c
)
35 extern char *__strchrnul (const char *__s
, int __c
)
38 extern void *__memrchr (const void *__s
, int __c
, size_t __n
)
41 extern void *__memchr (const void *__s
, int __c
, size_t __n
)
44 extern int __ffs (int __i
) __attribute__ ((const));
46 extern char *__strerror_r (int __errnum
, char *__buf
, size_t __buflen
);
49 /* Get _STRING_ARCH_unaligned. */
50 #include <string_private.h>
52 /* Now the real definitions. We do this here since some of the functions
53 above are defined as macros in the headers. */
54 #include <string/string.h>
56 #if !defined _ISOMAC && !defined __cplusplus
57 extern __typeof (strcoll_l
) __strcoll_l
;
58 extern __typeof (strxfrm_l
) __strxfrm_l
;
59 extern __typeof (strcasecmp_l
) __strcasecmp_l
;
60 extern __typeof (strncasecmp_l
) __strncasecmp_l
;
62 /* Alternative version which doesn't pollute glibc's namespace. */
65 # define strndupa(s, n) \
68 const char *__old = (s); \
69 size_t __len = __strnlen (__old, (n)); \
70 char *__new = (char *) __builtin_alloca (__len + 1); \
71 __new[__len] = '\0'; \
72 (char *) memcpy (__new, __old, __len); \
76 libc_hidden_proto (__mempcpy
)
77 libc_hidden_proto (__stpcpy
)
78 libc_hidden_proto (__stpncpy
)
79 libc_hidden_proto (__rawmemchr
)
80 libc_hidden_proto (__strcasecmp
)
81 libc_hidden_proto (__strcasecmp_l
)
82 libc_hidden_proto (__strncasecmp_l
)
83 libc_hidden_proto (__strdup
)
84 libc_hidden_proto (__strndup
)
85 libc_hidden_proto (__strerror_r
)
86 libc_hidden_proto (__strverscmp
)
87 libc_hidden_proto (basename
)
88 extern char *__basename (const char *__filename
) __THROW
__nonnull ((1));
89 libc_hidden_proto (__basename
)
90 libc_hidden_proto (strcoll
)
91 libc_hidden_proto (__strcoll_l
)
92 libc_hidden_proto (__strxfrm_l
)
93 libc_hidden_proto (__strtok_r
)
94 extern char *__strsep_g (char **__stringp
, const char *__delim
);
95 libc_hidden_proto (__strsep_g
)
96 libc_hidden_proto (strnlen
)
97 libc_hidden_proto (__strnlen
)
98 libc_hidden_proto (memmem
)
99 extern __typeof (memmem
) __memmem
;
100 libc_hidden_proto (__memmem
)
101 libc_hidden_proto (__ffs
)
104 /* Avoid hidden reference to IFUNC symbol __explicit_bzero_chk. */
105 void __explicit_bzero_chk_internal (void *, size_t, size_t)
106 __THROW
__nonnull ((1)) attribute_hidden
;
107 # define explicit_bzero(buf, len) \
108 __explicit_bzero_chk_internal (buf, len, __bos0 (buf))
109 #elif !IS_IN (nonlib)
110 void __explicit_bzero_chk (void *, size_t, size_t) __THROW
__nonnull ((1));
111 # define explicit_bzero(buf, len) __explicit_bzero_chk (buf, len, __bos0 (buf))
114 libc_hidden_builtin_proto (memchr
)
115 libc_hidden_builtin_proto (memcpy
)
116 libc_hidden_builtin_proto (mempcpy
)
117 libc_hidden_builtin_proto (memcmp
)
118 libc_hidden_builtin_proto (memmove
)
119 libc_hidden_builtin_proto (memset
)
120 libc_hidden_builtin_proto (strcat
)
121 libc_hidden_builtin_proto (strchr
)
122 libc_hidden_builtin_proto (strcmp
)
123 libc_hidden_builtin_proto (strcpy
)
124 libc_hidden_builtin_proto (strcspn
)
125 libc_hidden_builtin_proto (strlen
)
126 libc_hidden_builtin_proto (strncmp
)
127 libc_hidden_builtin_proto (strncpy
)
128 libc_hidden_builtin_proto (strpbrk
)
129 libc_hidden_builtin_proto (stpcpy
)
130 libc_hidden_builtin_proto (strrchr
)
131 libc_hidden_builtin_proto (strspn
)
132 libc_hidden_builtin_proto (strstr
)
133 libc_hidden_builtin_proto (ffs
)
136 extern __typeof (__stpcpy
) __stpcpy attribute_hidden
;
137 extern __typeof (__strdup
) __strdup attribute_hidden
;
138 extern __typeof (__strerror_r
) __strerror_r attribute_hidden
;
139 extern __typeof (__strsep_g
) __strsep_g attribute_hidden
;
141 extern __typeof (memchr
) memchr attribute_hidden
;
142 extern __typeof (memcmp
) memcmp attribute_hidden
;
143 extern __typeof (memcpy
) memcpy attribute_hidden
;
144 extern __typeof (memmove
) memmove attribute_hidden
;
145 extern __typeof (memset
) memset attribute_hidden
;
146 extern __typeof (rawmemchr
) rawmemchr attribute_hidden
;
147 extern __typeof (stpcpy
) stpcpy attribute_hidden
;
148 extern __typeof (strchr
) strchr attribute_hidden
;
149 extern __typeof (strcmp
) strcmp attribute_hidden
;
150 extern __typeof (strlen
) strlen attribute_hidden
;
151 extern __typeof (strnlen
) strnlen attribute_hidden
;
152 extern __typeof (strsep
) strsep attribute_hidden
;
155 #if (!IS_IN (libc) || !defined SHARED) \
156 && !defined NO_MEMPCPY_STPCPY_REDIRECT
157 /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
158 __mempcpy and __stpcpy if not inlined. */
159 extern __typeof (mempcpy
) mempcpy
__asm__ ("__mempcpy");
160 extern __typeof (stpcpy
) stpcpy
__asm__ ("__stpcpy");
163 extern void *__memcpy_chk (void *__restrict __dest
,
164 const void *__restrict __src
, size_t __len
,
165 size_t __destlen
) __THROW
;
166 extern void *__memmove_chk (void *__dest
, const void *__src
, size_t __len
,
167 size_t __destlen
) __THROW
;
168 extern void *__mempcpy_chk (void *__restrict __dest
,
169 const void *__restrict __src
, size_t __len
,
170 size_t __destlen
) __THROW
;
171 extern void *__memset_chk (void *__dest
, int __ch
, size_t __len
,
172 size_t __destlen
) __THROW
;
173 extern char *__strcpy_chk (char *__restrict __dest
,
174 const char *__restrict __src
,
175 size_t __destlen
) __THROW
;
176 extern char *__stpcpy_chk (char *__restrict __dest
,
177 const char *__restrict __src
,
178 size_t __destlen
) __THROW
;
179 extern char *__strncpy_chk (char *__restrict __dest
,
180 const char *__restrict __src
,
181 size_t __len
, size_t __destlen
) __THROW
;
182 extern char *__strcat_chk (char *__restrict __dest
,
183 const char *__restrict __src
,
184 size_t __destlen
) __THROW
;
185 extern char *__strncat_chk (char *__restrict __dest
,
186 const char *__restrict __src
,
187 size_t __len
, size_t __destlen
) __THROW
;