35 int main(
int ac,
char **av)
43 memset(plane, 0,
sizeof(plane));
44 memset(page, 0,
sizeof(page));
46 while (fgets(str,
sizeof(str), stdin))
48 int code1, code2, width;
53 code1= strtol(str, &end, 16);
54 if (code1 < 0 || code1 > 0xFFFF)
60 else if (end[0] ==
'.' && end[1] ==
'.')
63 code2= strtol(end, &end, 16);
64 if (code2 < 0 || code2 > 0xFFFF)
69 fprintf(stderr,
"error: %s", str);
76 fprintf(stderr,
"error: %s", str);
81 width= (end[0] ==
'F' || end[0] ==
'W') ? 1 : 0;
83 for ( ; code1 <= code2; code1++)
92 for (i=0; i < 256; i++)
95 int *p= plane + 256 *
i;
97 for (j=0; j < 256; j++)
101 if (page[i] != 0 && page[i] != 256)
103 printf(
"static char pg%02X[256]=\n{\n", i);
104 for (j=0; j < 256; j++)
106 printf(
"%d%s%s", p[j], j < 255 ?
"," :
"", (j + 1) % 32 ?
"" :
"\n");
112 printf(
"static struct {int page; char *p;} utr11_data[256]=\n{\n");
113 for (i=0; i < 256; i++)
115 if (page[i] == 0 || page[i] == 256)
117 int width= (page[
i] == 256) ? 1 : 0;
118 printf(
"{%d,NULL}", width);
122 printf(
"{0,pg%02X}", i);
124 printf(
"%s%s", i < 255 ?
"," :
"", (i+1) % 8 ?
"" :
"\n");