vfs: Implement a sys_acl_blob_get_{fd,file} for POSIX ACL backends
[Samba/gebeck_regimport.git] / docs-xml / scripts / find_missing_doc
blobd75ef8dcc72a938ac3fd7f594c521f61caaf520d
1 #!/usr/bin/python
3 # Copyright (C) 2007,2012 Jelmer Vernooij <jelmer@samba.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 import optparse
20 import os
21 import re
23 parser = optparse.OptionParser("source_dir")
25 (opts, args) = parser.parse_args()
27 if len(args) == 1:
28 topdir = args[0]
29 else:
30 topdir = "."
32 # Reading links from manpage
34 curdir = os.getcwd()
35 doc = {}
37 os.chdir("smbdotconf");
39 f = os.popen("xsltproc --xinclude --param smb.context ALL generate-context.xsl parameters.all.xml", "r")
40 try:
41 for l in f.readlines():
42 m = re.match('<samba:parameter .*?name="([^"]*?)"', l)
43 if m:
44 name = m.group(1).replace(" ", "")
45 doc[name] = False
46 finally:
47 f.close()
49 os.chdir(curdir)
51 # Reading entries from source code
53 f = open(os.path.join(topdir, "lib/param/param_table.c"), "r")
55 # burn through the preceding lines
56 while True:
57 l = f.readline()
58 if l.startswith("static struct parm_struct parm_table"):
59 break
61 for l in f.readlines():
62 if re.match("^\s*\}\;\s*$", l):
63 break
64 # pull in the param names only
65 if re.match(".*P_SEPARATOR.*", l):
66 continue
67 m = re.match("\s*\.label\s*=\s*\"(.*)\".*", l)
68 if not m:
69 continue
71 name = m.group(1)
72 name = name.replace(" ", "")
74 if name.lower() in doc:
75 doc[name.lower()] = True
76 else:
77 print "'%s' is not documented" % name
78 f.close()
80 # Try to find missing references
81 for key in doc.keys():
82 if doc[key] == "FOUND":
83 print "'$_' is documented but is not a configuration option"