Free protect_ids in secret_store_domain_sid() as the caller of fetch_secrets() must...
[Samba/gebeck_regimport.git] / docs-xml / scripts / find_missing_doc.pl
blob6ce547be3edea0bfd5498de60daba58de2e47e97
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/lib/param/param_table.c") or die("Can't open $topdir/lib/param/param_table.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";