1 /* 2 * Copyright (c) 1988 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 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. 16 */ 17 18 #ifndef lint 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 25 static char sccsid[] = "@(#)mkdctype.c 4.1 (Berkeley) 12/04/88"; 26 #endif /* not lint */ 27 28 #include "../api/ebc_disp.h" 29 #include "ectype.h" 30 31 32 extern unsigned char ectype[256]; 33 34 35 void 36 main() 37 { 38 static unsigned char dctype[192] = { 0 }; 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 } 84