3 # Cross-reference RFC attributes.
14 open FILE, "<$filename" or die "Failed to open $filename: $!\n";
20 # Clear out trailing whitespace
30 # Suppress multiple blank lines
33 next if ($blank == 1);
42 if (/^VENDOR\s+([\w-]+)\s+(\w+)(.*)/) {
47 $lenx += 7; # round up
59 # Remember if we did begin-vendor.
61 if (/^BEGIN-VENDOR\s+([\w-]+)/) {
63 if (!defined $vendor) {
65 } elsif ($vendor ne $1) {
75 if (/^ATTRIBUTE\s+([\w-]+)\s+(\w+)\s+(\w+)(.*)/) {
80 $lenx += 7; # round up
95 if ($begin_vendor == 0) {
97 # FIXME: Catch and print conflicting attributes.
99 $file{$value} = $filename;
100 $file{$value} =~ s/dictionary\.//;
101 $name{$value} = $name . $tabs;
105 # See if it's old format, with the vendor at the end of
106 # the line. If so, make it the new format.
108 if ($stuff =~ /$vendor/) {
109 if ($begin_vendor == 0) {
112 $stuff =~ s/$vendor//;
122 if (/^VALUE\s+([\w-]+)\s+([\w-\/,.]+)\s+(\w+)(.*)/) {
127 $lenx += 7; # round up
130 $tabsa = "\t" x $lenx;
136 $len += 8 * length $tabsa;
144 # For the code below, we assume that the attribute lengths
155 $lenx = 24 - $lena - $len;
156 $lenx += 7; # round up
159 $tabsn = "\t" x $lenx;
171 # Remember if we did this.
178 # Everything else gets dumped out as-is.
187 # Print out the attributes.
189 foreach $attr (sort {$a <=> $b} keys %file) {
190 print $name{$attr}, $attr, "\t", $file{$attr}, "\n";