2 # Convert pci.ids to format used by the database.
10 $last = "????"; $lastd = "????????"; $cmt = "";
15 if (/^$/) { $cmt=""; next; }
16 if (/^#/) { s/^#//; $cmt="$cmt $_"; next; }
20 if (/^\t\t([0-9a-fA-F]{4}) ([0-9a-fA-F]{4})\s+([^\t]*)$/) {
21 print "s\t",id("$lastd$1$2"),"\t$3\t0\t$cmt\n";
22 } elsif (/^\t([0-9a-fA-F]{4})\s+([^\t]*)$/) {
24 print "d\t",id($lastd),"\t$2\t0\t$cmt\n";
25 } elsif (/^([0-9a-fA-F]{4})\s+([^\t]*)$/) {
26 $last=$1; $lastd="$1????";
27 print "v\t",id($1),"\t$2\t0\t$cmt\n";
29 die "Syntax error: $_";