* collate.h: New header.
(__collate_range_cmp): Declare.
(__collate_load_error): Define.
* glob.cc: Pull in latest version from FreeBSD. Simplify and reduce
Cygwin-specific changes.
* regex/regcomp.c: Include collate.h on Cygwin as well.
(__collate_range_cmp): Move from here...
* nlsfuncs.cc (__collate_range_cmp): ...to here.
* miscfuncs.cc (thread_wrapper): Fix typo in comment.
(CygwinCreateThread): Take dead zone of Windows stack into account.
Change the way how the stack is commited and how to handle guardpages.
Explain how and why.
* thread.h (PTHREAD_DEFAULT_STACKSIZE): Change definition. Explain why.
suffix.
* nlsfuncs.cc (rebase_locale_buf): Reorder arguments. Accommodate
throughout. Add pointer to end of buffer and avoid changing pointers
not pointing into the buffer.
* nlsfuncs.cc (__getlocaleinfo): Drop conversion to multibyte.
(__charfromwchar): New function to convert to multibyte.
(__eval_datetimefmt): Convert to return wchar_t pointer. Work on
wide char string.
(__set_lc_time_from_win): Take additional pointer to "C" category info
to accommodate C.foo locales. Rework to fill wide char members in
category info.
(__set_lc_ctype_from_win): New function.
(__set_lc_numeric_from_win): Take additional pointer to "C" category
info to accommodate C.foo locales. Rework to fill wide char members
in category info.
(__set_lc_monetary_from_win): Ditto.
(__set_lc_messages_from_win): Ditto.
(__get_current_collate_codeset): New function, called from nl_langinfo.
* include/cygwin/config.h (__HAVE_LOCALE_INFO_EXTENDED__): Define.
function pointers in locale structures. Explain why this is necessary.
(__set_lc_time_from_win): Use rebase_locale_buf after realloc.
(__set_lc_numeric_from_win): Ditto.
(__set_lc_monetary_from_win): Ditto.
default date and time formats as well to workaround YA Windows
shortcoming. Refresh with latest data.
* lc_msg.h: Refresh with latest data.
* nlsfuncs.cc (__eval_datetimefmt): Revert latest change.
(__set_lc_time_from_win): Rename res to era. Prefer default date and
time formats from era array if available.
(__set_lc_messages_from_win): Rename res to msg.
format.
* nlsfuncs.cc (dt_flags): Remove DT_ERACAL since crippled era data
in Windows makes it useless.
(__eval_datetimefmt): Check if locale's default calender has
non-gregorian start year. Use era year also in default date entries,
if so.
* nlsfuncs.cc: Include lc_era.h.
(locale_cmp): convert arguments to char** to be usable for both types,
lc_msg_t and lc_era_t.
(__set_lc_time_from_win): Handle era-related data
(enum dt_flags): Define.
(__eval_datetimefmt): Change force to flags and change type to
dt_flags. Accommodate throughout.
(__set_lc_time_from_win): Accommodate above change. Set era-related
values to empty strings for now.
whether invalid chars should be ignored or not. Change comment.
(__set_lc_monetary_from_win): Call lc_wcstombs with return_invalid
flag set.
(__set_lc_messages_from_win): Simplify to accommodate the fact that
lc_wcstombs just ignores invalid chars. Explain why.
* nlsfuncs.cc: Include lc_msg.h.
(lc_time_buf): Remove.
(lc_numeric_buf): Remove.
(lc_monetary_buf): Remove.
(lc_mbstowcs): Fix previous fix.
(__set_lc_time_from_win): Take additional pointer to buffer pointer,
defined in newlib.
(__set_lc_numeric_from_win): Ditto.
(__set_lc_monetary_from_win): Ditto.
(locale_cmp): New static function.
(__set_lc_messages_from_win): New function to be called from newlib.
__get_lcid_from_locale as well.
(__get_lcid_from_locale): Handle no_NO locale as alias for nn_NO.
Default all sr_XY locales to Cyrillic script. Change lcid to Latin
script if "@latin" modifier has been specified.
(__set_charset_from_locale): Handle Serbian in codepage 1251 case as
well. Also check for sr_BA lcid. Restrict "@euro" modifier to
locales otherwise defaulting to ISO-8859-1.
* Makefile.in (install-headers): Remove extra command to install
regex.h.
(uninstall-headers): Remove extra command to uninstall regex.h.
* nlsfuncs.cc (collate_lcid): Make externally available to allow
access to collation internals from regex functions.
(collate_charset): Ditto.
* wchar.h: Add __cplusplus guards to make C-clean.
* include/regex.h: New file, replacing regex/regex.h. Remove UCB
advertising clause.
* regex/COPYRIGHT: Accommodate BSD license. Remove UCB advertising
clause.
* regex/cclass.h: Remove.
* regex/cname.h: New file from FreeBSD.
* regex/engine.c: Ditto.
(NONCHAR): Tweak for Cygwin.
* regex/engine.ih: Remove.
* regex/mkh: Remove.
* regex/regcomp.c: New file from FreeBSD. Tweak slightly for Cygwin.
Import required collate internals from nlsfunc.cc.
(p_ere_exp): Add GNU-specific \< and \> handling for word boundaries.
(p_simp_re): Ditto.
(__collate_range_cmp): Define.
(p_b_term): Use Cygwin-specific collate internals.
(findmust): Ditto.
* regex/regcomp.ih: Remove.
* regex/regerror.c: New file from FreeBSD. Fix a few compiler warnings.
* regex/regerror.ih: Remove.
* regex/regex.7: New file from FreeBSD. Remove UCB advertising clause.
* regex/regex.h: Remove. Replaced by include/regex.h.
* regex/regexec.c: New file from FreeBSD. Fix a few compiler warnings.
* regex/regfree.c: New file from FreeBSD.
* regex/tests: Remove.
* regex/utils.h: New file from FreeBSD.
comments. Make sure to set last_lcid every time. Return locale
without territory part as invalid. Handle modern serbian territory
names per ISO 3166 on older systems as well. Add appropriate comment.
(__set_charset_from_locale): Handle LCID for sr_CS as well to make older
systems happy.
* autoload.cc (LocaleNameToLCID): Define.
* cygwin.din (strfmon): Export.
* nlsfuncs.cc: New file. Define a lot of internal functions called
from setlocale.
(wcscoll): Implement locale-aware here, using CompareStringW function.
(strcoll): Ditto.
(wcsxfrm): Implement locale-aware here, usingLCMapStringW function.
(strxfrm): Ditto.
(__set_charset_from_locale): Replace __set_charset_from_codepage.
Return Linux-compatible charset.
* strfuncs.cc (__set_charset_from_codepage): Remove.
* wchar.h (__set_charset_from_codepage): Drop definition.
* wincap.h (wincaps::has_localenames): New element.
* wincap.cc: Implement above element throughout.
* libc/strfmon.c: New file.
* libc/strptime.cc: Remove locale constant strings in favor of
access to locale-specifc data.
(strptime): Point _CurrentTimeLocale to locale-specific data.
Throughout use correct locale-specific format fields for all
locale-specific formats.
* include/monetary.h: New file.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.