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