You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ck/doc/refcheck.pl

28 lines
509 B

#!/usr/bin/perl
use warnings;
use strict;
my @files = @ARGV;
my $h;
foreach my $file (@files) {
$h->{$file} = 1;
}
foreach my $file (@files) {
open(my $fh, "<", $file) or die "cannot open < $file: $!";
while (<$fh>) {
chomp;
if ($_ =~ /\.Xr ((ck|CK)_[a-zA-Z_]+) ([0-9])/) {
my $name = $1;
my $section = $3;
if (!$h->{$name}) {
print STDERR "$file: ref to missing ${name}($section)\n";
}
}
}
close($fh) or die("cannot close $file: $!");
}