glibc/include/string.h
Roland McGrath da4cfe381c * ctype/ctype.h (isascii_l, toascii_l): Define to __*_l counterparts.
* ctype/ctype-extn.c (isblank_l): Add weak alias.
	* sysdeps/generic/strtol_l.c (strtol_l): Likewise.
	* sysdeps/generic/strtoll_l.c (strtoll_l): Likewise.
	* sysdeps/generic/strtoul_l.c (strtoul_l): Likewise.
	* sysdeps/generic/strtoull_l.c (strtoull_l): Likewise.
	* wctype/iswctype_l.c (iswctype_l): Likewise.

	* time/strftime.c [USE_IN_EXTENDED_LOCALE_MODEL]: No libc_hidden_def.

	* ctype/ctype.h (__exctype_l): Don't declare __ name.
	* stdlib/stdlib.h: Don't declare __*_l names.
	* include/stdlib.h: Declare them here instead.
	* include/string.h: Don't declare __*_l names.
	* string/string.h: Declare them here instead.
	* time/time.h: Don't declare __*_l names.
	* include/time.h: Declare them here instead.
	* wcsmbs/wchar.h: Don't declare __*_l names.
	* include/wchar.h: Declare them here instead.
	* wctype/wctype.h: Declare iswalnum_l, not __iswalnum_l.
	Don't declare __*_l names.
	* include/wctype.h: Declare them here instead.
	* stdlib/monetary.h: Declare strfmon_l, not __strfmon_l.
	* stdlib/strfmon_l.c (strfmon_l): Define as weak alias.
	* locale/langinfo.h: Don't declare __nl_langinfo_l.
	* include/langinfo.h: Declare it here with __typeof.
2002-08-27 23:36:31 +00:00

92 lines
2.6 KiB
C

#ifndef _STRING_H
#include <sys/types.h>
extern void *__memccpy (void *__dest, __const void *__src,
int __c, size_t __n);
extern size_t __strnlen (__const char *__string, size_t __maxlen)
__attribute_pure__;
extern char *__strsep (char **__stringp, __const char *__delim);
extern int __strverscmp (__const char *__s1, __const char *__s2)
__attribute_pure__;
extern int __strncasecmp (__const char *__s1, __const char *__s2,
size_t __n)
__attribute_pure__;
extern int __strcasecmp (__const char *__s1, __const char *__s2)
__attribute_pure__;
extern char *__strcasestr (__const char *__haystack, __const char *__needle)
__attribute_pure__;
extern char *__strdup (__const char *__string)
__attribute_malloc__;
extern char *__strndup (__const char *__string, size_t __n)
__attribute_malloc__;
extern void *__rawmemchr (__const void *__s, int __c)
__attribute_pure__;
extern char *__strchrnul (__const char *__s, int __c)
__attribute_pure__;
extern void *__memrchr (__const void *__s, int __c, size_t __n)
__attribute_pure__;
extern void *__memchr (__const void *__s, int __c, size_t __n)
__attribute_pure__;
extern int __ffs (int __i) __attribute__ ((const));
extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
/* Now the real definitions. We do this here since some of the functions
above are defined as macros in the headers. */
#include <string/string.h>
extern __typeof (strcoll_l) __strcoll_l;
extern __typeof (strxfrm_l) __strxfrm_l;
extern __typeof (strcasecmp_l) __strcasecmp_l;
extern __typeof (strncasecmp_l) __strncasecmp_l;
/* 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); \
}))
libc_hidden_proto (__mempcpy)
libc_hidden_proto (__stpcpy)
libc_hidden_proto (__stpncpy)
libc_hidden_proto (__rawmemchr)
libc_hidden_proto (__strcasecmp)
libc_hidden_proto (__strcasecmp_l)
libc_hidden_proto (__strncasecmp_l)
libc_hidden_proto (__strdup)
libc_hidden_proto (__strndup)
libc_hidden_proto (__strerror_r)
libc_hidden_proto (__strverscmp)
libc_hidden_proto (basename)
libc_hidden_proto (strcoll)
# ifndef _ISOMAC
# ifndef index
# define index(s, c) (strchr ((s), (c)))
# endif
# ifndef rindex
# define rindex(s, c) (strrchr ((s), (c)))
# endif
# endif
#endif