* libc/ctype/Makefile.am: Remove _tolower.c and _toupper.c

source files.  Add a dependency rule for ctype_o to note
	changes in ctype_iso.h and ctype_cp.h.
	* libc/ctype/Makefile.in: Regenerate.
	* libc/ctype/_tolower.c: Remove file.
	* libc/ctype/_toupper.c: Remove file.
	* libc/ctype/ctype_.c: Make sure ALLOW_NEGATIVE_CTYPE_INDEX
	is always defined on Cygwin.
	(_ctype_b): Don't make `static const' on Cygwin.
	(ctype_iso.h): Include if _MB_EXTENDED_CHARSETS_ISO is set.
	(ctype_cp.h): Include if _MB_EXTENDED_CHARSETS_WINDOWS is set.
	(__ctype_ptr): Drop definition.
	(__ctype_ptr__): De-constify.  Mark as __EXPORT symbol.
	(_ctype_): Add Cygwin-specifc asm define.
	(__set_ctype): New function to set __ctype_ptr__ according to
	current charset.
	* libc/ctype/ctype_cp.h: New file containing Windows codepage
	specific character class tables.
	* libc/ctype/ctype_iso.h: New file containing ISO-8859-x
	specific character class tables.
	* libc/ctype/tolower.c (tolower): Reimplement to support any singlebyte
	charset if one of the extended charsets is enabled.
	* libc/ctype/toupper.c (toupper): Ditto.
	* libc/include/ctype.h (_tolower): Define as macro per POSIX.
	(_toupper): Ditto.
	(__ctype_ptr__): De-constify.
	(toupper): Disable macro on systems supporting extended charsets.
	(tolower): Ditto.
	* libc/include/sys/config.h (__EXPORT): Define empty if not defined.
	* libc/locale/locale.c (__mb_cur_max): Mark as __EXPORT symbol.
	(__set_ctype): Declare unconditionally.
	(loadlocale): Remove __CYGWIN__ guard around __set_ctype call.
This commit is contained in:
Corinna Vinschen 2009-03-31 09:31:38 +00:00
parent 24bd1f86c2
commit 4bc42c05aa
13 changed files with 1141 additions and 91 deletions

View File

@ -1,3 +1,38 @@
2009-03-31 Corinna Vinschen <corinna@vinschen.de>
* libc/ctype/Makefile.am: Remove _tolower.c and _toupper.c
source files. Add a dependency rule for ctype_o to note
changes in ctype_iso.h and ctype_cp.h.
* libc/ctype/Makefile.in: Regenerate.
* libc/ctype/_tolower.c: Remove file.
* libc/ctype/_toupper.c: Remove file.
* libc/ctype/ctype_.c: Make sure ALLOW_NEGATIVE_CTYPE_INDEX
is always defined on Cygwin.
(_ctype_b): Don't make `static const' on Cygwin.
(ctype_iso.h): Include if _MB_EXTENDED_CHARSETS_ISO is set.
(ctype_cp.h): Include if _MB_EXTENDED_CHARSETS_WINDOWS is set.
(__ctype_ptr): Drop definition.
(__ctype_ptr__): De-constify. Mark as __EXPORT symbol.
(_ctype_): Add Cygwin-specifc asm define.
(__set_ctype): New function to set __ctype_ptr__ according to
current charset.
* libc/ctype/ctype_cp.h: New file containing Windows codepage
specific character class tables.
* libc/ctype/ctype_iso.h: New file containing ISO-8859-x
specific character class tables.
* libc/ctype/tolower.c (tolower): Reimplement to support any singlebyte
charset if one of the extended charsets is enabled.
* libc/ctype/toupper.c (toupper): Ditto.
* libc/include/ctype.h (_tolower): Define as macro per POSIX.
(_toupper): Ditto.
(__ctype_ptr__): De-constify.
(toupper): Disable macro on systems supporting extended charsets.
(tolower): Ditto.
* libc/include/sys/config.h (__EXPORT): Define empty if not defined.
* libc/locale/locale.c (__mb_cur_max): Mark as __EXPORT symbol.
(__set_ctype): Declare unconditionally.
(loadlocale): Remove __CYGWIN__ guard around __set_ctype call.
2009-03-26 Corinna Vinschen <corinna@vinschen.de>
* libc/locale/locale.c (loadlocale): Revert to charset "GBK" instead

View File

@ -41,8 +41,6 @@ ELIX_SOURCES = \
iswxdigit.c \
jp2uc.c \
toascii.c \
_tolower.c \
_toupper.c \
towctrans.c \
towlower.c \
towupper.c \
@ -113,3 +111,5 @@ doc: $(CHEWOUT_FILES)
cat $(srcdir)/ctype.tex >> $(TARGETDOC)
CLEANFILES = $(CHEWOUT_FILES) *.ref
$(lpfx)ctype_.$(oext): ctype_.c ctype_iso.h ctype_cp.h

View File

@ -38,6 +38,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
LIBOBJDIR =
DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
subdir = ctype
@ -81,8 +82,6 @@ am__objects_1 = lib_a-ctype_.$(OBJEXT) lib_a-isalnum.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-iswxdigit.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-jp2uc.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-toascii.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-_tolower.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-_toupper.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-towctrans.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-towlower.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-towupper.$(OBJEXT) \
@ -101,9 +100,9 @@ am__objects_3 = ctype_.lo isalnum.lo isalpha.lo iscntrl.lo isdigit.lo \
@ELIX_LEVEL_1_FALSE@ iswctype.lo iswdigit.lo iswgraph.lo \
@ELIX_LEVEL_1_FALSE@ iswlower.lo iswprint.lo iswpunct.lo \
@ELIX_LEVEL_1_FALSE@ iswspace.lo iswupper.lo iswxdigit.lo \
@ELIX_LEVEL_1_FALSE@ jp2uc.lo toascii.lo _tolower.lo \
@ELIX_LEVEL_1_FALSE@ _toupper.lo towctrans.lo towlower.lo \
@ELIX_LEVEL_1_FALSE@ towupper.lo wctrans.lo wctype.lo
@ELIX_LEVEL_1_FALSE@ jp2uc.lo toascii.lo towctrans.lo \
@ELIX_LEVEL_1_FALSE@ towlower.lo towupper.lo wctrans.lo \
@ELIX_LEVEL_1_FALSE@ wctype.lo
@USE_LIBTOOL_TRUE@am_libctype_la_OBJECTS = $(am__objects_3) \
@USE_LIBTOOL_TRUE@ $(am__objects_4)
libctype_la_OBJECTS = $(am_libctype_la_OBJECTS)
@ -232,20 +231,8 @@ STRIP = @STRIP@
USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_LIPO = @ac_ct_LIPO@
ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_OTOOL = @ac_ct_OTOOL@
ac_ct_OTOOL64 = @ac_ct_OTOOL64@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_READELF = @ac_ct_READELF@
ac_ct_STRIP = @ac_ct_STRIP@
aext = @aext@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@ -261,6 +248,9 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
extra_dir = @extra_dir@
host = @host@
@ -268,12 +258,14 @@ host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libm_machine_dir = @libm_machine_dir@
localedir = @localedir@
localstatedir = @localstatedir@
lpfx = @lpfx@
lt_ECHO = @lt_ECHO@
@ -283,8 +275,10 @@ mkdir_p = @mkdir_p@
newlib_basedir = @newlib_basedir@
oext = @oext@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
subdirs = @subdirs@
@ -326,8 +320,6 @@ GENERAL_SOURCES = \
@ELIX_LEVEL_1_FALSE@ iswxdigit.c \
@ELIX_LEVEL_1_FALSE@ jp2uc.c \
@ELIX_LEVEL_1_FALSE@ toascii.c \
@ELIX_LEVEL_1_FALSE@ _tolower.c \
@ELIX_LEVEL_1_FALSE@ _toupper.c \
@ELIX_LEVEL_1_FALSE@ towctrans.c \
@ELIX_LEVEL_1_FALSE@ towlower.c \
@ELIX_LEVEL_1_FALSE@ towupper.c \
@ -628,18 +620,6 @@ lib_a-toascii.o: toascii.c
lib_a-toascii.obj: toascii.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-toascii.obj `if test -f 'toascii.c'; then $(CYGPATH_W) 'toascii.c'; else $(CYGPATH_W) '$(srcdir)/toascii.c'; fi`
lib_a-_tolower.o: _tolower.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-_tolower.o `test -f '_tolower.c' || echo '$(srcdir)/'`_tolower.c
lib_a-_tolower.obj: _tolower.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-_tolower.obj `if test -f '_tolower.c'; then $(CYGPATH_W) '_tolower.c'; else $(CYGPATH_W) '$(srcdir)/_tolower.c'; fi`
lib_a-_toupper.o: _toupper.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-_toupper.o `test -f '_toupper.c' || echo '$(srcdir)/'`_toupper.c
lib_a-_toupper.obj: _toupper.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-_toupper.obj `if test -f '_toupper.c'; then $(CYGPATH_W) '_toupper.c'; else $(CYGPATH_W) '$(srcdir)/_toupper.c'; fi`
lib_a-towctrans.o: towctrans.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-towctrans.o `test -f 'towctrans.c' || echo '$(srcdir)/'`towctrans.c
@ -677,7 +657,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
-rm -f libtool config.lt
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -830,6 +810,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES)
doc: $(CHEWOUT_FILES)
cat $(srcdir)/ctype.tex >> $(TARGETDOC)
$(lpfx)ctype_.$(oext): ctype_.c ctype_iso.h ctype_cp.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,9 +0,0 @@
#include <_ansi.h>
#include <ctype.h>
#undef _tolower
int
_DEFUN(_tolower,(c),int c)
{
return isupper(c) ? (c) - 'A' + 'a' : c;
}

View File

@ -1,9 +0,0 @@
#include <_ansi.h>
#include <ctype.h>
#undef _toupper
int
_DEFUN(_toupper,(c),int c)
{
return islower(c) ? c - 'a' + 'A' : c;
}

View File

@ -73,58 +73,102 @@ static char sccsid[] = "@(#)ctype_.c 5.6 (Berkeley) 6/1/90";
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0
#if defined(__GNUC__) && !defined(__CHAR_UNSIGNED__) && !defined(COMPACT_CTYPE)
#if (defined(__GNUC__) && !defined(__CHAR_UNSIGNED__) && !defined(COMPACT_CTYPE)) || defined (__CYGWIN__)
#define ALLOW_NEGATIVE_CTYPE_INDEX
#endif
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
static _CONST char _ctype_b[128 + 256] = {
/* No static const on Cygwin since it's referenced and potentially overwritten
for compatibility with older applications. */
#ifndef __CYGWIN__
static _CONST
#endif
char _ctype_b[128 + 256] = {
_CTYPE_DATA_128_256,
_CTYPE_DATA_0_127,
_CTYPE_DATA_128_256
};
# if defined(__CYGWIN__)
_CONST char __declspec(dllexport) *__ctype_ptr = _ctype_b + 128;
_CONST char __declspec(dllexport) *__ctype_ptr__ = _ctype_b + 127;
# else
_CONST char *__ctype_ptr = _ctype_b + 128;
_CONST char *__ctype_ptr__ = _ctype_b + 127;
# endif
#if defined(_MB_CAPABLE)
#if defined(_MB_EXTENDED_CHARSETS_ISO)
#include "ctype_iso.h"
#endif
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
#include "ctype_cp.h"
#endif
#endif
# if defined(_HAVE_ARRAY_ALIASING)
char __EXPORT *__ctype_ptr__ = _ctype_b + 127;
# ifdef __CYGWIN__
__asm__ (" \n\
.data \n\
.globl __ctype_ \n\
.set __ctype_,__ctype_b+127 \n\
.text \n\
");
# elif defined(_HAVE_ARRAY_ALIASING)
# if defined(__CYGWIN__)
extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
# else
extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
# endif
# else /* !_HAVE_ARRAY_ALIASING */
# if defined(__CYGWIN__)
_CONST char __declspec(dllexport) _ctype_[1 + 256] = {
# else
_CONST char _ctype_[1 + 256] = {
# endif
0,
_CTYPE_DATA_0_127,
_CTYPE_DATA_128_256
};
# endif /* !_HAVE_ARRAY_ALIASING */
# endif /* !_HAVE_ARRAY_ALIASING */
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
# if defined(__CYGWIN__)
_CONST char __declspec(dllexport) _ctype_[1 + 256] = {
# else
_CONST char _ctype_[1 + 256] = {
# endif
0,
_CTYPE_DATA_0_127,
_CTYPE_DATA_128_256
};
_CONST char *__ctype_ptr = _ctype_ + 1;
_CONST char *__ctype_ptr__ = _ctype_;
#endif
#if defined(_MB_CAPABLE)
/* Cygwin has its own implementation which additionally maintains backward
compatibility with applications built under older Cygwin releases. */
#ifndef __CYGWIN__
void
__set_ctype (const char *charset)
{
int idx;
switch (*charset)
{
#if defined(_MB_EXTENDED_CHARSETS_ISO)
case 'I':
idx = __iso_8859_index (charset + 9);
/* The ctype table has a leading ISO-8859-1 element so we have to add
1 to the index returned by __iso_8859_index. If __iso_8859_index
returns < 0, it's ISO-8859-1. */
if (idx < 0)
idx = 0;
else
++idx;
__ctype_ptr__ = (char *) (__ctype_iso[idx] + 127);
return;
#endif
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
case 'C':
idx = __cp_index (charset + 2);
if (idx < 0)
break;
__ctype_ptr__ = (char *) (__ctype_cp[idx] + 127);
return;
#endif
default:
break;
}
__ctype_ptr__ = (char *) _ctype_b + 127;
}
#endif /* !__CYGWIN__ */
#endif /* _MB_CAPABLE */

View File

@ -0,0 +1,570 @@
/* ctype table definitions for Windows codepage charsets.
Included by ctype_.c. */
#define _CTYPE_CP437_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _U, _U, \
_U, _L, _U, _L, _L, _L, _L, _L, \
_L, _U, _U, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _U, _L, _U, _L, _P, _L, \
_U, _U, _U, _L, _P, _L, _L, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP720_128_256 \
0, 0, _L, _L, 0, _L, 0, _L, \
_L, _L, _L, _L, _L, 0, 0, 0, \
0, _P, _P, _L, _P, _P, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
0, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP737_128_256 \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _U, _U, _U, _U, _U, _U, \
_U, _P, _P, _P, _P, _U, _U, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP775_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _U, _L, _L, _U, _U, _U, \
_U, _L, _U, _L, _L, _U, _P, _U, \
_L, _U, _U, _P, _P, _P, _P, _P, \
_U, _U, _L, _U, _L, _L, _P, _P, \
_P, _P, _P, _P, _P, _U, _P, _P, \
_P, _P, _P, _P, _P, _U, _U, _U, \
_U, _P, _P, _P, _P, _U, _U, _P, \
_P, _P, _P, _P, _P, _P, _U, _U, \
_P, _P, _P, _P, _P, _P, _P, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _P, _P, _P, _P, _P, _P, _P, \
_U, _L, _U, _U, _L, _U, _L, _L, \
_U, _L, _U, _L, _L, _U, _U, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP850_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _U, _U, \
_U, _L, _U, _L, _L, _L, _L, _L, \
_L, _U, _U, _L, _P, _U, _P, _P, \
_L, _L, _L, _L, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _U, _U, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _L, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _U, _U, _U, _U, _L, _U, _U, \
_U, _P, _P, _P, _P, _P, _U, _P, \
_U, _L, _U, _U, _L, _U, _L, _U, \
_L, _U, _U, _U, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP852_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _U, _L, _L, _U, _U, _U, \
_U, _U, _L, _L, _L, _U, _L, _U, \
_L, _U, _U, _U, _L, _U, _P, _L, \
_L, _L, _L, _L, _U, _L, _U, _L, \
_U, _L, _P, _L, _U, _L, _P, _P, \
_P, _P, _P, _P, _P, _U, _U, _U, \
_U, _P, _P, _P, _P, _U, _L, _P, \
_P, _P, _P, _P, _P, _P, _U, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _U, _U, _U, _L, _U, _U, _U, \
_L, _P, _P, _P, _P, _U, _U, _P, \
_U, _L, _U, _U, _L, _L, _U, _L, \
_U, _U, _L, _U, _L, _U, _L, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _L, _U, _L, _P, _S|_B
#define _CTYPE_CP855_128_256 \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _U, _L, _U, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _L, _U, _L, \
_U, _P, _P, _P, _P, _L, _U, _P, \
_P, _P, _P, _P, _P, _P, _L, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _U, _L, _U, _L, _U, _L, _U, \
_L, _P, _P, _P, _P, _U, _L, _P, \
_U, _L, _U, _L, _U, _L, _U, _L, \
_U, _L, _U, _L, _U, _L, _U, _P, \
_P, _L, _U, _L, _U, _L, _U, _L, \
_U, _L, _U, _L, _U, _P, _P, _S|_B
#define _CTYPE_CP857_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _U, _U, \
_U, _L, _U, _L, _L, _L, _L, _L, \
_U, _U, _U, _L, _P, _U, _U, _L, \
_L, _L, _L, _L, _L, _U, _U, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _U, _U, _U, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _L, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _U, _U, _U, _L, _U, _U, \
_U, _P, _P, _P, _P, _P, _U, _P, \
_U, _L, _U, _U, _L, _U, _L, _L, \
_P, _U, _U, _U, _L, _L, _P, _P, \
_P, _P, _L, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP858_128_256 \
_U, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _U, _U, \
_U, _L, _U, _L, _L, _L, _L, _L, \
_L, _U, _U, _L, _P, _U, _P, _P, \
_L, _L, _L, _L, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _U, _U, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _L, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _U, _U, _U, _U, _P, _U, _U, \
_U, _P, _P, _P, _P, _P, _U, _P, \
_U, _L, _U, _U, _L, _U, _L, _U, \
_L, _U, _U, _U, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP862_128_256 \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _U, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _U, _L, _U, _L, _P, _L, \
_U, _U, _U, _L, _P, _L, _L, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP866_128_256 \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_U, _L, _U, _L, _U, _L, _U, _L, \
_P, _P, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP874_128_256 \
_P, 0, 0, 0, 0, _P, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
0, 0, 0, 0, 0, 0, 0, 0, \
_S|_B, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, 0, 0, 0, 0, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _L, _L, 0, 0, 0, 0
#define _CTYPE_CP1125_128_256 \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_U, _L, _U, _L, _U, _L, _U, _L, \
_U, _L, _P, _P, _P, _P, _P, _S|_B
#define _CTYPE_CP1250_128_256 \
_P, 0, _P, 0, _P, _P, _P, _P, \
0, _P, _U, _P, _U, _U, _U, _U, \
0, _P, _P, _P, _P, _P, _P, _P, \
0, _P, _L, _P, _L, _L, _L, _L, \
_S|_B, _P, _P, _U, _P, _U, _P, _P, \
_P, _P, _U, _P, _P, _P, _P, _U, \
_P, _P, _P, _L, _P, _P, _P, _P, \
_P, _L, _L, _P, _U, _P, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _P
#define _CTYPE_CP1251_128_256 \
_U, _U, _P, _L, _P, _P, _P, _P, \
_P, _P, _U, _P, _U, _U, _U, _U, \
_L, _P, _P, _P, _P, _P, _P, _P, \
_L, _P, _L, _L, _L, _L, _P, _U, \
_S|_B, _U, _L, _U, _P, _U, _P, _P, \
_U, _P, _U, _P, _P, _P, _P, _U, \
_P, _P, _U, _L, _L, _P, _P, _P, \
_L, _P, _L, _P, _L, _U, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_CP1252_128_256 \
_P, 0, _P, _L, _P, _P, _P, _P, \
_P, _P, _U, _P, _U, _U, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _L, _P, _L, 0, _L, _U, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_CP1253_128_256 \
_P, 0, _P, _L, _P, _P, _P, _P, \
0, _P, 0, _P, 0, 0, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
0, _P, _P, 0, 0, 0, 0, 0, \
_S|_B, _P, _U, _P, _P, _P, _P, _P, \
_P, _P, 0, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _P, _U, _P, _U, _U, \
_L, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_CP1254_128_256 \
_P, 0, _P, _L, _P, _P, _P, _P, \
_P, _P, _U, _P, _U, 0, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _L, _P, _L, 0, 0, _U, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_CP1255_128_256 \
_P, 0, _P, _L, _P, _P, _P, _P, \
_P, _P, 0, _P, 0, 0, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, 0, _P, 0, 0, 0, 0, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, 0, 0, 0, 0, 0, 0, 0, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, 0, 0, _P, _P, 0
#define _CTYPE_CP1256_128_256 \
_P, _L, _P, _L, _P, _P, _P, _P, \
_P, _P, _L, _P, _U, _L, _L, _L, \
_L, _P, _P, _P, _P, _P, _P, _P, \
_L, _P, _L, _P, _L, _P, _P, _L, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _L, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _P, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _P, _P, _P, _L, _P, _P, _P, \
_P, _L, _P, _L, _L, _P, _P, _L
#define _CTYPE_CP1257_128_256 \
_P, 0, _P, 0, _P, _P, _P, _P, \
0, _P, 0, _P, 0, _P, _P, _P, \
0, _P, _P, _P, _P, _P, _P, _P, \
0, _P, 0, _P, 0, _P, _P, 0, \
_S|_B, 0, _P, _P, _P, 0, _P, _P, \
_U, _P, _U, _P, _P, _P, _P, _U, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_L, _P, _L, _P, _P, _P, _P, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _P
#define _CTYPE_CP1258_128_256 \
_P, 0, _P, _L, _P, _P, _P, _P, \
_P, _P, 0, _P, _U, 0, 0, 0, \
0, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, 0, _P, _L, 0, 0, _U, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _P, _U, _U, _U, \
_U, _U, _P, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _P, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _P, _L, _L, _L, \
_L, _L, _P, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _P, _L
extern int __cp_index (const char *charset_ext);
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
#ifndef __CYGWIN__
static _CONST
#endif
char __ctype_cp[22][128 + 256] = {
{ _CTYPE_CP437_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP437_128_256
},
{ _CTYPE_CP720_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP720_128_256
},
{ _CTYPE_CP737_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP737_128_256
},
{ _CTYPE_CP775_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP775_128_256
},
{ _CTYPE_CP850_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP850_128_256
},
{ _CTYPE_CP852_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP852_128_256
},
{ _CTYPE_CP855_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP855_128_256
},
{ _CTYPE_CP857_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP857_128_256
},
{ _CTYPE_CP858_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP858_128_256
},
{ _CTYPE_CP862_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP862_128_256
},
{ _CTYPE_CP866_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP866_128_256
},
{ _CTYPE_CP874_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP874_128_256
},
{ _CTYPE_CP1125_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1125_128_256
},
{ _CTYPE_CP1250_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1250_128_256
},
{ _CTYPE_CP1251_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1251_128_256
},
{ _CTYPE_CP1252_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1252_128_256
},
{ _CTYPE_CP1253_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1253_128_256
},
{ _CTYPE_CP1254_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1254_128_256
},
{ _CTYPE_CP1255_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1255_128_256
},
{ _CTYPE_CP1256_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1256_128_256
},
{ _CTYPE_CP1257_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1257_128_256
},
{ _CTYPE_CP1258_128_256,
_CTYPE_DATA_0_127,
_CTYPE_CP1258_128_256
},
};
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
static _CONST char __ctype_cp[22][1 + 256] = {
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP437_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP720_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP737_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP775_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP850_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP852_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP855_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP857_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP858_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP862_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP866_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP874_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1125_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1250_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1251_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1252_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1253_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1254_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1255_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1256_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1257_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_CP1258_128_256
},
};
#endif /* ALLOW_NEGATIVE_CTYPE_INDEX */

View File

@ -0,0 +1,395 @@
/* ctype table definitions for ISO-8859-x charsets.
Included by ctype_.c. */
#define _CTYPE_ISO_8859_1_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_2_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _P, _U, _P, _U, _U, _P, \
_P, _U, _U, _U, _U, _P, _U, _U, \
_P, _L, _P, _L, _P, _L, _L, _P, \
_P, _L, _L, _L, _L, _P, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_3_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _P, _P, _P, 0, _U, _P, \
_P, _U, _U, _U, _U, _P, 0, _U, \
_P, _L, _P, _P, _P, _L, _L, _P, \
_P, _L, _L, _L, _L, _P, 0, _L, \
_U, _U, _U, 0, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
0, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, 0, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
0, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _P
#define _CTYPE_ISO_8859_4_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _L, _U, _P, _U, _U, _P, \
_P, _U, _U, _U, _U, _P, _U, _P, \
_P, _L, _P, _L, _P, _L, _L, _P, \
_P, _L, _L, _L, _L, _P, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_5_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _P, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_P, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _P, _L, _L
#define _CTYPE_ISO_8859_6_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, 0, 0, 0, _P, 0, 0, 0, \
0, 0, 0, 0, _P, _P, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, _P, 0, 0, 0, _P, \
0, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
0, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, 0, 0, 0, 0, 0, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _P, _P, _P, _P, _P, \
_P, _P, _P, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0
#define _CTYPE_ISO_8859_7_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _U, _P, \
_U, _U, _U, _P, _U, _P, _U, _U, \
_L, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P
#define _CTYPE_ISO_8859_8_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, 0, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, 0, 0, _P, _P, 0
#define _CTYPE_ISO_8859_9_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_10_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _P, _U, _U, \
_P, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _P, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_11_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _P, _L, _L, _P, _P, _P, _P, \
_P, _P, _P, 0, 0, 0, 0, _P, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_P, _P, _P, _P, _P, _P, _P, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, 0, 0, 0, 0
#define _CTYPE_ISO_8859_13_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _U, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _L, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _P
#define _CTYPE_ISO_8859_14_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _L, _P, _U, _L, _U, _P, \
_U, _P, _U, _L, _U, _P, _P, _U, \
_U, _L, _U, _L, _U, _L, _P, _U, \
_L, _L, _L, _U, _L, _U, _L, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_15_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_P, _P, _P, _P, _P, _P, _P, _P, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _P, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _P, \
_L, _L, _L, _L, _L, _L, _L, _L
#define _CTYPE_ISO_8859_16_128_256 \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_C, _C, _C, _C, _C, _C, _C, _C, \
_S|_B, _U, _L, _U, _P, _P, _U, _P, \
_L, _P, _U, _P, _U, _P, _L, _U, \
_P, _P, _U, _U, _U, _P, _P, _P, \
_L, _L, _L, _P, _U, _L, _U, _L, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _U, \
_U, _U, _U, _U, _U, _U, _U, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L, \
_L, _L, _L, _L, _L, _L, _L, _L
extern int __iso_8859_index (const char *charset_ext);
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
#ifndef __CYGWIN__
static _CONST
#endif
char __ctype_iso[15][128 + 256] = {
{ _CTYPE_ISO_8859_1_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_1_128_256
},
{ _CTYPE_ISO_8859_2_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_2_128_256
},
{ _CTYPE_ISO_8859_3_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_3_128_256
},
{ _CTYPE_ISO_8859_4_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_4_128_256
},
{ _CTYPE_ISO_8859_5_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_5_128_256
},
{ _CTYPE_ISO_8859_6_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_6_128_256
},
{ _CTYPE_ISO_8859_7_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_7_128_256
},
{ _CTYPE_ISO_8859_8_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_8_128_256
},
{ _CTYPE_ISO_8859_9_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_9_128_256
},
{ _CTYPE_ISO_8859_10_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_10_128_256
},
{ _CTYPE_ISO_8859_11_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_11_128_256
},
{ _CTYPE_ISO_8859_13_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_13_128_256
},
{ _CTYPE_ISO_8859_14_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_14_128_256
},
{ _CTYPE_ISO_8859_15_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_15_128_256
},
{ _CTYPE_ISO_8859_16_128_256,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_16_128_256
},
};
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
static _CONST char __ctype_iso[15][1 + 256] = {
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_1_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_2_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_3_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_4_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_5_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_6_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_7_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_8_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_9_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_10_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_11_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_13_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_14_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_15_128_256
},
{ 0,
_CTYPE_DATA_0_127,
_CTYPE_ISO_8859_16_128_256
},
};
#endif /* ALLOW_NEGATIVE_CTYPE_INDEX */

View File

@ -46,10 +46,31 @@ No supporting OS subroutines are required.
#include <_ansi.h>
#include <ctype.h>
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <wctype.h>
#include <wchar.h>
#endif
#undef tolower
int
_DEFUN(tolower,(c),int c)
{
return isupper(c) ? (c) - 'A' + 'a' : c;
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
if ((unsigned char) c <= 0x7f)
return isupper (c) ? c - 'A' + 'a' : c;
else if (c != EOF && MB_CUR_MAX == 1 && isupper (c))
{
char s[MB_LEN_MAX] = { c, '\0' };
wchar_t wc;
if (mbtowc (&wc, s, 1) >= 0
&& wctomb (s, (wchar_t) towlower ((wint_t) wc)) == 1)
c = s[0];
}
return c;
#else
return isupper(c) ? (c) - 'A' + 'a' : c;
#endif
}

View File

@ -45,10 +45,31 @@ No supporting OS subroutines are required.
#include <_ansi.h>
#include <ctype.h>
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <wctype.h>
#include <wchar.h>
#endif
#undef toupper
int
_DEFUN(toupper,(c),int c)
{
return islower(c) ? c - 'a' + 'A' : c;
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
if ((unsigned char) c <= 0x7f)
return islower (c) ? c - 'a' + 'A' : c;
else if (c != EOF && MB_CUR_MAX == 1 && islower (c))
{
char s[MB_LEN_MAX] = { c, '\0' };
wchar_t wc;
if (mbtowc (&wc, s, 1) >= 0
&& wctomb (s, (wchar_t) towupper ((wint_t) wc)) == 1)
c = s[0];
}
return c;
#else
return islower (c) ? c - 'a' + 'A' : c;
#endif
}

View File

@ -26,8 +26,8 @@ int _EXFUN(isblank, (int __c));
#ifndef __STRICT_ANSI__
int _EXFUN(isascii, (int __c));
int _EXFUN(toascii, (int __c));
int _EXFUN(_tolower, (int __c));
int _EXFUN(_toupper, (int __c));
#define _tolower(c) ((unsigned char)(c) - 'A' + 'a')
#define _toupper(c) ((unsigned char)(c) - 'a' + 'A')
#endif
#define _U 01
@ -39,7 +39,7 @@ int _EXFUN(_toupper, (int __c));
#define _X 0100
#define _B 0200
extern __IMPORT _CONST char *__ctype_ptr__;
extern __IMPORT char *__ctype_ptr__;
#ifndef __cplusplus
#define isalpha(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L))
@ -60,8 +60,9 @@ extern __IMPORT _CONST char *__ctype_ptr__;
/* Non-gcc versions will get the library versions, and will be
slightly slower */
#ifdef __GNUC__
slightly slower. These macros are not NLS-aware so they are
disabled if the system supports the extended character sets. */
# if defined(__GNUC__) && !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
# define toupper(c) \
__extension__ ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
# define tolower(c) \

View File

@ -187,6 +187,10 @@
#define _READ_WRITE_RETURN_TYPE _ssize_t
#endif
#ifndef __EXPORT
#define __EXPORT
#endif
#ifndef __IMPORT
#define __IMPORT
#endif

View File

@ -149,11 +149,7 @@ No supporting OS subroutines are required.
#define _LC_LAST 7
#define ENCODING_LEN 31
#ifdef __CYGWIN__
int __declspec(dllexport) __mb_cur_max = 1;
#else
int __mb_cur_max = 1;
#endif
int __EXPORT __mb_cur_max = 1;
int __nlocale_changed = 0;
int __mlocale_changed = 0;
@ -377,9 +373,10 @@ currentlocale()
#ifdef _MB_CAPABLE
#ifdef __CYGWIN__
extern void *__set_charset_from_codepage (unsigned int, char *charset);
extern void __set_ctype (const char *charset);
#endif /* __CYGWIN__ */
extern void __set_ctype (const char *charset);
static char *
loadlocale(struct _reent *p, int category)
{
@ -604,9 +601,7 @@ loadlocale(struct _reent *p, int category)
#ifdef _MB_CAPABLE
__wctomb = l_wctomb;
__mbtowc = l_mbtowc;
#ifdef __CYGWIN__
__set_ctype (charset);
#endif
#endif
}
else if (category == LC_MESSAGES)