diff options
34 files changed, 285 insertions, 70 deletions
@@ -1,3 +1,43 @@ +2002-08-06 Roland McGrath <roland@redhat.com> + + * locale/Versions (libc: GLIBC_2.3): Add all the *_l functions + with no __ prefix. + * locale/langinfo.h [__USE_GNU]: Declare nl_langinfo_l. + * ctype/ctype.h [__USE_GNU]: Add declarations and macros for + all *_l functions with no __ prefix. + * wctype/wcfuncs_l.c: Define weak aliases without __ for all fns. + * ctype/ctype_l.c: Likewise. + * locale/nl_langinfo.c: Likewise. + * string/string.h [__USE_GNU]: Add decls for all *_l fns with no __. + * stdlib/stdlib.h [__USE_GNU]: Likewise. + * wcsmbs/wchar.h [__USE_GNU]: Likewise. + * wctype/wctype.h [__USE_GNU]: Likewise. + * string/strcoll_l.c (strcoll_l): Define as weak alias. + * string/strxfrm_l.c (strxfrm_l): Define as weak alias. + * sysdeps/generic/strcasecmp_l.c (strcasecmp_l): Define as weak alias. + * sysdeps/generic/strncase_l.c (strncasecmp_l): Define as weak alias. + * stdlib/strtod_l.c (strtod_l): Define as weak alias. + * stdlib/strtof_l.c (strtof_l): Define as weak alias. + * stdlib/strtold_l.c (strtold_l): Define as weak alias. + * wcsmbs/wcscasecmp_l.c (wcscasecmp_l): Define as weak alias. + (__wcscasecmp_l): Add libc_hidden_def. + * wcsmbs/wcsncase_l.c (wcsncasecmp_l): Define as weak alias. + (__wcsncasecmp_l): Add libc_hidden_def. + * wcsmbs/wcstof_l.c (wcstof_l): Define as weak alias. + * wcsmbs/wcstod_l.c (wcstod_l): Define as weak alias. + * wcsmbs/wcstold_l.c (wcstold_l): Define as weak alias. + * wcsmbs/wcscoll_l.c (wcscoll_l): Define as weak alias. + * wcsmbs/wcsxfrm_l.c (wcsxfrm_l): Define as weak alias. + * sysdeps/generic/wcstol_l.c (wcstol_l): Define as weak alias. + * sysdeps/generic/wcstoll_l.c (wcstoll_l): Define as weak alias. + * sysdeps/generic/wcstoul_l.c (wcstoul_l): Define as weak alias. + * sysdeps/generic/wcstoull_l.c (wcstoull_l): Define as weak alias. + * sysdeps/wordsize-64/wcstol_l.c (wcstoll_l): Define as weak alias. + * sysdeps/wordsize-64/wcstoul_l.c (wcstoull_l): Define as weak alias. + * wctype/wctrans_l.c (wctrans_l) Define as weak alias. + * wctype/towctrans_l.c (towctrans_l) Define as weak alias. + * wctype/wctype_l.c (wctype_l) Define as weak alias. + 2002-08-05 Roland McGrath <roland@redhat.com> * include/rpc/auth.h: Use libc_hidden_proto for getnetname, diff --git a/ctype/ctype.h b/ctype/ctype.h index e73a06d64e..c17aaf171c 100644 --- a/ctype/ctype.h +++ b/ctype/ctype.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,92,93,95,96,97,98,99,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,02 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -214,38 +215,44 @@ toupper (int __c) __THROW # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) -# define __exctype_l(name) extern int name (int, __locale_t) __THROW +# define __exctype_l(name) \ + extern int name (int, __locale_t) __THROW; \ + extern int __##name (int, __locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ -__exctype_l (__isalnum_l); -__exctype_l (__isalpha_l); -__exctype_l (__iscntrl_l); -__exctype_l (__isdigit_l); -__exctype_l (__islower_l); -__exctype_l (__isgraph_l); -__exctype_l (__isprint_l); -__exctype_l (__ispunct_l); -__exctype_l (__isspace_l); -__exctype_l (__isupper_l); -__exctype_l (__isxdigit_l); +__exctype_l (isalnum_l); +__exctype_l (isalpha_l); +__exctype_l (iscntrl_l); +__exctype_l (isdigit_l); +__exctype_l (islower_l); +__exctype_l (isgraph_l); +__exctype_l (isprint_l); +__exctype_l (ispunct_l); +__exctype_l (isspace_l); +__exctype_l (isupper_l); +__exctype_l (isxdigit_l); -__exctype_l (__isblank_l); +__exctype_l (isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l (int __c, __locale_t __l) __THROW; +extern int tolower_l (int __c, __locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l (int __c, __locale_t __l) __THROW; +extern int toupper_l (int __c, __locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) +# define tolower_l(c, locale) __tolower_l ((c), (locale)) +# define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ @@ -265,8 +272,27 @@ extern int __toupper_l (int __c, __locale_t __l) __THROW; # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN -# define __isascii_l(c,l) __isascii(c) -# define __toascii_l(c,l) __toascii(c) +# define __isascii_l(c,l) ((l), __isascii (c)) +# define __toascii_l(c,l) ((l), __toascii (c)) +# endif + +# define isalnum_l(c,l) __isalnum_l ((c), (l)) +# define isalpha_l(c,l) __isalpha_l ((c), (l)) +# define iscntrl_l(c,l) __iscntrl_l ((c), (l)) +# define isdigit_l(c,l) __isdigit_l ((c), (l)) +# define islower_l(c,l) __islower_l ((c), (l)) +# define isgraph_l(c,l) __isgraph_l ((c), (l)) +# define isprint_l(c,l) __isprint_l ((c), (l)) +# define ispunct_l(c,l) __ispunct_l ((c), (l)) +# define isspace_l(c,l) __isspace_l ((c), (l)) +# define isupper_l(c,l) __isupper_l ((c), (l)) +# define isxdigit_l(c,l) __isxdigit_l ((c), (l)) + +# define isblank_l(c,l) __isblank_l ((c), (l)) + +# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +# define isascii_l(c,l) __isascii ((c), (l)) +# define toascii_l(c,l) __toascii ((c), (l)) # endif # endif /* Not __NO_CTYPE. */ diff --git a/ctype/ctype_l.c b/ctype/ctype_l.c index f895c48858..f35ce5f519 100644 --- a/ctype/ctype_l.c +++ b/ctype/ctype_l.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,97,2001,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,28 +22,31 @@ /* Provide real-function versions of all the ctype macros. */ #define func(name, type) \ - int name (int c, __locale_t l) { return __isctype_l (c, type, l); } - -func (__isalnum_l, _ISalnum) -func (__isalpha_l, _ISalpha) -func (__iscntrl_l, _IScntrl) -func (__isdigit_l, _ISdigit) -func (__islower_l, _ISlower) -func (__isgraph_l, _ISgraph) -func (__isprint_l, _ISprint) -func (__ispunct_l, _ISpunct) -func (__isspace_l, _ISspace) -func (__isupper_l, _ISupper) -func (__isxdigit_l, _ISxdigit) + int __##name (int c, __locale_t l) { return __isctype_l (c, type, l); } \ + weak_alias (__##name, name) + +func (isalnum_l, _ISalnum) +func (isalpha_l, _ISalpha) +func (iscntrl_l, _IScntrl) +func (isdigit_l, _ISdigit) +func (islower_l, _ISlower) +func (isgraph_l, _ISgraph) +func (isprint_l, _ISprint) +func (ispunct_l, _ISpunct) +func (isspace_l, _ISspace) +func (isupper_l, _ISupper) +func (isxdigit_l, _ISxdigit) int (__tolower_l) (int c, __locale_t l) { return l->__ctype_tolower[c]; } +weak_alias (__tolower_l, tolower_l) int (__toupper_l) (int c, __locale_t l) { return l->__ctype_toupper[c]; } +weak_alias (__toupper_l, toupper_l) diff --git a/locale/Versions b/locale/Versions index bb875f84a4..4cf2f585ad 100644 --- a/locale/Versions +++ b/locale/Versions @@ -49,6 +49,19 @@ libc { GLIBC_2.3 { # the new "experimental" interface is now public newlocale; duplocale; freelocale; uselocale; + + isalnum_l; isalpha_l; isascii_l; isblank_l; iscntrl_l; + isdigit_l; isgraph_l; islower_l; isprint_l; ispunct_l; + isspace_l; isupper_l; iswalnum_l; iswalpha_l; iswblank_l; + iswcntrl_l; iswctype_l; iswdigit_l; iswgraph_l; iswlower_l; + iswprint_l; iswpunct_l; iswspace_l; iswupper_l; iswxdigit_l; + isxdigit_l; strcasecmp_l; strcoll_l; strfmon_l; strncasecmp_l; + strtod_l; strtof_l; strtol_l; strtold_l; strtoll_l; strtoul_l; + strtoull_l; strxfrm_l; toascii_l; tolower_l; toupper_l; + towctrans_l; towlower_l; towupper_l; wcscasecmp_l; wcscoll_l; + wcsncasecmp_l; wcstod_l; wcstof_l; wcstol_l; wcstold_l; + wcstoll_l; wcstoul_l; wcstoull_l; wcsxfrm_l; wctype_l; + wctrans_l; nl_langinfo_l; } GLIBC_PRIVATE { # global variables diff --git a/locale/langinfo.h b/locale/langinfo.h index 859b007c12..557129f83a 100644 --- a/locale/langinfo.h +++ b/locale/langinfo.h @@ -1,5 +1,5 @@ /* Access to locale-dependent parameters. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -584,6 +584,7 @@ extern char *nl_langinfo (nl_item __item) __THROW; /* Just like nl_langinfo but get the information from the locale object L. */ extern char *__nl_langinfo_l (nl_item __item, __locale_t l); +extern char *nl_langinfo_l (nl_item __item, __locale_t l); #endif __END_DECLS diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c index 34b67d0646..7df2b30ba9 100644 --- a/locale/nl_langinfo.c +++ b/locale/nl_langinfo.c @@ -58,6 +58,8 @@ nl_langinfo (item) /* Return the string for the specified item. */ return (char *) data->values[index].string; } -#ifndef USE_IN_EXTENDED_LOCALE_MODEL +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +weak_alias (__nl_langinfo_l, nl_langinfo_l) +#else libc_hidden_def (nl_langinfo) #endif diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 9b0ed9e3a6..ccead6b023 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991-99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -215,32 +215,55 @@ extern unsigned long long int strtoull (__const char *__restrict __nptr, extern long int __strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW; +extern long int strtol_l (__const char *__restrict __nptr, + char **__restrict __endptr, int __base, + __locale_t __loc) __THROW; extern unsigned long int __strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW; +extern unsigned long int strtoul_l (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, __locale_t __loc) __THROW; __extension__ extern long long int __strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW; +__extension__ +extern long long int strtoll_l (__const char *__restrict __nptr, + char **__restrict __endptr, int __base, + __locale_t __loc) __THROW; __extension__ extern unsigned long long int __strtoull_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW; +__extension__ +extern unsigned long long int strtoull_l (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, __locale_t __loc) + __THROW; extern double __strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW; +extern double strtod_l (__const char *__restrict __nptr, + char **__restrict __endptr, __locale_t __loc) + __THROW; extern float __strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW; +extern float strtof_l (__const char *__restrict __nptr, + char **__restrict __endptr, __locale_t __loc) __THROW; extern long double __strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW; +extern long double strtold_l (__const char *__restrict __nptr, + char **__restrict __endptr, + __locale_t __loc) __THROW; #endif /* GNU */ diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c index a15ff10a5c..e8449050d3 100644 --- a/stdlib/strtod_l.c +++ b/stdlib/strtod_l.c @@ -1,5 +1,5 @@ /* Convert string representing a number to float value, using given locale. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997,98,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -27,3 +27,5 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **, int, int, __locale_t); #include <strtod.c> + +weak_alias (__strtod_l, strtod_l) diff --git a/stdlib/strtof_l.c b/stdlib/strtof_l.c index c39e17653b..1187ffc73b 100644 --- a/stdlib/strtof_l.c +++ b/stdlib/strtof_l.c @@ -1,5 +1,5 @@ /* Convert string representing a number to float value, using given locale. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997,98,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -27,3 +27,5 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **, int, int, __locale_t); #include <strtof.c> + +weak_alias (__strtof_l, strtof_l) diff --git a/stdlib/strtold_l.c b/stdlib/strtold_l.c index f06d777b83..c3a4e79390 100644 --- a/stdlib/strtold_l.c +++ b/stdlib/strtold_l.c @@ -1,5 +1,5 @@ /* Convert string representing a number to float value, using given locale. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997,98,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -49,3 +49,5 @@ __strtold_l (const char *nptr, char **endptr, __locale_t loc) return ____strtod_l_internal (nptr, endptr, 0, loc); } #endif + +weak_alias (__strtold_l, strtold_l) diff --git a/string/strcoll_l.c b/string/strcoll_l.c index 46aebbe426..6611589ed0 100644 --- a/string/strcoll_l.c +++ b/string/strcoll_l.c @@ -1,6 +1,6 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1995,96,97,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. - Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. + Written by Ulrich Drepper <drepper@gnu.org>, 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,3 +19,5 @@ #define USE_IN_EXTENDED_LOCALE_MODEL 1 #include <strcoll.c> + +weak_alias (__strcoll_l, strcoll_l) diff --git a/string/string.h b/string/string.h index 265e1fac9e..dd71072e76 100644 --- a/string/string.h +++ b/string/string.h @@ -110,9 +110,13 @@ extern size_t strxfrm (char *__restrict __dest, /* Compare the collated forms of S1 and S2 using rules from L. */ extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) __THROW __attribute_pure__; +extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) + __THROW __attribute_pure__; /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) __THROW; +extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, + __locale_t __l) __THROW; #endif #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED @@ -282,10 +286,15 @@ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) of the global one. */ extern int __strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __THROW __attribute_pure__; +extern int strcasecmp_l (__const char *__s1, __const char *__s2, + __locale_t __loc) __THROW __attribute_pure__; extern int __strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__; +extern int strncasecmp_l (__const char *__s1, __const char *__s2, + size_t __n, __locale_t __loc) + __THROW __attribute_pure__; #endif #ifdef __USE_BSD |
