Commit Graph

16 Commits

Author SHA1 Message Date
Corinna Vinschen e916d8ec86 * libc/locale/locale.c (loadlocale): Revert to charset "GBK" instead
of "GB2312".  Fix documentation accordingly.
2009-03-26 10:24:38 +00:00
Corinna Vinschen 6396c8889f * libc/locale/locale.c (loadlocale): Only change __wctomb and __mbtowc
pointers if category is LC_CTYPE.
2009-03-25 13:52:08 +00:00
Corinna Vinschen 790d0a4c64 * libc/locale/locale.c (loadlocale): Rename charset "GBK" to
"GB2312".  Fix documentation accordingly.
2009-03-25 09:00:03 +00:00
Corinna Vinschen 4e4ff45c0b * libc/locale/locale.c (loadlocale): Rename charset "CP949" to
"eucKR".  Fix documentation accordingly.
2009-03-24 18:18:14 +00:00
Corinna Vinschen 62e51f09f9 * libc/locale/locale.c (loadlocale): Allow charset starting with 'e'
for "eucJP" charset support.
2009-03-24 16:56:33 +00:00
Corinna Vinschen 28186e81d9 * libc/ctype/iswalpha.c: Handle all wchar_t as unicode on
_MB_CAPABLE systems.
	* libc/ctype/iswblank.c: Ditto.
	* libc/ctype/iswcntrl.c: Ditto.
	* libc/ctype/iswprint.c: Ditto.
	* libc/ctype/iswpunct.c: Ditto.
	* libc/ctype/iswspace.c: Ditto.
	* libc/ctype/jp2uc.c (__jp2uc): On Cygwin, just return c.
	Explain why.
	* libc/ctype/towlower.c: Ditto.
	* libc/ctype/towupper.c: Ditto.
	* libc/include/sys/config.h: Define _MB_EXTENDED_CHARSETS_ISO
	and _MB_EXTENDED_CHARSETS_WINDOWS if _MB_EXTENDED_CHARSETS_ALL is
	defined.  Define _MB_EXTENDED_CHARSETS_ALL on Cygwin only for now.
	* libc/include/sys/reent.h (struct _reent): Mark _current_category
	and _current_locale as unused.
	* libc/locale/locale.c: Add new charset support to documentation.
	Include ../stdio/local.h from here.
	(lc_ctype_charset): Set to "ASCII" by default.
	(lc_message_charset): Ditto.
	(_setlocale_r): Don't set _current_category and _current_locale.
	(loadlocale): Add Cygwin codepage support.  On _MB_CAPABLE
	systems, set __mbtowc and __wctomb function pointers to function
	corresponding with current charset.  Don't allow non-existant
	ISO-8859-12 charset.  Add support for Windows singlebyte codepages.
	On Cygwin, add support for GBK, CP949, and BIG5.  On Cygwin,
	call __set_ctype() in case the catorgy is LC_CTYPE.  Don't set
	_current_category and _current_locale.
	* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add sb_charsets.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/local.h: Add prototype for __locale_charset.
	Add prototypes for __mbtowc and __wctomb pointers.
	Add prototypes for charset-specific _wctomb_r and _mbtowc_r
	functions.
	Declare tables and functions from sb_charsets.c.
	* libc/stdlib/mbtowc_r.c (__mbtowc): Define.  Set to __ascii_mbtowc
	by default.
	(_mbtowc_r): Just call __mbtowc from here.
	(__ascii_mbtowc): New function.
	(__iso_mbtowc): New function.
	(__cp_mbtowc): New function.
	(__utf8_mbtowc): New function.
	(__sjis_mbtowc): New function.  Disable on Cygwin.
	(__eucjp_mbtowc): New function.  Disable on Cygwin.
	(__jis_mbtowc): New function.  Disable on Cygwin.
	* libc/stdlib/sb_charsets.c: New file, adding singlebyte to UTF
	conversion tables for all ISO and CP charsets.
	(__iso_8859_index): New function.
	(__cp_index): New function.
	* libc/stdlib/wctomb_r.c (__wctomb): Define.  Set to __ascii_wctomb
	by default.
	(_wctomb_r): Just call __wctomb from here.
	(__ascii_wctomb): New function.
	(__utf8_wctomb): New function.
	(__sjis_wctomb): New function.  Disable on Cygwin.
	(__eucjp_wctomb): New function.  Disable on Cygwin.
	(__jis_wctomb): New function.  Disable on Cygwin.
	(__iso_wctomb): New function.
	(__cp_wctomb): New function.
2009-03-24 10:13:27 +00:00
Corinna Vinschen 9accf06e03 * libc/locale/locale.c (loadlocale): Fix typo in language and
territory evaluation.
2009-03-23 11:28:12 +00:00
Corinna Vinschen d6cd9169dc * libc/locale/locale.c (_setlocale_r): New implementation based on
FreeBSD's setlocale.
	(currentlocale): New helper function.
	(loadlocale): Ditto.
	(__locale_charset): New function.
	(__locale_msgcharset): Rename from __locale_charset.
	* libc/ctype/local.h (__lc_ctype): Remove declaration.
	(__locale_charset): Declare.
	* libc/ctype/iswalpha.c (iswalpha): Call __locale_charset instead of
	using __lc_ctype directly.  Only compare against the charset alone.
	* libc/ctype/iswblank.c (iswblank): Ditto.
	* libc/ctype/iswcntrl.c (iswcntrl): Ditto.
	* libc/ctype/iswprint.c (iswprint): Ditto.
	* libc/ctype/iswpunct.c (iswpunct): Ditto.
	* libc/ctype/iswspace.c (iswspace): Ditto.
	* libc/ctype/towlower.c (towlower): Ditto.
	* libc/ctype/towupper.c (towupper): Ditto.
	* libc/stdlib/mbtowc_r.c (_mbtowc_r): Ditto.
	* libc/stdlib/wctomb_r.c (_wctomb_r): Ditto.
	* libc/sys/linux/intl/loadmsgcat.c (_nl_init_domain_conv): Call
	__locale_msgcharset instead of __locale_charset.
2009-03-03 09:28:45 +00:00
Jeff Johnston f777e3a5ac 2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* configure.in: Define _MB_CAPABLE if mb supported.
        * configure: Regenerated.
        * configure.host: Remove manual setting of MB_CAPABLE compiler
        flag.
        * newlib.hin: Add _MB_CAPABLE flag.
        * libc/ctype/iswalpha.c, libc/ctype/iswblank.c: Include <newlib.h>
        and check for _MB_CAPABLE flag instead of MB_CAPABLE.
        * libc/ctype/iswcntrl.c, libc/ctype/iswprint.c: Ditto.
        * libc/ctype/iswpunct.c, libc/ctype/iswspace.c: Ditto.
        * libc/ctype/jp2uc.c: Ditto.
        * libc/ctype/towlower.c, libc/ctype/towupper.c: Ditto.
        * libc/locale/locale.c: Ditto
        * libc/machine/powerpc/vfscanf.c: Ditto
        * libc/stdio/vfprintf.c, libc/stdio/vfscanf.c: Ditto
        * libc/stdlib/mblen.c: Ditto
        * libc/stdlib/mblen_r.c, libc/stdlib/mbrlen.c: Ditto
        * libc/stdlib/mbrtowc.c, libc/stdlib/mbsrtowcs.c: Ditto
        * libc/stdlib/mbstowcs.c, libc/stdlib/mbtowc.c: Ditto
        * libc/stdlib/mbtowc_r.c, libc/stdlib/wcrtomb.c: Ditto
        * libc/stdlib/wcsrtombs.c, libc/stdlib/wcstombs.c: Ditto
        * libc/stdlib/wctomb.c, libc/sys/linux/intl/dcigettext.c: Ditto
        * libc/sys/linux/intl/explodename.c: Ditto
        * libc/sys/linux/intl/finddomain.c: Ditto
        * libc/sys/linux/intl/l10nflist.c: Ditto
        * libc/sys/linux/intl/loadmsgcat.c: Ditto
        * libc/sys/linux/intl/localealias.c: Ditto
2004-04-23 21:44:22 +00:00
Jeff Johnston 76a7df5256 2003-10-20 Bob Wilson <bob.wilson@acm.org>
* libc/locale/locale.c: Use double quotes in code.
	* libc/locale/locale.tex: Likewise.
	* libc/libc.texinfo: Hyphenate "floating-point".
	* libc/machine/necv70/necv70.tex: Likewise.
	* libc/stdio/sprintf.c: Likewise.
	* libc/stdio/sscanf.c: Likewise.
	* libc/stdlib/atof.c: Likewise.
	* libc/stdlib/ldtoa.c: Fix comment typo.
	* libc/stdlib/div.c: Use @ifnottex instead of @ifinfo.
	* libc/stdlib/ldiv.c: Likewise.
	* libm/common/s_expm1.c: Likewise.
	* libm/common/s_ilogb.c: Hyphenate "floating-point".  Use "nonzero".
	* libm/common/s_infinity: Hyphenate "double- and single-precision".
	* libm/common/s_nan.c: Likewise.  Also correct the FUNCTION summary.
	* libm/common/s_nextafter.c: Fix typo.  Hyphenate "double-precision"
	and "floating-point".
	* libm/common/s_scalbn.c: Correct the FUNCTION summary.
	* libm/math/e_pow.c: Fix comment typo.
	* libm/math/math.tex: Hyphenate "single-precision" and "floating-point".
	* libm/math/s_asinh.c: Use @ifnottex instead of @ifinfo.
	* libm/math/s_atan.c: Likewise.
	* libm/math/s_frexp.c: Likewise.  Also use "nonzero".
	* libm/math/s_isnan.c: Hyphenate "single-precision" and
	"floating-point".  Use "nonzero".
	* libm/math/s_ldexp.c: Use @ifnottex instead of @ifinfo.
	* libm/math/w_acos.c: Likewise.
	* libm/math/w_acosh.c: Likewise.
	* libm/math/w_asin.c: Likewise.
	* libm/math/w_atan2.c: Likewise.
	* libm/math/w_atanh.c: Likewise.
	* libm/math/w_cosh.c: Likewise.
	* libm/math/w_exp.c: Likewise.
	* libm/math/w_exp2.c: Likewise.  Add missing @end and missing @tex
	version of 2^x in the description.
	* libm/math/w_fmod.c: Use @ifnottex instead of @ifinfo.
	* libm/math/w_gamma.c: Likewise.
	* libm/math/w_hypot.c: Likewise.
	* libm/math/w_j0.c: Likewise.
	* libm/math/w_sinh.c: Likewise.
	* libm/math/w_pow.c: Replace "exp1.0nt" with "exponent".
	* libm/mathfp/mathfp.tex: Hyphenate "single-precision" and
	"floating-point".
	* libm/mathfp/e_acosh.c: Use @ifnottex instead of @ifinfo.
	* libm/mathfp/e_atanh.c: Likewise.
	* libm/mathfp/e_hypot.c: Likewise.
	* libm/mathfp/er_lgamma.c: Likewise.
	* libm/mathfp/s_acos.c: Likewise.
	* libm/mathfp/s_asine.c: Likewise.
	* libm/mathfp/s_asinh.c: Likewise.
	* libm/mathfp/s_atan.c: Likewise.
	* libm/mathfp/s_atan2.c: Likewise.
	* libm/mathfp/s_atangent.c: Likewise.
	* libm/mathfp/s_cosh.c: Likewise.
	* libm/mathfp/s_exp.c: Likewise.
	* libm/mathfp/s_fmod.c: Likewise.
	* libm/mathfp/s_frexp.c: Likewise.  Also use "nonzero".
	* libm/mathfp/s_isnan.c: Hyphenate "single-precision" and
	"floating-point".  Use "nonzero".
	* libm/math/s_pow.c: Replace "exp1.0nt" with "exponent".
	* libm/mathfp/s_ldexp.c: Use @ifnottex instead of @ifinfo.
	* libm/mathfp/s_sineh.c: Likewise.
	* libm/mathfp/w_jn.c: Likewise.
2003-10-20 18:46:38 +00:00
Jeff Johnston 1525d127da 2002-09-20 Jeff Johnston <jjohnstn@redhat.com>
* libc/ctype/Makefile.am: Add new files.
        * libc/ctype/Makefile.in: Regenerated.
        * libc/ctype/ctype.tex: Add new iswxxxx, towxxxx, wctype,
        and wctrans functions to documentation index.
        * libc/ctype/iswalnum.c: New file.
        * libc/ctype/iswalpha.c: Ditto.
        * libc/ctype/iswblank.c: Ditto.
        * libc/ctype/iswcntrl.c: Ditto.
        * libc/ctype/iswctype.c: Ditto.
        * libc/ctype/iswdigit.c: Ditto.
        * libc/ctype/iswgraph.c: Ditto.
        * libc/ctype/iswlower.c: Ditto.
        * libc/ctype/iswprint.c: Ditto.
        * libc/ctype/iswpunct.c: Ditto.
        * libc/ctype/iswspace.c: Ditto.
        * libc/ctype/iswupper.c: Ditto.
        * libc/ctype/iswxdigit.c: Ditto.
        * libc/ctype/jp2uc.c: Ditto.
        * libc/ctype/jp2uc.h: Ditto.
        * libc/ctype/local.h: Ditto.
        * libc/ctype/towctrans.c: Ditto.
        * libc/ctype/towlower.c: Ditto.
        * libc/ctype/towupper.c: Ditto.
        * libc/ctype/utf8alpha.h: Ditto.
        * libc/ctype/utf8print.h: Ditto.
        * libc/ctype/utf8punct.h: Ditto.
        * libc/ctype/wctrans.c: Ditto.
        * libc/ctype/wctype.c: Ditto.
        * libc/locale/locale.c (__lc_ctype): New external array to
        replace static lc_ctype array.
        * libc/stdlib/mbtowc_r.c: Use __lc_ctype to check current lc_ctype
        rather than reentrancy structure's _current_locale field.
        * libc/stdlib/wctomb_r.c: Ditto.
2002-09-20 20:13:11 +00:00
Jeff Johnston 86620e2190 2002-08-29 Jeff Johnston <jjohnstn@redhat.com>
* libc/locale/locale.c (_setlocale_r)[MB_CAPABLE]: Fix so
        default locale "" is accepted for LC_CTYPE or LC_MESSAGES
        and is treated as if "C" was specified.
2002-08-29 15:32:08 +00:00
Jeff Johnston ad5527663e 2002-08-17 Jeff Johnston <jjohnstn@redhat.com>
*  Makefile.am: Move cmath stuff into libc/sys/linux.
        *  Makefile.in: Regenerated.
        *  configure.host: Default -DMB_CAPABLE for x86-linux.
        *  libc/include/reent.h: Define _sbrk to take signed int argument.
        *  libc/include/sys/unistd.h: Ditto for _sbrk_r and sbrk.
        *  libc/locale/locale.c[MB_CAPABLE]: Add LC_MESSAGES support and
        make locale name checking more efficient.  Also allow "C-ISO-8859-1"
        locale for LC_CTYPE and LC_MESSAGES.
        *  libc/reent/sbrkr.c: Change prototype to take ptrdiff_t.
        *  libc/sys/linux/brk.c: Change sbrk prototype.
        *  libc/sys/linux/include/time.h: Remove Cygwin stuff and
        include <sys/features.h>.
        (CLOCK_THREAD_CPUTIME): Renamed to CLOCK_THREAD_CPUTIME_ID.
        (CLOCK_PROCESS_CPUTIME): Renamed to CLOCK_PROCESS_CPUTIME_ID.
        *  libc/sys/linux/sys/cdefs.h: Replace with glibc sys/cdefs.h
        with a few local additions.
        *  libc/sys/linux/sys/features.h: New file.
        *  libc/sys/linux/sys/unistd.h: Change _sbrk_r and sbrk prototypes
        to take signed argument.
        *  libc/syscalls/syssbrk.c: Change sbrk, _sbrk_r, and _sbrk
        prototypes to take signed size argument.
2002-08-17 05:19:18 +00:00
Thomas Fitzsimmons eaa75b70e3 * Makefile.am (check-DEJAGNU): New target.
(site.exp): Likewise.
	* acinclude.m4 (NEWLIB_CONFIGURE): Replace AC_CANONICAL_HOST
	with AC_CANONICAL_SYSTEM.  Remove AC_CANONICAL_BUILD.
	* libc/locale/locale.c (_setlocale_r): Add UTF-8 support.
	* libc/stdlib/mbtowc_r.c (_mbtowc_r): Likewise.
	* libc/stdlib/wctomb_r.c (_wctomb_r): Likewise.
	* testsuite: New directory.
	* testsuite/config: Likewise.
	* testsuite/lib: Likewise.
	* testsuite/newlib.locale: Likewise.
	* testsuite/newlib.string: Likewise.
	* testsuite/config/default.exp: New file.
	* testsuite/lib/checkoutput.exp: New file.
	* testsuite/lib/newlib.exp: New file.
	* testsuite/lib/passfail.exp: New file.
	* testsuite/newlib.locale/UTF-8.c: New file.
	* testsuite/newlib.locale/UTF-8.exp: New file.
	* testsuite/newlib.locale/locale.exp: New file.
	* testsuite/newlib.string/string.exp: New file.
	* testsuite/newlib.string/tstring.c: New file.
2002-04-24 20:53:30 +00:00
Jeff Johnston 0888fedd86 2000-08-23 Werner Almesberger <Werner.Almesberger@epfl.ch>
* libc/stdio/stdio.c (__swrite): declare "oldmode" only if it's
        used later (ifdef __SCLE)
        * libc/stdio/vfscanf.c (__svfscanf): declare "state" only if it's
        used later (ifdef MB_CAPABLE)
        * libc/string/memset.c (memset): removed unused variables "count"
        and "unaligned_addr"
        * libc/locale/locale.c (_setlocale_r): declare "lc_ctype" and
        "last_lc_ctype" only of they're used later (ifdef MB_CAPABLE)
        * libc/unix/getpwent.c (getpwnam): removed unused variables "uid"
        and "gid"
2000-08-24 16:25:36 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00