From d4d4705780933c7ad181a7bd902c91d1d1adaba3 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 18 Jan 2009 17:26:02 +0000 Subject: [PATCH] apply patch from Marcus Meissner to add gcc attribute alloc_size should * include/libxml/xmlversion.h.in include/libxml/xmlmemory.h: apply patch from Marcus Meissner to add gcc attribute alloc_size should fix #552505 * doc/apibuild.py doc/* testapi.c: regenerate the API * include/libxml/parserInternals.h: fix a comment problem raised by apibuild.py daniel svn path=/trunk/; revision=3811 --- ChangeLog | 9 +++++ doc/APIchunk2.html | 3 ++ doc/APIchunk22.html | 27 +------------ doc/APIchunk3.html | 2 + doc/APIchunk4.html | 5 +++ doc/APIchunk8.html | 1 + doc/APIchunk9.html | 2 + doc/APIfiles.html | 2 + doc/APIsymbols.html | 2 + doc/apibuild.py | 1 + doc/devhelp/libxml2-parser.html | 3 +- doc/devhelp/libxml2-parserInternals.html | 5 +++ doc/devhelp/libxml2-valid.html | 4 +- doc/devhelp/libxml2.devhelp | 2 + doc/html/libxml-parser.html | 1 + doc/html/libxml-parserInternals.html | 3 +- doc/html/libxml-valid.html | 4 +- doc/libxml2-api.xml | 17 +++++--- doc/libxml2-refs.xml | 50 +++++++++++------------- include/libxml/parserInternals.h | 2 +- include/libxml/xmlmemory.h | 8 ++-- include/libxml/xmlversion.h.in | 10 +++++ testapi.c | 4 +- 23 files changed, 94 insertions(+), 73 deletions(-) diff --git a/ChangeLog b/ChangeLog index 334d8485..889b3614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sun Jan 18 18:22:33 CET 2009 Daniel Veillard + + * include/libxml/xmlversion.h.in include/libxml/xmlmemory.h: + apply patch from Marcus Meissner to add gcc attribute alloc_size + should fix #552505 + * doc/apibuild.py doc/* testapi.c: regenerate the API + * include/libxml/parserInternals.h: fix a comment problem raised + by apibuild.py + Sun Jan 18 16:39:01 CET 2009 Daniel Veillard * threads.c: also remove pthread key when stopping thread diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index aeb315a8..e8f243fe 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -199,11 +199,13 @@ A:link, A:visited, A:active { text-decoration: underline }

Letter E:

ELEMENT
_xmlElementContent
EMPTY
xmlParseElementContentDecl
ENTITIES
xmlParseAttributeType
+xmlValidateAttributeValue
xmlValidateDtdFinal
ENTITY
htmlParseEntityRef
xmlParseAttributeType
xmlParseEntityRef
xmlParseEntityValue
+xmlValidateAttributeValue
xmlValidateDtdFinal
ENTITY_REF
xmlNodeBufGetContent
xmlNodeGetContent
@@ -294,6 +296,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParsePEReference
xmlParserHandlePEReference
xmlParserHandleReference
+xmlValidateAttributeValue
xmlValidateOneAttribute
xmlValidateOneNamespace
EntityDecl
xmlParseEntityDecl
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index 6e3c9c4d..6ac60275 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -430,32 +430,6 @@ A:link, A:visited, A:active { text-decoration: underline }
produced
xmlCharEncodingOutputFunc
xmlCurrentChar
producing
xmlCheckUTF8
-
production
IS_BASECHAR
-IS_BLANK
-IS_BYTE_CHAR
-IS_CHAR
-IS_COMBINING
-IS_DIGIT
-IS_EXTENDER
-IS_IDEOGRAPHIC
-IS_LETTER
-IS_PUBIDCHAR
-xmlIsLetter
-xmlParseAttributeType
-xmlParseBalancedChunkMemory
-xmlParseBalancedChunkMemoryRecover
-xmlParseCharRef
-xmlParseCtxtExternalEntity
-xmlParseExtParsedEnt
-xmlParseExternalEntity
-xmlParseExternalID
-xmlParseInNodeContext
-xmlValidateNameValue
-xmlValidateNamesValue
-xmlValidateNmtokenValue
-xmlValidateNmtokensValue
-xmlXPathIdFunction
-xmlXPathNormalizeFunction
production:
xmlCheckLanguageID
productions
xmlCheckLanguageID
program
xmlXPtrNewContext
@@ -482,6 +456,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathIsNaN
prolog
xmlParseDocument
prompt
xmlShellReadlineFunc
+
proper
xmlValidateAttributeValue
properly
xmlParseElementChildrenContentDecl
xmlParseMarkupDecl
xmlReconciliateNs
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html index 958aefef..6c2be3b6 100644 --- a/doc/APIchunk3.html +++ b/doc/APIchunk3.html @@ -197,12 +197,14 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserInputBufferRead
IDREF
xmlParseAttributeType
xmlValidateAttributeDecl
+xmlValidateAttributeValue
xmlValidateDocumentFinal
xmlValidateDtd
xmlValidateOneAttribute
xmlValidateOneElement
xmlValidateOneNamespace
IDREFS
xmlParseAttributeType
+xmlValidateAttributeValue
xmlValidateDocumentFinal
IDREFs
_xmlDoc
IDs
xmlXPathIdFunction
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 924c236c..b954f386 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -182,7 +182,9 @@ A:link, A:visited, A:active { text-decoration: underline }
NDataDecl
xmlParseEntityDecl
NDataDecl?
xmlParseEntityDecl
NMTOKEN
xmlParseAttributeType
+xmlValidateAttributeValue
NMTOKENS
xmlParseAttributeType
+xmlValidateAttributeValue
NMToken
xmlValidateNMToken
NOTATION
xmlParseEnumeratedType
xmlParseNotationType
@@ -232,6 +234,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Names
xmlParseAttributeType
xmlParseName
xmlScanName
+xmlValidateAttributeValue
xmlValidateNamesValue
Namespace
XML_XML_NAMESPACE
_xmlElementContent
@@ -248,9 +251,11 @@ A:link, A:visited, A:active { text-decoration: underline }
Nmtoken
xmlParseAttributeType
xmlParseEnumerationType
xmlParseNmtoken
+xmlValidateAttributeValue
xmlValidateNmtokenValue
Nmtokens
xmlParseAttributeType
xmlParseNmtoken
+xmlValidateAttributeValue
xmlValidateNmtokensValue
Node
_xmlParserCtxt
_xmlValidCtxt
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index 10e852af..2d733000 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -119,6 +119,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Thus:
xmlXPathSubstringFunction
Tibetan
xmlUCSIsTibetan
Token
xmlParseAttributeType
+xmlValidateAttributeValue
xmlValidateNmtokenValue
xmlValidateNmtokensValue
xmlValidateOneAttribute
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html index ca0b6eb1..e1f38c01 100644 --- a/doc/APIchunk9.html +++ b/doc/APIchunk9.html @@ -46,6 +46,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaValidateStream
xmlSchematronValidateDoc
xmlShellValidate
+xmlValidateAttributeValue
xmlValidateNameValue
xmlValidateNamesValue
xmlValidateNmtokenValue
@@ -62,6 +63,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseDefaultDecl
xmlParseEnumerationType
xmlParseNotationType
+xmlValidateAttributeValue
Variable
xmlXPathVariableLookup
xmlXPathVariableLookupNS
VariationSelectors
xmlUCSIsVariationSelectors
diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 0c9934d3..8ad26732 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -614,6 +614,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_PARSE_NOXINCNODE
XML_PARSE_NSCLEAN
XML_PARSE_OLD10
+XML_PARSE_OLDSAX
XML_PARSE_PEDANTIC
XML_PARSE_PUSH_DOM
XML_PARSE_PUSH_SAX
@@ -800,6 +801,7 @@ A:link, A:visited, A:active { text-decoration: underline } MOVETO_STARTTAG
SKIP_EOL
XML_MAX_NAMELEN
+XML_MAX_TEXT_LENGHT
XML_SUBSTITUTE_BOTH
XML_SUBSTITUTE_NONE
XML_SUBSTITUTE_PEREF
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 32bfe394..4ed93879 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -534,6 +534,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_IO_WRITE
XML_LOCAL_NAMESPACE
XML_MAX_NAMELEN
+XML_MAX_TEXT_LENGHT
XML_MODULE_CLOSE
XML_MODULE_LAZY
XML_MODULE_LOCAL
@@ -589,6 +590,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_PARSE_NOXINCNODE
XML_PARSE_NSCLEAN
XML_PARSE_OLD10
+XML_PARSE_OLDSAX
XML_PARSE_PEDANTIC
XML_PARSE_PUSH_DOM
XML_PARSE_PUSH_SAX
diff --git a/doc/apibuild.py b/doc/apibuild.py index 3c380618..36870dad 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -72,6 +72,7 @@ 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"), } def escape(raw): diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html index ea0697fe..06e863a8 100644 --- a/doc/devhelp/libxml2-parser.html +++ b/doc/devhelp/libxml2-parser.html @@ -305,7 +305,8 @@ void xmlSetExternalEntityLoader (XML_PARSE_COMPACT = 65536 /* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */ XML_PARSE_OLD10 = 131072 /* parse using XML-1.0 before update 5 */ XML_PARSE_NOBASEFIX = 262144 /* do not fixup XINCLUDE xml:base uris */ - XML_PARSE_HUGE = 524288 /* relax any hardcoded limit from the parser */ + XML_PARSE_HUGE = 524288 /* relax any hardcoded limit from the parser */ + XML_PARSE_OLDSAX = 1048576 /* parse using SAX2 interface from before 2.7.0 */ };

diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html index cdae32e4..4b9bb0d9 100644 --- a/doc/devhelp/libxml2-parserInternals.html +++ b/doc/devhelp/libxml2-parserInternals.html @@ -55,6 +55,7 @@ #define IS_LETTER(c); #define IS_IDEOGRAPHIC(c); #define MOVETO_STARTTAG(p); +#define XML_MAX_TEXT_LENGHT; #define IS_ASCII_LETTER(c); #define IS_DIGIT(c); #define XML_SUBSTITUTE_PEREF; @@ -264,6 +265,10 @@ void xmlParseEntityDecl (

Macro XML_MAX_NAMELEN

#define XML_MAX_NAMELEN;
 

Identifiers can be longer, but this will be more costly at runtime.

+ +
+

Macro XML_MAX_TEXT_LENGHT

#define XML_MAX_TEXT_LENGHT;
+


Macro XML_SUBSTITUTE_BOTH

#define XML_SUBSTITUTE_BOTH;
diff --git a/doc/devhelp/libxml2-valid.html b/doc/devhelp/libxml2-valid.html
index 15b33716..3480214a 100644
--- a/doc/devhelp/libxml2-valid.html
+++ b/doc/devhelp/libxml2-valid.html
@@ -443,8 +443,8 @@ The content of this structure is not made public by the API.
 
ctxt:the validation context
doc:a document instance
attr:an attribute definition
Returns:1 if valid or 0 otherwise

+

Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.

+
type:an attribute type
value:an attribute value
Returns:1 if valid or 0 otherwise

xmlValidateDocument ()

int	xmlValidateDocument		(xmlValidCtxtPtr ctxt, 
xmlDocPtr doc)

Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.

diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp index 65bcbdaa..68cd0a0c 100644 --- a/doc/devhelp/libxml2.devhelp +++ b/doc/devhelp/libxml2.devhelp @@ -159,6 +159,7 @@ + @@ -770,6 +771,7 @@ + diff --git a/doc/html/libxml-parser.html b/doc/html/libxml-parser.html index 82dbf959..83db4d98 100644 --- a/doc/html/libxml-parser.html +++ b/doc/html/libxml-parser.html @@ -285,6 +285,7 @@ void xmlParserInputDeallocate (XML_PARSE_OLD10 = 131072 : parse using XML-1.0 before update 5 XML_PARSE_NOBASEFIX = 262144 : do not fixup XINCLUDE xml:base uris XML_PARSE_HUGE = 524288 : relax any hardcoded limit from the parser + XML_PARSE_OLDSAX = 1048576 : parse using SAX2 interface from before 2.7.0 }

Structure xmlSAXHandlerV1

Structure xmlSAXHandlerV1
struct _xmlSAXHandlerV1 { internalSubsetSAXFunc internalSubset diff --git a/doc/html/libxml-parserInternals.html b/doc/html/libxml-parserInternals.html index ad1fb8e5..2231ff4a 100644 --- a/doc/html/libxml-parserInternals.html +++ b/doc/html/libxml-parserInternals.html @@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline } Module parserInternals from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module parserInternals from libxml2

API Menu
API Indexes
Related links

this module exports a number of internal parsing routines they are not really all intended for applications but can prove useful doing low level processing.

Table of Contents

#define INPUT_CHUNK
#define IS_ASCII_DIGIT
#define IS_ASCII_LETTER
#define IS_BASECHAR
#define IS_BLANK
#define IS_BLANK_CH
#define IS_BYTE_CHAR
#define IS_CHAR
#define IS_CHAR_CH
#define IS_COMBINING
#define IS_COMBINING_CH
#define IS_DIGIT
#define IS_DIGIT_CH
#define IS_EXTENDER
#define IS_EXTENDER_CH
#define IS_IDEOGRAPHIC
#define IS_LETTER
#define IS_LETTER_CH
#define IS_PUBIDCHAR
#define IS_PUBIDCHAR_CH
#define MOVETO_ENDTAG
#define MOVETO_STARTTAG
#define SKIP_EOL
#define XML_MAX_NAMELEN
#define XML_SUBSTITUTE_BOTH
#define XML_SUBSTITUTE_NONE
#define XML_SUBSTITUTE_PEREF
#define XML_SUBSTITUTE_REF
htmlParserCtxtPtr	htmlCreateFileParserCtxt	(const char * filename, 
const char * encoding)
+ Module parserInternals from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module parserInternals from libxml2

API Menu
API Indexes
Related links

this module exports a number of internal parsing routines they are not really all intended for applications but can prove useful doing low level processing.

Table of Contents

#define INPUT_CHUNK
#define IS_ASCII_DIGIT
#define IS_ASCII_LETTER
#define IS_BASECHAR
#define IS_BLANK
#define IS_BLANK_CH
#define IS_BYTE_CHAR
#define IS_CHAR
#define IS_CHAR_CH
#define IS_COMBINING
#define IS_COMBINING_CH
#define IS_DIGIT
#define IS_DIGIT_CH
#define IS_EXTENDER
#define IS_EXTENDER_CH
#define IS_IDEOGRAPHIC
#define IS_LETTER
#define IS_LETTER_CH
#define IS_PUBIDCHAR
#define IS_PUBIDCHAR_CH
#define MOVETO_ENDTAG
#define MOVETO_STARTTAG
#define SKIP_EOL
#define XML_MAX_NAMELEN
#define XML_MAX_TEXT_LENGHT
#define XML_SUBSTITUTE_BOTH
#define XML_SUBSTITUTE_NONE
#define XML_SUBSTITUTE_PEREF
#define XML_SUBSTITUTE_REF
htmlParserCtxtPtr	htmlCreateFileParserCtxt	(const char * filename, 
const char * encoding)
void	htmlInitAutoClose		(void)
xmlParserInputPtr	inputPop	(xmlParserCtxtPtr ctxt)
int	inputPush			(xmlParserCtxtPtr ctxt, 
xmlParserInputPtr value)
@@ -128,6 +128,7 @@ void xmlEntityReferenceFunc (Macro: MOVETO_STARTTAG
#define MOVETO_STARTTAG

Skips to the next '<' char.

Macro: SKIP_EOL

#define SKIP_EOL

Skips the end of line chars.

Macro: XML_MAX_NAMELEN

#define XML_MAX_NAMELEN

Identifiers can be longer, but this will be more costly at runtime.

+

Macro: XML_MAX_TEXT_LENGHT

#define XML_MAX_TEXT_LENGHT

Macro: XML_SUBSTITUTE_BOTH

#define XML_SUBSTITUTE_BOTH

Both general and parameter entities need to be substituted.

Macro: XML_SUBSTITUTE_NONE

#define XML_SUBSTITUTE_NONE

If no entities need to be substituted.

Macro: XML_SUBSTITUTE_PEREF

#define XML_SUBSTITUTE_PEREF

Whether parameter entities need to be substituted.

diff --git a/doc/html/libxml-valid.html b/doc/html/libxml-valid.html index eb9f6670..30ef3cd2 100644 --- a/doc/html/libxml-valid.html +++ b/doc/html/libxml-valid.html @@ -241,8 +241,8 @@ The content of this structure is not made public by the API.
doc:the document
elem:the parent
name:the attribute name
value:the attribute value
Returns:a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.

Function: xmlValidateAttributeDecl

int	xmlValidateAttributeDecl	(xmlValidCtxtPtr ctxt, 
xmlDocPtr doc,
xmlAttributePtr attr)

Try to validate a single attribute definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately

ctxt:the validation context
doc:a document instance
attr:an attribute definition
Returns:1 if valid or 0 otherwise

Function: xmlValidateAttributeValue

int	xmlValidateAttributeValue	(xmlAttributeType type, 
const xmlChar * value)
-

-
type:
value:
Returns:

Function: xmlValidateDocument

int	xmlValidateDocument		(xmlValidCtxtPtr ctxt, 
xmlDocPtr doc)
+

Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.

+
type:an attribute type
value:an attribute value
Returns:1 if valid or 0 otherwise

Function: xmlValidateDocument

int	xmlValidateDocument		(xmlValidCtxtPtr ctxt, 
xmlDocPtr doc)

Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.

ctxt:the validation context
doc:a document instance
Returns:1 if valid or 0 otherwise

Function: xmlValidateDocumentFinal

int	xmlValidateDocumentFinal	(xmlValidCtxtPtr ctxt, 
xmlDocPtr doc)

Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity

diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index a688847e..fd559a5c 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -679,7 +679,7 @@ - + @@ -733,6 +733,7 @@ + @@ -878,6 +879,7 @@ + @@ -4106,6 +4108,8 @@ Identifiers can be longer, but this will be more costly at runtime. + + Special constant found in SAX2 blocks initialized fields @@ -5032,7 +5036,7 @@ crash if you try to modify the tree)'/> - + @@ -5044,6 +5048,7 @@ crash if you try to modify the tree)'/> + @@ -16779,10 +16784,10 @@ Could we use @subtypes for this?'/> defined(LIBXML_VALID_ENABLED) - - - - + Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens. + + + defined(LIBXML_VALID_ENABLED) diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 148f426d..8f42a39b 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -528,6 +528,7 @@ + @@ -583,6 +584,7 @@ + @@ -4073,6 +4075,7 @@ + @@ -4128,6 +4131,7 @@ + @@ -11217,6 +11221,7 @@ + @@ -11405,6 +11410,7 @@ + @@ -15318,6 +15324,7 @@ + @@ -15325,6 +15332,7 @@ + @@ -15459,6 +15467,7 @@ + @@ -15905,6 +15914,7 @@ + @@ -15913,6 +15923,7 @@ + @@ -16417,9 +16428,11 @@ + + @@ -16487,6 +16500,7 @@ + @@ -16515,11 +16529,13 @@ + + @@ -17842,6 +17858,7 @@ + @@ -18085,6 +18102,7 @@ + @@ -18107,6 +18125,7 @@ + @@ -26524,34 +26543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -26598,6 +26589,9 @@ + + + diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h index 52113c5a..d7184f61 100644 --- a/include/libxml/parserInternals.h +++ b/include/libxml/parserInternals.h @@ -31,7 +31,7 @@ extern "C" { XMLPUBVAR unsigned int xmlParserMaxDepth; /** - * XML_MAX_TEXT_LENGHT + * XML_MAX_TEXT_LENGHT: * * 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, diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h index ee8328ab..8f3b1091 100644 --- a/include/libxml/xmlmemory.h +++ b/include/libxml/xmlmemory.h @@ -63,7 +63,7 @@ typedef void (XMLCALL *xmlFreeFunc)(void *mem); * * Returns a pointer to the newly allocated block or NULL in case of error. */ -typedef void *(XMLCALL *xmlMallocFunc)(size_t size); +typedef void *(ATTRIBUTE_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); /** * xmlReallocFunc: @@ -150,7 +150,7 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL xmlMemoryDump (void); XMLPUBFUN void * XMLCALL - xmlMemMalloc (size_t size); + xmlMemMalloc (size_t size) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlMemRealloc (void *ptr,size_t size); XMLPUBFUN void XMLCALL @@ -158,11 +158,11 @@ XMLPUBFUN void XMLCALL XMLPUBFUN char * XMLCALL xmlMemoryStrdup (const char *str); XMLPUBFUN void * XMLCALL - xmlMallocLoc (size_t size, const char *file, int line); + xmlMallocLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlReallocLoc (void *ptr, size_t size, const char *file, int line); XMLPUBFUN void * XMLCALL - xmlMallocAtomicLoc (size_t size, const char *file, int line); + xmlMallocAtomicLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN char * XMLCALL xmlMemStrdupLoc (const char *str, const char *file, int line); diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index 29cef749..4079295c 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -394,8 +394,18 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #ifndef ATTRIBUTE_UNUSED #define ATTRIBUTE_UNUSED __attribute__((unused)) #endif +#ifndef ATTRIBUTE_ALLOC_SIZE +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x))) +# else +# define ATTRIBUTE_ALLOC_SIZE(x) +# endif +#else +# define ATTRIBUTE_ALLOC_SIZE(x) +#endif #else #define ATTRIBUTE_UNUSED +#define ATTRIBUTE_ALLOC_SIZE(x) #endif #ifdef __cplusplus diff --git a/testapi.c b/testapi.c index 37511d6b..7a6ba3ac 100644 --- a/testapi.c +++ b/testapi.c @@ -26144,9 +26144,9 @@ test_xmlValidateAttributeValue(void) { #if defined(LIBXML_VALID_ENABLED) int mem_base; int ret_val; - xmlAttributeType type; /* */ + xmlAttributeType type; /* an attribute type */ int n_type; - xmlChar * value; /* */ + xmlChar * value; /* an attribute value */ int n_value; for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {