8 my ($mac_file, $xref_file) = @ARGV;
10 open(IN
, $mac_file) || die "Can't open $mac_file";
12 # Read in OID nid values for a lookup table.
17 my ($name, $num) = /^(\S+)\s+(\S+)$/;
18 $oid_tbl{$name} = $num;
22 open(IN
, $xref_file) || die "Can't open $xref_file";
31 my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
35 $xref_tbl{$xr} = [$p1, $p2, $ln];
38 my @xrkeys = keys %xref_tbl;
40 my @srt1 = sort { $oid_tbl{$a} <=> $oid_tbl{$b}} @xrkeys;
42 for(my $i = 0; $i <= $#srt1; $i++)
44 $xref_tbl{$srt1[$i]}[2] = $i;
49 my$ap1 = $oid_tbl{$xref_tbl{$a}[0]};
50 my$bp1 = $oid_tbl{$xref_tbl{$b}[0]};
51 return $ap1 - $bp1 if ($ap1 != $bp1);
52 my$ap2 = $oid_tbl{$xref_tbl{$a}[1]};
53 my$bp2 = $oid_tbl{$xref_tbl{$b}[1]};
60 $pname =~ s
|^.[^/]/||;
63 /* AUTOGENERATED BY $pname, DO NOT EDIT */
72 static const nid_triple sigoid_srt[] =
79 my ($p1, $p2) = @
{$xref_tbl{$_}};
80 print "\t{NID_$xr, NID_$p1, NID_$p2},\n";
87 static const nid_triple * const sigoid_srt_xref[] =
93 my $x = $xref_tbl{$_}[2];
94 print "\t\&sigoid_srt\[$x\],\n";
102 if (!exists $oid_tbl{$chk})
104 die "Not Found \"$chk\"\n";