+ while ( <$IN> ) {
+ next if /\bNOEXIST\b/;
+ next if /\bEXPORT_VAR_AS_FUNC\b/;
+ push @apis, $1 if /([^\s]+).\s/;
+ }
+
+ close $IN;
+
+ print "# Found ", scalar(@apis), " in $file\n";
+ return sort @apis;
+}
+
+sub getdocced()
+{
+ my $dir = shift;
+ my %return;
+
+ foreach my $pod ( glob("$dir/*.pod") ) {
+ my %podinfo = extract_pod_info($pod);
+ foreach my $n ( @{$podinfo{names}} ) {
+ $return{$n} = $pod;
+ print "# Duplicate $n in $pod and $dups{$n}\n"
+ if defined $dups{$n} && $dups{$n} ne $pod;
+ $dups{$n} = $pod;
+ }
+ }
+
+ return %return;
+}
+
+my %docced;
+
+sub printem()
+{
+ my $libname = shift;
+ my $numfile = shift;
+ my $count = 0;
+
+ foreach my $func ( &parsenum($numfile) ) {
+ next if $docced{$func};
+
+ # Skip ASN1 utilities
+ next if $func =~ /^ASN1_/;
+
+ print "$libname:$func\n";
+ $count++;
+ }
+ print "# Found $count missing from $numfile\n\n";
+}
+
+
+getopts('nshu');
+
+&help() if ( $opt_h );
+
+die "Need one of -n -s or -u flags.\n"
+ unless $opt_n or $opt_s or $opt_u;
+
+if ( $opt_n or $opt_s ) {
+ foreach (@ARGV ? @ARGV : glob('doc/*/*.pod')) {
+ &check($_);
+ }
+}
+if ( $opt_u ) {
+ my %temp = &getdocced('doc/man3');
+ foreach ( keys %temp ) {
+ $docced{$_} = $temp{$_};
+ }
+ &printem('crypto', 'util/libcrypto.num');
+ &printem('ssl', 'util/libssl.num');