Commit 01c13b5b authored by Daniel Veillard's avatar Daniel Veillard

code cleanup, especially the function comments. fixed a small bug when

* DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c
  nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c
  testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c
  xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c:
  code cleanup, especially the function comments.
* tree.c: fixed a small bug when freeing nodes which are XInclude ones.
Daniel
parent e1ca5033
Tue Dec 10 16:16:34 CET 2002 Daniel Veillard <daniel@veillard.com>
* DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c
nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c
testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c
xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c:
code cleanup, especially the function comments.
* tree.c: fixed a small bug when freeing nodes which are XInclude ones.
Mon Dec 9 15:08:17 CET 2002 Daniel Veillard <daniel@veillard.com>
* Makefile.am xmlreader.c include/libxml/Makefile.am
......
......@@ -3459,7 +3459,7 @@ docbParseCharRef(docbParserCtxtPtr ctxt) {
/**
* docbParseDocTypeDecl :
* docbParseDocTypeDecl:
* @ctxt: an SGML parser context
*
* parse a DOCTYPE declaration
......@@ -4791,7 +4791,7 @@ docbParseMisc(xmlParserCtxtPtr ctxt) {
}
/**
* docbParseDocument :
* docbParseDocument:
* @ctxt: an SGML parser context
*
* parse an SGML document (and build a tree if using the standard SAX
......@@ -5004,7 +5004,7 @@ docbFreeParserCtxt(docbParserCtxtPtr ctxt)
}
/**
* docbCreateDocParserCtxt :
* docbCreateDocParserCtxt:
* @cur: a pointer to an array of xmlChar
* @encoding: the SGML document encoding, or NULL
*
......@@ -5631,7 +5631,7 @@ docbParseTryOrFinish(docbParserCtxtPtr ctxt, int terminate) {
} else {
/* TODO Avoid the extra copy, handle directly !!!!!! */
/*
* Goal of the following test is :
* Goal of the following test is:
* - minimize calls to the SAX 'character' callback
* when they are mergeable
*/
......@@ -5869,7 +5869,7 @@ docbParseChunk(docbParserCtxtPtr ctxt, const char *chunk, int size,
************************************************************************/
/**
* docbCreatePushParserCtxt :
* docbCreatePushParserCtxt:
* @sax: a SAX handler
* @user_data: The user data returned on SAX callbacks
* @chunk: a pointer to an array of chars
......@@ -5949,7 +5949,7 @@ docbCreatePushParserCtxt(docbSAXHandlerPtr sax, void *user_data,
}
/**
* docbSAXParseDoc :
* docbSAXParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the SGML document encoding, or NULL
* @sax: the SAX handler block
......@@ -5989,7 +5989,7 @@ docbSAXParseDoc(xmlChar *cur, const char *encoding, docbSAXHandlerPtr sax, void
}
/**
* docbParseDoc :
* docbParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the SGML document encoding, or NULL
*
......@@ -6005,7 +6005,7 @@ docbParseDoc(xmlChar *cur, const char *encoding) {
/**
* docbCreateFileParserCtxt :
* docbCreateFileParserCtxt:
* @filename: the filename
* @encoding: the SGML document encoding, or NULL
*
......@@ -6058,7 +6058,7 @@ docbCreateFileParserCtxt(const char *filename,
}
/**
* docbSAXParseFile :
* docbSAXParseFile:
* @filename: the filename
* @encoding: a free form C string describing the SGML document encoding, or NULL
* @sax: the SAX handler block
......@@ -6100,7 +6100,7 @@ docbSAXParseFile(const char *filename, const char *encoding, docbSAXHandlerPtr s
}
/**
* docbParseFile :
* docbParseFile:
* @filename: the filename
* @encoding: a free form C string describing document encoding, or NULL
*
......
......@@ -2623,7 +2623,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
/**
* htmlParseDocTypeDecl :
* htmlParseDocTypeDecl:
* @ctxt: an HTML parser context
*
* parse a DOCTYPE declaration
......@@ -3544,7 +3544,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
}
/**
* htmlParseDocument :
* htmlParseDocument:
* @ctxt: an HTML parser context
*
* parse an HTML document (and build a tree if using the standard SAX
......@@ -3833,7 +3833,7 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) {
}
/**
* htmlCreateDocParserCtxt :
* htmlCreateDocParserCtxt:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the HTML document encoding, or NULL
*
......@@ -4491,7 +4491,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
} else {
/* TODO Avoid the extra copy, handle directly !!!!!! */
/*
* Goal of the following test is :
* Goal of the following test is:
* - minimize calls to the SAX 'character' callback
* when they are mergeable
*/
......@@ -4727,7 +4727,7 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
************************************************************************/
/**
* htmlCreatePushParserCtxt :
* htmlCreatePushParserCtxt:
* @sax: a SAX handler
* @user_data: The user data returned on SAX callbacks
* @chunk: a pointer to an array of chars
......@@ -4809,7 +4809,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
}
/**
* htmlSAXParseDoc :
* htmlSAXParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the HTML document encoding, or NULL
* @sax: the SAX handler block
......@@ -4852,7 +4852,7 @@ htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void
}
/**
* htmlParseDoc :
* htmlParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the HTML document encoding, or NULL
*
......@@ -4868,7 +4868,7 @@ htmlParseDoc(xmlChar *cur, const char *encoding) {
/**
* htmlCreateFileParserCtxt :
* htmlCreateFileParserCtxt:
* @filename: the filename
* @encoding: a free form C string describing the HTML document encoding, or NULL
*
......@@ -4933,7 +4933,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
}
/**
* htmlSAXParseFile :
* htmlSAXParseFile:
* @filename: the filename
* @encoding: a free form C string describing the HTML document encoding, or NULL
* @sax: the SAX handler block
......@@ -4978,7 +4978,7 @@ htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr s
}
/**
* htmlParseFile :
* htmlParseFile:
* @filename: the filename
* @encoding: a free form C string describing the HTML document encoding, or NULL
*
......
......@@ -283,8 +283,8 @@ xmlC14NStrEqual(const xmlChar *str1, const xmlChar *str2) {
/**
* xmlC14NVisibleNsStackFind:
* @ctx the C14N context
* @ns the namespace to check
* @ctx: the C14N context
* @ns: the namespace to check
*
* Checks whether the given namespace was already rendered or not
*
......
......@@ -2052,7 +2052,7 @@ xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer,
}
/**
* xmlShell
* xmlShell:
* @doc: the initial document
* @filename: the output buffer
* @input: the line reading function
......
......@@ -193,7 +193,7 @@ error:
}
/**
* xmlCheckUTF8: Check utf-8 string for legality.
* xmlCheckUTF8:
* @utf: Pointer to putative utf-8 encoded string.
*
* Checks @utf for being valid utf-8. @utf is assumed to be
......
......@@ -537,14 +537,6 @@ xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name,
return(NULL);
}
/**
* xmlHashScan:
* @table: the hash table
* @f: the scanner function for items in the hash
* @data: extra data passed to f
*
* Scan the hash @table and applied @f to each value.
*/
typedef struct {
xmlHashScanner hashscanner;
void *data;
......@@ -558,6 +550,14 @@ stubHashScannerFull (void *payload, void *data, const xmlChar *name,
stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name);
}
/**
* xmlHashScan:
* @table: the hash table
* @f: the scanner function for items in the hash
* @data: extra data passed to f
*
* Scan the hash @table and applied @f to each value.
*/
void
xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) {
stubData stubdata;
......@@ -752,13 +752,14 @@ int xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
*
* Returns 0 if the removal succeeded and -1 in case of error or not found.
*/
int xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
int
xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, xmlHashDeallocator f) {
return(xmlHashRemoveEntry3(table, name, name2, NULL, f));
}
/**
* xmlHashRemoveEntry3
* xmlHashRemoveEntry3:
* @table: the hash table
* @name: the name of the userdata
* @name2: a second name of the userdata
......@@ -771,7 +772,8 @@ int xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
*
* Returns 0 if the removal succeeded and -1 in case of error or not found.
*/
int xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
int
xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f) {
unsigned long key;
xmlHashEntryPtr entry;
......
......@@ -1853,12 +1853,14 @@ xmlNanoFTPClose(void *ctx) {
* Basic test in Standalone mode *
* *
************************************************************************/
static
void ftpList(void *userData, const char *filename, const char* attrib,
const char *owner, const char *group, unsigned long size, int links,
int year, const char *month, int day, int hour, int minute) {
xmlGenericError(xmlGenericErrorContext,
"%s %s %s %ld %s\n", attrib, owner, group, size, filename);
}
static
void ftpData(void *userData, const char *data, int len) {
if (userData == NULL) return;
if (len <= 0) {
......
......@@ -1419,7 +1419,7 @@ xmlNanoHTTPAuthHeader(void *ctx) {
}
/**
* xmlNanoHTTPContentLength
* xmlNanoHTTPContentLength:
* @ctx: the HTTP context
*
* Return the specified content length from the HTTP header. Note that
......@@ -1434,7 +1434,7 @@ xmlNanoHTTPContentLength( void * ctx ) {
}
/**
* xmlNanoHTTPFetchContent
* xmlNanoHTTPFetchContent:
* @ctx: the HTTP context
* @ptr: pointer to set to the content buffer.
* @len: integer pointer to hold the length of the content
......
......@@ -1234,7 +1234,6 @@ xmlCharStrndup(const char *cur, int len) {
/**
* xmlCharStrdup:
* @cur: the input char *
* @len: the len of @cur
*
* a strdup for char's to xmlChar's
*
......@@ -2390,6 +2389,16 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
return ret;
}
/**
* xmlParseAttValueComplex:
* @ctxt: an XML parser context
*
* parse a value for an attribute, this is the fallback function
* of xmlParseAttValue() when the attribute parsing requires handling
* of non-ASCII characters.
*
* Returns the AttValue parsed or NULL. The value has to be freed by the caller.
*/
xmlChar *
xmlParseAttValueComplex(xmlParserCtxtPtr ctxt) {
xmlChar limit = 0;
......@@ -2838,6 +2847,15 @@ get_more:
xmlParseCharDataComplex(ctxt, cdata);
}
/**
* xmlParseCharDataComplex:
* @ctxt: an XML parser context
* @cdata: int indicating whether we are within a CDATA section
*
* parse a CharData section.this is the fallback function
* of xmlParseCharData() when the parsing requires handling
* of non-ASCII characters.
*/
void
xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) {
xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
......@@ -10815,7 +10833,7 @@ xmlAddEntityReference(xmlEntityPtr ent, xmlNodePtr firstNode,
/**
* xmlSetEntityReferenceFunc:
* @func : A valid function
* @func: A valid function
*
* Set the function to call call back when a xml reference has been made
*/
......
......@@ -412,20 +412,6 @@ xmlIsBlank(int c) {
return(((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || ((c) == 0x0D));
}
/**
* xmlIsBaseChar:
* @c: an unicode character (int)
*
* Check whether the character is allowed by the production
* [85] BaseChar ::= ... long list see REC ...
*
* VI is your friend !
* :1,$ s/\[#x\([0-9A-Z]*\)-#x\([0-9A-Z]*\)\]/ (((c) >= 0x\1) \&\& ((c) <= 0x\2)) ||/
* and
* :1,$ s/#x\([0-9A-Z]*\)/ ((c) == 0x\1) ||/
*
* Returns 0 if not, non-zero otherwise
*/
static int xmlBaseArray[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0000 - 0x000F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0010 - 0x001F */
......@@ -445,6 +431,20 @@ static int xmlBaseArray[] = {
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00F0 - 0x00FF */
};
/**
* xmlIsBaseChar:
* @c: an unicode character (int)
*
* Check whether the character is allowed by the production
* [85] BaseChar ::= ... long list see REC ...
*
* VI is your friend !
* :1,$ s/\[#x\([0-9A-Z]*\)-#x\([0-9A-Z]*\)\]/ (((c) >= 0x\1) \&\& ((c) <= 0x\2)) ||/
* and
* :1,$ s/#x\([0-9A-Z]*\)/ ((c) == 0x\1) ||/
*
* Returns 0 if not, non-zero otherwise
*/
int
xmlIsBaseChar(int c) {
return(
......@@ -891,6 +891,7 @@ xmlIsPubidChar(int c) {
#ifdef DEBUG_INPUT
#define CHECK_BUFFER(in) check_buffer(in)
static
void check_buffer(xmlParserInputPtr in) {
if (in->base != in->buf->buffer->content) {
xmlGenericError(xmlGenericErrorContext,
......@@ -2383,7 +2384,7 @@ xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
/**
* xmlParserFindNodeInfo:
* @ctxt: an XML parser context
* @ctx: an XML parser context
* @node: an XML node within the tree
*
* Find the parser node info struct for a given node
......
......@@ -179,7 +179,8 @@ int main(int argc, char **argv) {
} \
}
xmlChar **parse_list(xmlChar *str) {
static xmlChar **
parse_list(xmlChar *str) {
xmlChar **buffer;
xmlChar **out = NULL;
int buffer_size = 0;
......@@ -221,7 +222,7 @@ xmlChar **parse_list(xmlChar *str) {
return buffer;
}
xmlXPathObjectPtr
static xmlXPathObjectPtr
load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
xmlXPathObjectPtr xpath;
xmlDocPtr doc;
......@@ -312,7 +313,7 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
return(xpath);
}
void
static void
print_xpath_nodes(xmlNodeSetPtr nodes) {
xmlNodePtr cur;
int i;
......
......@@ -97,7 +97,7 @@ extern xmlSAXHandlerPtr debugSAXHandler;
* Returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
isStandaloneDebug(void *ctxt ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
......@@ -112,7 +112,7 @@ isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
* Returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
hasInternalSubsetDebug(void *ctxt ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasInternalSubset()\n");
return(0);
......@@ -127,20 +127,20 @@ hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
* Returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
hasExternalSubsetDebug(void *ctxt ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasExternalSubset()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* internalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*/
static void
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
internalSubsetDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
fprintf(stdout, "SAX.internalSubset(%s,", name);
......@@ -169,7 +169,7 @@ internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
resolveEntityDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
{
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
......@@ -201,7 +201,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
getEntityDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getEntity(%s)\n", name);
return(NULL);
......@@ -217,7 +217,7 @@ getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
* Returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
getParameterEntityDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
return(NULL);
......@@ -236,7 +236,7 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
* An entity definition has been parsed
*/
static void
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
entityDeclDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
......@@ -252,7 +252,7 @@ entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
* An attribute definition has been parsed
*/
static void
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem,
attributeDeclDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *elem,
const xmlChar *name, int type, int def,
const xmlChar *defaultValue,
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
......@@ -271,7 +271,7 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem,
* An element definition has been parsed
*/
static void
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
elementDeclDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name, int type,
xmlElementContentPtr content ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
......@@ -288,7 +288,7 @@ elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
* What to do when a notation declaration has been parsed.
*/
static void
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
notationDeclDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId)
{
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
......@@ -306,7 +306,7 @@ notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
* What to do when an unparsed entity declaration is parsed
*/
static void
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
unparsedEntityDeclDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
......@@ -324,7 +324,7 @@ unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
* Everything is available on the context, so this is useless in our case.
*/
static void
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED,
setDocumentLocatorDebug(void *ctxt ATTRIBUTE_UNUSED,
xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.setDocumentLocator()\n");
......@@ -337,7 +337,7 @@ setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED,
* called when the document start being processed.
*/
static void
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
startDocumentDebug(void *ctxt ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.startDocument()\n");
}
......@@ -349,7 +349,7 @@ startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
* called when the document end has been detected.
*/
static void
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
endDocumentDebug(void *ctxt ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.endDocument()\n");
}
......@@ -362,7 +362,7 @@ endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
* called when an opening tag has been processed.
*/
static void
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
startElementDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
{
int i;
......@@ -396,7 +396,7 @@ startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar
* called when the end of an element has been detected.
*/
static void
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
endElementDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
}
......@@ -411,7 +411,7 @@ endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
* Question: how much at a time ???
*/
static void
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
charactersDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
unsigned char output[40];
int inlen = len, outlen = 30;
......@@ -430,7 +430,7 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
* called when an entity reference is detected.
*/
static void
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
referenceDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.reference(%s)\n", name);
}
......@@ -446,7 +446,7 @@ referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
* Question: how much at a time ???
*/
static void
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
ignorableWhitespaceDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
char output[40];
int i;
......@@ -468,7 +468,7 @@ ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
* A processing instruction has been parsed.
*/
static void
processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
processingInstructionDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *target,
const xmlChar *data)
{
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
......@@ -483,7 +483,7 @@ processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
* A comment has been parsed.
*/
static void
commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
commentDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *value)
{
fprintf(stdout, "SAX.comment(%s)\n", value);
}
......@@ -497,7 +497,7 @@ commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
* called when a pcdata block has been parsed
*/
static void
cdataBlockDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value, int len)
cdataBlockDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *value, int len)
{
fprintf(stdout, "SAX.pcdata(%.20s, %d)\n",
(char *) value, len);
......@@ -510,7 +510,7 @@ cdataBlockDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value, int len)
* Does this document has an external subset
*/
static void
externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
externalSubsetDebug(void *ctxt ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
fprintf(stdout, "SAX.externalSubset(%s,", name);
......@@ -534,7 +534,7 @@ externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
* extra parameters.
*/
static void
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
warningDebug(void *ctxt ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
......@@ -554,7 +554,7 @@ warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
* extra parameters.
*/
static void
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
errorDebug(void *ctxt ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
......@@ -574,7 +574,7 @@ errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
* extra parameters.
*/
static void
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
fatalErrorDebug(void *ctxt ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
......
......@@ -102,7 +102,7 @@ static xmlRMutexPtr xmlLibraryLock = NULL;
static void xmlOnceInit(void);
/**
* xmlMutexPtr:
* xmlNewMutex:
*
* xmlNewMutex() is used to allocate a libxml2 token struct for use in
* synchronizing access to data.
......@@ -176,7 +176,7 @@ xmlMutexUnlock(xmlMutexPtr tok ATTRIBUTE_UNUSED)
}
/**
* xmlRNewMutex:
* xmlNewRMutex:
*
* xmlRNewMutex() is used to allocate a reentrant mutex for use in
* synchronizing access to data. token_r is a re-entrant lock and thus useful
......@@ -204,7 +204,7 @@ xmlNewRMutex(void)
}
/**
* xmlRFreeMutex:
* xmlFreeRMutex:
* @tok: the reentrant mutex
*
* xmlRFreeMutex() is used to reclaim resources associated with a
......@@ -322,14 +322,6 @@ xmlNewGlobalState(void)
#endif /* LIBXML_THREAD_ENABLED */
/**
* xmlGetGlobalState:
*
* xmlGetGlobalState() is called to retrieve the global state for a thread.
*
* Returns the thread global state or NULL in case of error
*/
#ifdef HAVE_WIN32_THREADS
#if !defined(HAVE_COMPILER_TLS)
typedef struct _xmlGlobalStateCleanupHelperParams
......@@ -338,7 +330,7 @@ typedef struct _xmlGlobalStateCleanupHelperParams
void *memory;
} xmlGlobalStateCleanupHelperParams;
void xmlGlobalStateCleanupHelper (void *p)
static void xmlGlobalStateCleanupHelper (void *p)
{
xmlGlobalStateCleanupHelperParams *params = (xmlGlobalStateCleanupHelperParams *) p;
WaitForSingleObject(params->thread, INFINITE);
......@@ -350,6 +342,13 @@ void xmlGlobalStateCleanupHelper (void *p)
#endif /* HAVE_COMPILER_TLS */
#endif /* HAVE_WIN32_THREADS */
/**
* xmlGetGlobalState:
*
* xmlGetGlobalState() is called to retrieve the global state for a thread.
*
* Returns the thread global state or NULL in case of error
*/
xmlGlobalStatePtr
xmlGetGlobalState(void)
{
......
......@@ -2589,7 +2589,9 @@ xmlFreeNodeList(xmlNodePtr cur) {
if ((cur->children != NULL) &&
(cur->type != XML_ENTITY_REF_NODE))
xmlFreeNodeList(cur->children);
if ((cur->type == XML_ELEMENT_NODE) &&
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_XINCLUDE_START) ||
(cur->type == XML_XINCLUDE_END)) &&
(cur->properties != NULL))
xmlFreePropList(cur->properties);
if ((cur->type != XML_ELEMENT_NODE) &&
......@@ -2667,7 +2669,10 @@ xmlFreeNode(xmlNodePtr cur) {
if ((cur->children != NULL) &&
(cur->type != XML_ENTITY_REF_NODE))
xmlFreeNodeList(cur->children);
if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL))
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_XINCLUDE_START) ||
(cur->type == XML_XINCLUDE_END)) &&
(cur->properties != NULL))
xmlFreePropList(cur->properties);
if ((cur->type != XML_ELEMENT_NODE) &&
(cur->content != NULL) &&
......@@ -3407,7 +3412,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
/**
* xmlGetLineNo:
* @node : valid node
* @node: valid node
*
* Get line number of node. this requires activation of this option
* before invoking the parser by calling xmlLineNumbersDefault(1)
......@@ -4695,7 +4700,7 @@ shadowed:
}