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 #include "ansidecl.h"
00118 #include <safe-ctype.h>
00119 #include <stdio.h>
00120
00121 #if EOF != -1
00122 #error "<safe-ctype.h> requires EOF == -1"
00123 #endif
00124
00125
00126 #define bl _sch_isblank
00127 #define cn _sch_iscntrl
00128 #define di _sch_isdigit
00129 #define is _sch_isidst
00130 #define lo _sch_islower
00131 #define nv _sch_isnvsp
00132 #define pn _sch_ispunct
00133 #define pr _sch_isprint
00134 #define sp _sch_isspace
00135 #define up _sch_isupper
00136 #define vs _sch_isvsp
00137 #define xd _sch_isxdigit
00138
00139
00140 #define L (const unsigned short) (lo|is |pr)
00141 #define XL (const unsigned short) (lo|is|xd|pr)
00142 #define U (const unsigned short) (up|is |pr)
00143 #define XU (const unsigned short) (up|is|xd|pr)
00144 #define D (const unsigned short) (di |xd|pr)
00145 #define P (const unsigned short) (pn |pr)
00146 #define _ (const unsigned short) (pn|is |pr)
00147
00148 #define C (const unsigned short) ( cn)
00149 #define Z (const unsigned short) (nv |cn)
00150 #define M (const unsigned short) (nv|sp |cn)
00151 #define V (const unsigned short) (vs|sp |cn)
00152 #define T (const unsigned short) (nv|sp|bl|cn)
00153 #define S (const unsigned short) (nv|sp|bl|pr)
00154
00155
00156 #if HOST_CHARSET == HOST_CHARSET_ASCII
00157
00158 const unsigned short _sch_istable[256] =
00159 {
00160 Z, C, C, C, C, C, C, C,
00161 C, T, V, M, M, V, C, C,
00162 C, C, C, C, C, C, C, C,
00163 C, C, C, C, C, C, C, C,
00164 S, P, P, P, P, P, P, P,
00165 P, P, P, P, P, P, P, P,
00166 D, D, D, D, D, D, D, D,
00167 D, D, P, P, P, P, P, P,
00168 P, XU, XU, XU, XU, XU, XU, U,
00169 U, U, U, U, U, U, U, U,
00170 U, U, U, U, U, U, U, U,
00171 U, U, U, P, P, P, P, _,
00172 P, XL, XL, XL, XL, XL, XL, L,
00173 L, L, L, L, L, L, L, L,
00174 L, L, L, L, L, L, L, L,
00175 L, L, L, P, P, P, P, C,
00176
00177
00178
00179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
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
00184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
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 };
00189
00190 const unsigned char _sch_tolower[256] =
00191 {
00192 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
00193 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
00194 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
00195 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
00196 64,
00197
00198 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
00199 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
00200
00201 91, 92, 93, 94, 95, 96,
00202
00203 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
00204 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
00205
00206 123,124,125,126,127,
00207
00208 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
00209 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
00210 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
00211 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
00212
00213 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
00214 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
00215 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
00216 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
00217 };
00218
00219 const unsigned char _sch_toupper[256] =
00220 {
00221 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
00222 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
00223 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
00224 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
00225 64,
00226
00227 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
00228 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
00229
00230 91, 92, 93, 94, 95, 96,
00231
00232 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
00233 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
00234
00235 123,124,125,126,127,
00236
00237 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
00238 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
00239 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
00240 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
00241
00242 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
00243 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
00244 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
00245 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
00246 };
00247
00248 #else
00249 # if HOST_CHARSET == HOST_CHARSET_EBCDIC
00250 #error "FIXME: write tables for EBCDIC"
00251 # else
00252 #error "Unrecognized host character set"
00253 # endif
00254 #endif