This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Take2: Enable LC_MONETARY, LC_NUMERIC and LC_TIME handling


Hi,

On Jan 20 15:33, Corinna Vinschen wrote:
>  	* libc/locale/lmonetary.c (__monetary_load_locale): Take additional
>  	parameters for wide char to multibyte conversion.  Call
>  	__set_lc_monetary_from_win on Cygwin.
>  	* libc/locale/lmonetary.h: Make C++-safe.
>  	(__monetary_load_locale): Change declaration.
>  	* libc/locale/lnumeric.c (__numeric_load_locale): Take additional
>  	parameters for wide char to multibyte conversion.  Call
>  	__set_lc_numeric_from_win on Cygwin.
>  	* libc/locale/lnumeric.h: Make C++-safe.
>  	(__numeric_load_locale): Change declaration.
>  	* libc/locale/locale.c (lconv): De-constify for Cygwin.
> 	(__set_charset_from_locale): Rename from
> 	__set_charset_from_codepage.  Take locale as parameter instead of
> 	a codepage.
> 	(loadlocale): Enable LC_MONETARY, LC_NUMERIC, and LC_TIME handling
> 	on Cygwin.
> 	(_localeconv_r): On Cygwin, copy values from monetary and numeric
> 	domain if change has been noted.
>  	* libc/locale/nl_langinfo.c (nl_langinfo): Accommodate change of
>  	am/pm layout in struct lc_time_T.
>  	* libc/locale/timelocal.c (_C_time_locale): Accommodate
>  	redefinition of am/pm members.
>  	(__time_load_locale): Take additional parameters for wide char
>  	to multibyte conversion.  Call __set_lc_time_from_win on Cygwin.
>  	* libc/locale/timelocal.h: Make C++-safe.
>  	(struct lc_time_T): Convert am and pm to a am_pm array for easier
>  	consumption by strftime and strptime.
>  	(__time_load_locale): Change declaration.
>  	* libc/time/strftime.c: Change documentation to reflect changes to
>  	strftime.  Remove locale constant strings in favor of access to
>  	locale-specifc data.
>  	(_ctloc): Define access method for locale-specifc data.
>  	(TOLOWER): Define for tolower conversion.
>  	(strftime): Throughout, convert locale-specific formats to use
>  	locale-specific data.  Add GNU-specific "%P" format.
>  	* libc/time/strptime.c: Remove locale constant strings in favor of
>  	access to locale-specifc data.
>  	(_ctloc): Define access method for locale-specifc data.
>  	(strptime): Throughout, convert locale-specific formats to use
>  	locale-specific data.

I've checked this in, since I need this for Cygwin anyway.  Other
systems should only be mildly affected by reading the C locale info from
another, centralized place in strftime/strptime, rather than keeping
their own copies around.

I hope that's ok,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]