--- rxvt-unicode/src/gencompose 2004/03/04 02:05:49 1.1 +++ rxvt-unicode/src/gencompose 2004/03/14 23:14:39 1.3 @@ -2,6 +2,23 @@ open UNIDATA, "<", "www.unicode.org/Public/UNIDATA/UnicodeData.txt" or die "www.unicode.org/Public/UNIDATA/UnicodeData.txt: $!"; +my %docom = qw(initial | medial | final | isolated | compat | none |); + +while () { + my ($code, undef, $category, undef, undef, $decompose, undef) = split /;/; + + push @cat_z, $code if $category =~ /^Z/; + + if ($decompose) { + $type = $decompose =~ s/^<(.*)>\s*// ? $1 : "none"; + + next unless $docom{$type}; + next unless $decompose =~ /^([0-9a-f]+) ([0-9a-f]+)$/i; + my $pfx = sprintf "%08d %08d %08d", hex $1, hex $2, hex $code; + push @compose, [$pfx, hex $1, hex $2, hex $code]; + } +} + open TABLE, ">", "table/compose.h" or die "table/compose.h: $!"; @@ -10,36 +27,36 @@ // AUTOMATICALLLY GENERATED by gencompose // -struct rxvt_compose { +struct rxvt_compose_entry { uint32_t c1, c2, r; -} rxvt_compose_table = { +} rxvt_compose_table[] = { #ifdef ENCODING_COMPOSE EOF -my %docom = qw(initial | medial | final | isolated | compat | none |); - -while () { - my ($code, undef, undef, undef, undef, $decompose, undef) = split /;/; - next unless $decompose; - $type = $decompose =~ s/^<(.*)>\s*// ? $1 : "none"; - - next unless $docom{$type}; - next unless $decompose =~ /^([0-9a-f]+) ([0-9a-f]+)$/i; - my $pfx = sprintf "%08d %08d %08d", hex $1, hex $2, hex $code; - push @compose, [$pfx, hex $1, hex $2, hex $code]; -} - for (sort { $a->[0] cmp $b->[0] } @compose) { next if $seen{$_->[1],$_->[2]}++; printf TABLE " { 0x%05x, 0x%05x, 0x%05x },\n", $_->[1], $_->[2], $_->[3]; - $count++; } print TABLE <", "table/category.h"; + +print TABLE_Z <