Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-25Drop global __ctype_ptr__ entirely in favor of using locale_t::ctype_ptrCorinna Vinschen
Keep __ctype_ptr__ available on Cygwin only, for backward compatibility with existing apps referencing it via the ctype macros. Otherwise initialize __global_locale.ctype_ptr and __C_locale.ctype_ptr and use them throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Add __get_C_locale inline function and fix new locale code for !_MB_CAPABLE ↵Corinna Vinschen
targets Only access "C" locale using the new __get_C_locale inline function. Enable __global_locale for !_MB_CAPABLE targets. Accommodate !_MB_CAPABLE targets in new locale code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Add/change a few #ifdef comments in locale code for clearnessCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-17Constify __locale_ctype_ptr and __locale_ctype_ptr_lCorinna Vinschen
Remove _MB_CAPABLE-only _CONST in ctype.h Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-16Always fall back to __ctype_ptr__ in isXXX_l functions.Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15setlocale.h: Fix current locale handling for !__HAVE_LOCALE_INFO__ targetsCorinna Vinschen
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15__loadlocale: Set missing val when evaluating CP874Corinna Vinschen
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Move lconv into struct __locale_t and implement __localeconv_lCorinna Vinschen
Based on FreeBSD, just don't export symbol yet, unless required. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Move localeconv, duplocale, freelocale, newlocale, uselocale into separate filesCorinna Vinschen
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Fix memory handling in functions called from loadlocaleCorinna Vinschen
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Implement newlocale, freelocale, duplocale, uselocaleCorinna Vinschen
Add global const __C_locale for reference purposes. Bump Cygwin API minor number and DLL major version number to 2.6.0. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Use __get_global_locale function where appropriateCorinna Vinschen
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Rearrange struct __locale_t pointers into an arrayCorinna Vinschen
This allows looping through the structs and buffers. Also rearrange definitions to follow order of LC_xxx values. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Change loadlocale to fill a __locale_t given as parameterCorinna Vinschen
Don't use global variables. This allows to call loadlocale from the yet to be created newlocale(). Rename _thr_locale_t to __locale_t (these locales are not restricted to threads so the name is misleading). Along these lines, fix _set_ctype to take a __locale_t as parameter. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Consolidate wctomb/mbtowc calls for POSIX-1.2008Corinna Vinschen
- Remove charset parameter from low level __foo_wctomb/__foo_mbtowc calls. - Instead, create array of function for ISO and Windows codepages to point to function which does not require to evaluate the charset string on each call. Create matching helper functions. I.e., __iso_wctomb, __iso_mbtowc, __cp_wctomb and __cp_mbtowc are functions returning the right function pointer now. - Create __WCTOMB/__MBTOWC macros utilizing per-reent locale and replace calls to __wctomb/__mbtowc with calls to __WCTOMB/__MBTOWC. - Drop global __wctomb/__mbtowc vars. - Utilize aforementioned changes in Cygwin to get rid of charset in other, calling functions and simplify the code. - In Cygwin restrict global cygheap locale info to the job performed by internal_setlocale. Use UTF-8 instead of ASCII on the fly in internal conversion functions. - In Cygwin dll_entry, make sure to initialize a TLS area with a NULL _REENT->_locale pointer. Add comment to explain why. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15POSIX-1.2008 per-thread locales, groundwork part 2Corinna Vinschen
Move all locale category structure definitions into setlocale.h and remove other headers in locale subdir. Create inline accessor functions for current category struct pointers and use throughout. Use pointers to "C" locale category structs by default in __global_locale. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15POSIX-1.2008 per-thread locales, groundwork part 1Corinna Vinschen
Introduce first cut of struct _thr_locale_t used for the locale_t definition. Introduce global instance called __global_locale used by default. Introduce internal inline functions __get_global_locale, __get_locale_r, __get_current_locale. Remove usage of global variables in favor of accessor functions pointing to __global_locale for now. Include all local headers in locale subdir from setlocale.h to get single include for internal locale access. Introduce __CTYPE_PTR macro to replace direct access to __ctype_ptr__ and use throughout in isxxx functions. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-06-24Drop now useless comment from locale.cCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-23Drop has_always_all_codepages flagCorinna Vinschen
2015-06-24Fix mismatched parentheses in documentation.Jon TURNEY
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/locale/locale.c: Fix mismatched parentheses in documentation. * libc/locale/locale.tex: Ditto. * libc/stdio/fgetwc.c: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-30 * libc/locale/locale.c (__mb_cur_max): On Cygwin, align default valueCorinna Vinschen
with default UTF-8 charset.
2011-05-04 * libc/locale/lmessages.h (__messages_load_locale): Declare. RemoveCorinna Vinschen
accidental declaration of __numeric_load_locale. * libc/locale/locale.c: Include timelocal.h to get declaration of __time_load_locale. (__set_locale_from_locale_alias): Fix return type. (__locale_msgcharset): Avoid compiler warnings. (_localeconv_r): Ditto.
2011-05-04 Cygwin-specific patch from Andy Koppe:Corinna Vinschen
* libc/locale/locale.c (current_categories): On Cygwin, set LC_CTYPE to C.UTF-8 to match initial __wctomb and __mbtowc settings. (lc_ctype_charset): On Cygwin, initialize to "UTF-8". (loadlocale): Remove unused Cygwin-specifc code.
2010-11-19 * libc/locale/locale.c (loadlocale): Recognise the "cjknarrow"Corinna Vinschen
modifier on "C.<charset>" locales too.
2010-11-18 * libc/locale/locale.c (loadlocale): Fix width of CJK ambigousCorinna Vinschen
characters to 1 for singlebyte charsets and 2 for non-Unicode multibyte charsets. Change documentation accordingly.
2010-05-122010-05-11 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/locale/locale.c (loadlocale): Fix dangling switch statement caused by __HAVE_LOCALE_INFO__ not being defined.
2010-04-28 Extend locale support to maintain wide char values of native stringsCorinna Vinschen
if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/include/langinfo.h (enum __nl_item): New type. Define all native values accessible through nl_langinfo. Define previously existing POSIX-compatible values as macros as well. * libc/include/stdlib.h (__mb_cur_max): Drop declaration. (__locale_mb_cur_max): Declare. (MB_CUR_MAX): Re-define calling __locale_mb_cur_max. * libc/locale/Makefile.am (ELIX_SOURCES): Add lctype.c. * libc/locale/Makefile.in: Regenerate. * libc/locale/lctype.c: New file to define and load LC_CTYPE category. * libc/locale/lctype.h: New file, matching header. * libc/locale/lmessages.c (_C_messages_locale): Add default values for wide char members. (__messages_load_locale): Add _C_messages_locale in call to __set_lc_messages_from_win. * libc/locale/lmessages.h (struct lc_messages_T): Add wide char members. * libc/locale/lmonetary.c (_C_monetary_locale): Add default values for wide char members. (__monetary_load_locale): Add _C_monetary_locale in call to __set_lc_monetary_from_win. * libc/locale/lmonetary.h (struct lc_monetary_T): Add wide char members. Add numerical values for international currency formatting per POSIX-1.2008, if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/locale/lnumeric.c (_C_numeric_locale): Add default values for wide char members. (__numeric_load_locale): Add _C_numeric_locale in call to __set_lc_numeric_from_win. * libc/locale/lnumeric.h (struct lc_numeric_T): Add wide char members. * libc/locale/locale.c (loadlocale): Return doing nothing if category locale didn't change. Convert category if chain to switch statement. Call __ctype_load_locale in LC_CTYPE case. (__locale_charset): Add (but disable for now) returning codeset from __get_current_ctype_locale. (__locale_mb_cur_max): Add (but disable for now) returning mb_cur_max from __get_current_ctype_locale. (__locale_msgcharset): Add returning codeset from __get_current_messages_locale. (_localeconv_r): Accommodate int_XXX values. * libc/locale/nl_langinfo.c (nl_ext): New array to define what is to be returned for non-POSIX values. (nl_Langinfo): Return correct codeset for each locale category. Return extended values if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/locale/timelocal.c (_C_time_locale): Add default values for wide char members. (__time_load_locale): Add _C_time_locale in call to __set_lc_time_from_win. * libc/locale/timelocal.h (struct lc_time_T): Add wide char members. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Use wide char decimal point and thousands_sep if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/time/strftime.c: Rework to accommodate availability of wide char strings in LC_TIME category if __HAVE_LOCALE_INFO_EXTENDED__ is defined.
2010-04-23* libc/Makefile.am (SUBDEFS): Add LIBC_POSIX_DEF.DJ Delorie
(libc.info): Add posix.texi. (libc.dvi): Likewise. (stmp-posix): New. (posix.texi): New. (libc_TEXINFOS): Add posix.texi. * libc/configure.in (LIBC_POSIX_LIB, LIBC_POSIX_DEF): Add tests. * libc/libc.texinfo: Include posix.texi * libc/locale/locale.c: Fix texinfo typo. * libc/time/strftime.c: Fix texinfo typo. * libc/configure: Regenerate. * libc/Makefile.in: Regenerate. * libc/argz/Makefile.in: Regenerate. * libc/ctype/Makefile.in: Regenerate. * libc/errno/Makefile.in: Regenerate. * libc/iconv/Makefile.in: Regenerate. * libc/iconv/ccs/Makefile.in: Regenerate. * libc/iconv/ccs/binary/Makefile.in: Regenerate. * libc/iconv/ces/Makefile.in: Regenerate. * libc/iconv/lib/Makefile.in: Regenerate. * libc/locale/Makefile.in: Regenerate. * libc/misc/Makefile.in: Regenerate. * libc/posix/Makefile.in: Regenerate. * libc/reent/Makefile.in: Regenerate. * libc/search/Makefile.in: Regenerate. * libc/signal/Makefile.in: Regenerate. * libc/stdio/Makefile.in: Regenerate. * libc/stdio64/Makefile.in: Regenerate. * libc/stdlib/Makefile.in: Regenerate. * libc/string/Makefile.in: Regenerate. * libc/syscalls/Makefile.in: Regenerate. * libc/time/Makefile.in: Regenerate. * libc/unix/Makefile.in: Regenerate. * libc/xdr/Makefile.in: Regenerate.
2010-03-28 * libc/locale/locale.c (loadlocale): Optimize "EUC" charset check.Corinna Vinschen
Cygwin only: Allow GB2312 and EUC-CN as alternative codeset names for GBK. Add to documentation. * libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate EUCCN to GB2312.
2010-02-25 * libc/locale/locale.c (loadlocale): Fix typo in comment.Corinna Vinschen
2010-02-25 * libc/locale/locale.c: Throughout, extensively comment on theCorinna Vinschen
reason for using __CYGWIN__. (lconv): Remove _CONST entirely. (loadlocale): Guard calls to function loading locale-specific category data with __HAVE_LOCALE_INFO__ rather than __CYGWIN__. * libc/sys/config.h (__HAVE_LOCALE_INFO__): Define for Cygwin.
2010-02-09 * libc/locale/lmessages.c (__messages_load_locale): Take additionalCorinna Vinschen
parameters for wide char to multibyte conversion. Call __set_lc_messages_from_win on Cygwin. * libc/locale/lmessages.h: Make C++-safe. (__messages_load_locale): Change declaration. * libc/locale/lmonetary.c (__monetary_load_locale): Use _monetary_locale_buf as buffer pointer. * libc/locale/lnumeric.c (__numeric_load_locale): Use _numeric_locale_buf as buffer pointer. * libc/locale/timelocal.c (__time_load_locale): Use time_locale_buf as buffer pointer. * libc/locale/locale.c (loadlocale): Enable loading LC_MESSAGES data on Cygwin.
2010-02-07 * libc/locale/locale.c: Add Cygwin's /usr/share/locale/locale.aliasCorinna Vinschen
support to documentation. (__set_locale_from_locale_alias): Declare when build for Cygwin. (loadlocale): On Cygwin, if locale can't be recognized, call __set_locale_from_locale_alias to check for locale alias. Define FAIL macro to replace `return NULL' statements. Replace throughout.
2010-02-07 * libc/locale/locale.c: Fix typo in documentation. Remove uselessCorinna Vinschen
_MB_CAPABLE guards within other _MB_CAPABLE guards. Add comment to remaining #endif's.
2010-02-06 * libc/ctype/ctype_cp.h (_CTYPE_GEORGIAN_PS_128_254): Define.Corinna Vinschen
(_CTYPE_GEORGIAN_PS_255): Define. (_CTYPE_PT154_128_254): Define. (_CTYPE_PT154_255): Define. (__ctype_cp): Add array members for above ctype definitions. * libc/locale/locale.c (loadlocale): Make TIS-620 charset name available for all targets. Add guards for setting the conversion function pointers. Add support for GEORGIAN-PS and PT154 charsets. Change documentation to reflect current behaviour more closely. * libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate "CP101" to "GEORGIAN-PS" and "CP102" to "PT154". * libc/stdlib/sb_charsets.c (__cp_conv): Add conversion arrays for GEORGIAN-PS and PT154. (__cp_index): Map invalid Windows codepage number 101 to GEORGIAN-PS conversion array, 102 to PT154 conversion array.
2010-02-06 * libc/locale/locale.c (loadlocale): Handle ISO-8859 and KOI8 charsetsCorinna Vinschen
so that the dashes are optional. Align documentation.
2010-01-23 * libc/locale/locale.c (loadlocale): Allow CP932 as alias for SJIS.Corinna Vinschen
Add to documentation. Add a few comments to #endif's for Cygwin.
2010-01-23 * libc/locale/locale.c (loadlocale): Disable JIS entirely on Cygwin.Corinna Vinschen
Allow TIS620 and TIS-620 as aliases for CP874 on Cygwin.
2010-01-22 * libc/locale/lmonetary.c (__monetary_load_locale): Take additionalCorinna Vinschen
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): Allow "EUC-JP" for "EUCJP" and "EUC-KR" for "EUCKR". Change documnetation accordingly. Enable LC_COLLATE, 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.
2010-01-17 * libc/locale/locale.c (loadlocale): Change comments to refer toCorinna Vinschen
ISO 639-3 rather than 639-2.
2010-01-17 * libc/locale/locale.c (loadlocale): Allow three characterCorinna Vinschen
language codes to accommodate ISO 639-2 codes.
2010-01-17 * libc/locale/locale.c (lc_ctype_charset): Disable defaulting toCorinna Vinschen
"UTF-8" on Cygwin. (lc_message_charset): Ditto. (loadlocale): Disable setting charset of the "C" locale to "UTF-8" on Cygwin. * libc/stdlib/mbtowc_r.c (__mbtowc): Add Cygwin-specific comment. * libc/stdlib/wctomb_r.c (__wctomb): Ditto.
2009-10-09 * libc/locale/locale.c (DEFAULT_LOCALE): New define.Corinna Vinschen
(__default_locale): New global variable set to the default locale. (__get_locale_env): Return __default_locale rather than fixed "C".
2009-09-29 * libc/locale/locale.c (loadlocale): Allow "C." same as "C-" as localeCorinna Vinschen
prefix. Add some words to documentation.
2009-09-27 * libc/locale/locale.c (lc_ctype_charset): Set to "UTF-8" on Cygwin.Corinna Vinschen
(lc_message_charset): Ditto. (loadlocale): Set charset of the "C" locale to "UTF-8" on Cygwin. * libc/stdlib/mbtowc_r.c (__mbtowc): Default to __utf8_mbtowc on Cygwin. * libc/stdlib/wctomb_r.c (__wctomb): Default to __utf8_wctomb on Cygwin.
2009-09-23 * libc/locale/locale.c: Drop Cygwin-specific windows.h include.Corinna Vinschen
(loadlocale): Call __set_charset_from_codepage with 0 codepage.
2009-08-252009-08-25 Andy Koppe <andy.koppe@gmail.com>Jeff Johnston
* libc/stdlib/sb_charsets.c (__micro_atoi): Allow five-digit codepage numbers. * libc/locale/locale.c (loadlocale): Set MB_CUR_MAX to 1 for KOI8 charsets. * libc/stdlib/local.h (__cp_conv): Remove incorrect number of codepages.
2009-08-252009-08-24 Corinna Vinschen <corinna@vinschen.de>Jeff Johnston
* libc/locale/locale.c: Update documentation. (loadlocale): Map "KOI8-R" and "KOI8-U" to CP20866 and CP21866. 2009-08-24 Andy Koppe <andy.koppe@gmail.com> * libc/stdlib/sb_charsets.c (__cp_conv): Add KOI8-R (Russian, CP20866) and KOI8-U (Ukrainian, CP21866) to Windows codepage conversion tables. * libc/ctype/ctype_cp.h (__ctype_cp): Likewise for ctype tables.
2009-08-22 * libc/locale/locale.c (loadlocale): Throughout check charset stringCorinna Vinschen
case insensitive and store internal charset string uppercased. Allow "UTF8" additionally to "UTF-8". Add this change to documentation.
2009-06-18 * libc/locale/locale.c (loadlocale): Add handling of "@cjknarrow"Corinna Vinschen
modifier on _MB_CAPABLE targets. Add comment to explain. Improve documentation.