Commit f63085de authored by Daniel Veillard's avatar Daniel Veillard

port patch from Marcus Meissner to add gcc checking for printf like

* include/libxml/parser.h include/libxml/xmlwriter.h
  include/libxml/relaxng.h include/libxml/xmlversion.h.in
  include/libxml/xmlwin32version.h.in include/libxml/valid.h
  include/libxml/xmlschemas.h include/libxml/xmlerror.h:
  port patch from Marcus Meissner to add gcc checking for
  printf like functions parameters, should fix #65068
* doc/apibuild.py doc/*: modified the script accordingly
  and regenerated
* xpath.c xmlmemory.c threads.c: fix a few warnings
Daniel

svn path=/trunk/; revision=3813
parent d032a5bc
Sun Jan 18 21:48:28 CET 2009 Daniel Veillard <daniel@veillard.com>
* include/libxml/parser.h include/libxml/xmlwriter.h
include/libxml/relaxng.h include/libxml/xmlversion.h.in
include/libxml/xmlwin32version.h.in include/libxml/valid.h
include/libxml/xmlschemas.h include/libxml/xmlerror.h:
port patch from Marcus Meissner to add gcc checking for
printf like functions parameters, should fix #65068
* doc/apibuild.py doc/*: modified the script accordingly
and regenerated
* xpath.c xmlmemory.c threads.c: fix a few warnings
Sun Jan 18 20:40:42 CET 2009 Daniel Veillard <daniel@veillard.com>
* include/libxml/xmlwin32version.h.in: windows header should
......
......@@ -72,7 +72,8 @@ ignored_words = {
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
"LIBEXSLT_PUBLIC": (0, "macro keyword"),
"X_IN_Y": (5, "macro function builder"),
"ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc chaking extension"),
"ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc checking extension"),
"ATTRIBUTE_PRINTF": (5, "macro for gcc printf args checking extension"),
}
def escape(raw):
......
......@@ -268,7 +268,7 @@ void <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a> (<a href="libxml2-tre
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XML_MAX_TEXT_LENGHT">Macro </a>XML_MAX_TEXT_LENGHT</h3><pre class="programlisting">#define <a href="#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a>;
</pre><p/>
</pre><p>Maximum size allowed for a single text node when building a tree. This is not a limitation of the parser but a safety boundary feature, use <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> option to override it.</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XML_SUBSTITUTE_BOTH">Macro </a>XML_SUBSTITUTE_BOTH</h3><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_BOTH">XML_SUBSTITUTE_BOTH</a>;
......
......@@ -44,7 +44,7 @@
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">#define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a>;
#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a>;
#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a>;
#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a>;
#define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a>;
#define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a>;
......@@ -53,8 +53,8 @@
#define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a>;
#define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a>;
#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a>;
#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a>;
#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a>;
#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a>;
#define <a href="#ATTRIBUTE_PRINTF">ATTRIBUTE_PRINTF</a>;
#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a>;
#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a>;
#define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a>;
......@@ -70,11 +70,13 @@
#define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a>;
#define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a>;
#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a>;
#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a>;
#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a>;
#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a>;
#define <a href="#LIBXML_AUTOMATA_ENABLED">LIBXML_AUTOMATA_ENABLED</a>;
#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a>;
#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a>;
#define <a href="#ATTRIBUTE_ALLOC_SIZE">ATTRIBUTE_ALLOC_SIZE</a>;
#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a>;
#define <a href="#LIBXML_C14N_ENABLED">LIBXML_C14N_ENABLED</a>;
#define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a>;
#define <a href="#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a>;
......@@ -93,6 +95,14 @@ void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version);
<div class="refsect1" lang="en">
<h2>Details</h2>
<div class="refsect2" lang="en">
<div class="refsect2" lang="en"><h3><a name="ATTRIBUTE_ALLOC_SIZE">Macro </a>ATTRIBUTE_ALLOC_SIZE</h3><pre class="programlisting">#define <a href="#ATTRIBUTE_ALLOC_SIZE">ATTRIBUTE_ALLOC_SIZE</a>;
</pre><p>Macro used to indicate to GCC this is an allocator function</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="ATTRIBUTE_PRINTF">Macro </a>ATTRIBUTE_PRINTF</h3><pre class="programlisting">#define <a href="#ATTRIBUTE_PRINTF">ATTRIBUTE_PRINTF</a>;
</pre><p>Macro used to indicate to GCC the parameter are printf like</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="ATTRIBUTE_UNUSED">Macro </a>ATTRIBUTE_UNUSED</h3><pre class="programlisting">#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a>;
</pre><p>Macro used to signal to GCC unused function parameters</p>
</div>
......
......@@ -52,6 +52,8 @@
</sub>
</chapters>
<functions>
<function name="ATTRIBUTE_ALLOC_SIZE" link="libxml2-xmlversion.html#ATTRIBUTE_ALLOC_SIZE"/>
<function name="ATTRIBUTE_PRINTF" link="libxml2-xmlversion.html#ATTRIBUTE_PRINTF"/>
<function name="ATTRIBUTE_UNUSED" link="libxml2-xmlversion.html#ATTRIBUTE_UNUSED"/>
<function name="BAD_CAST" link="libxml2-xmlstring.html#BAD_CAST"/>
<function name="BASE_BUFFER_SIZE" link="libxml2-tree.html#BASE_BUFFER_SIZE"/>
......
......@@ -3336,7 +3336,7 @@
<description>compile-time version informations for the XML library </description>
<author>Daniel Veillard </author>
<exports symbol='LIBXML_VERSION_EXTRA' type='macro'/>
<exports symbol='LIBXML_MODULES_ENABLED' type='macro'/>
<exports symbol='LIBXML_DOCB_ENABLED' type='macro'/>
<exports symbol='LIBXML_LEGACY_ENABLED' type='macro'/>
<exports symbol='LIBXML_READER_ENABLED' type='macro'/>
<exports symbol='LIBXML_THREAD_ENABLED' type='macro'/>
......@@ -3345,8 +3345,8 @@
<exports symbol='LIBXML_DEBUG_ENABLED' type='macro'/>
<exports symbol='LIBXML_XINCLUDE_ENABLED' type='macro'/>
<exports symbol='ATTRIBUTE_UNUSED' type='macro'/>
<exports symbol='LIBXML_DOCB_ENABLED' type='macro'/>
<exports symbol='LIBXML_PUSH_ENABLED' type='macro'/>
<exports symbol='LIBXML_MODULES_ENABLED' type='macro'/>
<exports symbol='ATTRIBUTE_PRINTF' type='macro'/>
<exports symbol='LIBXML_SAX1_ENABLED' type='macro'/>
<exports symbol='WITHOUT_TRIO' type='macro'/>
<exports symbol='LIBXML_SCHEMATRON_ENABLED' type='macro'/>
......@@ -3362,11 +3362,13 @@
<exports symbol='LIBXML_MODULE_EXTENSION' type='macro'/>
<exports symbol='LIBXML_ICONV_ENABLED' type='macro'/>
<exports symbol='LIBXML_HTML_ENABLED' type='macro'/>
<exports symbol='LIBXML_WRITER_ENABLED' type='macro'/>
<exports symbol='LIBXML_UNICODE_ENABLED' type='macro'/>
<exports symbol='LIBXML_FTP_ENABLED' type='macro'/>
<exports symbol='LIBXML_AUTOMATA_ENABLED' type='macro'/>
<exports symbol='LIBXML_ZLIB_ENABLED' type='macro'/>
<exports symbol='LIBXML_WRITER_ENABLED' type='macro'/>
<exports symbol='ATTRIBUTE_ALLOC_SIZE' type='macro'/>
<exports symbol='LIBXML_PUSH_ENABLED' type='macro'/>
<exports symbol='LIBXML_C14N_ENABLED' type='macro'/>
<exports symbol='LIBXML_SCHEMAS_ENABLED' type='macro'/>
<exports symbol='DEBUG_MEMORY_LOCATION' type='macro'/>
......@@ -3766,6 +3768,12 @@
</file>
</files>
<symbols>
<macro name='ATTRIBUTE_ALLOC_SIZE' file='xmlversion'>
<info>Macro used to indicate to GCC this is an allocator function</info>
</macro>
<macro name='ATTRIBUTE_PRINTF' file='xmlversion'>
<info>Macro used to indicate to GCC the parameter are printf like</info>
</macro>
<macro name='ATTRIBUTE_UNUSED' file='xmlversion'>
<info>Macro used to signal to GCC unused function parameters</info>
</macro>
......@@ -4109,6 +4117,7 @@
<info>Identifiers can be longer, but this will be more costly at runtime.</info>
</macro>
<macro name='XML_MAX_TEXT_LENGHT' file='parserInternals'>
<info>Maximum size allowed for a single text node when building a tree. This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it.</info>
</macro>
<macro name='XML_SAX2_MAGIC' file='parser'>
<info>Special constant found in SAX2 blocks initialized fields</info>
<?xml version="1.0" encoding="ISO-8859-1"?>
<apirefs name='libxml2'>
<references>
<reference name='ATTRIBUTE_ALLOC_SIZE' href='html/libxml-xmlversion.html#ATTRIBUTE_ALLOC_SIZE'/>
<reference name='ATTRIBUTE_PRINTF' href='html/libxml-xmlversion.html#ATTRIBUTE_PRINTF'/>
<reference name='ATTRIBUTE_UNUSED' href='html/libxml-xmlversion.html#ATTRIBUTE_UNUSED'/>
<reference name='BAD_CAST' href='html/libxml-xmlstring.html#BAD_CAST'/>
<reference name='BASE_BUFFER_SIZE' href='html/libxml-tree.html#BASE_BUFFER_SIZE'/>
......@@ -3526,6 +3528,8 @@
</references>
<alpha>
<letter name='A'>
<ref name='ATTRIBUTE_ALLOC_SIZE'/>
<ref name='ATTRIBUTE_PRINTF'/>
<ref name='ATTRIBUTE_UNUSED'/>
</letter>
<letter name='B'>
......@@ -13782,6 +13786,8 @@
<ref name='xmlUCSIsYijingHexagramSymbols'/>
</file>
<file name='xmlversion'>
<ref name='ATTRIBUTE_ALLOC_SIZE'/>
<ref name='ATTRIBUTE_PRINTF'/>
<ref name='ATTRIBUTE_UNUSED'/>
<ref name='DEBUG_MEMORY_LOCATION'/>
<ref name='LIBXML_AUTOMATA_ENABLED'/>
......@@ -15751,6 +15757,8 @@
</letter>
<letter name='G'>
<word name='GCC'>
<ref name='ATTRIBUTE_ALLOC_SIZE'/>
<ref name='ATTRIBUTE_PRINTF'/>
<ref name='ATTRIBUTE_UNUSED'/>
</word>
<word name='GEDecl'>
......@@ -16322,6 +16330,9 @@
<ref name='_xmlParserCtxt'/>
<ref name='_xmlValidCtxt'/>
</word>
<word name='Maximum'>
<ref name='XML_MAX_TEXT_LENGHT'/>
</word>
<word name='May'>
<ref name='xmlURIEscape'/>
</word>
......@@ -18370,6 +18381,9 @@
<word name='XML_ERR_OK'>
<ref name='xmlParseInNodeContext'/>
</word>
<word name='XML_PARSE_HUGE'>
<ref name='XML_MAX_TEXT_LENGHT'/>
</word>
<word name='XML_SCHEMAS_ELEM_GLOBAL'>
<ref name='XML_SCHEMAS_ELEM_TOPLEVEL'/>
</word>
......@@ -18869,6 +18883,7 @@
<ref name='xmlParserInputDeallocate'/>
</word>
<word name='allocator'>
<ref name='ATTRIBUTE_ALLOC_SIZE'/>
<ref name='DEBUG_MEMORY'/>
</word>
<word name='allocators'>
......@@ -18901,6 +18916,7 @@
<ref name='xmlSkipBlankChars'/>
</word>
<word name='allowed'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='_htmlElemDesc'/>
<ref name='_xmlElement'/>
<ref name='_xmlSchemaWildcard'/>
......@@ -19566,6 +19582,7 @@
<ref name='xmlSearchNs'/>
</word>
<word name='boundary'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='xmlParseElementChildrenContentDecl'/>
<ref name='xmlParseElementMixedContentDecl'/>
</word>
......@@ -19631,6 +19648,7 @@
<ref name='XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED'/>
</word>
<word name='building'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='_xmlParserCtxt'/>
<ref name='docbSAXParseDoc'/>
<ref name='docbSAXParseFile'/>
......@@ -22485,6 +22503,7 @@
<ref name='xmlNewElementContent'/>
</word>
<word name='feature'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='xmlGetFeature'/>
<ref name='xmlGetFeaturesList'/>
<ref name='xmlHasFeature'/>
......@@ -23632,6 +23651,8 @@
<ref name='xmlXPtrNewRange'/>
</word>
<word name='indicate'>
<ref name='ATTRIBUTE_ALLOC_SIZE'/>
<ref name='ATTRIBUTE_PRINTF'/>
<ref name='xmlParseExternalID'/>
<ref name='xmlParserInputGrow'/>
<ref name='xmlParserInputRead'/>
......@@ -24401,6 +24422,7 @@
<ref name='xmlExpCtxtNbCons'/>
</word>
<word name='like'>
<ref name='ATTRIBUTE_PRINTF'/>
<ref name='IS_CHAR_CH'/>
<ref name='IS_DIGIT_CH'/>
<ref name='IS_EXTENDER_CH'/>
......@@ -24422,6 +24444,9 @@
<ref name='xmlDecodeEntities'/>
<ref name='xmlPatternMaxDepth'/>
</word>
<word name='limitation'>
<ref name='XML_MAX_TEXT_LENGHT'/>
</word>
<word name='limited'>
<ref name='_htmlElemDesc'/>
</word>
......@@ -25776,6 +25801,7 @@
<ref name='xmlXPathNodeSetAddUnique'/>
</word>
<word name='option'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='xmlDOMWrapAdoptNode'/>
<ref name='xmlDOMWrapCloneNode'/>
<ref name='xmlDOMWrapReconcileNamespaces'/>
......@@ -25911,6 +25937,7 @@
<ref name='_xmlParserInput'/>
</word>
<word name='override'>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='resolveEntity'/>
<ref name='resolveEntitySAXFunc'/>
<ref name='xmlCatalogAdd'/>
......@@ -27626,6 +27653,9 @@
<ref name='xmlLoadCatalog'/>
<ref name='xmlLoadCatalogs'/>
</word>
<word name='safety'>
<ref name='XML_MAX_TEXT_LENGHT'/>
</word>
<word name='same'>
<ref name='HTML_COMMENT_NODE'/>
<ref name='HTML_ENTITY_REF_NODE'/>
......@@ -28102,6 +28132,7 @@
</word>
<word name='single'>
<ref name='IS_DIGIT_CH'/>
<ref name='XML_MAX_TEXT_LENGHT'/>
<ref name='xmlCurrentChar'/>
<ref name='xmlParseAttValue'/>
<ref name='xmlParseElementMixedContentDecl'/>
......@@ -594,7 +594,7 @@ typedef void (*cdataBlockSAXFunc) (
* Display and format a warning messages, callback.
*/
typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
const char *msg, ...);
const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* errorSAXFunc:
* @ctx: an XML parser context
......@@ -604,7 +604,7 @@ typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
* Display and format an error messages, callback.
*/
typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
const char *msg, ...);
const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* fatalErrorSAXFunc:
* @ctx: an XML parser context
......@@ -616,7 +616,7 @@ typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
* get all the callbacks for errors.
*/
typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx,
const char *msg, ...);
const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* isStandaloneSAXFunc:
* @ctx: the user data (XML parser context)
......
......@@ -32,7 +32,7 @@ typedef xmlRelaxNG *xmlRelaxNGPtr;
*
* Signature of an error callback from a Relax-NG validation
*/
typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* xmlRelaxNGValidityWarningFunc:
......@@ -42,7 +42,7 @@ typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg
*
* Signature of a warning callback from a Relax-NG validation
*/
typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* A schemas validation context
......@@ -114,27 +114,27 @@ typedef enum {
XMLPUBFUN int XMLCALL
xmlRelaxNGInitTypes (void);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGCleanupTypes (void);
/*
* Interfaces for parsing.
*/
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
xmlRelaxNGNewParserCtxt (const char *URL);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
xmlRelaxNGNewMemParserCtxt (const char *buffer,
int size);
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
int flag);
int flag);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc err,
xmlRelaxNGValidityWarningFunc warn,
......@@ -149,12 +149,12 @@ XMLPUBFUN void XMLCALL
xmlRelaxNGParserCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void *ctx);
XMLPUBFUN xmlRelaxNGPtr XMLCALL
XMLPUBFUN xmlRelaxNGPtr XMLCALL
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGFree (xmlRelaxNGPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGDump (FILE *output,
xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
......@@ -164,12 +164,12 @@ XMLPUBFUN void XMLCALL
/*
* Interfaces for validating
*/
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc err,
xmlRelaxNGValidityWarningFunc warn,
void *ctx);
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc *err,
xmlRelaxNGValidityWarningFunc *warn,
......@@ -177,29 +177,29 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
xmlStructuredErrorFunc serror, void *ctx);
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
xmlDocPtr doc);
xmlDocPtr doc);
/*
* Interfaces for progressive validation when possible
*/
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem);
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
const xmlChar *data,
int len);
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem);
XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem);
......
......@@ -41,7 +41,7 @@ typedef xmlValidState *xmlValidStatePtr;
*/
typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
const char *msg,
...);
...) ATTRIBUTE_PRINTF(2,3);
/**
* xmlValidityWarningFunc:
......@@ -56,7 +56,7 @@ typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
*/
typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
const char *msg,
...);
...) ATTRIBUTE_PRINTF(2,3);
#ifdef IN_LIBXML
/**
......
......@@ -61,7 +61,7 @@ typedef enum {
XML_FROM_CHECK, /* The error checking module */
XML_FROM_WRITER, /* The xmlwriter module */
XML_FROM_MODULE, /* The dynamically loaded module module*/
XML_FROM_I18N, /* The module handling character conversion */
XML_FROM_I18N, /* The module handling character conversion */
XML_FROM_SCHEMATRONV /* The Schematron validator module */
} xmlErrorDomain;
......@@ -645,7 +645,7 @@ typedef enum {
XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */
XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */
XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */
XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */
XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */
XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */
XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */
XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */
......@@ -670,7 +670,7 @@ typedef enum {
XML_SCHEMAV_CVC_IDC, /* 1877 */
XML_SCHEMAV_CVC_WILDCARD, /* 1878 */
XML_SCHEMAV_MISC, /* 1879 */
XML_XPTR_UNKNOWN_SCHEME = 1900,
XML_XPTR_UNKNOWN_SCHEME = 1900,
XML_XPTR_CHILDSEQ_START, /* 1901 */
XML_XPTR_EVAL_FAILED, /* 1902 */
XML_XPTR_EXTRA_OBJECTS, /* 1903 */
......@@ -691,15 +691,15 @@ typedef enum {
XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */
XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */
XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */
XML_SCHEMAP_SRC_RESOLVE, /* 3004 */
XML_SCHEMAP_SRC_RESOLVE, /* 3004 */
XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */
XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */
XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */
XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */
XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */
XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */
XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */
XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */
XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */
XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */
XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */
......@@ -718,7 +718,7 @@ typedef enum {
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */
XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */
XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */
XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */
......@@ -737,14 +737,14 @@ typedef enum {
XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */
XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */
XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */
XML_SCHEMAP_SRC_INCLUDE, /* 3050 */
XML_SCHEMAP_SRC_INCLUDE, /* 3050 */
XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */
XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */
XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */
XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */
XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */
XML_SCHEMAP_NO_XMLNS, /* 3056 */
XML_SCHEMAP_NO_XSI, /* 3057 */
XML_SCHEMAP_NO_XSI, /* 3057 */
XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */
XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */
XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */
......@@ -843,7 +843,7 @@ typedef enum {
*/
typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
const char *msg,
...);
...) ATTRIBUTE_PRINTF(2,3);
/**
* xmlStructuredErrorFunc:
* @userData: user provided data for the error callback
......@@ -858,38 +858,38 @@ typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr erro
* Use the following function to reset the two global variables
* xmlGenericError and xmlGenericErrorContext.
*/
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlSetGenericErrorFunc (void *ctx,
xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlSetStructuredErrorFunc (void *ctx,
xmlStructuredErrorFunc handler);
/*
* Default message routines used by SAX and Valid context for error
* and warning reporting.
*/
XMLPUBFUN void XMLCDECL
XMLPUBFUN void XMLCDECL
xmlParserError (void *ctx,
const char *msg,
...);
XMLPUBFUN void XMLCDECL
...) ATTRIBUTE_PRINTF(2,3);
XMLPUBFUN void XMLCDECL
xmlParserWarning (void *ctx,
const char *msg,
...);
XMLPUBFUN void XMLCDECL
...) ATTRIBUTE_PRINTF(2,3);
XMLPUBFUN void XMLCDECL
xmlParserValidityError (void *ctx,
const char *msg,
...);
XMLPUBFUN void XMLCDECL
...) ATTRIBUTE_PRINTF(2,3);
XMLPUBFUN void XMLCDECL
xmlParserValidityWarning (void *ctx,
const char *msg,
...);
XMLPUBFUN void XMLCALL
...) ATTRIBUTE_PRINTF(2,3);
XMLPUBFUN void XMLCALL
xmlParserPrintFileInfo (xmlParserInputPtr input);
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlParserPrintFileContext (xmlParserInputPtr input);
/*
......@@ -907,19 +907,19 @@ XMLPUBFUN void XMLCALL
xmlResetError (xmlErrorPtr err);
XMLPUBFUN int XMLCALL
xmlCopyError (xmlErrorPtr from,
xmlErrorPtr to);
xmlErrorPtr to);
#ifdef IN_LIBXML
/*
* Internal callback reporting routine
*/
XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
__xmlRaiseError (xmlStructuredErrorFunc schannel,
xmlGenericErrorFunc channel,
void *data,
xmlGenericErrorFunc channel,
void *data,
void *ctx,
void *node,
int domain,
void *node,
int domain,
int code,
xmlErrorLevel level,
const char *file,
......@@ -930,10 +930,10 @@ XMLPUBFUN void XMLCALL
int int1,
int col,
const char *msg,
...);
XMLPUBFUN void XMLCALL
...) ATTRIBUTE_PRINTF(16,17);
XMLPUBFUN void XMLCALL
__xmlSimpleError (int domain,
int code,
int code,
xmlNodePtr node,
const char *msg,
const char *extra);
......
......@@ -92,7 +92,7 @@ typedef xmlSchema *xmlSchemaPtr;
*
* Signature of an error callback from an XSD validation
*/
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* xmlSchemaValidityWarningFunc:
......@@ -102,7 +102,7 @@ typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg,
*
* Signature of a warning callback from an XSD validation
*/
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
/**
* A schemas validation context
......
......@@ -382,18 +382,27 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#define LIBXML_ZLIB_ENABLED
#endif
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((unused))
#endif
/**
* ATTRIBUTE_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#ifndef ATTRIBUTE_ALLOC_SIZE
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
# define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
......@@ -403,10 +412,43 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#else
# define ATTRIBUTE_ALLOC_SIZE(x)
#endif
/**
* ATTRIBUTE_PRINTF:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#ifndef ATTRIBUTE_PRINTF
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define ATTRIBUTE_PRINTF(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
# else
# define ATTRIBUTE_PRINTF(fmt,args)
# endif
#else
# define ATTRIBUTE_PRINTF(fmt,args)
#endif
#else /* ! __GNUC__ */
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#define ATTRIBUTE_UNUSED
/**
* ATTRIBUTE_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#define ATTRIBUTE_ALLOC_SIZE(x)
#endif
/**
* ATTRIBUTE_PRINTF:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#define ATTRIBUTE_PRINTF(fmt,args)
#endif /* __GNUC__ */
#ifdef __cplusplus
}
......
......@@ -242,18 +242,27 @@ extern void xmlCheckVersion(int version);
#endif
#endif
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED
#endif
/**
* ATTRIBUTE_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/