diff options
author | Rich Salz <rsalz@openssl.org> | 2016-06-09 17:02:59 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-09 17:03:30 -0400 |
commit | 8162f6f58aa784e242941d1168fb8fc0618cf0a2 (patch) | |
tree | 97c766e40155594a47631d733bbbf45e02a529d2 /util/find-doc-nits.pl | |
parent | 53934822ac7acf69dde54a070eacd1c77cf079ff (diff) |
More API docs; small changes.
Also fix typo noted on GitHub.
Suppport typedef and #define to find-doc-nits
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'util/find-doc-nits.pl')
-rwxr-xr-x | util/find-doc-nits.pl | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/util/find-doc-nits.pl b/util/find-doc-nits.pl index cd30dfeb26..69d7c93521 100755 --- a/util/find-doc-nits.pl +++ b/util/find-doc-nits.pl @@ -38,10 +38,6 @@ sub name_synopsis() my $filename = shift; my $contents = shift; - # If it's a generic page (all lowercase), or apps, skip it. - return if $filename =~ /[a-z]+\.pod/; - return if $filename =~ m@/apps/@; - # Get NAME section and all words in it. return unless $contents =~ /=head1 NAME(.*)=head1 SYNOPSIS/ms; my $tmp = $1; @@ -71,12 +67,21 @@ sub name_synopsis() return unless $contents =~ /=head1 SYNOPSIS(.*)=head1 DESCRIPTION/ms; my $syn = $1; foreach my $line ( split /\n+/, $syn ) { - next if $line =~ /typedef/; - next if $line =~ /STACK_OF/; - next unless $line =~ /([A-Za-z0-9_]+)\(/; - print "$id $1 missing from NAME section\n" - unless defined $names{$1}; - $names{$1} = 2; + my $sym; + $line =~ s/STACK_OF\([^)]+\)//; + if ( $line =~ /typedef.* (\S+);/ ) { + $sym = $1; + } elsif ( $line =~ /#define (\S+)/ ) { + $sym = $1; + } elsif ( $line =~ /([A-Za-z0-9_]+)\(/ ) { + $sym = $1; + } + else { + next; + } + print "$id $sym missing from NAME section\n" + unless defined $names{$sym}; + $names{$sym} = 2; } foreach my $n ( keys %names ) { @@ -101,7 +106,9 @@ sub check() my $id = "${filename}:1:"; &name_synopsis($id, $filename, $contents) - unless $contents =~ /=for comment generic/; + unless $contents =~ /=for comment generic/ + or $contents =~ /=for comment openssl_manual_section:7/ + or $filename =~ m@/apps/@; print "$id doesn't start with =pod\n" if $contents !~ /^=pod/; |