doc/Makefile: add 'refcheck' to find missing cross-references

Some missing references found are not surprising (e.g. *_INITIALIZER),
but real mistakes are also found (ck_ht_init->ck_entry_set_direct).

ck/doc$ make refcheck
ck_brlock: ref to missing ck_bytelock(3)
ck_ht_get_spmc: ref to missing ck_ht_entry_set_key(3)
ck_ht_init: ref to missing ck_entry_set_direct(3)
ck_ht_remove_spmc: ref to missing ck_ht_entry_set_key(3)
ck_bitmap_test: ref to missing ck_bitmap_set_mpmc(3)
ck_bitmap_test: ref to missing ck_bitmap_reset_mpmc(3)
ck_bitmap_size: ref to missing ck_bitmap_set_mpmc(3)
ck_bitmap_size: ref to missing ck_bitmap_reset_mpmc(3)
ck_rwcohort: ref to missing CK_RWCOHORT_STRATEGY_PROTOTYPE(3)
ck_rwcohort: ref to missing CK_COHORT_INITIALIZER(3)
ck_rwcohort: ref to missing CK_COHORT_LOCKED(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_TRYLOCK_PROTOTYPE(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_LOCK(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_UNLOCK(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_LOCKED(3)
CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_TRYLOCK(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_TRYLOCK_PROTOTYPE(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_LOCK(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_UNLOCK(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_LOCKED(3)
CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_TRYLOCK(3)
CK_RWCOHORT_PROTOTYPE: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_READ_LOCK: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_READ_UNLOCK: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_WRITE_LOCK: ref to missing CK_RWCOHORT_INITIALIZER(3)
CK_RWCOHORT_WRITE_UNLOCK: ref to missing CK_RWCOHORT_INITIALIZER(3)
ck_cohort: ref to missing CK_COHORT_LOCKED(3)
ck_cohort: ref to missing CK_COHORT_INITIALIZER(3)
ck_cohort: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_PROTOTYPE: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_PROTOTYPE: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_TRYLOCK_PROTOTYPE: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_TRYLOCK_PROTOTYPE: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_INSTANCE: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_INSTANCE: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_INIT: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_INIT: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_LOCK: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_LOCK: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_UNLOCK: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_UNLOCK: ref to missing CK_COHORT_LOCKED(3)
CK_COHORT_TRYLOCK: ref to missing CK_COHORT_INITIALIZER(3)
CK_COHORT_TRYLOCK: ref to missing CK_COHORT_LOCKED(3)
ck_sequence: ref to missing ck_bytelock(3)

Signed-off-by: Emilio G. Cota <cota@braap.org>
ck_pring
Emilio G. Cota 10 years ago
parent 055ec11080
commit 1d3300ac3a

@ -199,6 +199,10 @@ objcheck: all
fi; \
done
# check for stale references
refcheck:
@./refcheck.pl $(OBJECTS)
install:
mkdir -p $(DESTDIR)/$(MANDIR)/man3 || exit
cp *$(GZIP_SUFFIX) $(DESTDIR)/$(MANDIR)/man3 || exit

@ -0,0 +1,27 @@
#!/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: $!");
}
Loading…
Cancel
Save