9 open(IN,"<$in") || die "unable to open '$in'\n";
15 if (/^L\s+(\S+)\s+(\S+)$/)
19 elsif (/^R\s+(\S+)\s+(\S+)$/)
21 else { die "bad input line: $in:$.\n"; }
27 open(IN,"<$in") || die "unable to open '$in'\n";
31 if (/err\(([A-Z0-9]+_F_[0-9A-Z_]+)\s*,\s*([0-9A-Z]+_R_[0-9A-Z_]+)\s*\)/)
35 if ($function{$1} == 0)
37 printf STDERR "$. $1 is bad\n";
48 foreach (keys %function,keys %reason)
54 @F=sort keys %function;
56 foreach $j (sort keys %prefix)
58 next if $errfile{$j} eq "NONE";
59 printf STDERR "doing %-6s - ",$j;
60 if (defined($errfile{$j}))
62 open(OUT,">$errfile{$j}") ||
63 die "unable to open '$errfile{$j}':$!\n";
74 print OUT "/* Error codes for the $j functions. */\n\n";
75 print OUT "/* Function codes. */\n";
79 $z=6-int(length($i)/8);
80 printf OUT "#define $i%s $num\n","\t" x $z;
85 print OUT "\n/* Reason codes. */\n";
89 $z=6-int(length($i)/8);
90 if (defined($r_value{$i}))
92 printf OUT "#define $i%s $r_value{$i}\n","\t" x $z;
96 printf OUT "#define $i%s $num\n","\t" x $z;
101 close(OUT) if $close_file;
103 printf STDERR "%3d functions, %3d reasons\n",$f_count,$r_count;