source: branches/samba-3.3.x/docs-xml/scripts/find_missing_doc.pl

Last change on this file was 217, checked in by Herwig Bauernfeind, 16 years ago

Import Samba 3.3 branch at 3.3.0 level docs-xml (psmedley's port)

File size: 1.3 KB
Line 
1#!/usr/bin/perl
2
3my %doc;
4
5$topdir = (shift @ARGV) or $topdir = ".";
6
7##################################################
8# Reading links from manpage
9
10$curdir = $ENV{PWD};
11
12chdir("smbdotconf");
13
14open(IN,"xsltproc --xinclude --param smb.context ALL generate-context.xsl parameters.all.xml|");
15
16while(<IN>) {
17 if( /<listitem><para><link linkend="([^"]*)"><parameter moreinfo="none">([^<]*)<\/parameter><\/link><\/para><\/listitem>/g ){
18 $doc{$2} = $1;
19 }
20}
21
22close(IN);
23
24chdir($curdir);
25
26#################################################
27# Reading entries from source code
28
29
30open(SOURCE,"$topdir/param/loadparm.c") or die("Can't open $topdir/param/loadparm.c: $!");
31
32while ($ln = <SOURCE>) {
33 last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/;
34} #burn through the preceding lines
35
36while ($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*\{\"(.*)\".*/;
41
42 if($doc{lc($1)}) {
43 $doc{lc($1)} = "FOUND";
44 } else {
45 print "'$1' is not documented\n";
46 }
47}
48close SOURCE;
49
50##################################################
51# Trying to find missing references
52
53foreach (keys %doc) {
54 if($doc{$_} cmp "FOUND") {
55 print "'$_' is documented but is not a configuration option\n";
56 }
57}
Note: See TracBrowser for help on using the repository browser.