1 /* 2 * Copyright (c) 1984-1987 by the Regents of the 3 * University of California and by Gregory Glenn Minshall. 4 * 5 * Permission to use, copy, modify, and distribute these 6 * programs and their documentation for any purpose and 7 * without fee is hereby granted, provided that this 8 * copyright and permission appear on all copies and 9 * supporting documentation, the name of the Regents of 10 * the University of California not be used in advertising 11 * or publicity pertaining to distribution of the programs 12 * without specific prior permission, and notice be given in 13 * supporting documentation that copying and distribution is 14 * by permission of the Regents of the University of California 15 * and by Gregory Glenn Minshall. Neither the Regents of the 16 * University of California nor Gregory Glenn Minshall make 17 * representations about the suitability of this software 18 * for any purpose. It is provided "as is" without 19 * express or implied warranty. 20 */ 21 22 #ifndef lint 23 static char sccsid[] = "@(#)mkdstoas.c 3.1 (Berkeley) 08/11/87"; 24 #endif /* not lint */ 25 26 #include <stdio.h> 27 #if defined(unix) 28 #include <strings.h> 29 #else /* defined(unix) */ 30 #include <string.h> 31 #endif /* defined(unix) */ 32 #include <ctype.h> 33 #include "../api/asc_ebc.h" 34 #include "../api/ebc_disp.h" 35 36 37 int 38 main() 39 { 40 int i; 41 42 /* For each display code, find the ascii code that matches */ 43 44 printf("unsigned char disp_asc[256] = {"); 45 for (i = 0; i < sizeof disp_ebc; i++) { 46 if ((i%8) == 0) { 47 printf("\n"); 48 } 49 printf("\t0x%02x,", ebc_asc[disp_ebc[i]]); 50 } 51 for (i = sizeof disp_ebc; i < 256; i++) { 52 if ((i%8) == 0) { 53 printf("\n"); 54 } 55 printf("\t0x%02x,", ' '); 56 } 57 printf("\n};\n"); 58 59 return 0; 60 } 61