5 extern void *__memccpy (void *__dest, __const void *__src,
8 extern size_t __strnlen (__const char *__string, size_t __maxlen)
11 extern char *__strsep (char **__stringp, __const char *__delim);
13 extern int __strverscmp (__const char *__s1, __const char *__s2)
16 extern int __strncasecmp (__const char *__s1, __const char *__s2,
20 extern int __strcasecmp (__const char *__s1, __const char *__s2)
23 extern char *__strcasestr (__const char *__haystack, __const char *__needle)
26 extern char *__strdup (__const char *__string)
28 extern char *__strndup (__const char *__string, size_t __n)
31 extern void *__rawmemchr (__const void *__s, int __c)
34 extern char *__strchrnul (__const char *__s, int __c)
37 extern void *__memrchr (__const void *__s, int __c, size_t __n)
40 extern void *__memchr (__const void *__s, int __c, size_t __n)
43 extern int __ffs (int __i) __attribute__ ((const));
45 extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
47 /* Now the real definitions. We do this here since some of the functions
48 above are defined as macros in the headers. */
49 #include <string/string.h>
51 /* Alternative version which doesn't pollute glibc's namespace. */
53 #define strndupa(s, n) \
56 __const char *__old = (s); \
57 size_t __len = __strnlen (__old, (n)); \
58 char *__new = (char *) __builtin_alloca (__len + 1); \
59 __new[__len] = '\0'; \
60 (char *) memcpy (__new, __old, __len); \
63 libc_hidden_proto (__mempcpy)
64 libc_hidden_proto (__stpcpy)
65 libc_hidden_proto (__stpncpy)
66 libc_hidden_proto (__rawmemchr)
67 libc_hidden_proto (__strcasecmp)
68 libc_hidden_proto (__strcasecmp_l)
69 libc_hidden_proto (__strncasecmp_l)
70 libc_hidden_proto (__strdup)
71 libc_hidden_proto (__strndup)
72 libc_hidden_proto (__strerror_r)
73 libc_hidden_proto (__strverscmp)
74 libc_hidden_proto (basename)
75 libc_hidden_proto (strcoll)
79 # define index(s, c) (strchr ((s), (c)))
82 # define rindex(s, c) (strrchr ((s), (c)))