1 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
2 See the file COPYING for copying permission.
14 struct range nmstrt
[] = {
226 /* name chars that are not name start chars */
227 struct range name
[] = {
357 setTab(char *tab
, struct range
*ranges
, size_t nRanges
)
361 for (i
= 0; i
< nRanges
; i
++) {
363 for (j
= ranges
[i
].start
; j
<= ranges
[i
].end
; j
++)
367 tab
[ranges
[i
].start
] = 1;
376 unsigned char pageIndex
[512];
379 "static const unsigned namingBitmap[] = {\n\
380 0x00000000, 0x00000000, 0x00000000, 0x00000000,\n\
381 0x00000000, 0x00000000, 0x00000000, 0x00000000,\n\
382 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,\n\
383 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,\n");
384 for (i
= 0; i
< 512; i
++) {
385 int kind
= tab
[i
*256];
386 for (j
= 1; j
< 256; j
++)
387 if (tab
[i
*256 +j
] != kind
) {
391 if (i
>= 256 && memcmp(tab
+ (i
- 256)*256, tab
+ i
*256, 256) == 0)
392 pageIndex
[i
] = pageIndex
[i
- 256];
393 else if (kind
== -1) {
394 pageIndex
[i
] = nBitmaps
++;
395 for (j
= 0; j
< 8; j
++) {
397 for (k
= 0; k
< 32; k
++) {
398 if (tab
[i
*256 + j
*32 +k
])
401 printf("0x%08X,", val
);
402 putchar((((j
+ 1) & 3) == 0) ? '\n' : ' ');
409 printf("static const unsigned char nmstrtPages[] = {\n");
410 for (i
= 0; i
< 512; i
++) {
412 printf("};\nstatic const unsigned char namePages[] = {\n");
413 printf("0x%02X,", pageIndex
[i
]);
414 putchar((((i
+ 1) & 7) == 0) ? '\n' : ' ');
423 memset(tab
, 0, 65536);
424 setTab(tab
, nmstrt
, sizeof(nmstrt
)/sizeof(nmstrt
[0]));
425 memcpy(tab
+ 65536, tab
, 65536);
426 setTab(tab
+ 65536, name
, sizeof(name
)/sizeof(name
[0]));