Unify d2i/i2d documentation.
[openssl.git] / util / find-doc-nits.pl
index b0fab953539a913add600980153b8a1115089f48..cd30dfeb26f51e6e6ab47f46f46bffa35ce85bcc 100755 (executable)
@@ -48,10 +48,24 @@ sub name_synopsis()
     $tmp =~ tr/\n/ /;
     $tmp =~ s/-.*//g;
     $tmp =~ s/,//g;
+
+    my $dirname = dirname($filename);
+    my $simplename = basename($filename);
+    $simplename =~ s/.pod$//;
+    my $foundfilename = 0;
+    my %foundfilenames = ();
     my %names;
     foreach my $n ( split ' ', $tmp ) {
         $names{$n} = 1;
+        $foundfilename++ if $n eq $simplename;
+        $foundfilenames{$n} = 1
+            if -f "$dirname/$n.pod" && $n ne $simplename;
     }
+    print "$id the following exist as other .pod files:\n",
+        join(" ", sort keys %foundfilenames), "\n"
+        if %foundfilenames;
+    print "$id $simplename (filename) missing from NAME section\n",
+        unless $foundfilename;
 
     # Find all functions in SYNOPSIS
     return unless $contents =~ /=head1 SYNOPSIS(.*)=head1 DESCRIPTION/ms;
@@ -86,7 +100,8 @@ sub check()
 
     my $id = "${filename}:1:";
 
-    &name_synopsis($id, $filename, $contents);
+    &name_synopsis($id, $filename, $contents)
+        unless $contents =~ /=for comment generic/;
 
     print "$id doesn't start with =pod\n"
         if $contents !~ /^=pod/;