1998-09-06 23:45:24 +00:00
|
|
|
#ifndef _STRING_H
|
1999-11-24 20:48:27 +00:00
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
extern void *__memccpy (void *__dest, __const void *__src,
|
|
|
|
|
int __c, size_t __n);
|
|
|
|
|
|
2000-05-12 07:01:25 +00:00
|
|
|
extern size_t __strnlen (__const char *__string, size_t __maxlen)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
|
|
|
|
extern char *__strsep (char **__stringp, __const char *__delim);
|
|
|
|
|
|
2000-05-12 07:01:25 +00:00
|
|
|
extern int __strverscmp (__const char *__s1, __const char *__s2)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
|
|
|
|
extern int __strncasecmp (__const char *__s1, __const char *__s2,
|
2000-05-12 07:01:25 +00:00
|
|
|
size_t __n)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
2000-10-20 06:16:38 +00:00
|
|
|
extern int __strcasecmp (__const char *__s1, __const char *__s2)
|
|
|
|
|
__attribute_pure__;
|
|
|
|
|
|
|
|
|
|
extern char *__strcasestr (__const char *__haystack, __const char *__needle)
|
|
|
|
|
__attribute_pure__;
|
|
|
|
|
|
2000-06-23 02:04:57 +00:00
|
|
|
extern char *__strdup (__const char *__string)
|
|
|
|
|
__attribute_malloc__;
|
1999-12-19 19:14:15 +00:00
|
|
|
extern char *__strndup (__const char *__string, size_t __n)
|
|
|
|
|
__attribute_malloc__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
2000-05-12 07:01:25 +00:00
|
|
|
extern void *__rawmemchr (__const void *__s, int __c)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
2000-05-12 07:01:25 +00:00
|
|
|
extern char *__strchrnul (__const char *__s, int __c)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
2000-05-12 07:01:25 +00:00
|
|
|
extern void *__memrchr (__const void *__s, int __c, size_t __n)
|
|
|
|
|
__attribute_pure__;
|
1999-11-24 20:48:27 +00:00
|
|
|
|
2000-07-18 14:00:31 +00:00
|
|
|
extern void *__memchr (__const void *__s, int __c, size_t __n)
|
|
|
|
|
__attribute_pure__;
|
2001-02-06 18:27:57 +00:00
|
|
|
|
|
|
|
|
extern int __ffs (int __i) __attribute__ ((const));
|
|
|
|
|
|
|
|
|
|
extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
|
|
|
|
|
|
1999-11-24 20:48:27 +00:00
|
|
|
/* Now the real definitions. We do this here since some of the functions
|
|
|
|
|
above are defined as macros in the headers. */
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <string/string.h>
|
2001-08-30 23:22:02 +00:00
|
|
|
|
2002-08-27 23:36:31 +00:00
|
|
|
extern __typeof (strcoll_l) __strcoll_l;
|
|
|
|
|
extern __typeof (strxfrm_l) __strxfrm_l;
|
|
|
|
|
extern __typeof (strcasecmp_l) __strcasecmp_l;
|
|
|
|
|
extern __typeof (strncasecmp_l) __strncasecmp_l;
|
|
|
|
|
|
2001-08-30 23:22:02 +00:00
|
|
|
/* Alternative version which doesn't pollute glibc's namespace. */
|
|
|
|
|
#undef strndupa
|
|
|
|
|
#define strndupa(s, n) \
|
|
|
|
|
(__extension__ \
|
|
|
|
|
({ \
|
|
|
|
|
__const char *__old = (s); \
|
|
|
|
|
size_t __len = __strnlen (__old, (n)); \
|
|
|
|
|
char *__new = (char *) __builtin_alloca (__len + 1); \
|
|
|
|
|
__new[__len] = '\0'; \
|
|
|
|
|
(char *) memcpy (__new, __old, __len); \
|
|
|
|
|
}))
|
2002-08-03 07:02:10 +00:00
|
|
|
|
|
|
|
|
libc_hidden_proto (__mempcpy)
|
2002-08-04 01:22:11 +00:00
|
|
|
libc_hidden_proto (__stpcpy)
|
2002-08-03 07:02:10 +00:00
|
|
|
libc_hidden_proto (__stpncpy)
|
|
|
|
|
libc_hidden_proto (__rawmemchr)
|
|
|
|
|
libc_hidden_proto (__strcasecmp)
|
2002-08-03 21:19:56 +00:00
|
|
|
libc_hidden_proto (__strcasecmp_l)
|
|
|
|
|
libc_hidden_proto (__strncasecmp_l)
|
|
|
|
|
libc_hidden_proto (__strdup)
|
|
|
|
|
libc_hidden_proto (__strndup)
|
|
|
|
|
libc_hidden_proto (__strerror_r)
|
2002-08-04 09:27:27 +00:00
|
|
|
libc_hidden_proto (__strverscmp)
|
2002-08-12 02:02:20 +00:00
|
|
|
libc_hidden_proto (basename)
|
2002-08-13 00:24:58 +00:00
|
|
|
libc_hidden_proto (strcoll)
|
2002-08-06 06:09:28 +00:00
|
|
|
|
2002-08-08 04:44:47 +00:00
|
|
|
# ifndef _ISOMAC
|
|
|
|
|
# ifndef index
|
|
|
|
|
# define index(s, c) (strchr ((s), (c)))
|
|
|
|
|
# endif
|
|
|
|
|
# ifndef rindex
|
|
|
|
|
# define rindex(s, c) (strrchr ((s), (c)))
|
|
|
|
|
# endif
|
2002-08-06 06:09:28 +00:00
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
#endif
|