Commit | Line | Data |
---|---|---|
992de934 | 1 | /* |
0de390c0 KB |
2 | * Copyright (c) 1988 Regents of the University of California. |
3 | * All rights reserved. | |
992de934 | 4 | * |
0de390c0 | 5 | * Redistribution and use in source and binary forms are permitted |
b36fc510 KB |
6 | * provided that the above copyright notice and this paragraph are |
7 | * duplicated in all such forms and that any documentation, | |
8 | * advertising materials, and other materials related to such | |
9 | * distribution and use acknowledge that the software was developed | |
10 | * by the University of California, Berkeley. The name of the | |
11 | * University may not be used to endorse or promote products derived | |
12 | * from this software without specific prior written permission. | |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
992de934 GM |
16 | */ |
17 | ||
18 | #ifndef lint | |
0de390c0 KB |
19 | char copyright[] = |
20 | "@(#) Copyright (c) 1988 Regents of the University of California.\n\ | |
21 | All rights reserved.\n"; | |
22 | #endif /* not lint */ | |
23 | ||
24 | #ifndef lint | |
d43d1075 | 25 | static char sccsid[] = "@(#)mkdctype.c 4.1 (Berkeley) %G%"; |
0de390c0 | 26 | #endif /* not lint */ |
992de934 | 27 | |
4718d085 | 28 | #include "../api/ebc_disp.h" |
e7f863aa GM |
29 | #include "ectype.h" |
30 | ||
31 | ||
32 | extern unsigned char ectype[256]; | |
33 | ||
34 | ||
35 | void | |
36 | main() | |
37 | { | |
e56fc5cb | 38 | static unsigned char dctype[192] = { 0 }; |
e7f863aa GM |
39 | int i; |
40 | char *orbar; | |
41 | int type; | |
42 | ||
43 | for (i = 0; i < sizeof ectype; i++) { | |
44 | dctype[ebc_disp[i]] = ectype[i]; | |
45 | } | |
46 | ||
47 | for (i = 0; i < sizeof dctype; i++) { | |
48 | if ((i%16) == 0) { | |
49 | printf("/*%02x*/\n", i); | |
50 | } | |
51 | printf("\t"); | |
52 | type = dctype[i]; | |
53 | orbar = ""; | |
54 | if (type & E_UPPER) { | |
55 | printf("E_UPPER"); | |
56 | orbar = "|"; | |
57 | } | |
58 | if (type & E_LOWER) { | |
59 | printf("%sD_LOWER", orbar); | |
60 | orbar = "|"; | |
61 | } | |
62 | if (type & E_DIGIT) { | |
63 | printf("%sD_DIGIT", orbar); | |
64 | orbar = "|"; | |
65 | } | |
66 | if (type & E_SPACE) { | |
67 | printf("%sD_SPACE", orbar); | |
68 | orbar = "|"; | |
69 | } | |
70 | if (type & E_PUNCT) { | |
71 | printf("%sD_PUNCT", orbar); | |
72 | orbar = "|"; | |
73 | } | |
74 | if (type & E_PRINT) { | |
75 | printf("%sD_PRINT", orbar); | |
76 | orbar = "|"; | |
77 | } | |
78 | if (orbar[0] == 0) { | |
79 | printf("0"); | |
80 | } | |
81 | printf(",\n"); | |
82 | } | |
83 | } |