diff options
author | obrien <obrien@FreeBSD.org> | 2000-02-08 07:43:26 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-02-08 07:43:26 +0000 |
commit | 049c6bbad03e47e3215ece2def41d171d4d7dd13 (patch) | |
tree | fc7eb2a086e24adead0c5f81e13925e143715141 /lib/libc | |
parent | bcb32823be5f02644ad81cf37952accd5b07a80f (diff) | |
download | FreeBSD-src-049c6bbad03e47e3215ece2def41d171d4d7dd13.zip FreeBSD-src-049c6bbad03e47e3215ece2def41d171d4d7dd13.tar.gz |
There is a problem in that one cannot use ctype.h at the same time as parts
of the C++ stdlib. Our ctype.h uses symbols of the form _<X> to denote the
various character classes. Our ctype.h also extends the usual ctype.h
offering by adding the "_T" (special) class. Problem is parts of the STL
also use the symbol "_T" as its parameterized type. These two uses are
incompatible.
Thus change the form of the symbols used in ctype to something that fixes
the current problem and is less likely to cause conflicts in the future.
Requested by: Tomoaki NISHIYAMA <tomoaki@biol.s.u-tokyo.ac.jp>
Ok'ed by: JKH
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/isctype.c | 34 | ||||
-rw-r--r-- | lib/libc/locale/table.c | 160 |
2 files changed, 145 insertions, 49 deletions
diff --git a/lib/libc/locale/isctype.c b/lib/libc/locale/isctype.c index 70bcfd4..98e70e4 100644 --- a/lib/libc/locale/isctype.c +++ b/lib/libc/locale/isctype.c @@ -60,7 +60,7 @@ int isalnum(c) int c; { - return (__istype((c), _A|_D)); + return (__istype((c), _CTYPE_A|_CTYPE_D)); } #undef isalpha @@ -68,7 +68,7 @@ int isalpha(c) int c; { - return (__istype((c), _A)); + return (__istype((c), _CTYPE_A)); } #undef isascii @@ -84,7 +84,7 @@ int isblank(c) int c; { - return (__istype((c), _B)); + return (__istype((c), _CTYPE_B)); } #undef iscntrl @@ -92,7 +92,7 @@ int iscntrl(c) int c; { - return (__istype((c), _C)); + return (__istype((c), _CTYPE_C)); } #undef isdigit @@ -100,7 +100,7 @@ int isdigit(c) int c; { - return (__isctype((c), _D)); + return (__isctype((c), _CTYPE_D)); } #undef isgraph @@ -108,7 +108,7 @@ int isgraph(c) int c; { - return (__istype((c), _G)); + return (__istype((c), _CTYPE_G)); } #undef ishexnumber @@ -116,7 +116,7 @@ int ishexnumber(c) int c; { - return (__istype((c), _X)); + return (__istype((c), _CTYPE_X)); } #undef isideogram @@ -124,7 +124,7 @@ int isideogram(c) int c; { - return (__istype((c), _I)); + return (__istype((c), _CTYPE_I)); } #undef islower @@ -132,7 +132,7 @@ int islower(c) int c; { - return (__istype((c), _L)); + return (__istype((c), _CTYPE_L)); } #undef isnumber @@ -140,7 +140,7 @@ int isnumber(c) int c; { - return (__istype((c), _D)); + return (__istype((c), _CTYPE_D)); } #undef isphonogram @@ -148,7 +148,7 @@ int isphonogram(c) int c; { - return (__istype((c), _Q)); + return (__istype((c), _CTYPE_Q)); } #undef isprint @@ -156,7 +156,7 @@ int isprint(c) int c; { - return (__istype((c), _R)); + return (__istype((c), _CTYPE_R)); } #undef ispunct @@ -164,7 +164,7 @@ int ispunct(c) int c; { - return (__istype((c), _P)); + return (__istype((c), _CTYPE_P)); } #undef isrune @@ -180,7 +180,7 @@ int isspace(c) int c; { - return (__istype((c), _S)); + return (__istype((c), _CTYPE_S)); } #undef isspecial @@ -188,7 +188,7 @@ int isspecial(c) int c; { - return (__istype((c), _T)); + return (__istype((c), _CTYPE_T)); } #undef isupper @@ -196,7 +196,7 @@ int isupper(c) int c; { - return (__istype((c), _U)); + return (__istype((c), _CTYPE_U)); } #undef isxdigit @@ -204,7 +204,7 @@ int isxdigit(c) int c; { - return (__isctype((c), _X)); + return (__isctype((c), _CTYPE_X)); } #undef toascii diff --git a/lib/libc/locale/table.c b/lib/libc/locale/table.c index 556a8de..2fe979c 100644 --- a/lib/libc/locale/table.c +++ b/lib/libc/locale/table.c @@ -54,38 +54,134 @@ _RuneLocale _DefaultRuneLocale = { _none_sputrune, 0xFFFD, - { /*00*/ _C, _C, _C, _C, - _C, _C, _C, _C, - /*08*/ _C, _C|_S|_B, _C|_S, _C|_S, - _C|_S, _C|_S, _C, _C, - /*10*/ _C, _C, _C, _C, - _C, _C, _C, _C, - /*18*/ _C, _C, _C, _C, - _C, _C, _C, _C, - /*20*/ _S|_B|_R, _P|_R|_G, _P|_R|_G, _P|_R|_G, - _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G, - /*28*/ _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G, - _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G, - /*30*/ _D|_R|_G|_X|0, _D|_R|_G|_X|1, _D|_R|_G|_X|2, _D|_R|_G|_X|3, - _D|_R|_G|_X|4, _D|_R|_G|_X|5, _D|_R|_G|_X|6, _D|_R|_G|_X|7, - /*38*/ _D|_R|_G|_X|8, _D|_R|_G|_X|9, _P|_R|_G, _P|_R|_G, - _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G, - /*40*/ _P|_R|_G, _U|_X|_R|_G|_A|10, _U|_X|_R|_G|_A|11, _U|_X|_R|_G|_A|12, - _U|_X|_R|_G|_A|13, _U|_X|_R|_G|_A|14, _U|_X|_R|_G|_A|15, _U|_R|_G|_A, - /*48*/ _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, - _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, - /*50*/ _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, - _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, - /*58*/ _U|_R|_G|_A, _U|_R|_G|_A, _U|_R|_G|_A, _P|_R|_G, - _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G, - /*60*/ _P|_R|_G, _L|_X|_R|_G|_A|10, _L|_X|_R|_G|_A|11, _L|_X|_R|_G|_A|12, - _L|_X|_R|_G|_A|13, _L|_X|_R|_G|_A|14, _L|_X|_R|_G|_A|15, _L|_R|_G|_A, - /*68*/ _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, - _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, - /*70*/ _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, - _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, - /*78*/ _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _P|_R|_G, - _P|_R|_G, _P|_R|_G, _P|_R|_G, _C, + { /*00*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*08*/ _CTYPE_C, + _CTYPE_C|_CTYPE_S|_CTYPE_B, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C, + _CTYPE_C, + /*10*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*18*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*20*/ _CTYPE_S|_CTYPE_B|_CTYPE_R, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + /*28*/ _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|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