3 # Generate C Language Table for UniCode Data
4 # (c) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
13 ($i =~ /^(..)(..)$/) || die "Syntax error at $i";
14 $table{$1} = "$name" . "_$1";
18 print "/* Generated automatically by gentab. Please don't edit. */\n\n";
20 for($i=0; $i<256; $i++) {
21 $x = sprintf("%02X", $i);
22 if (defined($table{$x})) {
23 print "static $type $table{$x}\[256\] = \{\n";
24 for($j=0; $j<256; $j++) {
25 $y = $x . sprintf("%02X", $j);
26 if ($val{$y}) { print $val{$y}; }
28 if ($j != 255) { print ","; }
29 if ($j % 16 == 15) { print "\n"; }
35 print "$type \*$name\[256\] = \{\n";
36 for($j=0; $j<256; $j++) {
37 $y = sprintf("%02X", $j);
38 if (defined $table{$y}) { print $table{$y}; }
39 else { print "NULL"; }
40 if ($j != 255) { print ","; }
41 if ($j % 16 == 15) { print "\n"; }