break out special local mail processing (e.g., mapping to the
[unix-history] / usr / src / bin / csh / char.c
CommitLineData
ecc449eb 1/*-
ed72f0a0
KB
2 * Copyright (c) 1980, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
ecc449eb
KB
4 *
5 * %sccs.include.redist.c%
b79f4fa9
DF
6 */
7
f1415978 8#ifndef lint
ed72f0a0 9static char sccsid[] = "@(#)char.c 8.1 (Berkeley) %G%";
ecc449eb 10#endif /* not lint */
f1415978 11
4d7b2685 12#include "char.h"
f1415978 13
c2dc294d 14unsigned short _cmap[256] = {
f1415978 15/* nul soh stx etx */
6e37afca 16 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
17
18/* eot enq ack bel */
6e37afca 19 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
20
21/* bs ht nl vt */
6e37afca 22 _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR,
f1415978
EW
23
24/* np cr so si */
6e37afca 25 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
26
27/* dle dc1 dc2 dc3 */
6e37afca 28 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
29
30/* dc4 nak syn etb */
6e37afca 31 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
32
33/* can em sub esc */
6e37afca 34 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
35
36/* fs gs rs us */
6e37afca 37 _CTR, _CTR, _CTR, _CTR,
f1415978
EW
38
39/* sp ! " # */
f0053a32 40 _SP|_META, 0, _QF, _META,
f1415978
EW
41
42/* $ % & ' */
f0053a32 43 _DOL, 0, _META|_CMD, _QF,
f1415978
EW
44
45/* ( ) * + */
6e37afca 46 _META|_CMD, _META, _GLOB, 0,
f1415978
EW
47
48/* , - . / */
49 0, 0, 0, 0,
50
51/* 0 1 2 3 */
6e37afca 52 _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
f1415978
EW
53
54/* 4 5 6 7 */
6e37afca 55 _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
f1415978
EW
56
57/* 8 9 : ; */
6e37afca 58 _DIG|_XD, _DIG|_XD, 0, _META|_CMD,
f1415978
EW
59
60/* < = > ? */
61 _META, 0, _META, _GLOB,
62
63/* @ A B C */
6e37afca 64 0, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD,
f1415978
EW
65
66/* D E F G */
6e37afca 67 _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP,
f1415978
EW
68
69/* H I J K */
6e37afca 70 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
f1415978
EW
71
72/* L M N O */
6e37afca 73 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
f1415978
EW
74
75/* P Q R S */
6e37afca 76 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
f1415978
EW
77
78/* T U V W */
6e37afca 79 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
f1415978
EW
80
81/* X Y Z [ */
6e37afca 82 _LET|_UP, _LET|_UP, _LET|_UP, _GLOB,
f1415978
EW
83
84/* \ ] ^ _ */
6e37afca 85 _ESC, 0, 0, 0,
f1415978
EW
86
87/* ` a b c */
f0053a32 88 _QB|_GLOB|_META, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD,
f1415978
EW
89
90/* d e f g */
6e37afca 91 _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW,
f1415978
EW
92
93/* h i j k */
6e37afca 94 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
f1415978
EW
95
96/* l m n o */
6e37afca 97 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
f1415978
EW
98
99/* p q r s */
6e37afca 100 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
f1415978
EW
101
102/* t u v w */
6e37afca 103 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
f1415978
EW
104
105/* x y z { */
6e37afca 106 _LET|_LOW, _LET|_LOW, _LET|_LOW, _GLOB,
f1415978
EW
107
108/* | } ~ del */
6e37afca
KB
109 _META|_CMD, 0, 0, _CTR,
110
111#if defined(SHORT_STRINGS) && !defined(KANJI)
112/****************************************************************/
113/* 128 - 255 The below is supposedly ISO 8859/1 */
114/****************************************************************/
115/* (undef) (undef) (undef) (undef) */
116 _CTR, _CTR, _CTR, _CTR,
117
118/* (undef) (undef) (undef) (undef) */
119 _CTR, _CTR, _CTR, _CTR,
120
121/* (undef) (undef) (undef) (undef) */
122 _CTR, _CTR, _CTR, _CTR,
123
124/* (undef) (undef) (undef) (undef) */
125 _CTR, _CTR, _CTR, _CTR,
126
127/* (undef) (undef) (undef) (undef) */
128 _CTR, _CTR, _CTR, _CTR,
129
130/* (undef) (undef) (undef) (undef) */
131 _CTR, _CTR, _CTR, _CTR,
132
133/* (undef) (undef) (undef) (undef) */
134 _CTR, _CTR, _CTR, _CTR,
135
136/* (undef) (undef) (undef) (undef) */
137 _CTR, _CTR, _CTR, _CTR,
138
139/* nobreakspace exclamdown cent sterling */
140 _SP, 0, 0, 0,
141
142/* currency yen brokenbar section */
143 0, 0, 0, 0,
144
145/* diaeresis copyright ordfeminine guillemotleft */
146 0, 0, 0, 0,
147
148/* notsign hyphen registered macron */
149 0, 0, 0, 0,
150
151/* degree plusminus twosuperior threesuperior */
152 0, 0, 0, 0,
153
154/* acute mu paragraph periodcentered */
155 0, 0, 0, 0,
156
157/* cedilla onesuperior masculine guillemotright */
158 0, 0, 0, 0,
159
160/* onequarter onehalf threequarters questiondown */
161 0, 0, 0, 0,
162
163/* Agrave Aacute Acircumflex Atilde */
164 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
165
166/* Adiaeresis Aring AE Ccedilla */
167 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
168
169/* Egrave Eacute Ecircumflex Ediaeresis */
170 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
171
172/* Igrave Iacute Icircumflex Idiaeresis */
173 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
174
175/* ETH Ntilde Ograve Oacute */
176 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
177
178/* Ocircumflex Otilde Odiaeresis multiply */
179 _LET|_UP, _LET|_UP, _LET|_UP, 0,
180
181/* Ooblique Ugrave Uacute Ucircumflex */
182 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
183
184/* Udiaeresis Yacute THORN ssharp */
185 _LET|_UP, _LET|_UP, _LET|_UP, _LET|_LOW,
186
187/* agrave aacute acircumflex atilde */
188 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
189
190/* adiaeresis aring ae ccedilla */
191 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
192
193/* egrave eacute ecircumflex ediaeresis */
194 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
195
196/* igrave iacute icircumflex idiaeresis */
197 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
198
199/* eth ntilde ograve oacute */
200 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
201
202/* ocircumflex otilde odiaeresis division */
203 _LET|_LOW, _LET|_LOW, _LET|_LOW, 0,
204
205/* oslash ugrave uacute ucircumflex */
206 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
207
208/* udiaeresis yacute thorn ydiaeresis */
209 _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
210#endif /* SHORT_STRINGS && !KANJI */
211};
212
213#ifndef NLS
214/* _cmap_lower, _cmap_upper for ISO 8859/1 */
215
216unsigned char _cmap_lower[256] = {
217 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
218 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
219 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
220 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
221 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
222 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
223 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
224 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
225 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
226 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
227 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
228 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137,
229 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
230 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
231 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
232 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
233 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
234 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
235 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
236 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
237 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
238 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
239 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
240 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
241 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
242 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
243 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0327,
244 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0337,
245 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
246 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
247 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
248 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377,
249};
250
251unsigned char _cmap_upper[256] = {
252 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
253 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
254 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
255 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
256 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
257 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
258 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
259 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
260 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
261 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
262 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
263 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
264 0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
265 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
266 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
267 0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177,
268 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
269 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
270 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
271 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
272 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
273 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
274 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
275 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
276 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
277 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
278 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
279 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
280 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
281 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
282 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0367,
283 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0377,
f1415978 284};
6e37afca 285#endif /* NLS */