Introduce __current_locale_charset/__locale_charset
The former __locale_charset always fetched the current locale's charset. We need the per-locale charset, too, in future. Rename __locale_charset to __current_locale_charset and change __locale_charset to take a locale_t as parameter. Accommodate througout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -154,11 +154,11 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type)
|
||||
wint_t
|
||||
_DEFUN (_jp2uc, (c), wint_t c)
|
||||
{
|
||||
if (!strcmp (__locale_charset (), "JIS"))
|
||||
if (!strcmp (__current_locale_charset (), "JIS"))
|
||||
c = __jp2uc (c, JP_JIS);
|
||||
else if (!strcmp (__locale_charset (), "SJIS"))
|
||||
else if (!strcmp (__current_locale_charset (), "SJIS"))
|
||||
c = __jp2uc (c, JP_SJIS);
|
||||
else if (!strcmp (__locale_charset (), "EUCJP"))
|
||||
else if (!strcmp (__current_locale_charset (), "EUCJP"))
|
||||
c = __jp2uc (c, JP_EUCJP);
|
||||
return c;
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ _DEFUN(nl_langinfo, (item),
|
||||
#endif /* __HAVE_LOCALE_INFO__ */
|
||||
case CODESET:
|
||||
#ifdef __CYGWIN__
|
||||
ret = (char *) __locale_charset ();
|
||||
ret = (char *) __current_locale_charset ();
|
||||
#endif
|
||||
do_codeset:
|
||||
#ifdef __CYGWIN__
|
||||
|
@ -373,7 +373,17 @@ __get_current_messages_locale (void)
|
||||
#endif /* !__HAVE_LOCALE_INFO__ */
|
||||
|
||||
_ELIDABLE_INLINE const char *
|
||||
__locale_charset (void)
|
||||
__locale_charset (struct __locale_t *locale)
|
||||
{
|
||||
#ifdef __HAVE_LOCALE_INFO__
|
||||
return __get_ctype_locale (locale)->codeset;
|
||||
#else
|
||||
return locale->ctype_codeset;
|
||||
#endif
|
||||
}
|
||||
|
||||
_ELIDABLE_INLINE const char *
|
||||
__current_locale_charset (void)
|
||||
{
|
||||
#ifdef __HAVE_LOCALE_INFO__
|
||||
return __get_current_ctype_locale ()->codeset;
|
||||
|
Reference in New Issue
Block a user