Skip to content

Commit

Permalink
added new function xmlSchemaValidCtxtGetParserCtxt based on Holger
Browse files Browse the repository at this point in the history
* include/libxml/xmlschemas.h xmlschemas.c: added new function
  xmlSchemaValidCtxtGetParserCtxt based on Holger Kaelberer patch
* doc/apibuild.py doc/*: regenerated the doc, chased why the new
  function didn't got any documentation, added more checking in the
  generator
* include/libxml/relaxng.h include/libxml/schematron.h
  include/libxml/xmlschemas.h include/libxml/c14n.h
  include/libxml/xmlregexp.h include/libxml/globals.h
  include/libxml/xmlreader.h threads.c xmlschemas.c: various changes
  and cleanups following the new reports
Daniel

svn path=/trunk/; revision=3738
  • Loading branch information
Daniel Veillard committed Apr 11, 2008
1 parent 33fe288 commit dee2348
Show file tree
Hide file tree
Showing 30 changed files with 1,519 additions and 1,191 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Fri Apr 11 14:44:00 CEST 2008 Daniel Veillard <[email protected]>

* include/libxml/xmlschemas.h xmlschemas.c: added new function
xmlSchemaValidCtxtGetParserCtxt based on Holger Kaelberer patch
* doc/apibuild.py doc/*: regenerated the doc, chased why the new
function didn't got any documentation, added more checking in the
generator
* include/libxml/relaxng.h include/libxml/schematron.h
include/libxml/xmlschemas.h include/libxml/c14n.h
include/libxml/xmlregexp.h include/libxml/globals.h
include/libxml/xmlreader.h threads.c xmlschemas.c: various changes
and cleanups following the new reports


Thu Apr 10 10:07:00 CEST 2008 Daniel Veillard <[email protected]>

* Makefile.am: extend the cleanup rule
Expand Down
1 change: 1 addition & 0 deletions doc/APIconstructors.html
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@
<a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlCreateURLParserCtxt">xmlCreateURLParserCtxt</a><br />
<a href="html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
</p><h2>Type xmlParserErrors:</h2><p><a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
</p><h2>Type xmlParserInputBufferCreateFilenameFunc:</h2><p><a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a><br />
<a href="html/libxml-globals.html#xmlThrDefParserInputBufferCreateFilenameDefault">xmlThrDefParserInputBufferCreateFilenameDefault</a><br />
Expand Down
1 change: 1 addition & 0 deletions doc/APIfiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,7 @@
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />
Expand Down
1 change: 1 addition & 0 deletions doc/APIfunctions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
Expand Down
1 change: 1 addition & 0 deletions doc/APIsymbols.html
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,7 @@
<a href="html/libxml-schemasInternals.html#xmlSchemaValType">xmlSchemaValType</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />
Expand Down
43 changes: 24 additions & 19 deletions doc/apibuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def analyze(self):
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"""
Expand Down Expand Up @@ -388,7 +388,7 @@ def getline(self):
else:
line = line + n
return line

def getlineno(self):
return self.lineno

Expand Down Expand Up @@ -557,12 +557,12 @@ def token(self):
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):
Expand Down Expand Up @@ -717,7 +717,7 @@ def parseTypeComment(self, name, quiet = 0):
l = string.strip(l)
desc = desc + " " + l
del lines[0]

desc = string.strip(desc)

if quiet == 0:
Expand Down Expand Up @@ -787,7 +787,7 @@ def parseMacroComment(self, name, quiet = 0):
l = string.strip(l)
desc = desc + " " + l
del lines[0]

desc = string.strip(desc)

if quiet == 0:
Expand Down Expand Up @@ -888,7 +888,7 @@ def mergeFunctionComment(self, name, description, quiet = 0):
else:
desc = desc + " " + l
del lines[0]

retdesc = string.strip(retdesc)
desc = string.strip(desc)

Expand All @@ -898,15 +898,15 @@ def mergeFunctionComment(self, name, description, quiet = 0):
#
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":
self.warning("Function comment for %s lacks description of return value" % (name))
if desc == "":
self.warning("Function comment for %s lacks description of the function" % (name))


return(((ret[0], retdesc), args, desc))

def parsePreproc(self, token):
Expand Down Expand Up @@ -966,15 +966,15 @@ def parsePreproc(self, token):
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":
apstr = self.lexer.tokens[0][1]
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":
Expand Down Expand Up @@ -1096,7 +1096,7 @@ def parseTypedef(self, token):
return token
token = self.token()
return token

#
# Parse a C code block, used for functions it parse till
# the balancing } included
Expand Down Expand Up @@ -1131,7 +1131,7 @@ def parseBlock(self, token):
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
Expand Down Expand Up @@ -1264,7 +1264,7 @@ def parseType(self, token):
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"):
Expand All @@ -1284,7 +1284,7 @@ def parseType(self, token):
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]
Expand Down Expand Up @@ -1574,7 +1574,7 @@ def parseGlobal(self, token):
token = self.token()
else:
break

return token

def parse(self):
Expand All @@ -1590,7 +1590,7 @@ def parse(self):
return
self.parseTopComment(self.top_comment)
return self.index


class docBuilder:
"""A documentation builder"""
Expand Down Expand Up @@ -1687,7 +1687,7 @@ def scan(self):
self.headers[file] = None;
self.scanHeaders()
self.scanModules()

def modulename_file(self, file):
module = os.path.basename(file)
if module[-2:] == '.h':
Expand Down Expand Up @@ -1781,7 +1781,7 @@ def serialize_variable(self, output, name):
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:
Expand All @@ -1802,6 +1802,11 @@ def serialize_function(self, output, name):
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:
Expand Down
4 changes: 2 additions & 2 deletions doc/devhelp/libxml2-c14n.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ <h2>Description</h2>
<h2>Details</h2>
<div class="refsect2" lang="en">
<div class="refsect2" lang="en"><h3><a name="xmlC14NIsVisibleCallback"/>Function type xmlC14NIsVisibleCallback</h3><pre class="programlisting">int xmlC14NIsVisibleCallback (void * user_data, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> parent)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature for a C14N callback on visible nodes</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>user data</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the curent node</td></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td>the parent node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node should be included</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlC14NDocDumpMemory"/>xmlC14NDocDumpMemory ()</h3><pre class="programlisting">int xmlC14NDocDumpMemory (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes, <br/> int exclusive, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** inclusive_ns_prefixes, <br/> int with_comments, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** doc_txt_ptr)<br/>
</pre><p>Dumps the canonized image of given XML document into memory. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p>
Expand Down
16 changes: 8 additions & 8 deletions doc/devhelp/libxml2-globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ <h2>Details</h2>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlDeregisterNodeFunc"/>Function type xmlDeregisterNodeFunc</h3><pre class="programlisting">void xmlDeregisterNodeFunc (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature for the deregistration callback of a discarded node</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlOutputBufferCreateFilenameFunc"/>Function type xmlOutputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> xmlOutputBufferCreateFilenameFunc (const char * URI, <br/> <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder, <br/> int compression)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to write to</td></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParserInputBufferCreateFilenameFunc"/>Function type xmlParserInputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> xmlParserInputBufferCreateFilenameFunc (const char * URI, <br/> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to read from</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>the requested source encoding</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegisterNodeFunc"/>Function type xmlRegisterNodeFunc</h3><pre class="programlisting">void xmlRegisterNodeFunc (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature for the registration callback of a created node</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="docbDefaultSAXHandler">Variable </a>docbDefaultSAXHandler</h3><pre class="programlisting"><a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> docbDefaultSAXHandler;
</pre><p/>
Expand Down
8 changes: 4 additions & 4 deletions doc/devhelp/libxml2-relaxng.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ <h2>Details</h2>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityErrorFunc"/>Function type xmlRelaxNGValidityErrorFunc</h3><pre class="programlisting">void xmlRelaxNGValidityErrorFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature of an error callback from a Relax-NG validation</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityWarningFunc"/>Function type xmlRelaxNGValidityWarningFunc</h3><pre class="programlisting">void xmlRelaxNGValidityWarningFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
</pre><p/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
</pre><p>Signature of a warning callback from a Relax-NG validation</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGCleanupTypes"/>xmlRelaxNGCleanupTypes ()</h3><pre class="programlisting">void xmlRelaxNGCleanupTypes (void)<br/>
</pre><p>Cleanup the default Schemas type library associated to RelaxNG</p>
Expand Down
Loading

0 comments on commit dee2348

Please sign in to comment.