00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 #include "ansidecl.h"
00119 #include <safe-ctype.h>
00120 #include <stdio.h>
00121
00122 #if EOF != -1
00123 #error "<safe-ctype.h> requires EOF == -1"
00124 #endif
00125
00126
00127 #define bl _sch_isblank
00128 #define cn _sch_iscntrl
00129 #define di _sch_isdigit
00130 #define is _sch_isidst
00131 #define lo _sch_islower
00132 #define nv _sch_isnvsp
00133 #define pn _sch_ispunct
00134 #define pr _sch_isprint
00135 #define sp _sch_isspace
00136 #define up _sch_isupper
00137 #define vs _sch_isvsp
00138 #define xd _sch_isxdigit
00139
00140
00141 #define L (const unsigned short) (lo|is |pr)
00142 #define XL (const unsigned short) (lo|is|xd|pr)
00143 #define U (const unsigned short) (up|is |pr)
00144 #define XU (const unsigned short) (up|is|xd|pr)
00145 #define D (const unsigned short) (di |xd|pr)
00146 #define P (const unsigned short) (pn |pr)
00147 #define _ (const unsigned short) (pn|is |pr)
00148
00149 #define C (const unsigned short) ( cn)
00150 #define Z (const unsigned short) (nv |cn)
00151 #define M (const unsigned short) (nv|sp |cn)
00152 #define V (const unsigned short) (vs|sp |cn)
00153 #define T (const unsigned short) (nv|sp|bl|cn)
00154 #define S (const unsigned short) (nv|sp|bl|pr)
00155
00156
00157 #if HOST_CHARSET == HOST_CHARSET_ASCII
00158
00159 const unsigned short _sch_istable[256] =
00160 {
00161 Z, C, C, C, C, C, C, C,
00162 C, T, V, M, M, V, C, C,
00163 C, C, C, C, C, C, C, C,
00164 C, C, C, C, C, C, C, C,
00165 S, P, P, P, P, P, P, P,
00166 P, P, P, P, P, P, P, P,
00167 D, D, D, D, D, D, D, D,
00168 D, D, P, P, P, P, P, P,
00169 P, XU, XU, XU, XU, XU, XU, U,
00170 U, U, U, U, U, U, U, U,
00171 U, U, U, U, U, U, U, U,
00172 U, U, U, P, P, P, P, _,
00173 P, XL, XL, XL, XL, XL, XL, L,
00174 L, L, L, L, L, L, L, L,
00175 L, L, L, L, L, L, L, L,
00176 L, L, L, P, P, P, P, C,
00177
00178
00179
00180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00183 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00184
00185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00187 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00188 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00189 };
00190
00191 const unsigned char _sch_tolower[256] =
00192 {
00193 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
00194 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
00195 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
00196 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
00197 64,
00198
00199 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
00200 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
00201
00202 91, 92, 93, 94, 95, 96,
00203
00204 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
00205 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
00206
00207 123,124,125,126,127,
00208
00209 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
00210 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
00211 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
00212 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
00213
00214 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
00215 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
00216 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
00217 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
00218 };
00219
00220 const unsigned char _sch_toupper[256] =
00221 {
00222 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
00223 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
00224 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
00225 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
00226 64,
00227
00228 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
00229 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
00230
00231 91, 92, 93, 94, 95, 96,
00232
00233 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
00234 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
00235
00236 123,124,125,126,127,
00237
00238 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
00239 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
00240 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
00241 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
00242
00243 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
00244 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
00245 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
00246 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
00247 };
00248
00249 #else
00250 # if HOST_CHARSET == HOST_CHARSET_EBCDIC
00251 #error "FIXME: write tables for EBCDIC"
00252 # else
00253 #error "Unrecognized host character set"
00254 # endif
00255 #endif