Man page update for idmap backend with idmap_rid plug-in.
[Samba/gebeck_regimport.git] / docs / scripts / find_missing_doc.pl
blob545bf140aeedda8ef61bd6d5dd9bf7600069e9f6
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( /<listitem><para><link linkend="([^"]*)"><parameter moreinfo="none">([^<]*)<\/parameter><\/link><\/para><\/listitem>/g ){
18 $doc{$2} = $1;
22 close(IN);
24 chdir($curdir);
26 #################################################
27 # Reading entries from source code
30 open(SOURCE,"$topdir/source/param/loadparm.c") or die("Can't open $topdir/source/param/loadparm.c: $!");
32 while ($ln = <SOURCE>) {
33 last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/;
34 } #burn through the preceding lines
36 while ($ln = <SOURCE>) {
37 last if $ln =~ m/^\s*\}\;\s*$/;
38 #pull in the param names only
39 next if $ln =~ m/.*P_SEPARATOR.*/;
40 next unless $ln =~ /\s*\{\"(.*)\".*/;
42 if($doc{lc($1)}) {
43 $doc{lc($1)} = "FOUND";
44 } else {
45 print "$1 is not documented!\n";
48 close SOURCE;
50 ##################################################
51 # Trying to find missing references
53 foreach (keys %doc) {
54 if($doc{$_} cmp "FOUND") {
55 print "$_ is documented but is not a configuration option!\n";