0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 while(<>) {
0023 next if (!/^0x(..)(..)\t0x(....)\t/);
0024 $firstchar = hex($1);
0025 $secondchar = hex($2);
0026 $uppercase = hex($3);
0027
0028 $top[$firstchar][$secondchar] = $uppercase;
0029 }
0030
0031 for ($i = 0; $i < 256; $i++) {
0032 next if (!$top[$i]);
0033
0034 printf("static const wchar_t t2_%2.2x[256] = {", $i);
0035 for ($j = 0; $j < 256; $j++) {
0036 if (($j % 8) == 0) {
0037 print "\n\t";
0038 } else {
0039 print " ";
0040 }
0041 printf("0x%4.4x,", $top[$i][$j] ? $top[$i][$j] : 0);
0042 }
0043 print "\n};\n\n";
0044 }
0045
0046 printf("static const wchar_t *const toplevel[256] = {", $i);
0047 for ($i = 0; $i < 256; $i++) {
0048 if (($i % 8) == 0) {
0049 print "\n\t";
0050 } elsif ($top[$i]) {
0051 print " ";
0052 } else {
0053 print " ";
0054 }
0055
0056 if ($top[$i]) {
0057 printf("t2_%2.2x,", $i);
0058 } else {
0059 print "NULL,";
0060 }
0061 }
0062 print "\n};\n\n";