$line =~ s/STACK_OF\([^)]+\)/int/g;
$line =~ s/SPARSE_ARRAY_OF\([^)]+\)/int/g;
$line =~ s/__declspec\([^)]+\)//;
+ if ( $line =~ /typedef.*\(\*\S+\)\s+\(/ ) {
+ # a callback function with whitespace before the argument list:
+ # typedef ... (*NAME) (...
+ err($id, "function typedef has space before arg list: $line");
+ }
if ( $line =~ /env (\S*)=/ ) {
# environment variable env NAME=...
$sym = $1;
my @missing;
open FH, $missingfile
- || die "Can't open $missingfile";
+ or die "Can't open $missingfile";
while ( <FH> ) {
chomp;
next if /^#/;
for (@missing) {
err("$missingfile:", "$_ is documented in $name_map{$_}")
- if exists $name_map{$_} && defined $name_map{$_};
+ if !$opt_o && exists $name_map{$_} && defined $name_map{$_};
}
return @missing;
next if $f eq 'include/openssl/asn1.h';
next if $f eq 'include/openssl/asn1t.h';
next if $f eq 'include/openssl/err.h';
- open(IN, $f) || die "Can't open $f, $!";
+ open(IN, $f)
+ or die "Can't open $f, $!";
while ( <IN> ) {
next unless /^#\s*define\s*(\S+)\(/;
my $macro = "$1(3)"; # We know they're all in section 3
my $count = 0;
my %seen;
- my @missing = loadmissing($missingfile) if ( $opt_v );
+ my @missing = loadmissing($missingfile) if $opt_v;
foreach my $func ( parsenum($numfile) ) {
$func .= '(3)'; # We know they're all in section 3
err($id, "$simplename not in NAME section");
push @{$podinfo{names}}, $simplename;
}
- foreach my $name (@{$podinfo{names}}) {
+ foreach my $name ( @{$podinfo{names}} ) {
next if $name eq "";
err($id, "'$name' contains white space")
if $name =~ /\s/;
}
}
- my @foreign_names =
- map { map { s/\s+//g; $_ } split(/,/, $_) }
- $podinfo{contents} =~ /=for\s+openssl\s+foreign\s+manuals:\s*(.*)\n\n/;
- foreach ( @foreign_names ) {
- $name_map{$_} = undef; # It still exists!
+ if ( $podinfo{contents} =~ /=for openssl foreign manual (.*)\n/ ) {
+ foreach my $f ( split / /, $1 ) {
+ $name_map{$f} = undef; # It still exists!
+ }
}
my @links =
# Look for L<> ("link") references that point to files that do not exist.
sub checklinks {
- foreach my $filename (sort keys %link_map) {
- foreach my $link (@{$link_map{$filename}}) {
+ foreach my $filename ( sort keys %link_map ) {
+ foreach my $link ( @{$link_map{$filename}} ) {
err("${filename}:1:", "reference to non-existing $link")
unless exists $name_map{$link};
}
# Get the list of options in the command.
open CFH, "./apps/openssl list --options $cmd|"
- || die "Can list options for $cmd, $!";
+ or die "Can list options for $cmd, $!";
while ( <CFH> ) {
chop;
s/ .$//;
# Get the list of flags from the synopsis
open CFH, "<$doc"
- || die "Can't open $doc, $!";
+ or die "Can't open $doc, $!";
while ( <CFH> ) {
chop;
last if /DESCRIPTION/;
}
next;
}
- next unless /\[B<-([^ >]+)/;
- my $opt = $1;
+ my $opt;
+ if ( /\[B<-([^ >]+)/ ) {
+ $opt = $1;
+ } elsif ( /^B<-([^ >]+)/ ) {
+ $opt = $1;
+ } else {
+ next;
+ }
$opt = $1 if $opt =~ /I<(.*)/;
$docopts{$1} = 1;
}
my @unimpl = sort grep { !defined $cmdopts{$_} } keys %docopts;
foreach ( @unimpl ) {
next if defined $skips{$_} || defined $localskips{$_};
- err("$cmd documented but not implemented -$_");
+ err("$doc: $cmd does not implement -$_");
}
}
# Get list of commands.
open FH, "./apps/openssl list -1 -commands|"
- || die "Can't list commands, $!";
+ or die "Can't list commands, $!";
while ( <FH> ) {
chop;
push @commands, $_;
# See if each has a manpage.
foreach my $cmd ( @commands ) {
next if $cmd eq 'help' || $cmd eq 'exit';
- my $doc = "doc/man1/$cmd.pod";
- $doc = "doc/man1/openssl-$cmd.pod" if -f "doc/man1/openssl-$cmd.pod";
+ my $doc = "doc/man1/openssl-$cmd.pod";
+ # Handle "tsget" and "CA.pl" pod pages
+ $doc = "doc/man1/$cmd.pod" if -f "doc/man1/$cmd.pod";
if ( ! -f "$doc" ) {
err("$doc does not exist");
} else {
# See what help is missing.
open FH, "./apps/openssl list --missing-help |"
- || die "Can't list missing help, $!";
+ or die "Can't list missing help, $!";
while ( <FH> ) {
chop;
my ($cmd, $flag) = split;
}
if ( $opt_l ) {
+ foreach my $func ( loadmissing("util/missingcrypto.txt") ) {
+ $name_map{$func} = undef;
+ }
checklinks();
}
# If not given args, check that all man1 commands are named properly.
if ( scalar @ARGV == 0 ) {
- foreach (glob('doc/man1/*.pod')) {
+ foreach ( glob('doc/man1/*.pod') ) {
next if /CA.pl/ || /openssl\.pod/ || /tsget\.pod/;
err("$_ doesn't start with openssl-") unless /openssl-/;
}