diff options
Diffstat (limited to 'doc/apibuild.py')
-rwxr-xr-x | doc/apibuild.py | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/doc/apibuild.py b/doc/apibuild.py index 1e73725..3c38061 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -51,6 +51,7 @@ ignored_files = { "tst.c": "not part of the library", "test.c": "not part of the library", "testdso.c": "test for dynamid shared libraries", + "testrecurse.c": "test for entities recursions", } ignored_words = { @@ -356,7 +357,7 @@ class index: self.analyze_dict("structs", self.structs) self.analyze_dict("typedefs", self.typedefs) self.analyze_dict("macros", self.macros) - + class CLexer: """A lexer for the C language, tokenize the input by reading and analyzing it line by line""" @@ -388,7 +389,7 @@ class CLexer: else: line = line + n return line - + def getlineno(self): return self.lineno @@ -557,12 +558,12 @@ class CLexer: else: break self.tokens.append(('name', line[s:i])) - + tok = self.tokens[0] self.tokens = self.tokens[1:] self.last = tok return tok - + class CParser: """The C module parser""" def __init__(self, filename, idx = None): @@ -717,7 +718,7 @@ class CParser: l = string.strip(l) desc = desc + " " + l del lines[0] - + desc = string.strip(desc) if quiet == 0: @@ -787,7 +788,7 @@ class CParser: l = string.strip(l) desc = desc + " " + l del lines[0] - + desc = string.strip(desc) if quiet == 0: @@ -888,7 +889,7 @@ class CParser: else: desc = desc + " " + l del lines[0] - + retdesc = string.strip(retdesc) desc = string.strip(desc) @@ -898,7 +899,8 @@ class CParser: # i = 0 while i < nbargs: - if args[i][2] == None and args[i][0] != "void" and args[i][1] != None: + if args[i][2] == None and args[i][0] != "void" and \ + ((args[i][1] != None) or (args[i][1] == '')): self.warning("Function comment for %s lacks description of arg %s" % (name, args[i][1])) i = i + 1 if retdesc == "" and ret[0] != "void": @@ -906,7 +908,6 @@ class CParser: if desc == "": self.warning("Function comment for %s lacks description of the function" % (name)) - return(((ret[0], retdesc), args, desc)) def parsePreproc(self, token): @@ -966,7 +967,7 @@ class CParser: try: self.defines.append(apstr) if string.find(apstr, 'ENABLED') != -1: - self.conditionals.append("defined(%s)" % apstr) + self.conditionals.append("defined(%s)" % apstr) except: pass elif name == "#ifndef": @@ -974,7 +975,7 @@ class CParser: try: self.defines.append(apstr) if string.find(apstr, 'ENABLED') != -1: - self.conditionals.append("!defined(%s)" % apstr) + self.conditionals.append("!defined(%s)" % apstr) except: pass elif name == "#if": @@ -1096,7 +1097,7 @@ class CParser: return token token = self.token() return token - + # # Parse a C code block, used for functions it parse till # the balancing } included @@ -1131,7 +1132,7 @@ class CParser: elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXML_": self.index_add_ref(oldtok[1], self.filename, 0, "typedef") - + else: token = self.token() return token @@ -1264,7 +1265,7 @@ class CParser: if token == None: return token - while token[0] == "name" and ( + while token[0] == "name" and ( token[1] == "const" or \ token[1] == "unsigned" or \ token[1] == "signed"): @@ -1284,7 +1285,7 @@ class CParser: self.type = tmp[1] else: self.type = self.type + " " + tmp[1] - + elif token[0] == "name" and token[1] == "struct": if self.type == "": self.type = token[1] @@ -1574,7 +1575,7 @@ class CParser: token = self.token() else: break - + return token def parse(self): @@ -1590,7 +1591,7 @@ class CParser: return self.parseTopComment(self.top_comment) return self.index - + class docBuilder: """A documentation builder""" @@ -1687,7 +1688,7 @@ class docBuilder: self.headers[file] = None; self.scanHeaders() self.scanModules() - + def modulename_file(self, file): module = os.path.basename(file) if module[-2:] == '.h': @@ -1781,7 +1782,7 @@ class docBuilder: else: output.write(" <variable name='%s' file='%s'/>\n" % ( name, self.modulename_file(id.header))) - + def serialize_function(self, output, name): id = self.idx.functions[name] if name == debugsym: @@ -1802,6 +1803,11 @@ class docBuilder: output.write(" <cond>%s</cond>\n"% (apstr)); try: (ret, params, desc) = id.info + if (desc == None or desc == '') and \ + name[0:9] != "xmlThrDef" and name != "xmlDllMain": + print "%s %s from %s has no description" % (id.type, name, + self.modulename_file(id.module)) + output.write(" <info>%s</info>\n" % (escape(desc))) self.indexString(name, desc) if ret[0] != None: |