printing: explicitly clear PUBLISHED attribute
[Samba.git] / docs-xml / scripts / find_missing_doc.pl
blob3d0c345a5d67a45bff6034d72d281d6c1f393dfb
1 #!/usr/bin/perl
3 my %doc;
5 $topdir = (shift @ARGV) or $topdir = ".";
7 ##################################################
8 # Reading links from manpage
10 $curdir = $ENV{PWD};
12 chdir("smbdotconf");
14 open(IN,"xsltproc --xinclude --param smb.context ALL generate-context.xsl parameters.all.xml|");
16 while(<IN>) {
17 if( /<samba:parameter .*?name="([^"]*?)"/g ){
18 my $name = $1;
19 $name =~ s/ //g;
20 $doc{$name} = "NOTFOUND";
24 close(IN);
26 chdir($curdir);
28 #################################################
29 # Reading entries from source code
32 open(SOURCE,"$topdir/param/loadparm.c") or die("Can't open $topdir/param/loadparm.c: $!");
34 while ($ln = <SOURCE>) {
35 last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/;
36 } #burn through the preceding lines
38 while ($ln = <SOURCE>) {
39 last if $ln =~ m/^\s*\}\;\s*$/;
40 #pull in the param names only
41 next if $ln =~ m/.*P_SEPARATOR.*/;
42 next unless $ln =~ /\s*\.label\s*=\s*\"(.*)\".*/;
44 my $name = $1;
45 $name =~ s/ //g;
47 if($doc{lc($name)}) {
48 $doc{lc($name)} = "FOUND";
49 } else {
50 print "'$name' is not documented\n";
53 close SOURCE;
55 ##################################################
56 # Trying to find missing references
58 foreach (keys %doc) {
59 if($doc{$_} cmp "FOUND") {
60 print "'$_' is documented but is not a configuration option\n";