1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#!/usr/bin/perl -w
if ($ARGV[0]) {$funcfile = $ARGV[0]}
else {$funcfile = "efunc.out"}
if ($ARGV[1]) {$datafile = $ARGV[1]}
else {$datafile = "edata.out"}
open (FUNC, $funcfile) || die "Cannot open $funcfile";
open (DATA, $datafile) || die "Cannot open $datafile";
%efunc = ();
%edata = ();
%efuncdoc = ();
%edatadoc = ();
$dtot=0;
$ftot=0;
while (<FUNC>) {
if (($ctype, $cdata, $cfunc, $cmod, $clib, $cdesc) =
/^category +(\S+) +[\[]([^\]]+)\] +(\S+) +(\S+) +(\S+) +: +(.*)/) {
$ftot++;
$efunc{"$cdata\_$cfunc"} = $ctype;
$efuncdoc{"$cdata\_$cfunc"} = $cdesc;
$efuncsrc{"$cdata\_$cfunc"} = $cmod;
### print "efunc $cdata\_$cfunc '$ctype'\n";
}
}
while (<DATA>) {
if (($ctype, $cdata, $cfunc, $cmod, $clib, $cdesc) =
/^category +(\S+) +[\[]([^\]]+)\] +(\S+) +(\S+) +(\S+) +: +(.*)/) {
$dtot++;
$edata{"$cdata\_$cfunc"} = $ctype;
$edatadoc{"$cdata\_$cfunc"} = $cdesc;
### print "edata $cdata\_$cfunc '$ctype'\n";
if (!defined($efunc{"$cdata\_$cfunc"})) {
print "\n";
print "$clib/$cmod $cdata bad category $ctype $cfunc (undefined)\n";
$outstr = "Expected:\n** \@category $ctype [$cdata] $cdesc\n";
$outstr =~ s/^([^\n]{65,75}) ([^ \n]{3})/$1\n** $2/om;
$outstr =~ s/[\n]([^\n]{65,75}) ([^ \n]{3})/\n$1\n** $2/om;
$outstr =~ s/[\n]([^\n]{65,75}) ([^ \n]{3})/\n$1\n** $2/om;
$outstr =~ s/[\n]([^\n]{65,75}) ([^ \n]{3})/\n$1\n** $2/om;
$outstr =~ s/[\n]([^\n]{65,75}) ([^ \n]{3})/\n$1\n** $2/om;
$outstr =~ s/[\n][*][*] +([^\n]{1,10})\n/ $1\n/gom;
print $outstr;
}
elsif ($efunc{"$cdata\_$cfunc"} ne $ctype) {
$etype = $efunc{"$cdata\_$cfunc"};
$esrc = $efuncsrc{"$cdata\_$cfunc"};
print "\n";
print "$clib/$cmod $cdata $cfunc bad category type $ctype defined as $etype in $esrc\n"
}
elsif ($efuncdoc{"$cdata\_$cfunc"} ne $cdesc) {
$edesc = $efuncdoc{"$cdata\_$cfunc"};
$esrc = $efuncsrc{"$cdata\_$cfunc"};
print "\n";
print "$clib/$cmod $cdata $cfunc bad category type $ctype described as '$cdesc' not '$edesc' in $esrc\n"
}
}
}
print "\nTested $dtot data and $ftot functions\n"
|