1 | /* $Header: /afs/dev.mit.edu/source/repository/third/tcsh/sh.char.c,v 1.1.1.2 1998-10-03 21:09:55 danw Exp $ */ |
---|
2 | /* |
---|
3 | * sh.char.c: Character classification tables |
---|
4 | */ |
---|
5 | /*- |
---|
6 | * Copyright (c) 1980, 1991 The Regents of the University of California. |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions |
---|
11 | * are met: |
---|
12 | * 1. Redistributions of source code must retain the above copyright |
---|
13 | * notice, this list of conditions and the following disclaimer. |
---|
14 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
15 | * notice, this list of conditions and the following disclaimer in the |
---|
16 | * documentation and/or other materials provided with the distribution. |
---|
17 | * 3. All advertising materials mentioning features or use of this software |
---|
18 | * must display the following acknowledgement: |
---|
19 | * This product includes software developed by the University of |
---|
20 | * California, Berkeley and its contributors. |
---|
21 | * 4. Neither the name of the University nor the names of its contributors |
---|
22 | * may be used to endorse or promote products derived from this software |
---|
23 | * without specific prior written permission. |
---|
24 | * |
---|
25 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
---|
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
---|
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
35 | * SUCH DAMAGE. |
---|
36 | */ |
---|
37 | #include "sh.h" |
---|
38 | |
---|
39 | RCSID("$Id: sh.char.c,v 1.1.1.2 1998-10-03 21:09:55 danw Exp $") |
---|
40 | |
---|
41 | #include "sh.char.h" |
---|
42 | |
---|
43 | #if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE) |
---|
44 | /* on default same as original map */ |
---|
45 | unsigned short _cmap[256] = { |
---|
46 | /* 0 nul 1 soh 2 stx 3 etx */ |
---|
47 | _CTR, _CTR, _CTR, _CTR, |
---|
48 | |
---|
49 | /* 4 eot 5 enq 6 ack 7 bel */ |
---|
50 | _CTR, _CTR, _CTR, _CTR, |
---|
51 | |
---|
52 | /* 8 bs 9 ht 10 nl 11 vt */ |
---|
53 | _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR, |
---|
54 | |
---|
55 | /* 12 np 13 cr 14 so 15 si */ |
---|
56 | _CTR, _CTR, _CTR, _CTR, |
---|
57 | |
---|
58 | /* 16 dle 17 dc1 18 dc2 19 dc3 */ |
---|
59 | _CTR, _CTR, _CTR, _CTR, |
---|
60 | |
---|
61 | /* 20 dc4 21 nak 22 syn 23 etb */ |
---|
62 | _CTR, _CTR, _CTR, _CTR, |
---|
63 | |
---|
64 | /* 24 can 25 em 26 sub 27 esc */ |
---|
65 | _CTR, _CTR, _CTR, _CTR, |
---|
66 | |
---|
67 | /* 28 fs 29 gs 30 rs 31 us */ |
---|
68 | _CTR, _CTR, _CTR, _CTR, |
---|
69 | |
---|
70 | /* 32 sp 33 ! 34 " 35 # */ |
---|
71 | _SP|_META, _PUN, _QF|_PUN, _META|_PUN, |
---|
72 | |
---|
73 | /* 36 $ 37 % 38 & 39 ' */ |
---|
74 | _DOL|_PUN, _PUN, _META|_CMD|_PUN,_QF|_PUN, |
---|
75 | |
---|
76 | /* 40 ( 41 ) 42 * 43 + */ |
---|
77 | _META|_CMD|_PUN,_META|_PUN, _GLOB|_PUN, _PUN, |
---|
78 | |
---|
79 | /* 44 , 45 - 46 . 47 / */ |
---|
80 | _PUN, _PUN, _PUN, _PUN, |
---|
81 | |
---|
82 | /* 48 0 49 1 50 2 51 3 */ |
---|
83 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
84 | |
---|
85 | /* 52 4 53 5 54 6 55 7 */ |
---|
86 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
87 | |
---|
88 | /* 56 8 57 9 58 : 59 ; */ |
---|
89 | _DIG|_XD, _DIG|_XD, _PUN, _META|_CMD|_PUN, |
---|
90 | |
---|
91 | /* 60 < 61 = 62 > 63 ? */ |
---|
92 | _META|_PUN, _PUN, _META|_PUN, _GLOB|_PUN, |
---|
93 | |
---|
94 | /* 64 @ 65 A 66 B 67 C */ |
---|
95 | _PUN, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, |
---|
96 | |
---|
97 | /* 68 D 69 E 70 F 71 G */ |
---|
98 | _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP, |
---|
99 | |
---|
100 | /* 72 H 73 I 74 J 75 K */ |
---|
101 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
102 | |
---|
103 | /* 76 L 77 M 78 N 79 O */ |
---|
104 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
105 | |
---|
106 | /* 80 P 81 Q 82 R 83 S */ |
---|
107 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
108 | |
---|
109 | /* 84 T 85 U 86 V 87 W */ |
---|
110 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
111 | |
---|
112 | /* 88 X 89 Y 90 Z 91 [ */ |
---|
113 | _LET|_UP, _LET|_UP, _LET|_UP, _GLOB|_PUN, |
---|
114 | |
---|
115 | /* 92 \ 93 ] 94 ^ 95 _ */ |
---|
116 | _ESC|_PUN, _PUN, _PUN, _PUN, |
---|
117 | |
---|
118 | /* 96 ` 97 a 98 b 99 c */ |
---|
119 | _QB|_GLOB|_META|_PUN, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, |
---|
120 | |
---|
121 | /* 100 d 101 e 102 f 103 g */ |
---|
122 | _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW, |
---|
123 | |
---|
124 | /* 104 h 105 i 106 j 107 k */ |
---|
125 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
126 | |
---|
127 | /* 108 l 109 m 110 n 111 o */ |
---|
128 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
129 | |
---|
130 | /* 112 p 113 q 114 r 115 s */ |
---|
131 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
132 | |
---|
133 | /* 116 t 117 u 118 v 119 w */ |
---|
134 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
135 | |
---|
136 | /* 120 x 121 y 122 z 123 { */ |
---|
137 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _GLOB|_PUN, |
---|
138 | |
---|
139 | /* 124 | 125 } 126 ~ 127 del */ |
---|
140 | _META|_CMD|_PUN,_PUN, _PUN, _CTR, |
---|
141 | |
---|
142 | /****************************************************************/ |
---|
143 | /* 128 - 255 The below is supposedly ISO 8859/1 */ |
---|
144 | /****************************************************************/ |
---|
145 | /* 128 (undef) 129 (undef) 130 (undef) 131 (undef) */ |
---|
146 | _CTR, _CTR, _CTR, _CTR, |
---|
147 | |
---|
148 | /* 132 (undef) 133 (undef) 134 (undef) 135 (undef) */ |
---|
149 | _CTR, _CTR, _CTR, _CTR, |
---|
150 | |
---|
151 | /* 136 (undef) 137 (undef) 138 (undef) 139 (undef) */ |
---|
152 | _CTR, _CTR, _CTR, _CTR, |
---|
153 | |
---|
154 | /* 140 (undef) 141 (undef) 142 (undef) 143 (undef) */ |
---|
155 | _CTR, _CTR, _CTR, _CTR, |
---|
156 | |
---|
157 | /* 144 (undef) 145 (undef) 146 (undef) 147 (undef) */ |
---|
158 | _CTR, _CTR, _CTR, _CTR, |
---|
159 | |
---|
160 | /* 148 (undef) 149 (undef) 150 (undef) 151 (undef) */ |
---|
161 | _CTR, _CTR, _CTR, _CTR, |
---|
162 | |
---|
163 | /* 152 (undef) 153 (undef) 154 (undef) 155 (undef) */ |
---|
164 | _CTR, _CTR, _CTR, _CTR, |
---|
165 | |
---|
166 | /* 156 (undef) 157 (undef) 158 (undef) 159 (undef) */ |
---|
167 | _CTR, _CTR, _CTR, _CTR, |
---|
168 | |
---|
169 | /* 160 nobreakspace 161 exclamdown 162 cent 163 sterling */ |
---|
170 | _PUN, /* XXX */ _PUN, _PUN, _PUN, |
---|
171 | |
---|
172 | /* 164 currency 165 yen 166 brokenbar 167 section */ |
---|
173 | _PUN, _PUN, _PUN, _PUN, |
---|
174 | |
---|
175 | /* 168 diaeresis 169 copyright 170 ordfeminine 171 guillemotleft*/ |
---|
176 | _PUN, _PUN, _PUN, _PUN, |
---|
177 | |
---|
178 | /* 172 notsign 173 hyphen 174 registered 175 macron */ |
---|
179 | _PUN, _PUN, _PUN, _PUN, |
---|
180 | |
---|
181 | /* 176 degree 177 plusminus 178 twosuperior 179 threesuperior*/ |
---|
182 | _PUN, _PUN, _PUN, _PUN, |
---|
183 | |
---|
184 | /* 180 acute 181 mu 182 paragraph 183 periodcentered*/ |
---|
185 | _PUN, _PUN, /*XXX*/ _PUN, _PUN, |
---|
186 | |
---|
187 | /* 184 cedilla 185 onesuperior 186 masculine 187 guillemotright*/ |
---|
188 | _PUN, _PUN, _PUN, _PUN, |
---|
189 | |
---|
190 | /* 188 onequarter 189 onehalf 190 threequarters 191 questiondown*/ |
---|
191 | _PUN, _PUN, _PUN, _PUN, |
---|
192 | |
---|
193 | /* 192 Agrave 193 Aacute 194 Acircumflex 195 Atilde */ |
---|
194 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
195 | |
---|
196 | /* 196 Adiaeresis 197 Aring 198 AE 199 Ccedilla */ |
---|
197 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
198 | |
---|
199 | /* 200 Egrave 201 Eacute 202 Ecircumflex 203 Ediaeresis */ |
---|
200 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
201 | |
---|
202 | /* 204 Igrave 205 Iacute 206 Icircumflex 207 Idiaeresis */ |
---|
203 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
204 | |
---|
205 | /* 208 ETH 209 Ntilde 210 Ograve 211 Oacute */ |
---|
206 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
207 | |
---|
208 | /* 212 Ocircumflex 213 Otilde 214 Odiaeresis 215 multiply */ |
---|
209 | _LET|_UP, _LET|_UP, _LET|_UP, _PUN, |
---|
210 | |
---|
211 | /* 216 Ooblique 217 Ugrave 218 Uacute 219 Ucircumflex */ |
---|
212 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
213 | |
---|
214 | /* 220 Udiaeresis 221 Yacute 222 THORN 223 ssharp */ |
---|
215 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_DOW, |
---|
216 | |
---|
217 | /* 224 agrave 225 aacute 226 acircumflex 227 atilde */ |
---|
218 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
219 | |
---|
220 | /* 228 adiaeresis 229 aring 230 ae 231 ccedilla */ |
---|
221 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
222 | |
---|
223 | /* 232 egrave 233 eacute 234 ecircumflex 235 ediaeresis */ |
---|
224 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
225 | |
---|
226 | /* 236 igrave 237 iacute 238 icircumflex 239 idiaeresis */ |
---|
227 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
228 | |
---|
229 | /* 240 eth 241 ntilde 242 ograve 243 oacute */ |
---|
230 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
231 | |
---|
232 | /* 244 ocircumflex 245 otilde 246 odiaeresis 247 division */ |
---|
233 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _PUN, |
---|
234 | |
---|
235 | /* 248 oslash 249 ugrave 250 uacute 251 ucircumflex */ |
---|
236 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
237 | |
---|
238 | /* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */ |
---|
239 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
240 | }; |
---|
241 | /* original table */ |
---|
242 | unsigned short _cmap_c[256] = { |
---|
243 | /* 0 nul 1 soh 2 stx 3 etx */ |
---|
244 | _CTR, _CTR, _CTR, _CTR, |
---|
245 | |
---|
246 | /* 4 eot 5 enq 6 ack 7 bel */ |
---|
247 | _CTR, _CTR, _CTR, _CTR, |
---|
248 | |
---|
249 | /* 8 bs 9 ht 10 nl 11 vt */ |
---|
250 | _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR, |
---|
251 | |
---|
252 | /* 12 np 13 cr 14 so 15 si */ |
---|
253 | _CTR, _CTR, _CTR, _CTR, |
---|
254 | |
---|
255 | /* 16 dle 17 dc1 18 dc2 19 dc3 */ |
---|
256 | _CTR, _CTR, _CTR, _CTR, |
---|
257 | |
---|
258 | /* 20 dc4 21 nak 22 syn 23 etb */ |
---|
259 | _CTR, _CTR, _CTR, _CTR, |
---|
260 | |
---|
261 | /* 24 can 25 em 26 sub 27 esc */ |
---|
262 | _CTR, _CTR, _CTR, _CTR, |
---|
263 | |
---|
264 | /* 28 fs 29 gs 30 rs 31 us */ |
---|
265 | _CTR, _CTR, _CTR, _CTR, |
---|
266 | |
---|
267 | /* 32 sp 33 ! 34 " 35 # */ |
---|
268 | _SP|_META, _PUN, _QF|_PUN, _META|_PUN, |
---|
269 | |
---|
270 | /* 36 $ 37 % 38 & 39 ' */ |
---|
271 | _DOL|_PUN, _PUN, _META|_CMD|_PUN,_QF|_PUN, |
---|
272 | |
---|
273 | /* 40 ( 41 ) 42 * 43 + */ |
---|
274 | _META|_CMD|_PUN,_META|_PUN, _GLOB|_PUN, _PUN, |
---|
275 | |
---|
276 | /* 44 , 45 - 46 . 47 / */ |
---|
277 | _PUN, _PUN, _PUN, _PUN, |
---|
278 | |
---|
279 | /* 48 0 49 1 50 2 51 3 */ |
---|
280 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
281 | |
---|
282 | /* 52 4 53 5 54 6 55 7 */ |
---|
283 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
284 | |
---|
285 | /* 56 8 57 9 58 : 59 ; */ |
---|
286 | _DIG|_XD, _DIG|_XD, _PUN, _META|_CMD|_PUN, |
---|
287 | |
---|
288 | /* 60 < 61 = 62 > 63 ? */ |
---|
289 | _META|_PUN, _PUN, _META|_PUN, _GLOB|_PUN, |
---|
290 | |
---|
291 | /* 64 @ 65 A 66 B 67 C */ |
---|
292 | _PUN, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, |
---|
293 | |
---|
294 | /* 68 D 69 E 70 F 71 G */ |
---|
295 | _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP, |
---|
296 | |
---|
297 | /* 72 H 73 I 74 J 75 K */ |
---|
298 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
299 | |
---|
300 | /* 76 L 77 M 78 N 79 O */ |
---|
301 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
302 | |
---|
303 | /* 80 P 81 Q 82 R 83 S */ |
---|
304 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
305 | |
---|
306 | /* 84 T 85 U 86 V 87 W */ |
---|
307 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
308 | |
---|
309 | /* 88 X 89 Y 90 Z 91 [ */ |
---|
310 | _LET|_UP, _LET|_UP, _LET|_UP, _GLOB|_PUN, |
---|
311 | |
---|
312 | /* 92 \ 93 ] 94 ^ 95 _ */ |
---|
313 | _ESC|_PUN, _PUN, _PUN, _PUN, |
---|
314 | |
---|
315 | /* 96 ` 97 a 98 b 99 c */ |
---|
316 | _QB|_GLOB|_META|_PUN, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, |
---|
317 | |
---|
318 | /* 100 d 101 e 102 f 103 g */ |
---|
319 | _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW, |
---|
320 | |
---|
321 | /* 104 h 105 i 106 j 107 k */ |
---|
322 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
323 | |
---|
324 | /* 108 l 109 m 110 n 111 o */ |
---|
325 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
326 | |
---|
327 | /* 112 p 113 q 114 r 115 s */ |
---|
328 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
329 | |
---|
330 | /* 116 t 117 u 118 v 119 w */ |
---|
331 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
332 | |
---|
333 | /* 120 x 121 y 122 z 123 { */ |
---|
334 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _GLOB|_PUN, |
---|
335 | |
---|
336 | /* 124 | 125 } 126 ~ 127 del */ |
---|
337 | _META|_CMD|_PUN,_PUN, _PUN, _CTR, |
---|
338 | |
---|
339 | /****************************************************************/ |
---|
340 | /* 128 - 255 The below is supposedly ISO 8859/1 */ |
---|
341 | /****************************************************************/ |
---|
342 | /* 128 (undef) 129 (undef) 130 (undef) 131 (undef) */ |
---|
343 | _CTR, _CTR, _CTR, _CTR, |
---|
344 | |
---|
345 | /* 132 (undef) 133 (undef) 134 (undef) 135 (undef) */ |
---|
346 | _CTR, _CTR, _CTR, _CTR, |
---|
347 | |
---|
348 | /* 136 (undef) 137 (undef) 138 (undef) 139 (undef) */ |
---|
349 | _CTR, _CTR, _CTR, _CTR, |
---|
350 | |
---|
351 | /* 140 (undef) 141 (undef) 142 (undef) 143 (undef) */ |
---|
352 | _CTR, _CTR, _CTR, _CTR, |
---|
353 | |
---|
354 | /* 144 (undef) 145 (undef) 146 (undef) 147 (undef) */ |
---|
355 | _CTR, _CTR, _CTR, _CTR, |
---|
356 | |
---|
357 | /* 148 (undef) 149 (undef) 150 (undef) 151 (undef) */ |
---|
358 | _CTR, _CTR, _CTR, _CTR, |
---|
359 | |
---|
360 | /* 152 (undef) 153 (undef) 154 (undef) 155 (undef) */ |
---|
361 | _CTR, _CTR, _CTR, _CTR, |
---|
362 | |
---|
363 | /* 156 (undef) 157 (undef) 158 (undef) 159 (undef) */ |
---|
364 | _CTR, _CTR, _CTR, _CTR, |
---|
365 | |
---|
366 | /* 160 nobreakspace 161 exclamdown 162 cent 163 sterling */ |
---|
367 | _PUN, /* XXX */ _PUN, _PUN, _PUN, |
---|
368 | |
---|
369 | /* 164 currency 165 yen 166 brokenbar 167 section */ |
---|
370 | _PUN, _PUN, _PUN, _PUN, |
---|
371 | |
---|
372 | /* 168 diaeresis 169 copyright 170 ordfeminine 171 guillemotleft*/ |
---|
373 | _PUN, _PUN, _PUN, _PUN, |
---|
374 | |
---|
375 | /* 172 notsign 173 hyphen 174 registered 175 macron */ |
---|
376 | _PUN, _PUN, _PUN, _PUN, |
---|
377 | |
---|
378 | /* 176 degree 177 plusminus 178 twosuperior 179 threesuperior*/ |
---|
379 | _PUN, _PUN, _PUN, _PUN, |
---|
380 | |
---|
381 | /* 180 acute 181 mu 182 paragraph 183 periodcentered*/ |
---|
382 | _PUN, _PUN, /*XXX*/ _PUN, _PUN, |
---|
383 | |
---|
384 | /* 184 cedilla 185 onesuperior 186 masculine 187 guillemotright*/ |
---|
385 | _PUN, _PUN, _PUN, _PUN, |
---|
386 | |
---|
387 | /* 188 onequarter 189 onehalf 190 threequarters 191 questiondown*/ |
---|
388 | _PUN, _PUN, _PUN, _PUN, |
---|
389 | |
---|
390 | /* 192 Agrave 193 Aacute 194 Acircumflex 195 Atilde */ |
---|
391 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
392 | |
---|
393 | /* 196 Adiaeresis 197 Aring 198 AE 199 Ccedilla */ |
---|
394 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
395 | |
---|
396 | /* 200 Egrave 201 Eacute 202 Ecircumflex 203 Ediaeresis */ |
---|
397 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
398 | |
---|
399 | /* 204 Igrave 205 Iacute 206 Icircumflex 207 Idiaeresis */ |
---|
400 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
401 | |
---|
402 | /* 208 ETH 209 Ntilde 210 Ograve 211 Oacute */ |
---|
403 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
404 | |
---|
405 | /* 212 Ocircumflex 213 Otilde 214 Odiaeresis 215 multiply */ |
---|
406 | _LET|_UP, _LET|_UP, _LET|_UP, _PUN, |
---|
407 | |
---|
408 | /* 216 Ooblique 217 Ugrave 218 Uacute 219 Ucircumflex */ |
---|
409 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
410 | |
---|
411 | /* 220 Udiaeresis 221 Yacute 222 THORN 223 ssharp */ |
---|
412 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_DOW, |
---|
413 | |
---|
414 | /* 224 agrave 225 aacute 226 acircumflex 227 atilde */ |
---|
415 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
416 | |
---|
417 | /* 228 adiaeresis 229 aring 230 ae 231 ccedilla */ |
---|
418 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
419 | |
---|
420 | /* 232 egrave 233 eacute 234 ecircumflex 235 ediaeresis */ |
---|
421 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
422 | |
---|
423 | /* 236 igrave 237 iacute 238 icircumflex 239 idiaeresis */ |
---|
424 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
425 | |
---|
426 | /* 240 eth 241 ntilde 242 ograve 243 oacute */ |
---|
427 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
428 | |
---|
429 | /* 244 ocircumflex 245 otilde 246 odiaeresis 247 division */ |
---|
430 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _PUN, |
---|
431 | |
---|
432 | /* 248 oslash 249 ugrave 250 uacute 251 ucircumflex */ |
---|
433 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
434 | |
---|
435 | /* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */ |
---|
436 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
437 | }; |
---|
438 | |
---|
439 | /* multi-byte table */ |
---|
440 | /* BY Masaaki Koyanagi VERY THANKS */ |
---|
441 | unsigned short _cmap_mbyte[256] = { |
---|
442 | /* 0 nul 1 soh 2 stx 3 etx */ |
---|
443 | _CTR, _CTR, _CTR, _CTR, |
---|
444 | |
---|
445 | /* 4 eot 5 enq 6 ack 7 bel */ |
---|
446 | _CTR, _CTR, _CTR, _CTR, |
---|
447 | |
---|
448 | /* 8 bs 9 ht 10 nl 11 vt */ |
---|
449 | _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR, |
---|
450 | |
---|
451 | /* 12 np 13 cr 14 so 15 si */ |
---|
452 | _CTR, _CTR, _CTR, _CTR, |
---|
453 | |
---|
454 | /* 16 dle 17 dc1 18 dc2 19 dc3 */ |
---|
455 | _CTR, _CTR, _CTR, _CTR, |
---|
456 | |
---|
457 | /* 20 dc4 21 nak 22 syn 23 etb */ |
---|
458 | _CTR, _CTR, _CTR, _CTR, |
---|
459 | |
---|
460 | /* 24 can 25 em 26 sub 27 esc */ |
---|
461 | _CTR, _CTR, _CTR, _CTR, |
---|
462 | |
---|
463 | /* 28 fs 29 gs 30 rs 31 us */ |
---|
464 | _CTR, _CTR, _CTR, _CTR, |
---|
465 | |
---|
466 | /* 32 sp 33 ! 34 " 35 # */ |
---|
467 | _SP|_META, _PUN, _QF|_PUN, _META|_PUN, |
---|
468 | |
---|
469 | /* 36 $ 37 % 38 & 39 ' */ |
---|
470 | _DOL|_PUN, _PUN, _META|_CMD|_PUN,_QF|_PUN, |
---|
471 | |
---|
472 | /* 40 ( 41 ) 42 * 43 + */ |
---|
473 | _META|_CMD|_PUN,_META|_PUN, _GLOB|_PUN, _PUN, |
---|
474 | |
---|
475 | /* 44 , 45 - 46 . 47 / */ |
---|
476 | _PUN, _PUN, _PUN, _PUN, |
---|
477 | |
---|
478 | /* 48 0 49 1 50 2 51 3 */ |
---|
479 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
480 | |
---|
481 | /* 52 4 53 5 54 6 55 7 */ |
---|
482 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
483 | |
---|
484 | /* 56 8 57 9 58 : 59 ; */ |
---|
485 | _DIG|_XD, _DIG|_XD, _PUN, _META|_CMD|_PUN, |
---|
486 | |
---|
487 | /* 60 < 61 = 62 > 63 ? */ |
---|
488 | _META|_PUN, _PUN, _META|_PUN, _GLOB|_PUN, |
---|
489 | |
---|
490 | /* 64 @ 65 A 66 B 67 C */ |
---|
491 | _PUN, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, |
---|
492 | |
---|
493 | /* 68 D 69 E 70 F 71 G */ |
---|
494 | _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP, |
---|
495 | |
---|
496 | /* 72 H 73 I 74 J 75 K */ |
---|
497 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
498 | |
---|
499 | /* 76 L 77 M 78 N 79 O */ |
---|
500 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
501 | |
---|
502 | /* 80 P 81 Q 82 R 83 S */ |
---|
503 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
504 | |
---|
505 | /* 84 T 85 U 86 V 87 W */ |
---|
506 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
507 | |
---|
508 | /* 88 X 89 Y 90 Z 91 [ */ |
---|
509 | _LET|_UP, _LET|_UP, _LET|_UP, _GLOB|_PUN, |
---|
510 | |
---|
511 | /* 92 \ 93 ] 94 ^ 95 _ */ |
---|
512 | _ESC|_PUN, _PUN, _PUN, _PUN, |
---|
513 | |
---|
514 | /* 96 ` 97 a 98 b 99 c */ |
---|
515 | _QB|_GLOB|_META|_PUN, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, |
---|
516 | |
---|
517 | /* 100 d 101 e 102 f 103 g */ |
---|
518 | _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW, |
---|
519 | |
---|
520 | /* 104 h 105 i 106 j 107 k */ |
---|
521 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
522 | |
---|
523 | /* 108 l 109 m 110 n 111 o */ |
---|
524 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
525 | |
---|
526 | /* 112 p 113 q 114 r 115 s */ |
---|
527 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
528 | |
---|
529 | /* 116 t 117 u 118 v 119 w */ |
---|
530 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
531 | |
---|
532 | /* 120 x 121 y 122 z 123 { */ |
---|
533 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _GLOB|_PUN, |
---|
534 | |
---|
535 | /* 124 | 125 } 126 ~ 127 del */ |
---|
536 | _META|_CMD|_PUN,_PUN, _PUN, _CTR, |
---|
537 | |
---|
538 | /****************************************************************/ |
---|
539 | /* 128 - 255 The below is supposedly ISO 8859/1 */ |
---|
540 | /****************************************************************/ |
---|
541 | /* 128 (undef) 129 (undef) 130 (undef) 131 (undef) */ |
---|
542 | _PUN, _PUN, _PUN, _PUN, |
---|
543 | |
---|
544 | /* 132 (undef) 133 (undef) 134 (undef) 135 (undef) */ |
---|
545 | _PUN, _PUN, _PUN, _PUN, |
---|
546 | |
---|
547 | /* 136 (undef) 137 (undef) 138 (undef) 139 (undef) */ |
---|
548 | _PUN, _PUN, _PUN, _PUN, |
---|
549 | |
---|
550 | /* 140 (undef) 141 (undef) 142 (undef) 143 (undef) */ |
---|
551 | _PUN, _PUN, _PUN, _PUN, |
---|
552 | |
---|
553 | /* 144 (undef) 145 (undef) 146 (undef) 147 (undef) */ |
---|
554 | _PUN, _PUN, _PUN, _PUN, |
---|
555 | |
---|
556 | /* 148 (undef) 149 (undef) 150 (undef) 151 (undef) */ |
---|
557 | _PUN, _PUN, _PUN, _PUN, |
---|
558 | |
---|
559 | /* 152 (undef) 153 (undef) 154 (undef) 155 (undef) */ |
---|
560 | _PUN, _PUN, _PUN, _PUN, |
---|
561 | |
---|
562 | /* 156 (undef) 157 (undef) 158 (undef) 159 (undef) */ |
---|
563 | _PUN, _PUN, _PUN, _PUN, |
---|
564 | |
---|
565 | /* 160 nobreakspace 161 exclamdown 162 cent 163 sterling */ |
---|
566 | _PUN, /* XXX */ _PUN, _PUN, _PUN, |
---|
567 | |
---|
568 | /* 164 currency 165 yen 166 brokenbar 167 section */ |
---|
569 | _PUN, _PUN, _PUN, _PUN, |
---|
570 | |
---|
571 | /* 168 diaeresis 169 copyright 170 ordfeminine 171 guillemotleft*/ |
---|
572 | _PUN, _PUN, _PUN, _PUN, |
---|
573 | |
---|
574 | /* 172 notsign 173 hyphen 174 registered 175 macron */ |
---|
575 | _PUN, _PUN, _PUN, _PUN, |
---|
576 | |
---|
577 | /* 176 degree 177 plusminus 178 twosuperior 179 threesuperior*/ |
---|
578 | _PUN, _PUN, _PUN, _PUN, |
---|
579 | |
---|
580 | /* 180 acute 181 mu 182 paragraph 183 periodcentered*/ |
---|
581 | _PUN, _PUN, /*XXX*/ _PUN, _PUN, |
---|
582 | |
---|
583 | /* 184 cedilla 185 onesuperior 186 masculine 187 guillemotright*/ |
---|
584 | _PUN, _PUN, _PUN, _PUN, |
---|
585 | |
---|
586 | /* 188 onequarter 189 onehalf 190 threequarters 191 questiondown*/ |
---|
587 | _PUN, _PUN, _PUN, _PUN, |
---|
588 | |
---|
589 | /* 192 Agrave 193 Aacute 194 Acircumflex 195 Atilde */ |
---|
590 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
591 | |
---|
592 | /* 196 Adiaeresis 197 Aring 198 AE 199 Ccedilla */ |
---|
593 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
594 | |
---|
595 | /* 200 Egrave 201 Eacute 202 Ecircumflex 203 Ediaeresis */ |
---|
596 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
597 | |
---|
598 | /* 204 Igrave 205 Iacute 206 Icircumflex 207 Idiaeresis */ |
---|
599 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
600 | |
---|
601 | /* 208 ETH 209 Ntilde 210 Ograve 211 Oacute */ |
---|
602 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
603 | |
---|
604 | /* 212 Ocircumflex 213 Otilde 214 Odiaeresis 215 multiply */ |
---|
605 | _LET|_UP, _LET|_UP, _LET|_UP, _PUN, |
---|
606 | |
---|
607 | /* 216 Ooblique 217 Ugrave 218 Uacute 219 Ucircumflex */ |
---|
608 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
609 | |
---|
610 | /* 220 Udiaeresis 221 Yacute 222 THORN 223 ssharp */ |
---|
611 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_DOW, |
---|
612 | |
---|
613 | /* 224 agrave 225 aacute 226 acircumflex 227 atilde */ |
---|
614 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
615 | |
---|
616 | /* 228 adiaeresis 229 aring 230 ae 231 ccedilla */ |
---|
617 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
618 | |
---|
619 | /* 232 egrave 233 eacute 234 ecircumflex 235 ediaeresis */ |
---|
620 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
621 | |
---|
622 | /* 236 igrave 237 iacute 238 icircumflex 239 idiaeresis */ |
---|
623 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
624 | |
---|
625 | /* 240 eth 241 ntilde 242 ograve 243 oacute */ |
---|
626 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
627 | |
---|
628 | /* 244 ocircumflex 245 otilde 246 odiaeresis 247 division */ |
---|
629 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _PUN, |
---|
630 | |
---|
631 | /* 248 oslash 249 ugrave 250 uacute 251 ucircumflex */ |
---|
632 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
633 | |
---|
634 | /* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */ |
---|
635 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
636 | }; |
---|
637 | |
---|
638 | short _enable_mbdisp = 0; /* control multi-byte 0...disable 1...enable */ |
---|
639 | |
---|
640 | /* multi-byte check table */ |
---|
641 | /* default = all 0 (clear process in update_vars()/unset()) */ |
---|
642 | unsigned short _mbmap[256]; |
---|
643 | |
---|
644 | unsigned short _mbmap_euc[256] = { |
---|
645 | /* first byte 0x8e,0xa0 - 0xf4 */ |
---|
646 | /* second byte 0xa0 - 0xfe */ |
---|
647 | /* 0 - 7f all 0 */ |
---|
648 | 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, |
---|
649 | 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, |
---|
650 | 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, |
---|
651 | 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, |
---|
652 | /* 80 81 82 83 */ |
---|
653 | 0, 0, 0, 0, |
---|
654 | /* 84 85 86 87 */ |
---|
655 | 0, 0, 0, 0, |
---|
656 | /* 88 89 8a 8b */ |
---|
657 | 0, 0, 0, 0, |
---|
658 | /* 8c 8d 8e 8f */ |
---|
659 | 0, 0, _MB1, 0, |
---|
660 | /* 90 - 9f all 0 */ |
---|
661 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
662 | /* a0 a1 a2 a3 */ |
---|
663 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
664 | /* a4 a5 a6 a7 */ |
---|
665 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
666 | /* a8 a9 aa ab */ |
---|
667 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
668 | /* ac ad ae af */ |
---|
669 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
670 | /* b0 b1 b2 b3 */ |
---|
671 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
672 | /* b4 b5 b6 b7 */ |
---|
673 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
674 | /* b8 b9 ba bb */ |
---|
675 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
676 | /* bc bd be bf */ |
---|
677 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
678 | /* c0 c1 c2 c3 */ |
---|
679 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
680 | /* c4 c5 c6 c7 */ |
---|
681 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
682 | /* c8 c9 ca cb */ |
---|
683 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
684 | /* cc cd ce cf */ |
---|
685 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
686 | /* d0 d1 d2 d3 */ |
---|
687 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
688 | /* d4 d5 d6 d7 */ |
---|
689 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
690 | /* d8 d9 da db */ |
---|
691 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
692 | /* dc dd de df */ |
---|
693 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
694 | /* e0 e1 e2 e3 */ |
---|
695 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
696 | /* e4 e5 e6 e7 */ |
---|
697 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
698 | /* e8 e9 ea eb */ |
---|
699 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
700 | /* ec ed ee ef */ |
---|
701 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
702 | /* f0 f1 f2 f3 */ |
---|
703 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
704 | /* f4 f5 f6 f7 */ |
---|
705 | _MB1|_MB2, _MB2, _MB2, _MB2, |
---|
706 | /* f8 f9 fa fb */ |
---|
707 | _MB2, _MB2, _MB2, _MB2, |
---|
708 | /* fc fd fe ff */ |
---|
709 | _MB2, _MB2, _MB2, 0, |
---|
710 | }; |
---|
711 | |
---|
712 | unsigned short _mbmap_sjis[256] = { |
---|
713 | /* first byte 0x81-0x9f,0xe0 - 0xfc */ |
---|
714 | /* second byte 0x40-0x7e,0x80 - 0xfc */ |
---|
715 | /* 0 - 3f all 0 */ |
---|
716 | 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, |
---|
717 | 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, |
---|
718 | /* 40 41 42 43 */ |
---|
719 | _MB2, _MB2, _MB2, _MB2, |
---|
720 | /* 44 45 46 47 */ |
---|
721 | _MB2, _MB2, _MB2, _MB2, |
---|
722 | /* 48 49 4a 4b */ |
---|
723 | _MB2, _MB2, _MB2, _MB2, |
---|
724 | /* 4c 4d 4e 4f */ |
---|
725 | _MB2, _MB2, _MB2, _MB2, |
---|
726 | /* 50 51 52 53 */ |
---|
727 | _MB2, _MB2, _MB2, _MB2, |
---|
728 | /* 54 55 56 57 */ |
---|
729 | _MB2, _MB2, _MB2, _MB2, |
---|
730 | /* 58 59 5a 5b */ |
---|
731 | _MB2, _MB2, _MB2, _MB2, |
---|
732 | /* 5c 5d 5e 5f */ |
---|
733 | _MB2, _MB2, _MB2, _MB2, |
---|
734 | /* 60 61 62 63 */ |
---|
735 | _MB2, _MB2, _MB2, _MB2, |
---|
736 | /* 64 65 66 67 */ |
---|
737 | _MB2, _MB2, _MB2, _MB2, |
---|
738 | /* 68 69 6a 6b */ |
---|
739 | _MB2, _MB2, _MB2, _MB2, |
---|
740 | /* 6c 6d 6e 6f */ |
---|
741 | _MB2, _MB2, _MB2, _MB2, |
---|
742 | /* 70 71 72 73 */ |
---|
743 | _MB2, _MB2, _MB2, _MB2, |
---|
744 | /* 74 75 76 77 */ |
---|
745 | _MB2, _MB2, _MB2, _MB2, |
---|
746 | /* 78 79 7a 7b */ |
---|
747 | _MB2, _MB2, _MB2, _MB2, |
---|
748 | /* 7c 7d 7e 7f */ |
---|
749 | _MB2, _MB2, _MB2, 0, |
---|
750 | /* 80 81 82 83 */ |
---|
751 | _MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
752 | /* 84 85 86 87 */ |
---|
753 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
754 | /* 88 89 8a 8b */ |
---|
755 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
756 | /* 8c 8d 8e 8f */ |
---|
757 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
758 | /* 90 91 92 93 */ |
---|
759 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
760 | /* 94 95 96 97 */ |
---|
761 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
762 | /* 98 99 9a 9b */ |
---|
763 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
764 | /* 9c 9d 9e 9f */ |
---|
765 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
766 | /* a0 a1 a2 a3 */ |
---|
767 | _MB2, _MB2, _MB2, _MB2, |
---|
768 | /* a4 a5 a6 a7 */ |
---|
769 | _MB2, _MB2, _MB2, _MB2, |
---|
770 | /* a8 a9 aa ab */ |
---|
771 | _MB2, _MB2, _MB2, _MB2, |
---|
772 | /* ac ad ae af */ |
---|
773 | _MB2, _MB2, _MB2, _MB2, |
---|
774 | /* b0 b1 b2 b3 */ |
---|
775 | _MB2, _MB2, _MB2, _MB2, |
---|
776 | /* b4 b5 b6 b7 */ |
---|
777 | _MB2, _MB2, _MB2, _MB2, |
---|
778 | /* b8 b9 ba bb */ |
---|
779 | _MB2, _MB2, _MB2, _MB2, |
---|
780 | /* bc bd be bf */ |
---|
781 | _MB2, _MB2, _MB2, _MB2, |
---|
782 | /* c0 c1 c2 c3 */ |
---|
783 | _MB2, _MB2, _MB2, _MB2, |
---|
784 | /* c4 c5 c6 c7 */ |
---|
785 | _MB2, _MB2, _MB2, _MB2, |
---|
786 | /* c8 c9 ca cb */ |
---|
787 | _MB2, _MB2, _MB2, _MB2, |
---|
788 | /* cc cd ce cf */ |
---|
789 | _MB2, _MB2, _MB2, _MB2, |
---|
790 | /* d0 d1 d2 d3 */ |
---|
791 | _MB2, _MB2, _MB2, _MB2, |
---|
792 | /* d4 d5 d6 d7 */ |
---|
793 | _MB2, _MB2, _MB2, _MB2, |
---|
794 | /* d8 d9 da db */ |
---|
795 | _MB2, _MB2, _MB2, _MB2, |
---|
796 | /* dc dd de df */ |
---|
797 | _MB2, _MB2, _MB2, _MB2, |
---|
798 | /* e0 e1 e2 e3 */ |
---|
799 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
800 | /* e4 e5 e6 e7 */ |
---|
801 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
802 | /* e8 e9 ea eb */ |
---|
803 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
804 | /* ec ed ee ef */ |
---|
805 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
806 | /* f0 f1 f2 f3 */ |
---|
807 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
808 | /* f4 f5 f6 f7 */ |
---|
809 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
810 | /* f8 f9 fa fb */ |
---|
811 | _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, |
---|
812 | /* fc fd fe ff */ |
---|
813 | _MB1|_MB2, 0, 0, 0, |
---|
814 | }; |
---|
815 | |
---|
816 | #else /* !(defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)) */ |
---|
817 | unsigned short _cmap[256] = { |
---|
818 | /* 0 nul 1 soh 2 stx 3 etx */ |
---|
819 | _CTR, _CTR, _CTR, _CTR, |
---|
820 | |
---|
821 | /* 4 eot 5 enq 6 ack 7 bel */ |
---|
822 | _CTR, _CTR, _CTR, _CTR, |
---|
823 | |
---|
824 | /* 8 bs 9 ht 10 nl 11 vt */ |
---|
825 | _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR, |
---|
826 | |
---|
827 | /* 12 np 13 cr 14 so 15 si */ |
---|
828 | _CTR, _CTR, _CTR, _CTR, |
---|
829 | |
---|
830 | /* 16 dle 17 dc1 18 dc2 19 dc3 */ |
---|
831 | _CTR, _CTR, _CTR, _CTR, |
---|
832 | |
---|
833 | /* 20 dc4 21 nak 22 syn 23 etb */ |
---|
834 | _CTR, _CTR, _CTR, _CTR, |
---|
835 | |
---|
836 | /* 24 can 25 em 26 sub 27 esc */ |
---|
837 | _CTR, _CTR, _CTR, _CTR, |
---|
838 | |
---|
839 | /* 28 fs 29 gs 30 rs 31 us */ |
---|
840 | _CTR, _CTR, _CTR, _CTR, |
---|
841 | |
---|
842 | /* 32 sp 33 ! 34 " 35 # */ |
---|
843 | _SP|_META, _PUN, _QF|_PUN, _META|_PUN, |
---|
844 | |
---|
845 | /* 36 $ 37 % 38 & 39 ' */ |
---|
846 | _DOL|_PUN, _PUN, _META|_CMD|_PUN,_QF|_PUN, |
---|
847 | |
---|
848 | /* 40 ( 41 ) 42 * 43 + */ |
---|
849 | _META|_CMD|_PUN,_META|_PUN, _GLOB|_PUN, _PUN, |
---|
850 | |
---|
851 | /* 44 , 45 - 46 . 47 / */ |
---|
852 | _PUN, _PUN, _PUN, _PUN, |
---|
853 | |
---|
854 | /* 48 0 49 1 50 2 51 3 */ |
---|
855 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
856 | |
---|
857 | /* 52 4 53 5 54 6 55 7 */ |
---|
858 | _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, |
---|
859 | |
---|
860 | /* 56 8 57 9 58 : 59 ; */ |
---|
861 | _DIG|_XD, _DIG|_XD, _PUN, _META|_CMD|_PUN, |
---|
862 | |
---|
863 | /* 60 < 61 = 62 > 63 ? */ |
---|
864 | _META|_PUN, _PUN, _META|_PUN, _GLOB|_PUN, |
---|
865 | |
---|
866 | /* 64 @ 65 A 66 B 67 C */ |
---|
867 | _PUN, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, |
---|
868 | |
---|
869 | /* 68 D 69 E 70 F 71 G */ |
---|
870 | _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP, |
---|
871 | |
---|
872 | /* 72 H 73 I 74 J 75 K */ |
---|
873 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
874 | |
---|
875 | /* 76 L 77 M 78 N 79 O */ |
---|
876 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
877 | |
---|
878 | /* 80 P 81 Q 82 R 83 S */ |
---|
879 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
880 | |
---|
881 | /* 84 T 85 U 86 V 87 W */ |
---|
882 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
883 | |
---|
884 | /* 88 X 89 Y 90 Z 91 [ */ |
---|
885 | _LET|_UP, _LET|_UP, _LET|_UP, _GLOB|_PUN, |
---|
886 | |
---|
887 | /* 92 \ 93 ] 94 ^ 95 _ */ |
---|
888 | _ESC|_PUN, _PUN, _PUN, _PUN, |
---|
889 | |
---|
890 | /* 96 ` 97 a 98 b 99 c */ |
---|
891 | _QB|_GLOB|_META|_PUN, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, |
---|
892 | |
---|
893 | /* 100 d 101 e 102 f 103 g */ |
---|
894 | _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW, |
---|
895 | |
---|
896 | /* 104 h 105 i 106 j 107 k */ |
---|
897 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
898 | |
---|
899 | /* 108 l 109 m 110 n 111 o */ |
---|
900 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
901 | |
---|
902 | /* 112 p 113 q 114 r 115 s */ |
---|
903 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
904 | |
---|
905 | /* 116 t 117 u 118 v 119 w */ |
---|
906 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
907 | |
---|
908 | /* 120 x 121 y 122 z 123 { */ |
---|
909 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _GLOB|_PUN, |
---|
910 | |
---|
911 | /* 124 | 125 } 126 ~ 127 del */ |
---|
912 | _META|_CMD|_PUN,_PUN, _PUN, _CTR, |
---|
913 | |
---|
914 | #ifdef SHORT_STRINGS |
---|
915 | /****************************************************************/ |
---|
916 | /* 128 - 255 The below is supposedly ISO 8859/1 */ |
---|
917 | /****************************************************************/ |
---|
918 | /* 128 (undef) 129 (undef) 130 (undef) 131 (undef) */ |
---|
919 | _CTR, _CTR, _CTR, _CTR, |
---|
920 | |
---|
921 | /* 132 (undef) 133 (undef) 134 (undef) 135 (undef) */ |
---|
922 | _CTR, _CTR, _CTR, _CTR, |
---|
923 | |
---|
924 | /* 136 (undef) 137 (undef) 138 (undef) 139 (undef) */ |
---|
925 | _CTR, _CTR, _CTR, _CTR, |
---|
926 | |
---|
927 | /* 140 (undef) 141 (undef) 142 (undef) 143 (undef) */ |
---|
928 | _CTR, _CTR, _CTR, _CTR, |
---|
929 | |
---|
930 | /* 144 (undef) 145 (undef) 146 (undef) 147 (undef) */ |
---|
931 | _CTR, _CTR, _CTR, _CTR, |
---|
932 | |
---|
933 | /* 148 (undef) 149 (undef) 150 (undef) 151 (undef) */ |
---|
934 | _CTR, _CTR, _CTR, _CTR, |
---|
935 | |
---|
936 | /* 152 (undef) 153 (undef) 154 (undef) 155 (undef) */ |
---|
937 | _CTR, _CTR, _CTR, _CTR, |
---|
938 | |
---|
939 | /* 156 (undef) 157 (undef) 158 (undef) 159 (undef) */ |
---|
940 | _CTR, _CTR, _CTR, _CTR, |
---|
941 | |
---|
942 | /* 160 nobreakspace 161 exclamdown 162 cent 163 sterling */ |
---|
943 | _PUN, /* XXX */ _PUN, _PUN, _PUN, |
---|
944 | |
---|
945 | /* 164 currency 165 yen 166 brokenbar 167 section */ |
---|
946 | _PUN, _PUN, _PUN, _PUN, |
---|
947 | |
---|
948 | /* 168 diaeresis 169 copyright 170 ordfeminine 171 guillemotleft*/ |
---|
949 | _PUN, _PUN, _PUN, _PUN, |
---|
950 | |
---|
951 | /* 172 notsign 173 hyphen 174 registered 175 macron */ |
---|
952 | _PUN, _PUN, _PUN, _PUN, |
---|
953 | |
---|
954 | /* 176 degree 177 plusminus 178 twosuperior 179 threesuperior*/ |
---|
955 | _PUN, _PUN, _PUN, _PUN, |
---|
956 | |
---|
957 | /* 180 acute 181 mu 182 paragraph 183 periodcentered*/ |
---|
958 | _PUN, _PUN, /*XXX*/ _PUN, _PUN, |
---|
959 | |
---|
960 | /* 184 cedilla 185 onesuperior 186 masculine 187 guillemotright*/ |
---|
961 | _PUN, _PUN, _PUN, _PUN, |
---|
962 | |
---|
963 | /* 188 onequarter 189 onehalf 190 threequarters 191 questiondown*/ |
---|
964 | _PUN, _PUN, _PUN, _PUN, |
---|
965 | |
---|
966 | /* 192 Agrave 193 Aacute 194 Acircumflex 195 Atilde */ |
---|
967 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
968 | |
---|
969 | /* 196 Adiaeresis 197 Aring 198 AE 199 Ccedilla */ |
---|
970 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
971 | |
---|
972 | /* 200 Egrave 201 Eacute 202 Ecircumflex 203 Ediaeresis */ |
---|
973 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
974 | |
---|
975 | /* 204 Igrave 205 Iacute 206 Icircumflex 207 Idiaeresis */ |
---|
976 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
977 | |
---|
978 | /* 208 ETH 209 Ntilde 210 Ograve 211 Oacute */ |
---|
979 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
980 | |
---|
981 | /* 212 Ocircumflex 213 Otilde 214 Odiaeresis 215 multiply */ |
---|
982 | _LET|_UP, _LET|_UP, _LET|_UP, _PUN, |
---|
983 | |
---|
984 | /* 216 Ooblique 217 Ugrave 218 Uacute 219 Ucircumflex */ |
---|
985 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, |
---|
986 | |
---|
987 | /* 220 Udiaeresis 221 Yacute 222 THORN 223 ssharp */ |
---|
988 | _LET|_UP, _LET|_UP, _LET|_UP, _LET|_DOW, |
---|
989 | |
---|
990 | /* 224 agrave 225 aacute 226 acircumflex 227 atilde */ |
---|
991 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
992 | |
---|
993 | /* 228 adiaeresis 229 aring 230 ae 231 ccedilla */ |
---|
994 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
995 | |
---|
996 | /* 232 egrave 233 eacute 234 ecircumflex 235 ediaeresis */ |
---|
997 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
998 | |
---|
999 | /* 236 igrave 237 iacute 238 icircumflex 239 idiaeresis */ |
---|
1000 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
1001 | |
---|
1002 | /* 240 eth 241 ntilde 242 ograve 243 oacute */ |
---|
1003 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
1004 | |
---|
1005 | /* 244 ocircumflex 245 otilde 246 odiaeresis 247 division */ |
---|
1006 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _PUN, |
---|
1007 | |
---|
1008 | /* 248 oslash 249 ugrave 250 uacute 251 ucircumflex */ |
---|
1009 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
1010 | |
---|
1011 | /* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */ |
---|
1012 | _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW, |
---|
1013 | #endif /* SHORT_STRINGS */ |
---|
1014 | }; |
---|
1015 | #endif /* defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE) */ |
---|
1016 | |
---|
1017 | #ifndef NLS |
---|
1018 | /* _cmap_lower, _cmap_upper for ISO 8859/1 */ |
---|
1019 | |
---|
1020 | unsigned char _cmap_lower[256] = { |
---|
1021 | 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, |
---|
1022 | 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, |
---|
1023 | 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, |
---|
1024 | 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, |
---|
1025 | 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, |
---|
1026 | 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, |
---|
1027 | 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, |
---|
1028 | 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, |
---|
1029 | 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147, |
---|
1030 | 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, |
---|
1031 | 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, |
---|
1032 | 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137, |
---|
1033 | 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147, |
---|
1034 | 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, |
---|
1035 | 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, |
---|
1036 | 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177, |
---|
1037 | 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207, |
---|
1038 | 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217, |
---|
1039 | 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227, |
---|
1040 | 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237, |
---|
1041 | 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247, |
---|
1042 | 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257, |
---|
1043 | 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267, |
---|
1044 | 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277, |
---|
1045 | 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, |
---|
1046 | 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, |
---|
1047 | 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0327, |
---|
1048 | 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0337, |
---|
1049 | 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, |
---|
1050 | 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, |
---|
1051 | 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367, |
---|
1052 | 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377, |
---|
1053 | }; |
---|
1054 | |
---|
1055 | unsigned char _cmap_upper[256] = { |
---|
1056 | 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, |
---|
1057 | 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, |
---|
1058 | 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, |
---|
1059 | 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, |
---|
1060 | 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, |
---|
1061 | 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, |
---|
1062 | 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, |
---|
1063 | 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, |
---|
1064 | 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107, |
---|
1065 | 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, |
---|
1066 | 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, |
---|
1067 | 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137, |
---|
1068 | 0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107, |
---|
1069 | 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, |
---|
1070 | 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, |
---|
1071 | 0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177, |
---|
1072 | 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207, |
---|
1073 | 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217, |
---|
1074 | 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227, |
---|
1075 | 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237, |
---|
1076 | 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247, |
---|
1077 | 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257, |
---|
1078 | 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267, |
---|
1079 | 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277, |
---|
1080 | 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, |
---|
1081 | 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, |
---|
1082 | 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327, |
---|
1083 | 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337, |
---|
1084 | 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, |
---|
1085 | 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, |
---|
1086 | 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0367, |
---|
1087 | 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0377, |
---|
1088 | }; |
---|
1089 | #endif /* NLS */ |
---|
1090 | |
---|
1091 | #ifdef _OSD_POSIX |
---|
1092 | /* |
---|
1093 | Initial Port for tcsh-6.07.04 by <Martin.Kraemer@Mch.SNI.De> |
---|
1094 | |
---|
1095 | "BS2000 OSD" is a POSIX on a main frame. |
---|
1096 | It is made by Siemens Nixdorf AG, Germany. |
---|
1097 | Within the POSIX subsystem, the same character set was chosen as in |
---|
1098 | "native BS2000", namely EBCDIC. Yes, tcsh now runs on EBCDIC platforms, too. |
---|
1099 | |
---|
1100 | EBCDIC Table. (Yes, in EBCDIC, the letters 'a'..'z' are not contiguous!) |
---|
1101 | This table is bijective, i.e. there are no ambigous or duplicate characters |
---|
1102 | 00 00 01 02 03 85 09 86 7f 87 8d 8e 0b 0c 0d 0e 0f * ................ * |
---|
1103 | 10 10 11 12 13 8f 0a 08 97 18 19 9c 9d 1c 1d 1e 1f * ................ * |
---|
1104 | 20 80 81 82 83 84 92 17 1b 88 89 8a 8b 8c 05 06 07 * ................ * |
---|
1105 | 30 90 91 16 93 94 95 96 04 98 99 9a 9b 14 15 9e 1a * ................ * |
---|
1106 | 40 20 a0 e2 e4 e0 e1 e3 e5 e7 f1 60 2e 3c 28 2b 7c * .........`.<(+| * |
---|
1107 | 50 26 e9 ea eb e8 ed ee ef ec df 21 24 2a 29 3b 9f * &.........!$*);. * |
---|
1108 | 60 2d 2f c2 c4 c0 c1 c3 c5 c7 d1 5e 2c 25 5f 3e 3f * -/........^,%_>? * |
---|
1109 | 70 f8 c9 ca cb c8 cd ce cf cc a8 3a 23 40 27 3d 22 * ..........:#@'=" * |
---|
1110 | 80 d8 61 62 63 64 65 66 67 68 69 ab bb f0 fd fe b1 * .abcdefghi...... * |
---|
1111 | 90 b0 6a 6b 6c 6d 6e 6f 70 71 72 aa ba e6 b8 c6 a4 * .jklmnopqr...... * |
---|
1112 | a0 b5 af 73 74 75 76 77 78 79 7a a1 bf d0 dd de ae * ..stuvwxyz...... * |
---|
1113 | b0 a2 a3 a5 b7 a9 a7 b6 bc bd be ac 5b 5c 5d b4 d7 * ...........[\].. * |
---|
1114 | c0 f9 41 42 43 44 45 46 47 48 49 ad f4 f6 f2 f3 f5 * .ABCDEFGHI...... * |
---|
1115 | d0 a6 4a 4b 4c 4d 4e 4f 50 51 52 b9 fb fc db fa ff * .JKLMNOPQR...... * |
---|
1116 | e0 d9 f7 53 54 55 56 57 58 59 5a b2 d4 d6 d2 d3 d5 * ..STUVWXYZ...... * |
---|
1117 | f0 30 31 32 33 34 35 36 37 38 39 b3 7b dc 7d da 7e * 0123456789.{.}.~ * |
---|
1118 | */ |
---|
1119 | unsigned short _toascii[256] = { |
---|
1120 | /*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, |
---|
1121 | 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */ |
---|
1122 | /*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, |
---|
1123 | 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */ |
---|
1124 | /*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, |
---|
1125 | 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* ................ */ |
---|
1126 | /*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, |
---|
1127 | 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* ................ */ |
---|
1128 | /*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, |
---|
1129 | 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+| */ |
---|
1130 | /*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, |
---|
1131 | 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /* &.........!$*);. */ |
---|
1132 | /*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, |
---|
1133 | 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* -/........^,%_>? */ |
---|
1134 | /*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, |
---|
1135 | 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* ..........:#@'=" */ |
---|
1136 | /*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, |
---|
1137 | 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /* .abcdefghi...... */ |
---|
1138 | /*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, |
---|
1139 | 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /* .jklmnopqr...... */ |
---|
1140 | /*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, |
---|
1141 | 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /* ..stuvwxyz...... */ |
---|
1142 | /*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, |
---|
1143 | 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /* ...........[\].. */ |
---|
1144 | /*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, |
---|
1145 | 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /* .ABCDEFGHI...... */ |
---|
1146 | /*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, |
---|
1147 | 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /* .JKLMNOPQR...... */ |
---|
1148 | /*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, |
---|
1149 | 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /* ..STUVWXYZ...... */ |
---|
1150 | /*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, |
---|
1151 | 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /* 0123456789.{.}.~ */ |
---|
1152 | }; |
---|
1153 | /* The same, for ascii-in-ebcdic |
---|
1154 | 00 00 01 02 03 37 2d 2e 2f 16 05 15 0b 0c 0d 0e 0f * ................ * |
---|
1155 | 10 10 11 12 13 3c 3d 32 26 18 19 3f 27 1c 1d 1e 1f * ................ * |
---|
1156 | 20 40 5a 7f 7b 5b 6c 50 7d 4d 5d 5c 4e 6b 60 4b 61 * !"#$%&'()*+,-./ * |
---|
1157 | 30 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 7a 5e 4c 7e 6e 6f * 0123456789:;<=>? * |
---|
1158 | 40 7c c1 c2 c3 c4 c5 c6 c7 c8 c9 d1 d2 d3 d4 d5 d6 * @ABCDEFGHIJKLMNO * |
---|
1159 | 50 d7 d8 d9 e2 e3 e4 e5 e6 e7 e8 e9 bb bc bd 6a 6d * PQRSTUVWXYZ[\]^_ * |
---|
1160 | 60 4a 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 * `abcdefghijklmno * |
---|
1161 | 70 97 98 99 a2 a3 a4 a5 a6 a7 a8 a9 fb 4f fd ff 07 * pqrstuvwxyz{|}~. * |
---|
1162 | 80 20 21 22 23 24 04 06 08 28 29 2a 2b 2c 09 0a 14 * ................ * |
---|
1163 | 90 30 31 25 33 34 35 36 17 38 39 3a 3b 1a 1b 3e 5f * ................ * |
---|
1164 | a0 41 aa b0 b1 9f b2 d0 b5 79 b4 9a 8a ba ca af a1 * ................ * |
---|
1165 | b0 90 8f ea fa be a0 b6 b3 9d da 9b 8b b7 b8 b9 ab * ................ * |
---|
1166 | c0 64 65 62 66 63 67 9e 68 74 71 72 73 78 75 76 77 * ................ * |
---|
1167 | d0 ac 69 ed ee eb ef ec bf 80 e0 fe dd fc ad ae 59 * ................ * |
---|
1168 | e0 44 45 42 46 43 47 9c 48 54 51 52 53 58 55 56 57 * ................ * |
---|
1169 | f0 8c 49 cd ce cb cf cc e1 70 c0 de db dc 8d 8e df * ................ * |
---|
1170 | */ |
---|
1171 | unsigned short _toebcdic[256] = { |
---|
1172 | /*00*/ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, |
---|
1173 | 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */ |
---|
1174 | /*10*/ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, |
---|
1175 | 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */ |
---|
1176 | /*20*/ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, |
---|
1177 | 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* !"#$%&'()*+,-./ */ |
---|
1178 | /*30*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, |
---|
1179 | 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* 0123456789:;<=>? */ |
---|
1180 | /*40*/ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, |
---|
1181 | 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* @ABCDEFGHIJKLMNO */ |
---|
1182 | /*50*/ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, |
---|
1183 | 0xe7, 0xe8, 0xe9, 0xbb, 0xbc, 0xbd, 0x6a, 0x6d, /* PQRSTUVWXYZ[\]^_ */ |
---|
1184 | /*60*/ 0x4a, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, |
---|
1185 | 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* `abcdefghijklmno */ |
---|
1186 | /*70*/ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, |
---|
1187 | 0xa7, 0xa8, 0xa9, 0xfb, 0x4f, 0xfd, 0xff, 0x07, /* pqrstuvwxyz{|}~. */ |
---|
1188 | /*80*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08, |
---|
1189 | 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x14, /* ................ */ |
---|
1190 | /*90*/ 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17, |
---|
1191 | 0x38, 0x39, 0x3a, 0x3b, 0x1a, 0x1b, 0x3e, 0x5f, /* ................ */ |
---|
1192 | /*a0*/ 0x41, 0xaa, 0xb0, 0xb1, 0x9f, 0xb2, 0xd0, 0xb5, |
---|
1193 | 0x79, 0xb4, 0x9a, 0x8a, 0xba, 0xca, 0xaf, 0xa1, /* ................ */ |
---|
1194 | /*b0*/ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, |
---|
1195 | 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /* ................ */ |
---|
1196 | /*c0*/ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, |
---|
1197 | 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* ................ */ |
---|
1198 | /*d0*/ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, |
---|
1199 | 0x80, 0xe0, 0xfe, 0xdd, 0xfc, 0xad, 0xae, 0x59, /* ................ */ |
---|
1200 | /*e0*/ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, |
---|
1201 | 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* ................ */ |
---|
1202 | /*f0*/ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, |
---|
1203 | 0x70, 0xc0, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /* ................ */ |
---|
1204 | }; |
---|
1205 | |
---|
1206 | #endif /*_OSD_POSIX*/ |
---|