diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/libxml | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/libxml')
79 files changed, 8047 insertions, 8047 deletions
diff --git a/contrib/libs/libxml/AUTHORS b/contrib/libs/libxml/AUTHORS index 0ce23f8bd8..cf2e9a6fad 100644 --- a/contrib/libs/libxml/AUTHORS +++ b/contrib/libs/libxml/AUTHORS @@ -1,5 +1,5 @@ -Daniel Veillard <daniel@veillard.com> -Bjorn Reese <breese@users.sourceforge.net> -William Brack <wbrack@mmm.com.hk> -Igor Zlatkovic <igor@zlatkovic.com> for the Windows port -Aleksey Sanin <aleksey@aleksey.com> +Daniel Veillard <daniel@veillard.com> +Bjorn Reese <breese@users.sourceforge.net> +William Brack <wbrack@mmm.com.hk> +Igor Zlatkovic <igor@zlatkovic.com> for the Windows port +Aleksey Sanin <aleksey@aleksey.com> diff --git a/contrib/libs/libxml/HTMLparser.c b/contrib/libs/libxml/HTMLparser.c index 09e06c5658..7b6d68961c 100644 --- a/contrib/libs/libxml/HTMLparser.c +++ b/contrib/libs/libxml/HTMLparser.c @@ -26,8 +26,8 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif #include <libxml/xmlmemory.h> @@ -105,7 +105,7 @@ htmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra) * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -132,7 +132,7 @@ htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { @@ -303,7 +303,7 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt) #define UPP(val) (toupper(ctxt->input->cur[(val)])) #define CUR_PTR ctxt->input->cur -#define BASE_PTR ctxt->input->base +#define BASE_PTR ctxt->input->base #define SHRINK if ((ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \ (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \ @@ -317,7 +317,7 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt) #define SKIP_BLANKS htmlSkipBlankChars(ctxt) -/* Imported from XML */ +/* Imported from XML */ /* #define CUR (ctxt->token ? ctxt->token : (int) (*ctxt->input->cur)) */ #define CUR ((int) (*ctxt->input->cur)) @@ -537,7 +537,7 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { encoding_error: /* * If we detect an UTF8 error that probably mean that the - * input encoding didn't get properly advertised in the + * input encoding didn't get properly advertised in the * declaration header. Report the error and switch the encoding * to ISO-Latin-1 (if you don't like this policy, just declare the * encoding !) @@ -602,8 +602,8 @@ htmlSkipBlankChars(xmlParserCtxtPtr ctxt) { ************************************************************************/ /* - * Start Tag: 1 means the start tag can be omitted - * End Tag: 1 means the end tag can be omitted + * Start Tag: 1 means the start tag can be omitted + * End Tag: 1 means the end tag can be omitted * 2 means it's forbidden (empty elements) * 3 means the tag is stylistic and should be closed easily * Depr: this element is deprecated @@ -1084,7 +1084,7 @@ static const char * const htmlStartClose[] = { "menu", "p", "head", "ul", NULL, "p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL, "div", "p", "head", NULL, -"noscript", "script", NULL, +"noscript", "script", NULL, "center", "font", "b", "i", "p", "head", NULL, "a", "a", "head", NULL, "caption", "p", NULL, @@ -1342,7 +1342,7 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag) if (xmlStrEqual(newtag, ctxt->nameTab[i])) break; /* - * A misplaced endtag can only close elements with lower + * A misplaced endtag can only close elements with lower * or equal priority, so if we find an element with higher * priority before we find an element with * matching name, we just ignore this endtag @@ -2176,7 +2176,7 @@ htmlEncodeEntities(unsigned char* out, int *outlen, * * ************************************************************************/ -#ifdef LIBXML_PUSH_ENABLED +#ifdef LIBXML_PUSH_ENABLED /** * htmlNewInputStream: * @ctxt: an HTML parser context @@ -2208,7 +2208,7 @@ htmlNewInputStream(htmlParserCtxtPtr ctxt) { input->length = 0; return(input); } -#endif +#endif /************************************************************************ @@ -2218,9 +2218,9 @@ htmlNewInputStream(htmlParserCtxtPtr ctxt) { ************************************************************************/ /* * all tags allowing pc data from the html 4.01 loose dtd - * NOTE: it might be more appropriate to integrate this information + * NOTE: it might be more appropriate to integrate this information * into the html40ElementTable array but I don't want to risk any - * binary incompatibility + * binary incompatibility */ static const char *allowPCData[] = { "a", "abbr", "acronym", "address", "applet", "b", "bdo", "big", @@ -2474,10 +2474,10 @@ htmlParseName(htmlParserCtxtPtr ctxt) { (*in == '_') || (*in == '-') || (*in == ':') || (*in == '.')) in++; - - if (in == ctxt->input->end) - return(NULL); - + + if (in == ctxt->input->end) + return(NULL); + if ((*in > 0) && (*in < 0x80)) { count = in - ctxt->input->cur; ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count); @@ -2495,7 +2495,7 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) { int len = 0, l; int c; int count = 0; - const xmlChar *base = ctxt->input->base; + const xmlChar *base = ctxt->input->base; /* * Handler for more complex cases @@ -2521,22 +2521,22 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) { len += l; NEXTL(l); c = CUR_CHAR(l); - if (ctxt->input->base != base) { - /* - * We changed encoding from an unknown encoding - * Input buffer changed location, so we better start again - */ - return(htmlParseNameComplex(ctxt)); - } - } - - if (ctxt->input->cur - ctxt->input->base < len) { - /* Sanity check */ - htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR, - "unexpected change of input buffer", NULL, NULL); - return (NULL); - } - + if (ctxt->input->base != base) { + /* + * We changed encoding from an unknown encoding + * Input buffer changed location, so we better start again + */ + return(htmlParseNameComplex(ctxt)); + } + } + + if (ctxt->input->cur - ctxt->input->base < len) { + /* Sanity check */ + htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR, + "unexpected change of input buffer", NULL, NULL); + return (NULL); + } + return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); } @@ -2788,43 +2788,43 @@ htmlParseAttValue(htmlParserCtxtPtr ctxt) { static xmlChar * htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) { - size_t len = 0, startPosition = 0; + size_t len = 0, startPosition = 0; xmlChar *ret = NULL; if (CUR == '"') { NEXT; - - if (CUR_PTR < BASE_PTR) - return(ret); - startPosition = CUR_PTR - BASE_PTR; - - while ((IS_CHAR_CH(CUR)) && (CUR != '"')) { + + if (CUR_PTR < BASE_PTR) + return(ret); + startPosition = CUR_PTR - BASE_PTR; + + while ((IS_CHAR_CH(CUR)) && (CUR != '"')) { NEXT; - len++; - } + len++; + } if (!IS_CHAR_CH(CUR)) { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, "Unfinished SystemLiteral\n", NULL, NULL); } else { - ret = xmlStrndup((BASE_PTR+startPosition), len); + ret = xmlStrndup((BASE_PTR+startPosition), len); NEXT; } } else if (CUR == '\'') { NEXT; - - if (CUR_PTR < BASE_PTR) - return(ret); - startPosition = CUR_PTR - BASE_PTR; - - while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) { + + if (CUR_PTR < BASE_PTR) + return(ret); + startPosition = CUR_PTR - BASE_PTR; + + while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) { NEXT; - len++; - } + len++; + } if (!IS_CHAR_CH(CUR)) { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, "Unfinished SystemLiteral\n", NULL, NULL); } else { - ret = xmlStrndup((BASE_PTR+startPosition), len); + ret = xmlStrndup((BASE_PTR+startPosition), len); NEXT; } } else { @@ -2848,47 +2848,47 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) { static xmlChar * htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) { - size_t len = 0, startPosition = 0; + size_t len = 0, startPosition = 0; xmlChar *ret = NULL; /* * Name ::= (Letter | '_') (NameChar)* */ if (CUR == '"') { NEXT; - - if (CUR_PTR < BASE_PTR) - return(ret); - startPosition = CUR_PTR - BASE_PTR; - - while (IS_PUBIDCHAR_CH(CUR)) { - len++; - NEXT; - } - + + if (CUR_PTR < BASE_PTR) + return(ret); + startPosition = CUR_PTR - BASE_PTR; + + while (IS_PUBIDCHAR_CH(CUR)) { + len++; + NEXT; + } + if (CUR != '"') { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, "Unfinished PubidLiteral\n", NULL, NULL); } else { - ret = xmlStrndup((BASE_PTR + startPosition), len); + ret = xmlStrndup((BASE_PTR + startPosition), len); NEXT; } } else if (CUR == '\'') { NEXT; - - if (CUR_PTR < BASE_PTR) - return(ret); - startPosition = CUR_PTR - BASE_PTR; - - while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')){ - len++; - NEXT; - } - + + if (CUR_PTR < BASE_PTR) + return(ret); + startPosition = CUR_PTR - BASE_PTR; + + while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')){ + len++; + NEXT; + } + if (CUR != '\'') { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, "Unfinished PubidLiteral\n", NULL, NULL); } else { - ret = xmlStrndup((BASE_PTR + startPosition), len); + ret = xmlStrndup((BASE_PTR + startPosition), len); NEXT; } } else { @@ -2961,7 +2961,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { } COPY_BUF(l,buf,nbchar,cur); if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) { - buf[nbchar] = 0; + buf[nbchar] = 0; if (ctxt->sax->cdataBlock!= NULL) { /* * Insert as CDATA, which is the same as HTML_PRESERVE_NODE @@ -2986,7 +2986,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { } if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) { - buf[nbchar] = 0; + buf[nbchar] = 0; if (ctxt->sax->cdataBlock!= NULL) { /* * Insert as CDATA, which is the same as HTML_PRESERVE_NODE @@ -3000,9 +3000,9 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { /** - * htmlParseCharDataInternal: + * htmlParseCharDataInternal: * @ctxt: an HTML parser context - * @readahead: optional read ahead character in ascii range + * @readahead: optional read ahead character in ascii range * * parse a CharData section. * if we are within a CDATA section ']]>' marks an end of section. @@ -3011,15 +3011,15 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { */ static void -htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) { - xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6]; +htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) { + xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6]; int nbchar = 0; int cur, l; int chunk = 0; - if (readahead) - buf[nbchar++] = readahead; - + if (readahead) + buf[nbchar++] = readahead; + SHRINK; cur = CUR_CHAR(l); while (((cur != '<') || (ctxt->token == '<')) && @@ -3032,8 +3032,8 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) { COPY_BUF(l,buf,nbchar,cur); } if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) { - buf[nbchar] = 0; - + buf[nbchar] = 0; + /* * Ok the segment is to be consumed as chars. */ @@ -3101,21 +3101,21 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) { } /** - * htmlParseCharData: - * @ctxt: an HTML parser context - * - * parse a CharData section. - * if we are within a CDATA section ']]>' marks an end of section. - * - * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) - */ - -static void -htmlParseCharData(htmlParserCtxtPtr ctxt) { - htmlParseCharDataInternal(ctxt, 0); -} - -/** + * htmlParseCharData: + * @ctxt: an HTML parser context + * + * parse a CharData section. + * if we are within a CDATA section ']]>' marks an end of section. + * + * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) + */ + +static void +htmlParseCharData(htmlParserCtxtPtr ctxt) { + htmlParseCharDataInternal(ctxt, 0); +} + +/** * htmlParseExternalID: * @ctxt: an HTML parser context * @publicID: a xmlChar** receiving PubidLiteral @@ -3318,15 +3318,15 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { ctxt->instate = state; return; } - len = 0; - buf[len] = 0; + len = 0; + buf[len] = 0; q = CUR_CHAR(ql); - if (!IS_CHAR(q)) - goto unfinished; + if (!IS_CHAR(q)) + goto unfinished; NEXTL(ql); r = CUR_CHAR(rl); - if (!IS_CHAR(r)) - goto unfinished; + if (!IS_CHAR(r)) + goto unfinished; NEXTL(rl); cur = CUR_CHAR(l); while (IS_CHAR(cur) && @@ -3359,20 +3359,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { } } buf[len] = 0; - if (IS_CHAR(cur)) { + if (IS_CHAR(cur)) { NEXT; if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) && (!ctxt->disableSAX)) ctxt->sax->comment(ctxt->userData, buf); xmlFree(buf); - ctxt->instate = state; - return; - } - -unfinished: - htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment not terminated \n<!--%.50s\n", buf, NULL); - xmlFree(buf); + ctxt->instate = state; + return; + } + +unfinished: + htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, + "Comment not terminated \n<!--%.50s\n", buf, NULL); + xmlFree(buf); } /** @@ -3642,7 +3642,7 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) { processed = ctxt->input->cur - ctxt->input->base; xmlBufShrink(ctxt->input->buf->buffer, processed); nbchars = xmlCharEncInput(ctxt->input->buf, 1); - xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input); + xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "htmlCheckEncoding: encoder error\n", @@ -3770,14 +3770,14 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) { htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED, "htmlParseStartTag: invalid element name\n", NULL, NULL); - /* if recover preserve text on classic misconstructs */ - if ((ctxt->recovery) && ((IS_BLANK_CH(CUR)) || (CUR == '<') || - (CUR == '=') || (CUR == '>') || (((CUR >= '0') && (CUR <= '9'))))) { - htmlParseCharDataInternal(ctxt, '<'); - return(-1); - } - - + /* if recover preserve text on classic misconstructs */ + if ((ctxt->recovery) && ((IS_BLANK_CH(CUR)) || (CUR == '<') || + (CUR == '=') || (CUR == '>') || (((CUR >= '0') && (CUR <= '9'))))) { + htmlParseCharDataInternal(ctxt, '<'); + return(-1); + } + + /* Dump the bogus tag like browsers do */ while ((IS_CHAR_CH(CUR)) && (CUR != '>') && (ctxt->instate != XML_PARSER_EOF)) @@ -4454,7 +4454,7 @@ static void htmlParseElementInternal(htmlParserCtxtPtr ctxt) { const xmlChar *name; const htmlElemDesc * info; - htmlParserNodeInfo node_info = { NULL, 0, 0, 0, 0 }; + htmlParserNodeInfo node_info = { NULL, 0, 0, 0, 0 }; int failed; if ((ctxt == NULL) || (ctxt->input == NULL)) { @@ -4951,7 +4951,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt) ctxt->wellFormed = 1; ctxt->replaceEntities = 0; ctxt->linenumbers = xmlLineNumbersDefaultValue; - ctxt->keepBlanks = xmlKeepBlanksDefaultValue; + ctxt->keepBlanks = xmlKeepBlanksDefaultValue; ctxt->html = 1; ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0; ctxt->vctxt.userData = ctxt; @@ -5768,9 +5768,9 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { break; } case XML_PARSER_CONTENT: { - xmlChar chr[2] = { 0, 0 }; + xmlChar chr[2] = { 0, 0 }; long cons; - + /* * Handle preparsed entities and charRef */ @@ -5786,22 +5786,22 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { cur = in->cur[0]; if ((cur != '<') && (cur != '&')) { if (ctxt->sax != NULL) { - chr[0] = cur; + chr[0] = cur; if (IS_BLANK_CH(cur)) { if (ctxt->keepBlanks) { if (ctxt->sax->characters != NULL) ctxt->sax->characters( - ctxt->userData, chr, 1); + ctxt->userData, chr, 1); } else { if (ctxt->sax->ignorableWhitespace != NULL) ctxt->sax->ignorableWhitespace( - ctxt->userData, chr, 1); + ctxt->userData, chr, 1); } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) ctxt->sax->characters( - ctxt->userData, chr, 1); + ctxt->userData, chr, 1); } } ctxt->token = 0; @@ -6285,8 +6285,8 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, */ htmlDocPtr -htmlSAXParseDoc(const xmlChar *cur, const char *encoding, - htmlSAXHandlerPtr sax, void *userData) { +htmlSAXParseDoc(const xmlChar *cur, const char *encoding, + htmlSAXHandlerPtr sax, void *userData) { htmlDocPtr ret; htmlParserCtxtPtr ctxt; @@ -6325,7 +6325,7 @@ htmlSAXParseDoc(const xmlChar *cur, const char *encoding, */ htmlDocPtr -htmlParseDoc(const xmlChar *cur, const char *encoding) { +htmlParseDoc(const xmlChar *cur, const char *encoding) { return(htmlSAXParseDoc(cur, encoding, NULL, NULL)); } @@ -6594,7 +6594,7 @@ htmlNodeStatus(const htmlNodePtr node, int legacy) { * DICT_FREE: * @str: a string * - * Free a string if it is not owned by the "dict" dictionary in the + * Free a string if it is not owned by the "dict" dictionary in the * current scope */ #define DICT_FREE(str) \ @@ -6681,7 +6681,7 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt) xmlInitNodeInfoSeq(&ctxt->node_seq); if (ctxt->attsDefault != NULL) { - xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); + xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); ctxt->attsDefault = NULL; } if (ctxt->attsSpecial != NULL) { diff --git a/contrib/libs/libxml/HTMLtree.c b/contrib/libs/libxml/HTMLtree.c index 5396b30639..db63b371f0 100644 --- a/contrib/libs/libxml/HTMLtree.c +++ b/contrib/libs/libxml/HTMLtree.c @@ -502,14 +502,14 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc, if (handler == NULL) htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } - } else { - /* - * Fallback to HTML or ASCII when the encoding is unspecified - */ - if (handler == NULL) - handler = xmlFindCharEncodingHandler("HTML"); - if (handler == NULL) - handler = xmlFindCharEncodingHandler("ascii"); + } else { + /* + * Fallback to HTML or ASCII when the encoding is unspecified + */ + if (handler == NULL) + handler = xmlFindCharEncodingHandler("HTML"); + if (handler == NULL) + handler = xmlFindCharEncodingHandler("ascii"); } /* @@ -570,20 +570,20 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { xmlCharEncoding enc; enc = xmlParseCharEncoding(encoding); - if (enc != XML_CHAR_ENCODING_UTF8) { + if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } - } else { - /* - * Fallback to HTML or ASCII when the encoding is unspecified - */ - if (handler == NULL) - handler = xmlFindCharEncodingHandler("HTML"); - if (handler == NULL) - handler = xmlFindCharEncodingHandler("ascii"); + } else { + /* + * Fallback to HTML or ASCII when the encoding is unspecified + */ + if (handler == NULL) + handler = xmlFindCharEncodingHandler("HTML"); + if (handler == NULL) + handler = xmlFindCharEncodingHandler("ascii"); } buf = xmlAllocOutputBufferInternal(handler); @@ -657,8 +657,8 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlOutputBufferWriteString(buf, " "); xmlBufWriteQuotedString(buf->buffer, cur->SystemID); } - } else if (cur->SystemID != NULL && - xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) { + } else if (cur->SystemID != NULL && + xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) { xmlOutputBufferWriteString(buf, " SYSTEM "); xmlBufWriteQuotedString(buf->buffer, cur->SystemID); } @@ -1048,7 +1048,7 @@ htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, * @cur: the document * @encoding: the encoding string * - * Dump an HTML document. Formatting return/spaces are added. + * Dump an HTML document. Formatting return/spaces are added. */ void htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, @@ -1090,19 +1090,19 @@ htmlDocDump(FILE *f, xmlDocPtr cur) { xmlCharEncoding enc; enc = xmlParseCharEncoding(encoding); - if (enc != XML_CHAR_ENCODING_UTF8) { + if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } - } else { - /* - * Fallback to HTML or ASCII when the encoding is unspecified - */ - if (handler == NULL) - handler = xmlFindCharEncodingHandler("HTML"); - if (handler == NULL) - handler = xmlFindCharEncodingHandler("ascii"); + } else { + /* + * Fallback to HTML or ASCII when the encoding is unspecified + */ + if (handler == NULL) + handler = xmlFindCharEncodingHandler("HTML"); + if (handler == NULL) + handler = xmlFindCharEncodingHandler("ascii"); } buf = xmlOutputBufferCreateFile(f, handler); @@ -1140,19 +1140,19 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { xmlCharEncoding enc; enc = xmlParseCharEncoding(encoding); - if (enc != XML_CHAR_ENCODING_UTF8) { + if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } - } else { - /* - * Fallback to HTML or ASCII when the encoding is unspecified - */ - if (handler == NULL) - handler = xmlFindCharEncodingHandler("HTML"); - if (handler == NULL) - handler = xmlFindCharEncodingHandler("ascii"); + } else { + /* + * Fallback to HTML or ASCII when the encoding is unspecified + */ + if (handler == NULL) + handler = xmlFindCharEncodingHandler("HTML"); + if (handler == NULL) + handler = xmlFindCharEncodingHandler("ascii"); } /* @@ -1194,7 +1194,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, xmlCharEncoding enc; enc = xmlParseCharEncoding(encoding); - if (enc != XML_CHAR_ENCODING_UTF8) { + if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); @@ -1202,14 +1202,14 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, htmlSetMetaEncoding(cur, (const xmlChar *) encoding); } else { htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); - - /* - * Fallback to HTML or ASCII when the encoding is unspecified - */ - if (handler == NULL) - handler = xmlFindCharEncodingHandler("HTML"); - if (handler == NULL) - handler = xmlFindCharEncodingHandler("ascii"); + + /* + * Fallback to HTML or ASCII when the encoding is unspecified + */ + if (handler == NULL) + handler = xmlFindCharEncodingHandler("HTML"); + if (handler == NULL) + handler = xmlFindCharEncodingHandler("ascii"); } /* diff --git a/contrib/libs/libxml/SAX2.c b/contrib/libs/libxml/SAX2.c index ec4f2d09e8..5f141f9a3c 100644 --- a/contrib/libs/libxml/SAX2.c +++ b/contrib/libs/libxml/SAX2.c @@ -12,7 +12,7 @@ #include <stdlib.h> #include <string.h> #include <limits.h> -#include <stddef.h> +#include <stddef.h> #include <libxml/xmlmemory.h> #include <libxml/tree.h> #include <libxml/parser.h> @@ -40,7 +40,7 @@ * TODO: * * macro to flag unimplemented blocks - * XML_CATALOG_PREFER user env to select between system/public preferred + * XML_CATALOG_PREFER user env to select between system/public preferred * option. C.f. Richard Tobin <richard@cogsci.ed.ac.uk> *> Just FYI, I am using an environment variable XML_CATALOG_PREFER with *> values "system" and "public". I have made the default be "system" to @@ -56,7 +56,7 @@ * @ctxt: an XML validation parser context * @msg: a string to accompany the error message */ -static void LIBXML_ATTR_FORMAT(2,0) +static void LIBXML_ATTR_FORMAT(2,0) xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) { xmlStructuredErrorFunc schannel = NULL; const char *str1 = "out of memory\n"; @@ -94,7 +94,7 @@ xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) { * * Handle a validation error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const char *str1, const char *str2) { @@ -134,7 +134,7 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -165,7 +165,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a parser warning */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1) { @@ -190,7 +190,7 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a namespace error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -214,7 +214,7 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a namespace warning */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -1182,8 +1182,8 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElement"); if (name != NULL) xmlFree(name); - if (nval != NULL) - xmlFree(nval); + if (nval != NULL) + xmlFree(nval); return; } } else { @@ -1245,8 +1245,8 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, xmlFree(ns); if (name != NULL) xmlFree(name); - if (nval != NULL) - xmlFree(nval); + if (nval != NULL) + xmlFree(nval); return; } } else { @@ -1316,8 +1316,8 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, name, namespace->href); ctxt->wellFormed = 0; if (ctxt->recovery == 0) ctxt->disableSAX = 1; - if (name != NULL) - xmlFree(name); + if (name != NULL) + xmlFree(name); goto error; } } @@ -1512,8 +1512,8 @@ process_external_subset: attr = elemDecl->attributes; while (attr != NULL) { /* - * Make sure that attributes redefinition occurring in the - * internal subset are not overridden by definitions in the + * Make sure that attributes redefinition occurring in the + * internal subset are not overridden by definitions in the * external subset. */ if (attr->defaultValue != NULL) { @@ -1665,13 +1665,13 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) #ifdef DEBUG_SAX_TREE xmlGenericError(xmlGenericErrorContext, "pushing(%s)\n", name); #endif - if (nodePush(ctxt, ret) < 0) { - xmlUnlinkNode(ret); - xmlFreeNode(ret); - if (prefix != NULL) - xmlFree(prefix); - return; - } + if (nodePush(ctxt, ret) < 0) { + xmlUnlinkNode(ret); + xmlFreeNode(ret); + if (prefix != NULL) + xmlFree(prefix); + return; + } /* * Link the child element @@ -1736,8 +1736,8 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) } /* - * set the namespace node, making sure that if the default namespace - * is unbound on a parent we simply keep it NULL + * set the namespace node, making sure that if the default namespace + * is unbound on a parent we simply keep it NULL */ if ((ns != NULL) && (ns->href != NULL) && ((ns->href[0] != 0) || (ns->prefix != NULL))) @@ -1921,7 +1921,7 @@ skip: else { ret->line = 65535; if (ctxt->options & XML_PARSE_BIG_LINES) - ret->psvi = (void *) (ptrdiff_t) ctxt->input->line; + ret->psvi = (void *) (ptrdiff_t) ctxt->input->line; } } } @@ -2012,7 +2012,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, else ret->name = xmlStrdup(localname); - /* link at the end to preserve order, TODO speed up with a last */ + /* link at the end to preserve order, TODO speed up with a last */ if (ctxt->node->properties == NULL) { ctxt->node->properties = ret; } else { @@ -2104,7 +2104,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, } else { /* * dup now contains a string of the flattened attribute - * content with entities substituted. Check if we need to + * content with entities substituted. Check if we need to * apply an extra layer of normalization. * It need to be done twice ... it's an extra burden related * to the ability to keep references in attributes @@ -2137,7 +2137,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, } } else { /* - * if entities already have been substituted, then + * if entities already have been substituted, then * the attribute as passed is already normalized */ dup = xmlStrndup(value, valueend - value); @@ -2263,7 +2263,7 @@ xmlSAX2StartElementNs(void *ctx, ctxt->freeElems = ret->next; ctxt->freeElemsNr--; memset(ret, 0, sizeof(xmlNode)); - ret->doc = ctxt->myDoc; + ret->doc = ctxt->myDoc; ret->type = XML_ELEMENT_NODE; if (ctxt->dictNames) @@ -2325,7 +2325,7 @@ xmlSAX2StartElementNs(void *ctx, } else { /* * any out of memory error would already have been raised - * but we can't be guaranteed it's the actual error due to the + * but we can't be guaranteed it's the actual error due to the * API, best is to skip in this case */ continue; @@ -2343,11 +2343,11 @@ xmlSAX2StartElementNs(void *ctx, /* * We are parsing a new node. */ - if (nodePush(ctxt, ret) < 0) { - xmlUnlinkNode(ret); - xmlFreeNode(ret); - return; - } + if (nodePush(ctxt, ret) < 0) { + xmlUnlinkNode(ret); + xmlFreeNode(ret); + return; + } /* * Link the child element @@ -2400,7 +2400,7 @@ xmlSAX2StartElementNs(void *ctx, if (nb_attributes > 0) { for (j = 0,i = 0;i < nb_attributes;i++,j+=5) { /* - * Handle the rare case of an undefined attribute prefix + * Handle the rare case of an undefined attribute prefix */ if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) { if (ctxt->dictNames) { @@ -2586,7 +2586,7 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len) * The whole point of maintaining nodelen and nodemem, * xmlTextConcat is too costly, i.e. compute length, * reallocate a new buffer, move data, append ch. Here - * We try to minimize realloc() uses and avoid copying + * We try to minimize realloc() uses and avoid copying * and recomputing length over and over. */ if (lastChild->content == (xmlChar *)&(lastChild->properties)) { @@ -2823,8 +2823,8 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len) xmlTextConcat(lastChild, value, len); } else { ret = xmlNewCDataBlock(ctxt->myDoc, value, len); - if (xmlAddChild(ctxt->node, ret) == NULL) - xmlFreeNode(ret); + if (xmlAddChild(ctxt->node, ret) == NULL) + xmlFreeNode(ret); } } diff --git a/contrib/libs/libxml/TODO b/contrib/libs/libxml/TODO index eda854e10c..9c32224982 100644 --- a/contrib/libs/libxml/TODO +++ b/contrib/libs/libxml/TODO @@ -1,278 +1,278 @@ -124907 HTML parse buffer problem when parsing larse in-memory docs -124110 DTD validation && wrong namespace -123564 xmllint --html --format - - TODO for the XML parser and stuff: - ================================== - - $Id$ - - this tend to be outdated :-\ ... - -DOCS: -===== - -- use case of using XInclude to load for example a description. - order document + product base -(XSLT)-> quote with XIncludes - | - HTML output with description of parts <---(XSLT)-- - -TODO: -===== -- XInclude at the SAX level (libSRVG) -- fix the C code prototype to bring back doc/libxml-undocumented.txt - to a reasonable level -- Computation of base when HTTP redirect occurs, might affect HTTP - interfaces. -- Computation of base in XInclude. Relativization of URIs. -- listing all attributes in a node. -- Better checking of external parsed entities TAG 1234 -- Go through erratas and do the cleanup. - http://www.w3.org/XML/xml-19980210-errata ... started ... -- jamesh suggestion: SAX like functions to save a document ie. call a - function to open a new element with given attributes, write character - data, close last element, etc - + inversted SAX, initial patch in April 2002 archives. -- htmlParseDoc has parameter encoding which is not used. - Function htmlCreateDocParserCtxt ignore it. -- fix realloc() usage. -- Stricten the UTF8 conformance (Martin Duerst): - http://www.w3.org/2001/06/utf-8-test/. - The bad files are in http://www.w3.org/2001/06/utf-8-wrong/. -- xml:id normalized value - -TODO: -===== - -- move all string manipulation functions (xmlStrdup, xmlStrlen, etc.) to - global.c. Bjorn noted that the following files depends on parser.o solely - because of these string functions: entities.o, global.o, hash.o, tree.o, - xmlIO.o, and xpath.o. - -- Optimization of tag strings allocation ? - -- maintain coherency of namespace when doing cut'n paste operations - => the functions are coded, but need testing - -- function to rebuild the ID table -- functions to rebuild the DTD hash tables (after DTD changes). - - -EXTENSIONS: -=========== - -- Tools to produce man pages from the SGML docs. - -- Add Xpointer recognition/API - -- Add Xlink recognition/API - => started adding an xlink.[ch] with a unified API for XML and HTML. - it's crap :-( - -- Implement XSchemas - => Really need to be done <grin/> - - datatype are complete, but structure support is very limited. - -- extend the shell with: - - edit - - load/save - - mv (yum, yum, but it's harder because directories are ordered in - our case, mvup and mvdown would be required) - - -Done: -===== - -- Add HTML validation using the XHTML DTD - - problem: do we want to keep and maintain the code for handling - DTD/System ID cache directly in libxml ? - => not really done that way, but there are new APIs to check elements - or attributes. Otherwise XHTML validation directly ... - -- XML Schemas datatypes except Base64 and BinHex - -- Relax NG validation - -- XmlTextReader streaming API + validation - -- Add a DTD cache prefilled with xhtml DTDs and entities and a program to - manage them -> like the /usr/bin/install-catalog from SGML - right place seems $datadir/xmldtds - Maybe this is better left to user apps - => use a catalog instead , and xhtml1-dtd package - -- Add output to XHTML - => XML serializer automatically recognize the DTd and apply the specific - rules. - -- Fix output of <tst val="x
y"/> - -- compliance to XML-Namespace checking, see section 6 of - http://www.w3.org/TR/REC-xml-names/ - -- Correct standalone checking/emitting (hard) - 2.9 Standalone Document Declaration - -- Implement OASIS XML Catalog support - http://www.oasis-open.org/committees/entity/ - -- Get OASIS testsuite to a more friendly result, check all the results - once stable. the check-xml-test-suite.py script does this - -- Implement XSLT - => libxslt - -- Finish XPath - => attributes addressing troubles - => defaulted attributes handling - => namespace axis ? - done as XSLT got debugged - -- bug reported by Michael Meallin on validation problems - => Actually means I need to add support (and warn) for non-deterministic - content model. -- Handle undefined namespaces in entity contents better ... at least - issue a warning -- DOM needs - int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr); - => done it's actually xmlRemoveProp xmlUnsetProp xmlUnsetNsProp - -- HTML: handling of Script and style data elements, need special code in - the parser and saving functions (handling of < > " ' ...): - http://www.w3.org/TR/html4/types.html#type-script - Attributes are no problems since entities are accepted. -- DOM needs - xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value) -- problem when parsing hrefs with & with the HTML parser (IRC ac) -- If the internal encoding is not UTF8 saving to a given encoding doesn't - work => fix to force UTF8 encoding ... - done, added documentation too -- Add an ASCII I/O encoder (asciiToUTF8 and UTF8Toascii) -- Issue warning when using non-absolute namespaces URI. -- the html parser should add <head> and <body> if they don't exist - started, not finished. - Done, the automatic closing is added and 3 testcases were inserted -- Command to force the parser to stop parsing and ignore the rest of the file. - xmlStopParser() should allow this, mostly untested -- support for HTML empty attributes like <hr noshade> -- plugged iconv() in for support of a large set of encodings. -- xmlSwitchToEncoding() rewrite done -- URI checkings (no fragments) rfc2396.txt -- Added a clean mechanism for overload or added input methods: - xmlRegisterInputCallbacks() -- dynamically adapt the alloc entry point to use g_alloc()/g_free() - if the programmer wants it: - - use xmlMemSetup() to reset the routines used. -- Check attribute normalization especially xmlGetProp() -- Validity checking problems for NOTATIONS attributes -- Validity checking problems for ENTITY ENTITIES attributes -- Parsing of a well balanced chunk xmlParseBalancedChunkMemory() -- URI module: validation, base, etc ... see uri.[ch] -- turn tester into a generic program xmllint installed with libxml -- extend validity checks to go through entities content instead of - just labelling them PCDATA -- Save Dtds using the children list instead of dumping the tables, - order is preserved as well as comments and PIs -- Wrote a notice of changes requires to go from 1.x to 2.x -- make sure that all SAX callbacks are disabled if a WF error is detected -- checking/handling of newline normalization - http://localhost/www.xml.com/axml/target.html#sec-line-ends -- correct checking of '&' '%' on entities content. -- checking of PE/Nesting on entities declaration -- checking/handling of xml:space - - checking done. - - handling done, not well tested -- Language identification code, productions [33] to [38] - => done, the check has been added and report WFness errors -- Conditional sections in DTDs [61] to [65] - => should this crap be really implemented ??? - => Yep OASIS testsuite uses them -- Allow parsed entities defined in the internal subset to override - the ones defined in the external subset (DtD customization). - => This mean that the entity content should be computed only at - use time, i.e. keep the orig string only at parse time and expand - only when referenced from the external subset :-( - Needed for complete use of most DTD from Eve Maler -- Add regression tests for all WFC errors - => did some in test/WFC - => added OASIS testsuite routines - http://xmlsoft.org/conf/result.html - -- I18N: http://wap.trondheim.com/vaer/index.phtml is not XML and accepted - by the XML parser, UTF-8 should be checked when there is no "encoding" - declared ! -- Support for UTF-8 and UTF-16 encoding - => added some convertion routines provided by Martin Durst - patched them, got fixes from @@@ - I plan to keep everything internally as UTF-8 (or ISO-Latin-X) - this is slightly more costly but more compact, and recent processors - efficiency is cache related. The key for good performances is keeping - the data set small, so will I. - => the new progressive reading routines call the detection code - is enabled, tested the ISO->UTF-8 stuff -- External entities loading: - - allow override by client code - - make sure it is alled for all external entities referenced - Done, client code should use xmlSetExternalEntityLoader() to set - the default loading routine. It will be called each time an external - entity entity resolution is triggered. -- maintain ID coherency when removing/changing attributes - The function used to deallocate attributes now check for it being an - ID and removes it from the table. -- push mode parsing i.e. non-blocking state based parser - done, both for XML and HTML parsers. Use xmlCreatePushParserCtxt() - and xmlParseChunk() and html counterparts. - The tester program now has a --push option to select that parser - front-end. Douplicated tests to use both and check results are similar. - -- Most of XPath, still see some troubles and occasionnal memleaks. -- an XML shell, allowing to traverse/manipulate an XML document with - a shell like interface, and using XPath for the anming syntax - - use of readline and history added when available - - the shell interface has been cleanly separated and moved to debugXML.c -- HTML parser, should be fairly stable now -- API to search the lang of an attribute -- Collect IDs at parsing and maintain a table. - PBM: maintain the table coherency - PBM: how to detect ID types in absence of DtD ! -- Use it for XPath ID support -- Add validity checking - Should be finished now ! -- Add regression tests with entity substitutions - -- External Parsed entities, either XML or external Subset [78] and [79] - parsing the xmllang DtD now works, so it should be sufficient for - most cases ! - -- progressive reading. The entity support is a first step toward - asbtraction of an input stream. A large part of the context is still - located on the stack, moving to a state machine and putting everyting - in the parsing context should provide an adequate solution. - => Rather than progressive parsing, give more power to the SAX-like - interface. Currently the DOM-like representation is built but - => it should be possible to define that only as a set of SAX callbacks - and remove the tree creation from the parser code. - DONE - -- DOM support, instead of using a proprietary in memory - format for the document representation, the parser should - call a DOM API to actually build the resulting document. - Then the parser becomes independent of the in-memory - representation of the document. Even better using RPC's - the parser can actually build the document in another - program. - => Work started, now the internal representation is by default - very near a direct DOM implementation. The DOM glue is implemented - as a separate module. See the GNOME gdome module. - -- C++ support : John Ehresman <jehresma@dsg.harvard.edu> -- Updated code to follow more recent specs, added compatibility flag -- Better error handling, use a dedicated, overridable error - handling function. -- Support for CDATA. -- Keep track of line numbers for better error reporting. -- Support for PI (SAX one). -- Support for Comments (bad, should be in ASAP, they are parsed - but not stored), should be configurable. -- Improve the support of entities on save (+SAX). - +124907 HTML parse buffer problem when parsing larse in-memory docs +124110 DTD validation && wrong namespace +123564 xmllint --html --format + + TODO for the XML parser and stuff: + ================================== + + $Id$ + + this tend to be outdated :-\ ... + +DOCS: +===== + +- use case of using XInclude to load for example a description. + order document + product base -(XSLT)-> quote with XIncludes + | + HTML output with description of parts <---(XSLT)-- + +TODO: +===== +- XInclude at the SAX level (libSRVG) +- fix the C code prototype to bring back doc/libxml-undocumented.txt + to a reasonable level +- Computation of base when HTTP redirect occurs, might affect HTTP + interfaces. +- Computation of base in XInclude. Relativization of URIs. +- listing all attributes in a node. +- Better checking of external parsed entities TAG 1234 +- Go through erratas and do the cleanup. + http://www.w3.org/XML/xml-19980210-errata ... started ... +- jamesh suggestion: SAX like functions to save a document ie. call a + function to open a new element with given attributes, write character + data, close last element, etc + + inversted SAX, initial patch in April 2002 archives. +- htmlParseDoc has parameter encoding which is not used. + Function htmlCreateDocParserCtxt ignore it. +- fix realloc() usage. +- Stricten the UTF8 conformance (Martin Duerst): + http://www.w3.org/2001/06/utf-8-test/. + The bad files are in http://www.w3.org/2001/06/utf-8-wrong/. +- xml:id normalized value + +TODO: +===== + +- move all string manipulation functions (xmlStrdup, xmlStrlen, etc.) to + global.c. Bjorn noted that the following files depends on parser.o solely + because of these string functions: entities.o, global.o, hash.o, tree.o, + xmlIO.o, and xpath.o. + +- Optimization of tag strings allocation ? + +- maintain coherency of namespace when doing cut'n paste operations + => the functions are coded, but need testing + +- function to rebuild the ID table +- functions to rebuild the DTD hash tables (after DTD changes). + + +EXTENSIONS: +=========== + +- Tools to produce man pages from the SGML docs. + +- Add Xpointer recognition/API + +- Add Xlink recognition/API + => started adding an xlink.[ch] with a unified API for XML and HTML. + it's crap :-( + +- Implement XSchemas + => Really need to be done <grin/> + - datatype are complete, but structure support is very limited. + +- extend the shell with: + - edit + - load/save + - mv (yum, yum, but it's harder because directories are ordered in + our case, mvup and mvdown would be required) + + +Done: +===== + +- Add HTML validation using the XHTML DTD + - problem: do we want to keep and maintain the code for handling + DTD/System ID cache directly in libxml ? + => not really done that way, but there are new APIs to check elements + or attributes. Otherwise XHTML validation directly ... + +- XML Schemas datatypes except Base64 and BinHex + +- Relax NG validation + +- XmlTextReader streaming API + validation + +- Add a DTD cache prefilled with xhtml DTDs and entities and a program to + manage them -> like the /usr/bin/install-catalog from SGML + right place seems $datadir/xmldtds + Maybe this is better left to user apps + => use a catalog instead , and xhtml1-dtd package + +- Add output to XHTML + => XML serializer automatically recognize the DTd and apply the specific + rules. + +- Fix output of <tst val="x
y"/> + +- compliance to XML-Namespace checking, see section 6 of + http://www.w3.org/TR/REC-xml-names/ + +- Correct standalone checking/emitting (hard) + 2.9 Standalone Document Declaration + +- Implement OASIS XML Catalog support + http://www.oasis-open.org/committees/entity/ + +- Get OASIS testsuite to a more friendly result, check all the results + once stable. the check-xml-test-suite.py script does this + +- Implement XSLT + => libxslt + +- Finish XPath + => attributes addressing troubles + => defaulted attributes handling + => namespace axis ? + done as XSLT got debugged + +- bug reported by Michael Meallin on validation problems + => Actually means I need to add support (and warn) for non-deterministic + content model. +- Handle undefined namespaces in entity contents better ... at least + issue a warning +- DOM needs + int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr); + => done it's actually xmlRemoveProp xmlUnsetProp xmlUnsetNsProp + +- HTML: handling of Script and style data elements, need special code in + the parser and saving functions (handling of < > " ' ...): + http://www.w3.org/TR/html4/types.html#type-script + Attributes are no problems since entities are accepted. +- DOM needs + xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value) +- problem when parsing hrefs with & with the HTML parser (IRC ac) +- If the internal encoding is not UTF8 saving to a given encoding doesn't + work => fix to force UTF8 encoding ... + done, added documentation too +- Add an ASCII I/O encoder (asciiToUTF8 and UTF8Toascii) +- Issue warning when using non-absolute namespaces URI. +- the html parser should add <head> and <body> if they don't exist + started, not finished. + Done, the automatic closing is added and 3 testcases were inserted +- Command to force the parser to stop parsing and ignore the rest of the file. + xmlStopParser() should allow this, mostly untested +- support for HTML empty attributes like <hr noshade> +- plugged iconv() in for support of a large set of encodings. +- xmlSwitchToEncoding() rewrite done +- URI checkings (no fragments) rfc2396.txt +- Added a clean mechanism for overload or added input methods: + xmlRegisterInputCallbacks() +- dynamically adapt the alloc entry point to use g_alloc()/g_free() + if the programmer wants it: + - use xmlMemSetup() to reset the routines used. +- Check attribute normalization especially xmlGetProp() +- Validity checking problems for NOTATIONS attributes +- Validity checking problems for ENTITY ENTITIES attributes +- Parsing of a well balanced chunk xmlParseBalancedChunkMemory() +- URI module: validation, base, etc ... see uri.[ch] +- turn tester into a generic program xmllint installed with libxml +- extend validity checks to go through entities content instead of + just labelling them PCDATA +- Save Dtds using the children list instead of dumping the tables, + order is preserved as well as comments and PIs +- Wrote a notice of changes requires to go from 1.x to 2.x +- make sure that all SAX callbacks are disabled if a WF error is detected +- checking/handling of newline normalization + http://localhost/www.xml.com/axml/target.html#sec-line-ends +- correct checking of '&' '%' on entities content. +- checking of PE/Nesting on entities declaration +- checking/handling of xml:space + - checking done. + - handling done, not well tested +- Language identification code, productions [33] to [38] + => done, the check has been added and report WFness errors +- Conditional sections in DTDs [61] to [65] + => should this crap be really implemented ??? + => Yep OASIS testsuite uses them +- Allow parsed entities defined in the internal subset to override + the ones defined in the external subset (DtD customization). + => This mean that the entity content should be computed only at + use time, i.e. keep the orig string only at parse time and expand + only when referenced from the external subset :-( + Needed for complete use of most DTD from Eve Maler +- Add regression tests for all WFC errors + => did some in test/WFC + => added OASIS testsuite routines + http://xmlsoft.org/conf/result.html + +- I18N: http://wap.trondheim.com/vaer/index.phtml is not XML and accepted + by the XML parser, UTF-8 should be checked when there is no "encoding" + declared ! +- Support for UTF-8 and UTF-16 encoding + => added some convertion routines provided by Martin Durst + patched them, got fixes from @@@ + I plan to keep everything internally as UTF-8 (or ISO-Latin-X) + this is slightly more costly but more compact, and recent processors + efficiency is cache related. The key for good performances is keeping + the data set small, so will I. + => the new progressive reading routines call the detection code + is enabled, tested the ISO->UTF-8 stuff +- External entities loading: + - allow override by client code + - make sure it is alled for all external entities referenced + Done, client code should use xmlSetExternalEntityLoader() to set + the default loading routine. It will be called each time an external + entity entity resolution is triggered. +- maintain ID coherency when removing/changing attributes + The function used to deallocate attributes now check for it being an + ID and removes it from the table. +- push mode parsing i.e. non-blocking state based parser + done, both for XML and HTML parsers. Use xmlCreatePushParserCtxt() + and xmlParseChunk() and html counterparts. + The tester program now has a --push option to select that parser + front-end. Douplicated tests to use both and check results are similar. + +- Most of XPath, still see some troubles and occasionnal memleaks. +- an XML shell, allowing to traverse/manipulate an XML document with + a shell like interface, and using XPath for the anming syntax + - use of readline and history added when available + - the shell interface has been cleanly separated and moved to debugXML.c +- HTML parser, should be fairly stable now +- API to search the lang of an attribute +- Collect IDs at parsing and maintain a table. + PBM: maintain the table coherency + PBM: how to detect ID types in absence of DtD ! +- Use it for XPath ID support +- Add validity checking + Should be finished now ! +- Add regression tests with entity substitutions + +- External Parsed entities, either XML or external Subset [78] and [79] + parsing the xmllang DtD now works, so it should be sufficient for + most cases ! + +- progressive reading. The entity support is a first step toward + asbtraction of an input stream. A large part of the context is still + located on the stack, moving to a state machine and putting everyting + in the parsing context should provide an adequate solution. + => Rather than progressive parsing, give more power to the SAX-like + interface. Currently the DOM-like representation is built but + => it should be possible to define that only as a set of SAX callbacks + and remove the tree creation from the parser code. + DONE + +- DOM support, instead of using a proprietary in memory + format for the document representation, the parser should + call a DOM API to actually build the resulting document. + Then the parser becomes independent of the in-memory + representation of the document. Even better using RPC's + the parser can actually build the document in another + program. + => Work started, now the internal representation is by default + very near a direct DOM implementation. The DOM glue is implemented + as a separate module. See the GNOME gdome module. + +- C++ support : John Ehresman <jehresma@dsg.harvard.edu> +- Updated code to follow more recent specs, added compatibility flag +- Better error handling, use a dedicated, overridable error + handling function. +- Support for CDATA. +- Keep track of line numbers for better error reporting. +- Support for PI (SAX one). +- Support for Comments (bad, should be in ASAP, they are parsed + but not stored), should be configurable. +- Improve the support of entities on save (+SAX). + diff --git a/contrib/libs/libxml/TODO_SCHEMAS b/contrib/libs/libxml/TODO_SCHEMAS index 25060758ae..145a4edacb 100644 --- a/contrib/libs/libxml/TODO_SCHEMAS +++ b/contrib/libs/libxml/TODO_SCHEMAS @@ -1,31 +1,31 @@ -- implement counted transitions at the automata level - -- Unicode: - + upgrade to 3.2 - + improve the python script to generate better test - expressions to check the list of ranges. - -- Implement the interface at the SAX level - -- Implement the missing parts in the Structure part - + all content model - + enumerations - + countless others c.f. the TODO scattered in the code - -- Complete the Built-In datatype collections and Facets implementations - -- Regression tests based on - + the primer: - http://www.w3.org/TR/xmlschema-0/ - + the Schemas Test Collection: - http://www.w3.org/2001/05/xmlschema-test-collection/ - + archives of the schemas-dev list - -- Integrity constraints: - + what's that ? How need to read about it - -- "formal" checking, i.e. go through the full Structure spec and - bind code and associated parts of the Schemas spec - -- go though the erratas - http://www.w3.org/2001/05/xmlschema-errata +- implement counted transitions at the automata level + +- Unicode: + + upgrade to 3.2 + + improve the python script to generate better test + expressions to check the list of ranges. + +- Implement the interface at the SAX level + +- Implement the missing parts in the Structure part + + all content model + + enumerations + + countless others c.f. the TODO scattered in the code + +- Complete the Built-In datatype collections and Facets implementations + +- Regression tests based on + + the primer: + http://www.w3.org/TR/xmlschema-0/ + + the Schemas Test Collection: + http://www.w3.org/2001/05/xmlschema-test-collection/ + + archives of the schemas-dev list + +- Integrity constraints: + + what's that ? How need to read about it + +- "formal" checking, i.e. go through the full Structure spec and + bind code and associated parts of the Schemas spec + +- go though the erratas + http://www.w3.org/2001/05/xmlschema-errata diff --git a/contrib/libs/libxml/buf.c b/contrib/libs/libxml/buf.c index 5fb03c8186..d46da36514 100644 --- a/contrib/libs/libxml/buf.c +++ b/contrib/libs/libxml/buf.c @@ -1,7 +1,7 @@ /* * buf.c: memory buffers for libxml2 * - * new buffer structures and entry points to simplify the maintenance + * new buffer structures and entry points to simplify the maintenance * of libxml2 and ensure we keep good control over memory allocations * and stay 64 bits clean. * The new entry point use the xmlBufPtr opaque structure and @@ -27,7 +27,7 @@ #include <libxml/tree.h> #include <libxml/globals.h> #include <libxml/tree.h> -#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */ +#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */ #include "buf.h" #define WITH_BUFFER_COMPAT @@ -49,7 +49,7 @@ struct _xmlBuf { size_t use; /* The buffer size used */ size_t size; /* The buffer size */ xmlBufferPtr buffer; /* wrapper for an old buffer */ - int error; /* an error code if a failure occurred */ + int error; /* an error code if a failure occurred */ }; #ifdef WITH_BUFFER_COMPAT @@ -231,7 +231,7 @@ xmlBufPtr xmlBufCreateStatic(void *mem, size_t size) { xmlBufPtr ret; - if (mem == NULL) + if (mem == NULL) return(NULL); ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); @@ -300,8 +300,8 @@ xmlBufSetAllocationScheme(xmlBufPtr buf, if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) || (scheme == XML_BUFFER_ALLOC_EXACT) || (scheme == XML_BUFFER_ALLOC_HYBRID) || - (scheme == XML_BUFFER_ALLOC_IMMUTABLE) || - (scheme == XML_BUFFER_ALLOC_BOUNDED)) { + (scheme == XML_BUFFER_ALLOC_IMMUTABLE) || + (scheme == XML_BUFFER_ALLOC_BOUNDED)) { buf->alloc = scheme; if (buf->buffer) buf->buffer->alloc = scheme; @@ -396,7 +396,7 @@ xmlBufShrink(xmlBufPtr buf, size_t len) { ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL))) { /* * we just move the content pointer, but also make sure - * the perceived buffer size has shrunk accordingly + * the perceived buffer size has shrunk accordingly */ buf->content += len; buf->size -= len; @@ -460,18 +460,18 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t len) { size = buf->use + len + 100; #endif - if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { - /* - * Used to provide parsing limits - */ - if ((buf->use + len >= XML_MAX_TEXT_LENGTH) || - (buf->size >= XML_MAX_TEXT_LENGTH)) { - xmlBufMemoryError(buf, "buffer error: text too long\n"); - return(0); - } - if (size >= XML_MAX_TEXT_LENGTH) - size = XML_MAX_TEXT_LENGTH; - } + if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { + /* + * Used to provide parsing limits + */ + if ((buf->use + len >= XML_MAX_TEXT_LENGTH) || + (buf->size >= XML_MAX_TEXT_LENGTH)) { + xmlBufMemoryError(buf, "buffer error: text too long\n"); + return(0); + } + if (size >= XML_MAX_TEXT_LENGTH) + size = XML_MAX_TEXT_LENGTH; + } if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { size_t start_buf = buf->content - buf->contentIO; @@ -701,7 +701,7 @@ xmlBufUse(const xmlBufPtr buf) * used in the buffer. It does not account for the terminating zero * usually needed * - * Returns the amount or 0 if none or an error occurred + * Returns the amount or 0 if none or an error occurred */ size_t @@ -753,15 +753,15 @@ xmlBufResize(xmlBufPtr buf, size_t size) CHECK_COMPAT(buf) if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0); - if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { - /* - * Used to provide parsing limits - */ - if (size >= XML_MAX_TEXT_LENGTH) { - xmlBufMemoryError(buf, "buffer error: text too long\n"); - return(0); - } - } + if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { + /* + * Used to provide parsing limits + */ + if (size >= XML_MAX_TEXT_LENGTH) { + xmlBufMemoryError(buf, "buffer error: text too long\n"); + return(0); + } + } /* Don't resize if we don't have to */ if (size < buf->size) @@ -890,15 +890,15 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) { needSize = buf->use + len + 2; if (needSize > buf->size){ - if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { - /* - * Used to provide parsing limits - */ - if (needSize >= XML_MAX_TEXT_LENGTH) { - xmlBufMemoryError(buf, "buffer error: text too long\n"); - return(-1); - } - } + if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { + /* + * Used to provide parsing limits + */ + if (needSize >= XML_MAX_TEXT_LENGTH) { + xmlBufMemoryError(buf, "buffer error: text too long\n"); + return(-1); + } + } if (!xmlBufResize(buf, needSize)){ xmlBufMemoryError(buf, "growing buffer"); return XML_ERR_NO_MEMORY; @@ -958,7 +958,7 @@ xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) { if (start_buf > (unsigned int) len) { /* - * We can add it in the space previously shrunk + * We can add it in the space previously shrunk */ buf->content -= len; memmove(&buf->content[0], str, len); @@ -970,15 +970,15 @@ xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) { } needSize = buf->use + len + 2; if (needSize > buf->size){ - if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { - /* - * Used to provide parsing limits - */ - if (needSize >= XML_MAX_TEXT_LENGTH) { - xmlBufMemoryError(buf, "buffer error: text too long\n"); - return(-1); - } - } + if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) { + /* + * Used to provide parsing limits + */ + if (needSize >= XML_MAX_TEXT_LENGTH) { + xmlBufMemoryError(buf, "buffer error: text too long\n"); + return(-1); + } + } if (!xmlBufResize(buf, needSize)){ xmlBufMemoryError(buf, "growing buffer"); return XML_ERR_NO_MEMORY; @@ -1204,10 +1204,10 @@ xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf) { xmlBufferPtr ret; - if (buf == NULL) + if (buf == NULL) return(NULL); CHECK_COMPAT(buf) - if ((buf->error) || (buf->buffer == NULL)) { + if ((buf->error) || (buf->buffer == NULL)) { xmlBufFree(buf); return(NULL); } @@ -1307,7 +1307,7 @@ xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) { CHECK_COMPAT(buf) base = input->base - buf->content; /* - * We could do some pointer arithmetic checks but that's probably + * We could do some pointer arithmetic checks but that's probably * sufficient. */ if (base > buf->size) { diff --git a/contrib/libs/libxml/c14n.c b/contrib/libs/libxml/c14n.c index 3488688540..5b3fbe70c6 100644 --- a/contrib/libs/libxml/c14n.c +++ b/contrib/libs/libxml/c14n.c @@ -43,7 +43,7 @@ typedef enum { typedef struct _xmlC14NVisibleNsStack { int nsCurEnd; /* number of nodes in the set */ - int nsPrevStart; /* the beginning of the stack for previous visible node */ + int nsPrevStart; /* the beginning of the stack for previous visible node */ int nsPrevEnd; /* the end of the stack for previous visible node */ int nsMax; /* size of the array as allocated */ xmlNsPtr *nsTab; /* array of ns in no particular order */ @@ -89,7 +89,7 @@ static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx); -static int xmlC14NIsNodeInNodeset (void *user_data, +static int xmlC14NIsNodeInNodeset (void *user_data, xmlNodePtr node, xmlNodePtr parent); @@ -226,7 +226,7 @@ xmlC14NErrRelativeNamespace(const char *ns_uri) * xmlC14NErr: * @ctxt: a C14N evaluation context * @node: the context node - * @error: the error code + * @error: the error code * @msg: the message * @extra: extra informations * @@ -252,8 +252,8 @@ xmlC14NErr(xmlC14NCtxPtr ctxt, xmlNodePtr node, int error, #define XML_NAMESPACES_DEFAULT 16 static int -xmlC14NIsNodeInNodeset(void *user_data, xmlNodePtr node, xmlNodePtr parent) { - xmlNodeSetPtr nodes = (xmlNodeSetPtr) user_data; +xmlC14NIsNodeInNodeset(void *user_data, xmlNodePtr node, xmlNodePtr parent) { + xmlNodeSetPtr nodes = (xmlNodeSetPtr) user_data; if((nodes != NULL) && (node != NULL)) { if(node->type != XML_NAMESPACE_DECL) { return(xmlXPathNodeSetContains(nodes, node)); @@ -514,10 +514,10 @@ xmlC14NIsXmlNs(xmlNsPtr ns) * Returns -1 if ns1 < ns2, 0 if ns1 == ns2 or 1 if ns1 > ns2. */ static int -xmlC14NNsCompare(const void *data1, const void *data2) +xmlC14NNsCompare(const void *data1, const void *data2) { - const xmlNsPtr ns1 = (const xmlNsPtr) data1; - const xmlNsPtr ns2 = (const xmlNsPtr) data2; + const xmlNsPtr ns1 = (const xmlNsPtr) data1; + const xmlNsPtr ns2 = (const xmlNsPtr) data2; if (ns1 == ns2) return (0); if (ns1 == NULL) @@ -562,11 +562,11 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx) return (1); } -static int -xmlC14NPrintNamespacesWalker(const void *ns, void *ctx) { - return xmlC14NPrintNamespaces((const xmlNsPtr) ns, (xmlC14NCtxPtr) ctx); -} - +static int +xmlC14NPrintNamespacesWalker(const void *ns, void *ctx) { + return xmlC14NPrintNamespaces((const xmlNsPtr) ns, (xmlC14NCtxPtr) ctx); +} + /** * xmlC14NProcessNamespacesAxis: * @ctx: the C14N context @@ -623,7 +623,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) /* * Create a sorted list to store element namespaces */ - list = xmlListCreate(NULL, xmlC14NNsCompare); + list = xmlListCreate(NULL, xmlC14NNsCompare); if (list == NULL) { xmlC14NErrInternal("creating namespaces list (c14n)"); return (-1); @@ -671,7 +671,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) /* * print out all elements from list */ - xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx); + xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx); /* * Cleanup @@ -736,7 +736,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) /* * Create a sorted list to store element namespaces */ - list = xmlListCreate(NULL, xmlC14NNsCompare); + list = xmlListCreate(NULL, xmlC14NNsCompare); if (list == NULL) { xmlC14NErrInternal("creating namespaces list (exc c14n)"); return (-1); @@ -848,7 +848,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) /* * print out all elements from list */ - xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx); + xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx); /* * Cleanup @@ -887,10 +887,10 @@ xmlC14NIsXmlAttr(xmlAttrPtr attr) * Returns -1 if attr1 < attr2, 0 if attr1 == attr2 or 1 if attr1 > attr2. */ static int -xmlC14NAttrsCompare(const void *data1, const void *data2) +xmlC14NAttrsCompare(const void *data1, const void *data2) { - const xmlAttrPtr attr1 = (const xmlAttrPtr) data1; - const xmlAttrPtr attr2 = (const xmlAttrPtr) data2; + const xmlAttrPtr attr1 = (const xmlAttrPtr) data1; + const xmlAttrPtr attr2 = (const xmlAttrPtr) data2; int ret = 0; /* @@ -941,10 +941,10 @@ xmlC14NAttrsCompare(const void *data1, const void *data2) * Returns 1 on success or 0 on fail. */ static int -xmlC14NPrintAttrs(const void *data, void *user) +xmlC14NPrintAttrs(const void *data, void *user) { - const xmlAttrPtr attr = (const xmlAttrPtr) data; - xmlC14NCtxPtr ctx = (xmlC14NCtxPtr) user; + const xmlAttrPtr attr = (const xmlAttrPtr) data; + xmlC14NCtxPtr ctx = (xmlC14NCtxPtr) user; xmlChar *value; xmlChar *buffer; @@ -1154,7 +1154,7 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) /* * Create a sorted list to store element attributes */ - list = xmlListCreate(NULL, xmlC14NAttrsCompare); + list = xmlListCreate(NULL, xmlC14NAttrsCompare); if (list == NULL) { xmlC14NErrInternal("creating attributes list"); return (-1); @@ -1343,7 +1343,7 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) /* * print out all elements from list */ - xmlListWalk(list, xmlC14NPrintAttrs, (void *) ctx); + xmlListWalk(list, xmlC14NPrintAttrs, (void *) ctx); /* * Cleanup @@ -1827,7 +1827,7 @@ xmlC14NNewCtx(xmlDocPtr doc, } /* - * Set "mode" flag and remember list of inclusive prefixes + * Set "mode" flag and remember list of inclusive prefixes * for exclusive c14n */ ctx->mode = mode; @@ -1967,7 +1967,7 @@ xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes, int mode, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { return(xmlC14NExecute(doc, - xmlC14NIsNodeInNodeset, + xmlC14NIsNodeInNodeset, nodes, mode, inclusive_ns_prefixes, @@ -2039,7 +2039,7 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, (void) xmlOutputBufferClose(buf); if ((*doc_txt_ptr == NULL) && (ret > 0)) { - xmlC14NErrMemory("coping canonicalized document"); + xmlC14NErrMemory("coping canonicalized document"); return (-1); } return (ret); @@ -2057,7 +2057,7 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, * canonicalization, ignored otherwise) * @with_comments: include comments in the result (!=0) or not (==0) * @filename: the filename to store canonical XML image - * @compression: the compression level (zlib required): + * @compression: the compression level (zlib required): * -1 - libxml default, * 0 - uncompressed, * >0 - compression level @@ -2080,7 +2080,7 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, xmlC14NErrParam("saving doc"); return (-1); } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (compression < 0) compression = xmlGetCompressMode(); #endif @@ -2100,7 +2100,7 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, ret = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf); if (ret < 0) { - xmlC14NErrInternal("canonize document to buffer"); + xmlC14NErrInternal("canonize document to buffer"); (void) xmlOutputBufferClose(buf); return (-1); } diff --git a/contrib/libs/libxml/catalog.c b/contrib/libs/libxml/catalog.c index b6d63245c1..7328fd319c 100644 --- a/contrib/libs/libxml/catalog.c +++ b/contrib/libs/libxml/catalog.c @@ -47,16 +47,16 @@ #define MAX_CATAL_DEPTH 50 #ifdef _WIN32 -# define PATH_SEPARATOR ';' +# define PATH_SEPARATOR ';' #else -# define PATH_SEPARATOR ':' +# define PATH_SEPARATOR ':' #endif /** * TODO: * * macro to flag unimplemented blocks - * XML_CATALOG_PREFER user env to select between system/public preferred + * XML_CATALOG_PREFER user env to select between system/public preferred * option. C.f. Richard Tobin <richard@cogsci.ed.ac.uk> *> Just FYI, I am using an environment variable XML_CATALOG_PREFER with *> values "system" and "public". I have made the default be "system" to @@ -238,7 +238,7 @@ xmlCatalogErrMemory(const char *extra) * * Handle a catalog error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error, const char *msg, const xmlChar *str1, const xmlChar *str2, const xmlChar *str3) @@ -319,13 +319,13 @@ xmlFreeCatalogEntryList(xmlCatalogEntryPtr ret); /** * xmlFreeCatalogEntry: - * @payload: a Catalog entry + * @payload: a Catalog entry * * Free the memory allocated to a Catalog entry */ static void -xmlFreeCatalogEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlCatalogEntryPtr ret = (xmlCatalogEntryPtr) payload; +xmlFreeCatalogEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlCatalogEntryPtr ret = (xmlCatalogEntryPtr) payload; if (ret == NULL) return; /* @@ -368,22 +368,22 @@ xmlFreeCatalogEntryList(xmlCatalogEntryPtr ret) { while (ret != NULL) { next = ret->next; - xmlFreeCatalogEntry(ret, NULL); + xmlFreeCatalogEntry(ret, NULL); ret = next; } } /** * xmlFreeCatalogHashEntryList: - * @payload: a Catalog entry list + * @payload: a Catalog entry list * * Free the memory allocated to list of Catalog entries from the * catalog file hash. */ static void -xmlFreeCatalogHashEntryList(void *payload, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlCatalogEntryPtr catal = (xmlCatalogEntryPtr) payload; +xmlFreeCatalogHashEntryList(void *payload, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlCatalogEntryPtr catal = (xmlCatalogEntryPtr) payload; xmlCatalogEntryPtr children, next; if (catal == NULL) @@ -394,11 +394,11 @@ xmlFreeCatalogHashEntryList(void *payload, next = children->next; children->dealloc = 0; children->children = NULL; - xmlFreeCatalogEntry(children, NULL); + xmlFreeCatalogEntry(children, NULL); children = next; } catal->dealloc = 0; - xmlFreeCatalogEntry(catal, NULL); + xmlFreeCatalogEntry(catal, NULL); } /** @@ -443,7 +443,7 @@ xmlFreeCatalog(xmlCatalogPtr catal) { if (catal->xml != NULL) xmlFreeCatalogEntryList(catal->xml); if (catal->sgml != NULL) - xmlHashFree(catal->sgml, xmlFreeCatalogEntry); + xmlHashFree(catal->sgml, xmlFreeCatalogEntry); xmlFree(catal); } @@ -462,10 +462,10 @@ xmlFreeCatalog(xmlCatalogPtr catal) { * Serialize an SGML Catalog entry */ static void -xmlCatalogDumpEntry(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload; - FILE *out = (FILE *) data; +xmlCatalogDumpEntry(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload; + FILE *out = (FILE *) data; if ((entry == NULL) || (out == NULL)) return; switch (entry->type) { @@ -728,10 +728,10 @@ BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"); * Convert one entry from the catalog */ static void -xmlCatalogConvertEntry(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload; - xmlCatalogPtr catal = (xmlCatalogPtr) data; +xmlCatalogConvertEntry(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload; + xmlCatalogPtr catal = (xmlCatalogPtr) data; if ((entry == NULL) || (catal == NULL) || (catal->sgml == NULL) || (catal->xml == NULL)) return; @@ -764,7 +764,7 @@ xmlCatalogConvertEntry(void *payload, void *data, entry->type = XML_CATA_CATALOG; break; default: - xmlHashRemoveEntry(catal->sgml, entry->name, xmlFreeCatalogEntry); + xmlHashRemoveEntry(catal->sgml, entry->name, xmlFreeCatalogEntry); return; } /* @@ -804,7 +804,7 @@ xmlConvertSGMLCatalog(xmlCatalogPtr catal) { xmlGenericError(xmlGenericErrorContext, "Converting SGML catalog to XML\n"); } - xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal); + xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal); return(0); } @@ -2401,7 +2401,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value, case SGML_CATA_ENTITY: if (*cur == '%') type = SGML_CATA_PENTITY; - /* Falls through. */ + /* Falls through. */ case SGML_CATA_PENTITY: case SGML_CATA_DOCTYPE: case SGML_CATA_LINKTYPE: @@ -2491,7 +2491,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value, NULL, XML_CATA_PREFER_NONE, NULL); res = xmlHashAddEntry(catal->sgml, name, entry); if (res < 0) { - xmlFreeCatalogEntry(entry, NULL); + xmlFreeCatalogEntry(entry, NULL); } xmlFree(filename); } @@ -2504,7 +2504,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value, XML_CATA_PREFER_NONE, NULL); res = xmlHashAddEntry(catal->sgml, sysid, entry); if (res < 0) { - xmlFreeCatalogEntry(entry, NULL); + xmlFreeCatalogEntry(entry, NULL); } } else { xmlChar *filename; @@ -2942,7 +2942,7 @@ xmlACatalogDump(xmlCatalogPtr catal, FILE *out) { if (catal->type == XML_XML_CATALOG_TYPE) { xmlDumpXMLCatalog(out, catal->xml); } else { - xmlHashScan(catal->sgml, xmlCatalogDumpEntry, out); + xmlHashScan(catal->sgml, xmlCatalogDumpEntry, out); } } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -3006,7 +3006,7 @@ xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *value) { if (catal->type == XML_XML_CATALOG_TYPE) { res = xmlDelXMLCatalog(catal->xml, value); } else { - res = xmlHashRemoveEntry(catal->sgml, value, xmlFreeCatalogEntry); + res = xmlHashRemoveEntry(catal->sgml, value, xmlFreeCatalogEntry); if (res == 0) res = 1; } @@ -3251,7 +3251,7 @@ xmlLoadCatalogs(const char *pathss) { while (xmlIsBlank_ch(*cur)) cur++; if (*cur != 0) { paths = cur; - while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur))) + while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur))) cur++; path = xmlStrndup((const xmlChar *)paths, cur - paths); #ifdef _WIN32 @@ -3267,7 +3267,7 @@ xmlLoadCatalogs(const char *pathss) { xmlFree(path); } } - while (*cur == PATH_SEPARATOR) + while (*cur == PATH_SEPARATOR) cur++; } } @@ -3287,7 +3287,7 @@ xmlCatalogCleanup(void) { xmlGenericError(xmlGenericErrorContext, "Catalogs cleanup\n"); if (xmlCatalogXMLFiles != NULL) - xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList); + xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList); xmlCatalogXMLFiles = NULL; if (xmlDefaultCatalog != NULL) xmlFreeCatalog(xmlDefaultCatalog); diff --git a/contrib/libs/libxml/config-armv7a.h b/contrib/libs/libxml/config-armv7a.h index 47cd8763cd..600b7234df 100644 --- a/contrib/libs/libxml/config-armv7a.h +++ b/contrib/libs/libxml/config-armv7a.h @@ -1,5 +1,5 @@ -#pragma once - -#include "config-linux.h" - -#undef VA_LIST_IS_ARRAY +#pragma once + +#include "config-linux.h" + +#undef VA_LIST_IS_ARRAY diff --git a/contrib/libs/libxml/config-armv8a.h b/contrib/libs/libxml/config-armv8a.h index 47cd8763cd..600b7234df 100644 --- a/contrib/libs/libxml/config-armv8a.h +++ b/contrib/libs/libxml/config-armv8a.h @@ -1,5 +1,5 @@ -#pragma once - -#include "config-linux.h" - -#undef VA_LIST_IS_ARRAY +#pragma once + +#include "config-linux.h" + +#undef VA_LIST_IS_ARRAY diff --git a/contrib/libs/libxml/config-linux.h b/contrib/libs/libxml/config-linux.h index 15a779cbfc..86d1ad76f3 100644 --- a/contrib/libs/libxml/config-linux.h +++ b/contrib/libs/libxml/config-linux.h @@ -1,282 +1,282 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Type cast for the gethostbyname() argument */ -#define GETHOSTBYNAME_ARG_CAST /**/ - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the <arpa/nameser.h> header file. */ -#define HAVE_ARPA_NAMESER_H 1 - -/* Whether struct sockaddr::__ss_family exists */ -/* #undef HAVE_BROKEN_SS_FAMILY */ - -/* Define to 1 if you have the <ctype.h> header file. */ -#define HAVE_CTYPE_H 1 - -/* Define to 1 if you have the <dirent.h> header file. */ -#define HAVE_DIRENT_H 1 - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#define HAVE_DLFCN_H 1 - -/* Have dlopen based dso */ -#define HAVE_DLOPEN /**/ - -/* Define to 1 if you have the <dl.h> header file. */ -/* #undef HAVE_DL_H */ - -/* Define to 1 if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the <float.h> header file. */ -#define HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `fprintf' function. */ -#define HAVE_FPRINTF 1 - -/* Define to 1 if you have the `ftime' function. */ -#define HAVE_FTIME 1 - -/* Define if getaddrinfo is there */ -#define HAVE_GETADDRINFO /**/ - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `isascii' function. */ -#define HAVE_ISASCII 1 - -/* Define if isinf is there */ -#define HAVE_ISINF /**/ - -/* Define if isnan is there */ -#define HAVE_ISNAN /**/ - -/* Define if history library is there (-lhistory) */ -/* #undef HAVE_LIBHISTORY */ - -/* Define if pthread library is there (-lpthread) */ -#define HAVE_LIBPTHREAD /**/ - -/* Define if readline library is there (-lreadline) */ -/* #undef HAVE_LIBREADLINE */ - -/* Define to 1 if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the `localtime' function. */ -#define HAVE_LOCALTIME 1 - -/* Define to 1 if you have the <lzma.h> header file. */ -/* #undef HAVE_LZMA_H */ - -/* Define to 1 if you have the <malloc.h> header file. */ -// #define HAVE_MALLOC_H 1 - -/* Define to 1 if you have the <math.h> header file. */ -#define HAVE_MATH_H 1 - -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mmap' function. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the `munmap' function. */ -#define HAVE_MUNMAP 1 - -/* mmap() is no good without munmap() */ -#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) -# undef /**/ HAVE_MMAP -#endif - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - -/* Define to 1 if you have the <netdb.h> header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the <poll.h> header file. */ -#define HAVE_POLL_H 1 - -/* Define to 1 if you have the `printf' function. */ -#define HAVE_PRINTF 1 - -/* Define if <pthread.h> is there */ -#define HAVE_PTHREAD_H /**/ - -/* Define to 1 if you have the `putenv' function. */ -#define HAVE_PUTENV 1 - -/* Define to 1 if you have the `rand' function. */ -#define HAVE_RAND 1 - -/* Define to 1 if you have the <resolv.h> header file. */ -#define HAVE_RESOLV_H 1 - -/* Have shl_load based dso */ -/* #undef HAVE_SHLLOAD */ - -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* Define to 1 if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define to 1 if you have the `snprintf' function. */ -#define HAVE_SNPRINTF 1 - -/* Define to 1 if you have the `sprintf' function. */ -#define HAVE_SPRINTF 1 - -/* Define to 1 if you have the `srand' function. */ -#define HAVE_SRAND 1 - -/* Define to 1 if you have the `sscanf' function. */ -#define HAVE_SSCANF 1 - -/* Define to 1 if you have the `stat' function. */ -#define HAVE_STAT 1 - -/* Define to 1 if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H 1 - -/* Define to 1 if you have the <stdint.h> header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - -/* Define to 1 if you have the <sys/mman.h> header file. */ -#define HAVE_SYS_MMAN_H 1 - -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define to 1 if you have the <sys/select.h> header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/timeb.h> header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define to 1 if you have the <sys/time.h> header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the `time' function. */ -#define HAVE_TIME 1 - -/* Define to 1 if you have the <time.h> header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 - -/* Whether va_copy() is available */ -#define HAVE_VA_COPY 1 - -/* Define to 1 if you have the `vfprintf' function. */ -#define HAVE_VFPRINTF 1 - -/* Define to 1 if you have the `vsnprintf' function. */ -#define HAVE_VSNPRINTF 1 - -/* Define to 1 if you have the `vsprintf' function. */ -#define HAVE_VSPRINTF 1 - -/* Define to 1 if you have the <zlib.h> header file. */ -#define HAVE_ZLIB_H 1 - -/* Whether __va_copy() is available */ -/* #undef HAVE___VA_COPY */ - -/* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "libxml2" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Type cast for the send() function 2nd arg */ -#define SEND_ARG2_CAST /**/ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Support for IPv6 */ -#define SUPPORT_IP6 /**/ - -/* Define if va_list is an array type */ -#define VA_LIST_IS_ARRAY 1 - -/* Version number of package */ -#define VERSION "2.9.10" - -/* Determine what socket length (socklen_t) data type is */ -#define XML_SOCKLEN_T socklen_t - -/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, - <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT32_T */ - -/* ss_family is not defined here, use __ss_family instead */ -/* #undef ss_family */ - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint32_t */ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Type cast for the gethostbyname() argument */ +#define GETHOSTBYNAME_ARG_CAST /**/ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <arpa/nameser.h> header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Whether struct sockaddr::__ss_family exists */ +/* #undef HAVE_BROKEN_SS_FAMILY */ + +/* Define to 1 if you have the <ctype.h> header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the <dirent.h> header file. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Have dlopen based dso */ +#define HAVE_DLOPEN /**/ + +/* Define to 1 if you have the <dl.h> header file. */ +/* #undef HAVE_DL_H */ + +/* Define to 1 if you have the <errno.h> header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the <float.h> header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `fprintf' function. */ +#define HAVE_FPRINTF 1 + +/* Define to 1 if you have the `ftime' function. */ +#define HAVE_FTIME 1 + +/* Define if getaddrinfo is there */ +#define HAVE_GETADDRINFO /**/ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define if isinf is there */ +#define HAVE_ISINF /**/ + +/* Define if isnan is there */ +#define HAVE_ISNAN /**/ + +/* Define if history library is there (-lhistory) */ +/* #undef HAVE_LIBHISTORY */ + +/* Define if pthread library is there (-lpthread) */ +#define HAVE_LIBPTHREAD /**/ + +/* Define if readline library is there (-lreadline) */ +/* #undef HAVE_LIBREADLINE */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localtime' function. */ +#define HAVE_LOCALTIME 1 + +/* Define to 1 if you have the <lzma.h> header file. */ +/* #undef HAVE_LZMA_H */ + +/* Define to 1 if you have the <malloc.h> header file. */ +// #define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the <math.h> header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `munmap' function. */ +#define HAVE_MUNMAP 1 + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <poll.h> header file. */ +#define HAVE_POLL_H 1 + +/* Define to 1 if you have the `printf' function. */ +#define HAVE_PRINTF 1 + +/* Define if <pthread.h> is there */ +#define HAVE_PTHREAD_H /**/ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the <resolv.h> header file. */ +#define HAVE_RESOLV_H 1 + +/* Have shl_load based dso */ +/* #undef HAVE_SHLLOAD */ + +/* Define to 1 if you have the `signal' function. */ +#define HAVE_SIGNAL 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `sprintf' function. */ +#define HAVE_SPRINTF 1 + +/* Define to 1 if you have the `srand' function. */ +#define HAVE_SRAND 1 + +/* Define to 1 if you have the `sscanf' function. */ +#define HAVE_SSCANF 1 + +/* Define to 1 if you have the `stat' function. */ +#define HAVE_STAT 1 + +/* Define to 1 if you have the <stdarg.h> header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the <sys/mman.h> header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the <sys/select.h> header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/timeb.h> header file. */ +#define HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `time' function. */ +#define HAVE_TIME 1 + +/* Define to 1 if you have the <time.h> header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Whether va_copy() is available */ +#define HAVE_VA_COPY 1 + +/* Define to 1 if you have the `vfprintf' function. */ +#define HAVE_VFPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `vsprintf' function. */ +#define HAVE_VSPRINTF 1 + +/* Define to 1 if you have the <zlib.h> header file. */ +#define HAVE_ZLIB_H 1 + +/* Whether __va_copy() is available */ +/* #undef HAVE___VA_COPY */ + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libxml2" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Type cast for the send() function 2nd arg */ +#define SEND_ARG2_CAST /**/ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Support for IPv6 */ +#define SUPPORT_IP6 /**/ + +/* Define if va_list is an array type */ +#define VA_LIST_IS_ARRAY 1 + +/* Version number of package */ +#define VERSION "2.9.10" + +/* Determine what socket length (socklen_t) data type is */ +#define XML_SOCKLEN_T socklen_t + +/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT32_T */ + +/* ss_family is not defined here, use __ss_family instead */ +/* #undef ss_family */ + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint32_t */ diff --git a/contrib/libs/libxml/config-win.h b/contrib/libs/libxml/config-win.h index 54e204d6e9..c2a19e4e10 100644 --- a/contrib/libs/libxml/config-win.h +++ b/contrib/libs/libxml/config-win.h @@ -1,10 +1,10 @@ -#pragma once - -#include "config-linux.h" - -#undef HAVE_LIBPTHREAD -#undef HAVE_PTHREAD_H -#undef HAVE_UNISTD_H - -// Under Windows, use compiler-specific TLS: it seems broken the other way round. -#define HAVE_COMPILER_TLS +#pragma once + +#include "config-linux.h" + +#undef HAVE_LIBPTHREAD +#undef HAVE_PTHREAD_H +#undef HAVE_UNISTD_H + +// Under Windows, use compiler-specific TLS: it seems broken the other way round. +#define HAVE_COMPILER_TLS diff --git a/contrib/libs/libxml/config.h b/contrib/libs/libxml/config.h index a7fa247569..cdeb8f75da 100644 --- a/contrib/libs/libxml/config.h +++ b/contrib/libs/libxml/config.h @@ -1,15 +1,15 @@ -#pragma once +#pragma once -#if defined(_MSC_VER) -# include "config-win.h" -#else -# include "config-linux.h" +#if defined(_MSC_VER) +# include "config-win.h" +#else +# include "config-linux.h" #endif -#if defined(__arm__) || defined(__ARM__) -# include "config-armv7a.h" +#if defined(__arm__) || defined(__ARM__) +# include "config-armv7a.h" #endif -#if defined(__aarch64__) -# include "config-armv8a.h" +#if defined(__aarch64__) +# include "config-armv8a.h" #endif diff --git a/contrib/libs/libxml/debugXML.c b/contrib/libs/libxml/debugXML.c index 570ba97c94..d855555861 100644 --- a/contrib/libs/libxml/debugXML.c +++ b/contrib/libs/libxml/debugXML.c @@ -44,10 +44,10 @@ struct _xmlDebugCtxt { int depth; /* current depth */ xmlDocPtr doc; /* current document */ xmlNodePtr node; /* current node */ - xmlDictPtr dict; /* the doc dictionary */ + xmlDictPtr dict; /* the doc dictionary */ int check; /* do just checkings */ int errors; /* number of errors found */ - int nodict; /* if the document has no dictionary */ + int nodict; /* if the document has no dictionary */ int options; /* options */ }; @@ -164,7 +164,7 @@ xmlDebugErr(xmlDebugCtxtPtr ctxt, int error, const char *msg) NULL, NULL, NULL, 0, 0, "%s", msg); } -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra) { ctxt->errors++; @@ -174,7 +174,7 @@ xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra) NULL, NULL, NULL, 0, 0, msg, extra); } -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra) { ctxt->errors++; @@ -243,7 +243,7 @@ xmlCtxtCheckString(xmlDebugCtxtPtr ctxt, const xmlChar * str) * @ctxt: the debug context * @name: the name * - * Do debugging on the name, for example the dictionary status and + * Do debugging on the name, for example the dictionary status and * conformance to the Name production. */ static void @@ -265,7 +265,7 @@ xmlCtxtCheckName(xmlDebugCtxtPtr ctxt, const xmlChar * name) ((ctxt->doc == NULL) || ((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) { xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT, - "Name is not from the document dictionary '%s'", + "Name is not from the document dictionary '%s'", (const char *) name); } } @@ -289,10 +289,10 @@ xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) { dict = doc->dict; if ((dict == NULL) && (ctxt->nodict == 0)) { #if 0 - /* deactivated right now as it raises too many errors */ + /* deactivated right now as it raises too many errors */ if (doc->type == XML_DOCUMENT_NODE) xmlDebugErr(ctxt, XML_CHECK_NO_DICT, - "Document has no dictionary\n"); + "Document has no dictionary\n"); #endif ctxt->nodict = 1; } @@ -1168,7 +1168,7 @@ xmlCtxtDumpDocHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) * @output: the FILE * for the output * @doc: the document * - * Dumps debug information concerning the document, not recursive + * Dumps debug information concerning the document, not recursive */ static void xmlCtxtDumpDocumentHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) @@ -1229,11 +1229,11 @@ xmlCtxtDumpDocument(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) } static void -xmlCtxtDumpEntityCallback(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) +xmlCtxtDumpEntityCallback(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { - xmlEntityPtr cur = (xmlEntityPtr) payload; - xmlDebugCtxtPtr ctxt = (xmlDebugCtxtPtr) data; + xmlEntityPtr cur = (xmlEntityPtr) payload; + xmlDebugCtxtPtr ctxt = (xmlDebugCtxtPtr) data; if (cur == NULL) { if (!ctxt->check) fprintf(ctxt->output, "Entity is NULL"); @@ -1292,7 +1292,7 @@ xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) if (!ctxt->check) fprintf(ctxt->output, "Entities in internal subset\n"); - xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt); + xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt); } else fprintf(ctxt->output, "No entities in internal subset\n"); if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) { @@ -1301,7 +1301,7 @@ xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) if (!ctxt->check) fprintf(ctxt->output, "Entities in external subset\n"); - xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt); + xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt); } else if (!ctxt->check) fprintf(ctxt->output, "No entities in external subset\n"); } @@ -1498,7 +1498,7 @@ xmlDebugDumpNodeList(FILE * output, xmlNodePtr node, int depth) * @output: the FILE * for the output * @doc: the document * - * Dumps debug information concerning the document, not recursive + * Dumps debug information concerning the document, not recursive */ void xmlDebugDumpDocumentHead(FILE * output, xmlDocPtr doc) @@ -2363,7 +2363,7 @@ xmlShellRNGValidate(xmlShellCtxtPtr sctxt, char *schemas, int ret; ctxt = xmlRelaxNGNewParserCtxt(schemas); - xmlRelaxNGSetParserErrors(ctxt, xmlGenericError, xmlGenericError, NULL); + xmlRelaxNGSetParserErrors(ctxt, xmlGenericError, xmlGenericError, NULL); relaxngschemas = xmlRelaxNGParse(ctxt); xmlRelaxNGFreeParserCtxt(ctxt); if (relaxngschemas == NULL) { @@ -2372,7 +2372,7 @@ xmlShellRNGValidate(xmlShellCtxtPtr sctxt, char *schemas, return(-1); } vctxt = xmlRelaxNGNewValidCtxt(relaxngschemas); - xmlRelaxNGSetValidErrors(vctxt, xmlGenericError, xmlGenericError, NULL); + xmlRelaxNGSetValidErrors(vctxt, xmlGenericError, xmlGenericError, NULL); ret = xmlRelaxNGValidateDoc(vctxt, sctxt->doc); if (ret == 0) { fprintf(stderr, "%s validates\n", sctxt->filename); @@ -2641,9 +2641,9 @@ xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd, int res = -1; if ((ctxt == NULL) || (ctxt->doc == NULL)) return(-1); - vctxt.userData = NULL; - vctxt.error = xmlGenericError; - vctxt.warning = xmlGenericError; + vctxt.userData = NULL; + vctxt.error = xmlGenericError; + vctxt.warning = xmlGenericError; if ((dtd == NULL) || (dtd[0] == 0)) { res = xmlValidateDocument(&vctxt, ctxt->doc); @@ -2910,9 +2910,9 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, fprintf(ctxt->output, "\tset xml_fragment replace the current node content with the fragment parsed in context\n"); #ifdef LIBXML_XPATH_ENABLED fprintf(ctxt->output, "\txpath expr evaluate the XPath expression in that context and print the result\n"); - fprintf(ctxt->output, "\tsetns nsreg register a namespace to a prefix in the XPath evaluation context\n"); + fprintf(ctxt->output, "\tsetns nsreg register a namespace to a prefix in the XPath evaluation context\n"); fprintf(ctxt->output, "\t format for nsreg is: prefix=[nsuri] (i.e. prefix= unsets a prefix)\n"); - fprintf(ctxt->output, "\tsetrootns register all namespace found on the root element\n"); + fprintf(ctxt->output, "\tsetrootns register all namespace found on the root element\n"); fprintf(ctxt->output, "\t the default namespace if any uses 'defaultns' prefix\n"); #endif /* LIBXML_XPATH_ENABLED */ fprintf(ctxt->output, "\tpwd display current working directory\n"); @@ -2926,7 +2926,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, fprintf(ctxt->output, "\tvalidate check the document for errors\n"); #endif /* LIBXML_VALID_ENABLED */ #ifdef LIBXML_SCHEMAS_ENABLED - fprintf(ctxt->output, "\trelaxng rng validate the document against the Relax-NG schemas\n"); + fprintf(ctxt->output, "\trelaxng rng validate the document against the Relax-NG schemas\n"); #endif fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n"); #ifdef LIBXML_VALID_ENABLED diff --git a/contrib/libs/libxml/dict.c b/contrib/libs/libxml/dict.c index 1618bc56dc..63febfb00c 100644 --- a/contrib/libs/libxml/dict.c +++ b/contrib/libs/libxml/dict.c @@ -38,8 +38,8 @@ * list we will use the BigKey algo as soon as the hash size grows * over MIN_DICT_SIZE so this actually works */ -#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ - !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) +#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ + !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) #define DICT_RANDOMIZATION #endif @@ -49,7 +49,7 @@ #else #ifdef HAVE_INTTYPES_H #include <inttypes.h> -#elif defined(_WIN32) +#elif defined(_WIN32) typedef unsigned __int32 uint32_t; #endif #endif @@ -89,7 +89,7 @@ typedef unsigned __int32 uint32_t; #endif /* WITH_BIG_KEY */ /* - * An entry in the dictionary + * An entry in the dictionary */ typedef struct _xmlDictEntry xmlDictEntry; typedef xmlDictEntry *xmlDictEntryPtr; @@ -112,7 +112,7 @@ struct _xmlDictStrings { xmlChar array[1]; }; /* - * The entire dictionary + * The entire dictionary */ struct _xmlDict { int ref_counter; @@ -207,7 +207,7 @@ xmlDictCleanup(void) { /* * xmlDictAddString: - * @dict: the dictionary + * @dict: the dictionary * @name: the name of the userdata * @len: the length of the name * @@ -227,7 +227,7 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) { #endif pool = dict->strings; while (pool != NULL) { - if ((size_t)(pool->end - pool->free) > namelen) + if ((size_t)(pool->end - pool->free) > namelen) goto found_pool; if (pool->size > size) size = pool->size; limit += pool->size; @@ -269,7 +269,7 @@ found_pool: /* * xmlDictAddQString: - * @dict: the dictionary + * @dict: the dictionary * @prefix: the prefix of the userdata * @plen: the prefix length * @name: the name of the userdata @@ -295,7 +295,7 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen, #endif pool = dict->strings; while (pool != NULL) { - if ((size_t)(pool->end - pool->free) > namelen + plen + 1) + if ((size_t)(pool->end - pool->free) > namelen + plen + 1) goto found_pool; if (pool->size > size) size = pool->size; limit += pool->size; @@ -349,9 +349,9 @@ found_pool: * http://burtleburtle.net/bob/hash/doobs.html */ -#ifdef __clang__ -ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") -#endif +#ifdef __clang__ +ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") +#endif static uint32_t xmlDictComputeBigKey(const xmlChar* data, int namelen, int seed) { uint32_t hash; @@ -384,9 +384,9 @@ xmlDictComputeBigKey(const xmlChar* data, int namelen, int seed) { * * Neither of the two strings must be NULL. */ -#ifdef __clang__ -ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") -#endif +#ifdef __clang__ +ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") +#endif static unsigned long xmlDictComputeBigQKey(const xmlChar *prefix, int plen, const xmlChar *name, int len, int seed) @@ -437,23 +437,23 @@ xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) { } switch (namelen) { case 10: value += name[9]; - /* Falls through. */ + /* Falls through. */ case 9: value += name[8]; - /* Falls through. */ + /* Falls through. */ case 8: value += name[7]; - /* Falls through. */ + /* Falls through. */ case 7: value += name[6]; - /* Falls through. */ + /* Falls through. */ case 6: value += name[5]; - /* Falls through. */ + /* Falls through. */ case 5: value += name[4]; - /* Falls through. */ + /* Falls through. */ case 4: value += name[3]; - /* Falls through. */ + /* Falls through. */ case 3: value += name[2]; - /* Falls through. */ + /* Falls through. */ case 2: value += name[1]; - /* Falls through. */ + /* Falls through. */ default: break; } return(value); @@ -479,35 +479,35 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen, value += 30 * (*prefix); if (len > 10) { - int offset = len - (plen + 1 + 1); - if (offset < 0) - offset = len - (10 + 1); - value += name[offset]; + int offset = len - (plen + 1 + 1); + if (offset < 0) + offset = len - (10 + 1); + value += name[offset]; len = 10; if (plen > 10) plen = 10; } switch (plen) { case 10: value += prefix[9]; - /* Falls through. */ + /* Falls through. */ case 9: value += prefix[8]; - /* Falls through. */ + /* Falls through. */ case 8: value += prefix[7]; - /* Falls through. */ + /* Falls through. */ case 7: value += prefix[6]; - /* Falls through. */ + /* Falls through. */ case 6: value += prefix[5]; - /* Falls through. */ + /* Falls through. */ case 5: value += prefix[4]; - /* Falls through. */ + /* Falls through. */ case 4: value += prefix[3]; - /* Falls through. */ + /* Falls through. */ case 3: value += prefix[2]; - /* Falls through. */ + /* Falls through. */ case 2: value += prefix[1]; - /* Falls through. */ + /* Falls through. */ case 1: value += prefix[0]; - /* Falls through. */ + /* Falls through. */ default: break; } len -= plen; @@ -517,25 +517,25 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen, } switch (len) { case 10: value += name[9]; - /* Falls through. */ + /* Falls through. */ case 9: value += name[8]; - /* Falls through. */ + /* Falls through. */ case 8: value += name[7]; - /* Falls through. */ + /* Falls through. */ case 7: value += name[6]; - /* Falls through. */ + /* Falls through. */ case 6: value += name[5]; - /* Falls through. */ + /* Falls through. */ case 5: value += name[4]; - /* Falls through. */ + /* Falls through. */ case 4: value += name[3]; - /* Falls through. */ + /* Falls through. */ case 3: value += name[2]; - /* Falls through. */ + /* Falls through. */ case 2: value += name[1]; - /* Falls through. */ + /* Falls through. */ case 1: value += name[0]; - /* Falls through. */ + /* Falls through. */ default: break; } return(value); @@ -546,7 +546,7 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen, * * Create a new dictionary * - * Returns the newly created dictionary, or NULL if an error occurred. + * Returns the newly created dictionary, or NULL if an error occurred. */ xmlDictPtr xmlDictCreate(void) { @@ -586,14 +586,14 @@ xmlDictCreate(void) { /** * xmlDictCreateSub: - * @sub: an existing dictionary + * @sub: an existing dictionary * * Create a new dictionary, inheriting strings from the read-only - * dictionary @sub. On lookup, strings are first searched in the - * new dictionary, then in @sub, and if not found are created in the - * new dictionary. + * dictionary @sub. On lookup, strings are first searched in the + * new dictionary, then in @sub, and if not found are created in the + * new dictionary. * - * Returns the newly created dictionary, or NULL if an error occurred. + * Returns the newly created dictionary, or NULL if an error occurred. */ xmlDictPtr xmlDictCreateSub(xmlDictPtr sub) { @@ -612,7 +612,7 @@ xmlDictCreateSub(xmlDictPtr sub) { /** * xmlDictReference: - * @dict: the dictionary + * @dict: the dictionary * * Increment the reference counter of a dictionary * @@ -633,10 +633,10 @@ xmlDictReference(xmlDictPtr dict) { /** * xmlDictGrow: - * @dict: the dictionary - * @size: the new size of the dictionary + * @dict: the dictionary + * @size: the new size of the dictionary * - * resize the dictionary + * resize the dictionary * * Returns 0 in case of success, -1 in case of failure */ @@ -711,8 +711,8 @@ xmlDictGrow(xmlDictPtr dict, size_t size) { dict->dict[key].next = entry; } else { /* - * we don't have much ways to alert from here - * result is losing an entry and unicity guarantee + * we don't have much ways to alert from here + * result is losing an entry and unicity guarantee */ ret = -1; } @@ -768,7 +768,7 @@ xmlDictGrow(xmlDictPtr dict, size_t size) { /** * xmlDictFree: - * @dict: the dictionary + * @dict: the dictionary * * Free the hash @dict and its contents. The userdata is * deallocated with @f if provided. @@ -830,11 +830,11 @@ xmlDictFree(xmlDictPtr dict) { /** * xmlDictLookup: - * @dict: the dictionary + * @dict: the dictionary * @name: the name of the userdata * @len: the length of the name, if -1 it is recomputed * - * Add the @name to the dictionary @dict if not present. + * Add the @name to the dictionary @dict if not present. * * Returns the internal copy of the name or NULL in case of internal error */ @@ -970,11 +970,11 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) { /** * xmlDictExists: - * @dict: the dictionary + * @dict: the dictionary * @name: the name of the userdata * @len: the length of the name, if -1 it is recomputed * - * Check if the @name exists in the dictionary @dict. + * Check if the @name exists in the dictionary @dict. * * Returns the internal copy of the name or NULL if not found. */ @@ -1078,7 +1078,7 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) { /** * xmlDictQLookup: - * @dict: the dictionary + * @dict: the dictionary * @prefix: the prefix * @name: the name * @@ -1183,10 +1183,10 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { /** * xmlDictOwns: - * @dict: the dictionary + * @dict: the dictionary * @str: the string * - * check if a string is owned by the dictionary + * check if a string is owned by the dictionary * * Returns 1 if true, 0 if false and -1 in case of error * -1 in case of error @@ -1210,11 +1210,11 @@ xmlDictOwns(xmlDictPtr dict, const xmlChar *str) { /** * xmlDictSize: - * @dict: the dictionary + * @dict: the dictionary * * Query the number of elements installed in the hash @dict. * - * Returns the number of elements in the dictionary or + * Returns the number of elements in the dictionary or * -1 in case of error */ int @@ -1228,7 +1228,7 @@ xmlDictSize(xmlDictPtr dict) { /** * xmlDictSetLimit: - * @dict: the dictionary + * @dict: the dictionary * @limit: the limit in bytes * * Set a size limit for the dictionary @@ -1249,7 +1249,7 @@ xmlDictSetLimit(xmlDictPtr dict, size_t limit) { /** * xmlDictGetUsage: - * @dict: the dictionary + * @dict: the dictionary * * Get how much memory is used by a dictionary for strings * Added in 2.9.0 diff --git a/contrib/libs/libxml/dynamic/ya.make b/contrib/libs/libxml/dynamic/ya.make index a8dd098c9b..05f475d1e1 100644 --- a/contrib/libs/libxml/dynamic/ya.make +++ b/contrib/libs/libxml/dynamic/ya.make @@ -1,5 +1,5 @@ -# Generated by devtools/yamaker. - +# Generated by devtools/yamaker. + OWNER(g:cpp-contrib g:yandex_io) - -DLL_FOR(contrib/libs/libxml libxml EXPORTS libxml2.syms) + +DLL_FOR(contrib/libs/libxml libxml EXPORTS libxml2.syms) diff --git a/contrib/libs/libxml/elfgcchack.h b/contrib/libs/libxml/elfgcchack.h index ba2fcc2f09..af8ad1148d 100644 --- a/contrib/libs/libxml/elfgcchack.h +++ b/contrib/libs/libxml/elfgcchack.h @@ -11,7 +11,7 @@ #ifdef IN_LIBXML #ifdef __GNUC__ #ifdef PIC -#ifdef __linux__ +#ifdef __linux__ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) #include "libxml/c14n.h" @@ -4312,16 +4312,16 @@ extern __typeof (xmlHashCreateDict) xmlHashCreateDict__internal_alias __attribut #endif #ifdef bottom_hash -#undef xmlHashDefaultDeallocator -extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator __attribute((alias("xmlHashDefaultDeallocator__internal_alias"))); -#else -#ifndef xmlHashDefaultDeallocator -extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator__internal_alias __attribute((visibility("hidden"))); -#define xmlHashDefaultDeallocator xmlHashDefaultDeallocator__internal_alias -#endif -#endif - -#ifdef bottom_hash +#undef xmlHashDefaultDeallocator +extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator __attribute((alias("xmlHashDefaultDeallocator__internal_alias"))); +#else +#ifndef xmlHashDefaultDeallocator +extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator__internal_alias __attribute((visibility("hidden"))); +#define xmlHashDefaultDeallocator xmlHashDefaultDeallocator__internal_alias +#endif +#endif + +#ifdef bottom_hash #undef xmlHashFree extern __typeof (xmlHashFree) xmlHashFree __attribute((alias("xmlHashFree__internal_alias"))); #else diff --git a/contrib/libs/libxml/enc.h b/contrib/libs/libxml/enc.h index 3f08893119..a69a5d03c8 100644 --- a/contrib/libs/libxml/enc.h +++ b/contrib/libs/libxml/enc.h @@ -1,7 +1,7 @@ /* * Summary: Internal Interfaces for encoding in libxml2 * Description: this module describes a few interfaces which were - * added along with the API changes in 2.9.0 + * added along with the API changes in 2.9.0 * those are private routines at this point * * Copy: See Copyright for the status of this software. diff --git a/contrib/libs/libxml/encoding.c b/contrib/libs/libxml/encoding.c index eacc5f35e6..89ac8dd2c9 100644 --- a/contrib/libs/libxml/encoding.c +++ b/contrib/libs/libxml/encoding.c @@ -97,7 +97,7 @@ xmlEncodingErrMemory(const char *extra) * * n encoding error */ -static void LIBXML_ATTR_FORMAT(2,0) +static void LIBXML_ATTR_FORMAT(2,0) xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val) { __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, @@ -114,9 +114,9 @@ openIcuConverter(const char* name, int toUnicode) if (conv == NULL) return NULL; - conv->pivot_source = conv->pivot_buf; - conv->pivot_target = conv->pivot_buf; - + conv->pivot_source = conv->pivot_buf; + conv->pivot_target = conv->pivot_buf; + conv->uconv = ucnv_open(name, &status); if (U_FAILURE(status)) goto error; @@ -361,14 +361,14 @@ UTF8ToUTF8(unsigned char* out, int *outlen, { int len; - if ((out == NULL) || (outlen == NULL) || (inlenb == NULL)) + if ((out == NULL) || (outlen == NULL) || (inlenb == NULL)) return(-1); - if (inb == NULL) { - /* inb == NULL means output is initialized. */ - *outlen = 0; - *inlenb = 0; - return(0); - } + if (inb == NULL) { + /* inb == NULL means output is initialized. */ + *outlen = 0; + *inlenb = 0; + return(0); + } if (*outlen > *inlenb) { len = *inlenb; } else { @@ -1805,7 +1805,7 @@ xmlFindCharEncodingHandler(const char *name) { * * The value of @inlen after return is the number of octets consumed * as the return value is positive, else unpredictable. - * The value of @outlen after return is the number of octets consumed. + * The value of @outlen after return is the number of octets consumed. */ static int xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, @@ -1863,7 +1863,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, * @outlen: the length of @out * @in: a pointer to an array of ISO Latin 1 chars * @inlen: the length of @in - * @flush: if true, indicates end of input + * @flush: if true, indicates end of input * * Returns 0 if success, or * -1 by lack of space, or @@ -1873,11 +1873,11 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, * * The value of @inlen after return is the number of octets consumed * as the return value is positive, else unpredictable. - * The value of @outlen after return is the number of octets consumed. + * The value of @outlen after return is the number of octets consumed. */ static int xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, int flush) { + const unsigned char *in, int *inlen, int flush) { const char *ucv_in = (const char *) in; char *ucv_out = (char *) out; UErrorCode err = U_ZERO_ERROR; @@ -1890,24 +1890,24 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, if (toUnicode) { /* encoding => UTF-16 => UTF-8 */ ucnv_convertEx(cd->utf8, cd->uconv, &ucv_out, ucv_out + *outlen, - &ucv_in, ucv_in + *inlen, cd->pivot_buf, - &cd->pivot_source, &cd->pivot_target, - cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, flush, &err); + &ucv_in, ucv_in + *inlen, cd->pivot_buf, + &cd->pivot_source, &cd->pivot_target, + cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, flush, &err); } else { /* UTF-8 => UTF-16 => encoding */ ucnv_convertEx(cd->uconv, cd->utf8, &ucv_out, ucv_out + *outlen, - &ucv_in, ucv_in + *inlen, cd->pivot_buf, - &cd->pivot_source, &cd->pivot_target, - cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, flush, &err); + &ucv_in, ucv_in + *inlen, cd->pivot_buf, + &cd->pivot_source, &cd->pivot_target, + cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, flush, &err); } *inlen = ucv_in - (const char*) in; *outlen = ucv_out - (char *) out; - if (U_SUCCESS(err)) { - /* reset pivot buf if this is the last call for input (flush==TRUE) */ - if (flush) - cd->pivot_source = cd->pivot_target = cd->pivot_buf; + if (U_SUCCESS(err)) { + /* reset pivot buf if this is the last call for input (flush==TRUE) */ + if (flush) + cd->pivot_source = cd->pivot_target = cd->pivot_buf; return 0; - } + } if (err == U_BUFFER_OVERFLOW_ERROR) return -1; if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND) @@ -1922,67 +1922,67 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, * * ************************************************************************/ -static int -xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, - int *outlen, const unsigned char *in, int *inlen, int flush) { - int ret; - (void)flush; - - if (handler->input != NULL) { - ret = handler->input(out, outlen, in, inlen); - } -#ifdef LIBXML_ICONV_ENABLED - else if (handler->iconv_in != NULL) { - ret = xmlIconvWrapper(handler->iconv_in, out, outlen, in, inlen); - } -#endif /* LIBXML_ICONV_ENABLED */ -#ifdef LIBXML_ICU_ENABLED - else if (handler->uconv_in != NULL) { - ret = xmlUconvWrapper(handler->uconv_in, 1, out, outlen, in, inlen, - flush); - } -#endif /* LIBXML_ICU_ENABLED */ - else { - *outlen = 0; - *inlen = 0; - ret = -2; - } - - return(ret); -} - -/* Returns -4 if no output function was found. */ -static int -xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out, - int *outlen, const unsigned char *in, int *inlen) { - int ret; - - if (handler->output != NULL) { - ret = handler->output(out, outlen, in, inlen); - } -#ifdef LIBXML_ICONV_ENABLED - else if (handler->iconv_out != NULL) { - ret = xmlIconvWrapper(handler->iconv_out, out, outlen, in, inlen); - } -#endif /* LIBXML_ICONV_ENABLED */ -#ifdef LIBXML_ICU_ENABLED - else if (handler->uconv_out != NULL) { - ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen, - TRUE); - } -#endif /* LIBXML_ICU_ENABLED */ - else { - *outlen = 0; - *inlen = 0; - ret = -4; - } - - return(ret); -} - +static int +xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, + int *outlen, const unsigned char *in, int *inlen, int flush) { + int ret; + (void)flush; + + if (handler->input != NULL) { + ret = handler->input(out, outlen, in, inlen); + } +#ifdef LIBXML_ICONV_ENABLED + else if (handler->iconv_in != NULL) { + ret = xmlIconvWrapper(handler->iconv_in, out, outlen, in, inlen); + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (handler->uconv_in != NULL) { + ret = xmlUconvWrapper(handler->uconv_in, 1, out, outlen, in, inlen, + flush); + } +#endif /* LIBXML_ICU_ENABLED */ + else { + *outlen = 0; + *inlen = 0; + ret = -2; + } + + return(ret); +} + +/* Returns -4 if no output function was found. */ +static int +xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out, + int *outlen, const unsigned char *in, int *inlen) { + int ret; + + if (handler->output != NULL) { + ret = handler->output(out, outlen, in, inlen); + } +#ifdef LIBXML_ICONV_ENABLED + else if (handler->iconv_out != NULL) { + ret = xmlIconvWrapper(handler->iconv_out, out, outlen, in, inlen); + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (handler->uconv_out != NULL) { + ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen, + TRUE); + } +#endif /* LIBXML_ICU_ENABLED */ + else { + *outlen = 0; + *inlen = 0; + ret = -4; + } + + return(ret); +} + /** * xmlCharEncFirstLineInt: - * @handler: char encoding transformation data structure + * @handler: char encoding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input * @len: number of bytes to convert for the first line, or -1 @@ -1998,7 +1998,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out, int xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in, int len) { - int ret; + int ret; int written; int toconv; @@ -2029,13 +2029,13 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, written = out->size - out->use - 1; } - ret = xmlEncInputChunk(handler, &out->content[out->use], &written, - in->content, &toconv, 0); - xmlBufferShrink(in, toconv); - out->use += written; - out->content[out->use] = 0; - if (ret == -1) ret = -3; - + ret = xmlEncInputChunk(handler, &out->content[out->use], &written, + in->content, &toconv, 0); + xmlBufferShrink(in, toconv); + out->use += written; + out->content[out->use] = 0; + if (ret == -1) ret = -3; + #ifdef DEBUG_ENCODING switch (ret) { case 0: @@ -2069,7 +2069,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, /** * xmlCharEncFirstLine: - * @handler: char encoding transformation data structure + * @handler: char encoding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input * @@ -2105,7 +2105,7 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out, int xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) { - int ret; + int ret; size_t written; size_t toconv; int c_in; @@ -2147,13 +2147,13 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) c_in = toconv; c_out = written; - ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out, - xmlBufContent(in), &c_in, 0); - xmlBufShrink(in, c_in); - xmlBufAddLen(out, c_out); - if (ret == -1) - ret = -3; - + ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in, 0); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + switch (ret) { case 0: #ifdef DEBUG_ENCODING @@ -2212,7 +2212,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) int xmlCharEncInput(xmlParserInputBufferPtr input, int flush) { - int ret; + int ret; size_t written; size_t toconv; int c_in; @@ -2245,13 +2245,13 @@ xmlCharEncInput(xmlParserInputBufferPtr input, int flush) c_in = toconv; c_out = written; - ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out, - xmlBufContent(in), &c_in, flush); - xmlBufShrink(in, c_in); - xmlBufAddLen(out, c_out); - if (ret == -1) - ret = -3; - + ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in, flush); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + switch (ret) { case 0: #ifdef DEBUG_ENCODING @@ -2312,7 +2312,7 @@ int xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, xmlBufferPtr in) { - int ret; + int ret; int written; int toconv; @@ -2331,14 +2331,14 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, xmlBufferGrow(out, out->size + toconv * 2); written = out->size - out->use - 1; } - ret = xmlEncInputChunk(handler, &out->content[out->use], &written, - in->content, &toconv, 1); - xmlBufferShrink(in, toconv); - out->use += written; - out->content[out->use] = 0; - if (ret == -1) - ret = -3; - + ret = xmlEncInputChunk(handler, &out->content[out->use], &written, + in->content, &toconv, 1); + xmlBufferShrink(in, toconv); + out->use += written; + out->content[out->use] = 0; + if (ret == -1) + ret = -3; + switch (ret) { case 0: #ifdef DEBUG_ENCODING @@ -2402,7 +2402,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, int xmlCharEncOutput(xmlOutputBufferPtr output, int init) { - int ret; + int ret; size_t written; size_t writtentot = 0; size_t toconv; @@ -2429,10 +2429,10 @@ retry: if (init) { c_in = 0; c_out = written; - /* TODO: Check return value. */ - xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, - NULL, &c_in); - xmlBufAddLen(out, c_out); + /* TODO: Check return value. */ + xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, + NULL, &c_in); + xmlBufAddLen(out, c_out); #ifdef DEBUG_ENCODING xmlGenericError(xmlGenericErrorContext, "initialized encoder\n"); @@ -2457,17 +2457,17 @@ retry: c_in = toconv; c_out = written; - ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, - xmlBufContent(in), &c_in); - xmlBufShrink(in, c_in); - xmlBufAddLen(out, c_out); - writtentot += c_out; - if (ret == -1) { + ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + writtentot += c_out; + if (ret == -1) { if (c_out > 0) { - /* Can be a limitation of iconv or uconv */ - goto retry; + /* Can be a limitation of iconv or uconv */ + goto retry; } - ret = -3; + ret = -3; } /* @@ -2493,44 +2493,44 @@ retry: c_in, c_out, (int) xmlBufUse(in)); #endif break; - case -4: - xmlEncodingErr(XML_I18N_NO_OUTPUT, - "xmlCharEncOutFunc: no output function !\n", NULL); - ret = -1; - break; + case -4: + xmlEncodingErr(XML_I18N_NO_OUTPUT, + "xmlCharEncOutFunc: no output function !\n", NULL); + ret = -1; + break; case -2: { - xmlChar charref[20]; + xmlChar charref[20]; int len = (int) xmlBufUse(in); xmlChar *content = xmlBufContent(in); - int cur, charrefLen; + int cur, charrefLen; cur = xmlGetUTF8Char(content, &len); - if (cur <= 0) + if (cur <= 0) break; #ifdef DEBUG_ENCODING - xmlGenericError(xmlGenericErrorContext, - "handling output conversion error\n"); - xmlGenericError(xmlGenericErrorContext, - "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n", - content[0], content[1], - content[2], content[3]); + xmlGenericError(xmlGenericErrorContext, + "handling output conversion error\n"); + xmlGenericError(xmlGenericErrorContext, + "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n", + content[0], content[1], + content[2], content[3]); #endif - /* - * Removes the UTF8 sequence, and replace it by a charref - * and continue the transcoding phase, hoping the error - * did not mangle the encoder state. - */ - charrefLen = snprintf((char *) &charref[0], sizeof(charref), - "&#%d;", cur); - xmlBufShrink(in, len); - xmlBufGrow(out, charrefLen * 4); - c_out = xmlBufAvail(out) - 1; - c_in = charrefLen; - ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, - charref, &c_in); - - if ((ret < 0) || (c_in != charrefLen)) { + /* + * Removes the UTF8 sequence, and replace it by a charref + * and continue the transcoding phase, hoping the error + * did not mangle the encoder state. + */ + charrefLen = snprintf((char *) &charref[0], sizeof(charref), + "&#%d;", cur); + xmlBufShrink(in, len); + xmlBufGrow(out, charrefLen * 4); + c_out = xmlBufAvail(out) - 1; + c_in = charrefLen; + ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out, + charref, &c_in); + + if ((ret < 0) || (c_in != charrefLen)) { char buf[50]; snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", @@ -2542,12 +2542,12 @@ retry: buf); if (xmlBufGetAllocationScheme(in) != XML_BUFFER_ALLOC_IMMUTABLE) content[0] = ' '; - break; + break; } - - xmlBufAddLen(out, c_out); - writtentot += c_out; - goto retry; + + xmlBufAddLen(out, c_out); + writtentot += c_out; + goto retry; } } return(ret); @@ -2556,7 +2556,7 @@ retry: /** * xmlCharEncOutFunc: - * @handler: char encoding transformation data structure + * @handler: char encoding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input * @@ -2575,7 +2575,7 @@ retry: int xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in) { - int ret; + int ret; int written; int writtentot = 0; int toconv; @@ -2596,11 +2596,11 @@ retry: */ if (in == NULL) { toconv = 0; - /* TODO: Check return value. */ - xmlEncOutputChunk(handler, &out->content[out->use], &written, - NULL, &toconv); - out->use += written; - out->content[out->use] = 0; + /* TODO: Check return value. */ + xmlEncOutputChunk(handler, &out->content[out->use], &written, + NULL, &toconv); + out->use += written; + out->content[out->use] = 0; #ifdef DEBUG_ENCODING xmlGenericError(xmlGenericErrorContext, "initialized encoder\n"); @@ -2618,18 +2618,18 @@ retry: xmlBufferGrow(out, toconv * 4); written = out->size - out->use - 1; } - ret = xmlEncOutputChunk(handler, &out->content[out->use], &written, - in->content, &toconv); - xmlBufferShrink(in, toconv); - out->use += written; - writtentot += written; - out->content[out->use] = 0; - if (ret == -1) { - if (written > 0) { - /* Can be a limitation of iconv or uconv */ - goto retry; - } - ret = -3; + ret = xmlEncOutputChunk(handler, &out->content[out->use], &written, + in->content, &toconv); + xmlBufferShrink(in, toconv); + out->use += written; + writtentot += written; + out->content[out->use] = 0; + if (ret == -1) { + if (written > 0) { + /* Can be a limitation of iconv or uconv */ + goto retry; + } + ret = -3; } if (ret >= 0) output += ret; @@ -2657,44 +2657,44 @@ retry: toconv, written, in->use); #endif break; - case -4: - xmlEncodingErr(XML_I18N_NO_OUTPUT, - "xmlCharEncOutFunc: no output function !\n", NULL); - ret = -1; - break; + case -4: + xmlEncodingErr(XML_I18N_NO_OUTPUT, + "xmlCharEncOutFunc: no output function !\n", NULL); + ret = -1; + break; case -2: { - xmlChar charref[20]; + xmlChar charref[20]; int len = in->use; const xmlChar *utf = (const xmlChar *) in->content; - int cur, charrefLen; + int cur, charrefLen; cur = xmlGetUTF8Char(utf, &len); - if (cur <= 0) + if (cur <= 0) break; #ifdef DEBUG_ENCODING - xmlGenericError(xmlGenericErrorContext, - "handling output conversion error\n"); - xmlGenericError(xmlGenericErrorContext, - "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n", - in->content[0], in->content[1], - in->content[2], in->content[3]); + xmlGenericError(xmlGenericErrorContext, + "handling output conversion error\n"); + xmlGenericError(xmlGenericErrorContext, + "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n", + in->content[0], in->content[1], + in->content[2], in->content[3]); #endif - /* - * Removes the UTF8 sequence, and replace it by a charref - * and continue the transcoding phase, hoping the error - * did not mangle the encoder state. - */ - charrefLen = snprintf((char *) &charref[0], sizeof(charref), - "&#%d;", cur); - xmlBufferShrink(in, len); - xmlBufferGrow(out, charrefLen * 4); - written = out->size - out->use - 1; - toconv = charrefLen; - ret = xmlEncOutputChunk(handler, &out->content[out->use], &written, - charref, &toconv); - - if ((ret < 0) || (toconv != charrefLen)) { + /* + * Removes the UTF8 sequence, and replace it by a charref + * and continue the transcoding phase, hoping the error + * did not mangle the encoder state. + */ + charrefLen = snprintf((char *) &charref[0], sizeof(charref), + "&#%d;", cur); + xmlBufferShrink(in, len); + xmlBufferGrow(out, charrefLen * 4); + written = out->size - out->use - 1; + toconv = charrefLen; + ret = xmlEncOutputChunk(handler, &out->content[out->use], &written, + charref, &toconv); + + if ((ret < 0) || (toconv != charrefLen)) { char buf[50]; snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", @@ -2706,13 +2706,13 @@ retry: buf); if (in->alloc != XML_BUFFER_ALLOC_IMMUTABLE) in->content[0] = ' '; - break; + break; } - - out->use += written; - writtentot += written; - out->content[out->use] = 0; - goto retry; + + out->use += written; + writtentot += written; + out->content[out->use] = 0; + goto retry; } } return(ret); @@ -2720,7 +2720,7 @@ retry: /** * xmlCharEncCloseFunc: - * @handler: char encoding transformation data structure + * @handler: char encoding transformation data structure * * Generic front-end for encoding handler close function * @@ -2821,7 +2821,7 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) { xmlCharEncodingHandler * handler = in->buf->encoder; /* * Encoding conversion, compute the number of unused original - * bytes from the input not consumed and subtract that from + * bytes from the input not consumed and subtract that from * the raw consumed value, this is not a cheap operation */ if (in->end - in->cur > 0) { @@ -2831,20 +2831,20 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) { int ret; - do { - toconv = in->end - cur; - written = 32000; - ret = xmlEncOutputChunk(handler, &convbuf[0], &written, - cur, &toconv); - if (ret < 0) { - if (written > 0) - ret = -2; - else - return(-1); - } - unused += written; - cur += toconv; - } while (ret == -2); + do { + toconv = in->end - cur; + written = 32000; + ret = xmlEncOutputChunk(handler, &convbuf[0], &written, + cur, &toconv); + if (ret < 0) { + if (written > 0) + ret = -2; + else + return(-1); + } + unused += written; + cur += toconv; + } while (ret == -2); } if (in->buf->rawconsumed < unused) return(-1); @@ -2870,7 +2870,7 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) { * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise * The value of @inlen after return is the number of octets consumed * as the return value is positive, else unpredictable. - * The value of @outlen after return is the number of octets consumed. + * The value of @outlen after return is the number of octets consumed. */ static int UTF8ToISO8859x(unsigned char* out, int *outlen, @@ -2986,7 +2986,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, * block of chars out. * Returns 0 if success, or -1 otherwise * The value of @inlen after return is the number of octets consumed - * The value of @outlen after return is the number of octets produced. + * The value of @outlen after return is the number of octets produced. */ static int ISO8859xToUTF8(unsigned char* out, int *outlen, diff --git a/contrib/libs/libxml/entities.c b/contrib/libs/libxml/entities.c index 9b235050ce..d575e9d177 100644 --- a/contrib/libs/libxml/entities.c +++ b/contrib/libs/libxml/entities.c @@ -6,11 +6,11 @@ * daniel@veillard.com */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" @@ -88,7 +88,7 @@ xmlEntitiesErrMemory(const char *extra) * * Handle an out of memory condition */ -static void LIBXML_ATTR_FORMAT(2,0) +static void LIBXML_ATTR_FORMAT(2,0) xmlEntitiesErr(xmlParserErrors code, const char *msg) { __xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL); @@ -148,7 +148,7 @@ xmlFreeEntity(xmlEntityPtr entity) /* * xmlCreateEntity: * - * internal routine doing the entity node structures allocations + * internal routine doing the entity node structures allocations */ static xmlEntityPtr xmlCreateEntity(xmlDictPtr dict, const xmlChar *name, int type, @@ -398,7 +398,7 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, * * Create a new entity, this differs from xmlAddDocEntity() that if * the document is NULL or has no internal subset defined, then an - * unlinked entity structure will be returned, it is then the responsibility + * unlinked entity structure will be returned, it is then the responsibility * of the caller to link it to the document later or free it when not needed * anymore. * @@ -548,7 +548,7 @@ xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) { * xmlEncodeEntitiesInternal: * @doc: the document containing the string * @input: A string to convert to XML. - * @attr: are we handling an attribute value + * @attr: are we handling an attribute value * * Do a global encoding of a string, replacing the predefined entities * and non ASCII values with their entities and CharRef counterparts. @@ -885,9 +885,9 @@ xmlCreateEntitiesTable(void) { * Deallocate the memory used by an entities in the hash table. */ static void -xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) { +xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) { if (entity != NULL) - xmlFreeEntity((xmlEntityPtr) entity); + xmlFreeEntity((xmlEntityPtr) entity); } /** @@ -898,7 +898,7 @@ xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) { */ void xmlFreeEntitiesTable(xmlEntitiesTablePtr table) { - xmlHashFree(table, xmlFreeEntityWrapper); + xmlHashFree(table, xmlFreeEntityWrapper); } #ifdef LIBXML_TREE_ENABLED @@ -910,9 +910,9 @@ xmlFreeEntitiesTable(xmlEntitiesTablePtr table) { * * Returns the new xmlEntitiesPtr or NULL in case of error. */ -static void * -xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlEntityPtr ent = (xmlEntityPtr) payload; +static void * +xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlEntityPtr ent = (xmlEntityPtr) payload; xmlEntityPtr cur; cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); @@ -949,7 +949,7 @@ xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { */ xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table) { - return(xmlHashCopy(table, xmlCopyEntity)); + return(xmlHashCopy(table, xmlCopyEntity)); } #endif /* LIBXML_TREE_ENABLED */ @@ -1090,9 +1090,9 @@ xmlDumpEntityDecl(xmlBufferPtr buf, xmlEntityPtr ent) { * When using the hash table scan function, arguments need to be reversed */ static void -xmlDumpEntityDeclScan(void *ent, void *buf, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlDumpEntityDecl((xmlBufferPtr) buf, (xmlEntityPtr) ent); +xmlDumpEntityDeclScan(void *ent, void *buf, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlDumpEntityDecl((xmlBufferPtr) buf, (xmlEntityPtr) ent); } /** @@ -1104,7 +1104,7 @@ xmlDumpEntityDeclScan(void *ent, void *buf, */ void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) { - xmlHashScan(table, xmlDumpEntityDeclScan, buf); + xmlHashScan(table, xmlDumpEntityDeclScan, buf); } #endif /* LIBXML_OUTPUT_ENABLED */ #define bottom_entities diff --git a/contrib/libs/libxml/error.c b/contrib/libs/libxml/error.c index 71af00e4e2..b7d5b36bc7 100644 --- a/contrib/libs/libxml/error.c +++ b/contrib/libs/libxml/error.c @@ -18,7 +18,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); + ...) LIBXML_ATTR_FORMAT(2,3); #define XML_GET_VAR_STR(msg, str) { \ int size, prev_size = -1; \ @@ -177,9 +177,9 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , xmlChar content[81]; /* space for 80 chars + line terminator */ xmlChar *ctnt; - if ((input == NULL) || (input->cur == NULL)) - return; - + if ((input == NULL) || (input->cur == NULL)) + return; + cur = input->cur; base = input->base; /* skip backwards over any end-of-lines */ @@ -238,7 +238,7 @@ xmlParserPrintFileContext(xmlParserInputPtr input) { * @ctx: the parser context or NULL * @str: the formatted error message * - * Report an error with its context, replace the 4 old error/warning + * Report an error with its context, replace the 4 old error/warning * routines. */ static void @@ -631,7 +631,7 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel, (channel == xmlParserValidityError) || (channel == xmlParserValidityWarning)) xmlReportError(to, ctxt, str, NULL, NULL); - else if (((void(*)(void)) channel == (void(*)(void)) fprintf) || + else if (((void(*)(void)) channel == (void(*)(void)) fprintf) || (channel == xmlGenericErrorDefaultFunc)) xmlReportError(to, ctxt, str, channel, data); else @@ -853,7 +853,7 @@ xmlParserValidityWarning(void *ctx, const char *msg, ...) * Get the last global error registered. This is per thread if compiled * with thread support. * - * Returns NULL if no error occurred or a pointer to the error + * Returns NULL if no error occurred or a pointer to the error */ xmlErrorPtr xmlGetLastError(void) @@ -910,7 +910,7 @@ xmlResetLastError(void) * * Get the last parsing error registered. * - * Returns NULL if no error occurred or a pointer to the error + * Returns NULL if no error occurred or a pointer to the error */ xmlErrorPtr xmlCtxtGetLastError(void *ctx) diff --git a/contrib/libs/libxml/globals.c b/contrib/libs/libxml/globals.c index 6c319f21a4..7bf985f487 100644 --- a/contrib/libs/libxml/globals.c +++ b/contrib/libs/libxml/globals.c @@ -92,7 +92,7 @@ xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; * * The variable holding the libxml free() implementation */ -xmlFreeFunc xmlFree = free; +xmlFreeFunc xmlFree = free; /** * xmlMalloc: * @size: the size requested in bytes @@ -101,18 +101,18 @@ xmlFreeFunc xmlFree = free; * * Returns a pointer to the newly allocated block or NULL in case of error */ -xmlMallocFunc xmlMalloc = malloc; +xmlMallocFunc xmlMalloc = malloc; /** * xmlMallocAtomic: * @size: the size requested in bytes * * The variable holding the libxml malloc() implementation for atomic - * data (i.e. blocks not containing pointers), useful when using a + * data (i.e. blocks not containing pointers), useful when using a * garbage collecting allocator. * * Returns a pointer to the newly allocated block or NULL in case of error */ -xmlMallocFunc xmlMallocAtomic = malloc; +xmlMallocFunc xmlMallocAtomic = malloc; /** * xmlRealloc: * @mem: an already allocated block of memory @@ -122,20 +122,20 @@ xmlMallocFunc xmlMallocAtomic = malloc; * * Returns a pointer to the newly reallocated block or NULL in case of error */ -xmlReallocFunc xmlRealloc = realloc; +xmlReallocFunc xmlRealloc = realloc; +/** + * xmlPosixStrdup + * @cur: the input char * + * + * a strdup implementation with a type signature matching POSIX + * + * Returns a new xmlChar * or NULL + */ +static char * +xmlPosixStrdup(const char *cur) { + return((char*) xmlCharStrdup(cur)); +} /** - * xmlPosixStrdup - * @cur: the input char * - * - * a strdup implementation with a type signature matching POSIX - * - * Returns a new xmlChar * or NULL - */ -static char * -xmlPosixStrdup(const char *cur) { - return((char*) xmlCharStrdup(cur)); -} -/** * xmlMemStrdup: * @str: a zero terminated string * @@ -143,7 +143,7 @@ xmlPosixStrdup(const char *cur) { * * Returns the copy of the string or NULL in case of error */ -xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup; +xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup; #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */ #include <libxml/threads.h> @@ -260,7 +260,7 @@ static int xmlPedanticParserDefaultValueThrDef = 0; * Global setting, indicate that the parser should store the line number * in the content field of elements in the DOM tree. * Disabled by default since this may not be safe for old classes of - * application. + * application. */ int xmlLineNumbersDefaultValue = 0; static int xmlLineNumbersDefaultValueThrDef = 0; @@ -361,7 +361,7 @@ static const char *xmlTreeIndentStringThrDef = " "; * xmlSaveNoEmptyTags: * * Global setting, asking the serializer to not output empty tags - * as <empty/> but <empty></empty>. those two forms are indistinguishable + * as <empty/> but <empty></empty>. those two forms are indistinguishable * once parsed. * Disabled by default */ diff --git a/contrib/libs/libxml/hash.c b/contrib/libs/libxml/hash.c index 6492587e7a..a83d979b64 100644 --- a/contrib/libs/libxml/hash.c +++ b/contrib/libs/libxml/hash.c @@ -33,8 +33,8 @@ * it seems that having hash randomization might be a good idea * when using XML with untrusted data */ -#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ - !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) +#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ + !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) #define HASH_RANDOMIZATION #endif @@ -79,9 +79,9 @@ struct _xmlHashTable { * xmlHashComputeKey: * Calculate the hash key */ -#ifdef __clang__ -ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") -#endif +#ifdef __clang__ +ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") +#endif static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3) { @@ -112,9 +112,9 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, return (value % table->size); } -#ifdef __clang__ -ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") -#endif +#ifdef __clang__ +ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") +#endif static unsigned long xmlHashComputeQKey(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, @@ -175,7 +175,7 @@ xmlHashComputeQKey(xmlHashTablePtr table, * * Create a new xmlHashTablePtr. * - * Returns the newly created object, or NULL if an error occurred. + * Returns the newly created object, or NULL if an error occurred. */ xmlHashTablePtr xmlHashCreate(int size) { @@ -209,7 +209,7 @@ xmlHashCreate(int size) { * * Create a new xmlHashTablePtr which will use @dict as the internal dictionary * - * Returns the newly created object, or NULL if an error occurred. + * Returns the newly created object, or NULL if an error occurred. */ xmlHashTablePtr xmlHashCreateDict(int size, xmlDictPtr dict) { @@ -368,18 +368,18 @@ xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f) { } /** - * xmlHashDefaultDeallocator: - * @entry: the hash table entry - * @name: the entry's name - * - * Free a hash table entry with xmlFree. - */ -void -xmlHashDefaultDeallocator(void *entry, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFree(entry); -} - -/** + * xmlHashDefaultDeallocator: + * @entry: the hash table entry + * @name: the entry's name + * + * Free a hash table entry with xmlFree. + */ +void +xmlHashDefaultDeallocator(void *entry, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFree(entry); +} + +/** * xmlHashAddEntry: * @table: the hash table * @name: the name of the userdata @@ -931,11 +931,11 @@ void xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data) { - stubData stubdata; - stubdata.data = data; - stubdata.hashscanner = f; - xmlHashScanFull3(table, name, name2, name3, stubHashScannerFull, - &stubdata); + stubData stubdata; + stubdata.data = data; + stubdata.hashscanner = f; + xmlHashScanFull3(table, name, name2, name3, stubHashScannerFull, + &stubdata); } /** diff --git a/contrib/libs/libxml/include/libxml/HTMLparser.h b/contrib/libs/libxml/include/libxml/HTMLparser.h index a7554420db..c4baf6519e 100644 --- a/contrib/libs/libxml/include/libxml/HTMLparser.h +++ b/contrib/libs/libxml/include/libxml/HTMLparser.h @@ -115,12 +115,12 @@ XMLPUBFUN htmlParserCtxtPtr XMLCALL XMLPUBFUN int XMLCALL htmlParseDocument(htmlParserCtxtPtr ctxt); XMLPUBFUN htmlDocPtr XMLCALL - htmlSAXParseDoc (const xmlChar *cur, + htmlSAXParseDoc (const xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData); XMLPUBFUN htmlDocPtr XMLCALL - htmlParseDoc (const xmlChar *cur, + htmlParseDoc (const xmlChar *cur, const char *encoding); XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseFile(const char *filename, diff --git a/contrib/libs/libxml/include/libxml/c14n.h b/contrib/libs/libxml/include/libxml/c14n.h index 4b961be8de..1237d6c366 100644 --- a/contrib/libs/libxml/include/libxml/c14n.h +++ b/contrib/libs/libxml/include/libxml/c14n.h @@ -28,17 +28,17 @@ extern "C" { #include "xpath.h" /* - * XML Canonicalization + * XML Canonicalization * http://www.w3.org/TR/xml-c14n * - * Exclusive XML Canonicalization + * Exclusive XML Canonicalization * http://www.w3.org/TR/xml-exc-c14n * * Canonical form of an XML document could be created if and only if * a) default attributes (if any) are added to all nodes * b) all character and parsed entity references are resolved - * In order to achieve this in libxml2 the document MUST be loaded with - * following global settings: + * In order to achieve this in libxml2 the document MUST be loaded with + * following global settings: * * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; * xmlSubstituteEntitiesDefault(1); @@ -59,7 +59,7 @@ extern "C" { * */ typedef enum { - XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */ + XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */ XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */ XML_C14N_1_1 = 2 /* C14N 1.1 spec */ } xmlC14NMode; @@ -96,7 +96,7 @@ XMLPUBFUN int XMLCALL /** * xmlC14NIsVisibleCallback: * @user_data: user data - * @node: the current node + * @node: the current node * @parent: the parent node * * Signature for a C14N callback on visible nodes diff --git a/contrib/libs/libxml/include/libxml/catalog.h b/contrib/libs/libxml/include/libxml/catalog.h index 04aaf8f332..88cce3b855 100644 --- a/contrib/libs/libxml/include/libxml/catalog.h +++ b/contrib/libs/libxml/include/libxml/catalog.h @@ -39,7 +39,7 @@ extern "C" { /** * XML_CATALOG_PI: * - * The specific XML Catalog Processing Instruction name. + * The specific XML Catalog Processing Instruction name. */ #define XML_CATALOG_PI \ (const xmlChar *) "oasis-xml-catalog" diff --git a/contrib/libs/libxml/include/libxml/dict.h b/contrib/libs/libxml/include/libxml/dict.h index 4ba8fe2727..4b0686b4ff 100644 --- a/contrib/libs/libxml/include/libxml/dict.h +++ b/contrib/libs/libxml/include/libxml/dict.h @@ -1,5 +1,5 @@ /* - * Summary: string dictionary + * Summary: string dictionary * Description: dictionary of reusable strings, just used to avoid allocation * and freeing operations. * @@ -11,7 +11,7 @@ #ifndef __XML_DICT_H__ #define __XML_DICT_H__ -#include <stddef.h> +#include <stddef.h> #include "xmlversion.h" #ifdef __cplusplus @@ -19,7 +19,7 @@ extern "C" { #endif /* - * The dictionary. + * The dictionary. */ typedef struct _xmlDict xmlDict; typedef xmlDict *xmlDictPtr; @@ -47,7 +47,7 @@ XMLPUBFUN void XMLCALL xmlDictFree (xmlDictPtr dict); /* - * Lookup of entry in the dictionary. + * Lookup of entry in the dictionary. */ XMLPUBFUN const xmlChar * XMLCALL xmlDictLookup (xmlDictPtr dict, diff --git a/contrib/libs/libxml/include/libxml/encoding.h b/contrib/libs/libxml/include/libxml/encoding.h index 52865c6067..e3582bf149 100644 --- a/contrib/libs/libxml/include/libxml/encoding.h +++ b/contrib/libs/libxml/include/libxml/encoding.h @@ -129,14 +129,14 @@ typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, * If iconv is supported, there are two extra fields. */ #ifdef LIBXML_ICU_ENABLED -/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ -#define ICU_PIVOT_BUF_SIZE 1024 +/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ +#define ICU_PIVOT_BUF_SIZE 1024 struct _uconv_t { UConverter *uconv; /* for conversion between an encoding and UTF-16 */ UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ - UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; - UChar *pivot_source; - UChar *pivot_target; + UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; + UChar *pivot_source; + UChar *pivot_target; }; typedef struct _uconv_t uconv_t; #endif diff --git a/contrib/libs/libxml/include/libxml/hash.h b/contrib/libs/libxml/include/libxml/hash.h index 15fdb39b28..2b0701c4b4 100644 --- a/contrib/libs/libxml/include/libxml/hash.h +++ b/contrib/libs/libxml/include/libxml/hash.h @@ -66,7 +66,7 @@ extern "C" { * * Callback to free data from a hash. */ -typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name); +typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name); /** * xmlHashCopier: * @payload: the data in the hash @@ -76,20 +76,20 @@ typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name); * * Returns a copy of the data or NULL in case of error. */ -typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name); +typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name); /** * xmlHashScanner: * @payload: the data in the hash - * @data: extra scanner data + * @data: extra scanner data * @name: the name associated * * Callback when scanning data in a hash with the simple scanner. */ -typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name); +typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name); /** * xmlHashScannerFull: * @payload: the data in the hash - * @data: extra scanner data + * @data: extra scanner data * @name: the name associated * @name2: the second name associated * @name3: the third name associated @@ -111,9 +111,9 @@ XMLPUBFUN xmlHashTablePtr XMLCALL XMLPUBFUN void XMLCALL xmlHashFree (xmlHashTablePtr table, xmlHashDeallocator f); -XMLPUBFUN void XMLCALL - xmlHashDefaultDeallocator(void *entry, - const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlHashDefaultDeallocator(void *entry, + const xmlChar *name); /* * Add a new entry to the hash table. diff --git a/contrib/libs/libxml/include/libxml/list.h b/contrib/libs/libxml/include/libxml/list.h index 02438fe595..526b9e718f 100644 --- a/contrib/libs/libxml/include/libxml/list.h +++ b/contrib/libs/libxml/include/libxml/list.h @@ -49,7 +49,7 @@ typedef int (*xmlListDataCompare) (const void *data0, const void *data1); * * Returns 0 to stop walking the list, 1 otherwise. */ -typedef int (*xmlListWalker) (const void *data, void *user); +typedef int (*xmlListWalker) (const void *data, void *user); /* Creation/Deletion */ XMLPUBFUN xmlListPtr XMLCALL @@ -110,11 +110,11 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL xmlListWalk (xmlListPtr l, xmlListWalker walker, - void *user); + void *user); XMLPUBFUN void XMLCALL xmlListReverseWalk (xmlListPtr l, xmlListWalker walker, - void *user); + void *user); XMLPUBFUN void XMLCALL xmlListMerge (xmlListPtr l1, xmlListPtr l2); diff --git a/contrib/libs/libxml/include/libxml/nanoftp.h b/contrib/libs/libxml/include/libxml/nanoftp.h index c7b17aa874..4af658de2e 100644 --- a/contrib/libs/libxml/include/libxml/nanoftp.h +++ b/contrib/libs/libxml/include/libxml/nanoftp.h @@ -16,7 +16,7 @@ #ifdef LIBXML_FTP_ENABLED /* Needed for portability to Windows 64 bits */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include <winsock2.h> #else /** diff --git a/contrib/libs/libxml/include/libxml/parser.h b/contrib/libs/libxml/include/libxml/parser.h index a18e5bbb7c..a4e97caee8 100644 --- a/contrib/libs/libxml/include/libxml/parser.h +++ b/contrib/libs/libxml/include/libxml/parser.h @@ -260,7 +260,7 @@ struct _xmlParserCtxt { void *catalogs; /* document's own catalog */ int recovery; /* run in recovery mode */ int progressive; /* is this a progressive parsing */ - xmlDictPtr dict; /* dictionary for the parser */ + xmlDictPtr dict; /* dictionary for the parser */ const xmlChar * *atts; /* array for the attributes callbacks */ int maxatts; /* the size of the array */ int docdict; /* use strings from dict to build tree */ @@ -283,11 +283,11 @@ struct _xmlParserCtxt { void * *pushTab; /* array of data for push */ xmlHashTablePtr attsDefault; /* defaulted attributes if any */ xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ - int nsWellFormed; /* is the document XML Namespace okay */ + int nsWellFormed; /* is the document XML Namespace okay */ int options; /* Extra options */ /* - * Those fields are needed only for streaming parsing so far + * Those fields are needed only for streaming parsing so far */ int dictNames; /* Use dictionary names for the tree */ int freeElemsNr; /* number of freed element nodes */ @@ -1097,9 +1097,9 @@ typedef enum { XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ - XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */ + XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */ XML_PARSE_NONET = 1<<11,/* Forbid network access */ - XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */ + XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */ XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ @@ -1191,7 +1191,7 @@ XMLPUBFUN xmlDocPtr XMLCALL /** * xmlFeature: * - * Used to examine the existence of features that can be enabled + * Used to examine the existence of features that can be enabled * or disabled at compile-time. * They used to be called XML_FEATURE_xxx but this clashed with Expat */ diff --git a/contrib/libs/libxml/include/libxml/parserInternals.h b/contrib/libs/libxml/include/libxml/parserInternals.h index 989a8d819a..31d0e4c6b8 100644 --- a/contrib/libs/libxml/include/libxml/parserInternals.h +++ b/contrib/libs/libxml/include/libxml/parserInternals.h @@ -43,7 +43,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth; /** * XML_MAX_NAME_LENGTH: * - * Maximum size allowed for a markup identifier. + * Maximum size allowed for a markup identifier. * This is not a limitation of the parser but a safety boundary feature, * use XML_PARSE_HUGE option to override it. * Note that with the use of parsing dictionaries overriding the limit @@ -351,7 +351,7 @@ XMLPUBFUN void XMLCALL xmlParserErrors xmlerr, const char *msg, const xmlChar * str1, - const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0); + const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0); #endif /** diff --git a/contrib/libs/libxml/include/libxml/schemasInternals.h b/contrib/libs/libxml/include/libxml/schemasInternals.h index 8c1638cbf8..32d649381e 100644 --- a/contrib/libs/libxml/include/libxml/schemasInternals.h +++ b/contrib/libs/libxml/include/libxml/schemasInternals.h @@ -3,7 +3,7 @@ * Description: internal interfaces for the XML Schemas handling * and schema validity checking * The Schemas development is a Work In Progress. - * Some of those interfaces are not guaranteed to be API or ABI stable ! + * Some of those interfaces are not guaranteed to be API or ABI stable ! * * Copy: See Copyright for the status of this software. * @@ -28,52 +28,52 @@ extern "C" { typedef enum { XML_SCHEMAS_UNKNOWN = 0, - XML_SCHEMAS_STRING = 1, - XML_SCHEMAS_NORMSTRING = 2, - XML_SCHEMAS_DECIMAL = 3, - XML_SCHEMAS_TIME = 4, - XML_SCHEMAS_GDAY = 5, - XML_SCHEMAS_GMONTH = 6, - XML_SCHEMAS_GMONTHDAY = 7, - XML_SCHEMAS_GYEAR = 8, - XML_SCHEMAS_GYEARMONTH = 9, - XML_SCHEMAS_DATE = 10, - XML_SCHEMAS_DATETIME = 11, - XML_SCHEMAS_DURATION = 12, - XML_SCHEMAS_FLOAT = 13, - XML_SCHEMAS_DOUBLE = 14, - XML_SCHEMAS_BOOLEAN = 15, - XML_SCHEMAS_TOKEN = 16, - XML_SCHEMAS_LANGUAGE = 17, - XML_SCHEMAS_NMTOKEN = 18, - XML_SCHEMAS_NMTOKENS = 19, - XML_SCHEMAS_NAME = 20, - XML_SCHEMAS_QNAME = 21, - XML_SCHEMAS_NCNAME = 22, - XML_SCHEMAS_ID = 23, - XML_SCHEMAS_IDREF = 24, - XML_SCHEMAS_IDREFS = 25, - XML_SCHEMAS_ENTITY = 26, - XML_SCHEMAS_ENTITIES = 27, - XML_SCHEMAS_NOTATION = 28, - XML_SCHEMAS_ANYURI = 29, - XML_SCHEMAS_INTEGER = 30, - XML_SCHEMAS_NPINTEGER = 31, - XML_SCHEMAS_NINTEGER = 32, - XML_SCHEMAS_NNINTEGER = 33, - XML_SCHEMAS_PINTEGER = 34, - XML_SCHEMAS_INT = 35, - XML_SCHEMAS_UINT = 36, - XML_SCHEMAS_LONG = 37, - XML_SCHEMAS_ULONG = 38, - XML_SCHEMAS_SHORT = 39, - XML_SCHEMAS_USHORT = 40, - XML_SCHEMAS_BYTE = 41, - XML_SCHEMAS_UBYTE = 42, - XML_SCHEMAS_HEXBINARY = 43, - XML_SCHEMAS_BASE64BINARY = 44, - XML_SCHEMAS_ANYTYPE = 45, - XML_SCHEMAS_ANYSIMPLETYPE = 46 + XML_SCHEMAS_STRING = 1, + XML_SCHEMAS_NORMSTRING = 2, + XML_SCHEMAS_DECIMAL = 3, + XML_SCHEMAS_TIME = 4, + XML_SCHEMAS_GDAY = 5, + XML_SCHEMAS_GMONTH = 6, + XML_SCHEMAS_GMONTHDAY = 7, + XML_SCHEMAS_GYEAR = 8, + XML_SCHEMAS_GYEARMONTH = 9, + XML_SCHEMAS_DATE = 10, + XML_SCHEMAS_DATETIME = 11, + XML_SCHEMAS_DURATION = 12, + XML_SCHEMAS_FLOAT = 13, + XML_SCHEMAS_DOUBLE = 14, + XML_SCHEMAS_BOOLEAN = 15, + XML_SCHEMAS_TOKEN = 16, + XML_SCHEMAS_LANGUAGE = 17, + XML_SCHEMAS_NMTOKEN = 18, + XML_SCHEMAS_NMTOKENS = 19, + XML_SCHEMAS_NAME = 20, + XML_SCHEMAS_QNAME = 21, + XML_SCHEMAS_NCNAME = 22, + XML_SCHEMAS_ID = 23, + XML_SCHEMAS_IDREF = 24, + XML_SCHEMAS_IDREFS = 25, + XML_SCHEMAS_ENTITY = 26, + XML_SCHEMAS_ENTITIES = 27, + XML_SCHEMAS_NOTATION = 28, + XML_SCHEMAS_ANYURI = 29, + XML_SCHEMAS_INTEGER = 30, + XML_SCHEMAS_NPINTEGER = 31, + XML_SCHEMAS_NINTEGER = 32, + XML_SCHEMAS_NNINTEGER = 33, + XML_SCHEMAS_PINTEGER = 34, + XML_SCHEMAS_INT = 35, + XML_SCHEMAS_UINT = 36, + XML_SCHEMAS_LONG = 37, + XML_SCHEMAS_ULONG = 38, + XML_SCHEMAS_SHORT = 39, + XML_SCHEMAS_USHORT = 40, + XML_SCHEMAS_BYTE = 41, + XML_SCHEMAS_UBYTE = 42, + XML_SCHEMAS_HEXBINARY = 43, + XML_SCHEMAS_BASE64BINARY = 44, + XML_SCHEMAS_ANYTYPE = 45, + XML_SCHEMAS_ANYSIMPLETYPE = 46 } xmlSchemaValType; /* @@ -321,13 +321,13 @@ struct _xmlSchemaWildcard { /** * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED: * - * The attribute wildcard has been built. + * The attribute wildcard has been built. */ #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0 /** * XML_SCHEMAS_ATTRGROUP_GLOBAL: * - * The attribute group has been defined. + * The attribute group has been defined. */ #define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1 /** @@ -725,7 +725,7 @@ struct _xmlSchemaType { /** * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION: * - * disallowed substitutions: "substitution" + * disallowed substitutions: "substitution" */ #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13 /** @@ -789,7 +789,7 @@ struct _xmlSchemaElement { xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */ xmlSchemaContentType contentType; const xmlChar *refPrefix; /* Deprecated; not used */ - xmlSchemaValPtr defVal; /* The compiled value constraint. */ + xmlSchemaValPtr defVal; /* The compiled value constraint. */ void *idcs; /* The identity-constraint defs */ }; @@ -881,7 +881,7 @@ struct _xmlSchemaNotation { /** * XML_SCHEMAS_FINAL_DEFAULT_LIST: * - * the schema has "list" in the set of finalDefault. + * the schema has "list" in the set of finalDefault. */ #define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4 /** @@ -942,7 +942,7 @@ struct _xmlSchema { xmlDictPtr dict; void *includes; /* the includes, this is opaque for now */ int preserve; /* whether to free the document */ - int counter; /* used to give anonymous components unique names */ + int counter; /* used to give anonymous components unique names */ xmlHashTablePtr idcDef; /* All identity-constraint defs. */ void *volatiles; /* Obsolete */ }; diff --git a/contrib/libs/libxml/include/libxml/threads.h b/contrib/libs/libxml/include/libxml/threads.h index 2ffccebf10..b0a99b2b01 100644 --- a/contrib/libs/libxml/include/libxml/threads.h +++ b/contrib/libs/libxml/include/libxml/threads.h @@ -72,14 +72,14 @@ XMLPUBFUN void XMLCALL XMLPUBFUN xmlGlobalStatePtr XMLCALL xmlGetGlobalState(void); -#ifdef HAVE_PTHREAD_H -#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) -#if defined(LIBXML_STATIC_FOR_DLL) -int XMLCALL -xmlDllMain(void *hinstDLL, unsigned long fdwReason, - void *lpvReserved); +#ifdef HAVE_PTHREAD_H +#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) +#if defined(LIBXML_STATIC_FOR_DLL) +int XMLCALL +xmlDllMain(void *hinstDLL, unsigned long fdwReason, + void *lpvReserved); +#endif #endif -#endif #ifdef __cplusplus } diff --git a/contrib/libs/libxml/include/libxml/tree.h b/contrib/libs/libxml/include/libxml/tree.h index cdaa723df6..f257fb6a9d 100644 --- a/contrib/libs/libxml/include/libxml/tree.h +++ b/contrib/libs/libxml/include/libxml/tree.h @@ -76,8 +76,8 @@ typedef enum { XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */ - XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */ - XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */ + XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */ + XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */ } xmlBufferAllocationScheme; /** @@ -527,7 +527,7 @@ struct _xmlNode { * xmlDocProperty * * Set of properties of the document as found by the parser - * Some of them are linked to similarly named xmlParserOption + * Some of them are linked to similarly named xmlParserOption */ typedef enum { XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */ @@ -575,7 +575,7 @@ struct _xmlDoc { void *ids; /* Hash table for ID attributes if any */ void *refs; /* Hash table for IDREFs attributes if any */ const xmlChar *URL; /* The URI for that document */ - int charset; /* Internal flag for charset handling, + int charset; /* Internal flag for charset handling, actually an xmlCharEncoding */ struct _xmlDict *dict; /* dict used to allocate names or NULL */ void *psvi; /* for type/PSVI informations */ diff --git a/contrib/libs/libxml/include/libxml/xlink.h b/contrib/libs/libxml/include/libxml/xlink.h index 0bbb36c23d..edae487b3e 100644 --- a/contrib/libs/libxml/include/libxml/xlink.h +++ b/contrib/libs/libxml/include/libxml/xlink.h @@ -26,7 +26,7 @@ extern "C" { * of namespaces. If "foo" is the prefix for "http://foo.com/" * then the link detection layer will expand role="foo:myrole" * to "http://foo.com/:myrole". - * NOTE: the link detection layer will expand URI-References found on + * NOTE: the link detection layer will expand URI-References found on * href attributes by using the base mechanism if found. */ typedef xmlChar *xlinkHRef; diff --git a/contrib/libs/libxml/include/libxml/xmlIO.h b/contrib/libs/libxml/include/libxml/xmlIO.h index 712ff231fc..a2da495f5f 100644 --- a/contrib/libs/libxml/include/libxml/xmlIO.h +++ b/contrib/libs/libxml/include/libxml/xmlIO.h @@ -27,7 +27,7 @@ extern "C" { * @filename: the filename or URI * * Callback used in the I/O Input API to detect if the current handler - * can provide input functionality for this resource. + * can provide input functionality for this resource. * * Returns 1 if yes and 0 if another Input module should be used */ @@ -73,7 +73,7 @@ typedef int (XMLCALL *xmlInputCloseCallback) (void * context); * @filename: the filename or URI * * Callback used in the I/O Output API to detect if the current handler - * can provide output functionality for this resource. + * can provide output functionality for this resource. * * Returns 1 if yes and 0 if another Output module should be used */ diff --git a/contrib/libs/libxml/include/libxml/xmlerror.h b/contrib/libs/libxml/include/libxml/xmlerror.h index 34cf206c74..d47d726d5a 100644 --- a/contrib/libs/libxml/include/libxml/xmlerror.h +++ b/contrib/libs/libxml/include/libxml/xmlerror.h @@ -837,7 +837,7 @@ typedef enum { * xmlGenericErrorFunc: * @ctx: a parsing context * @msg: the message - * @...: the extra arguments of the varargs to format the message + * @...: the extra arguments of the varargs to format the message * * Signature of the function to use when there is an error and * no parsing or validity context available . @@ -937,7 +937,7 @@ XMLPUBFUN void XMLCALL int code, xmlNodePtr node, const char *msg, - const char *extra) LIBXML_ATTR_FORMAT(4,0); + const char *extra) LIBXML_ATTR_FORMAT(4,0); #endif #ifdef __cplusplus } diff --git a/contrib/libs/libxml/include/libxml/xmlexports.h b/contrib/libs/libxml/include/libxml/xmlexports.h index a9fc0abb7a..f03af0d03a 100644 --- a/contrib/libs/libxml/include/libxml/xmlexports.h +++ b/contrib/libs/libxml/include/libxml/xmlexports.h @@ -122,8 +122,8 @@ #define XMLCDECL __cdecl #endif -/* Cygwin platform (does not define _WIN32), GNU compiler */ -#if defined(__CYGWIN__) +/* Cygwin platform (does not define _WIN32), GNU compiler */ +#if defined(__CYGWIN__) #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL @@ -136,7 +136,7 @@ #if !defined(LIBXML_STATIC) #define XMLPUBVAR __declspec(dllimport) extern #else - #define XMLPUBVAR extern + #define XMLPUBVAR extern #endif #endif #define XMLCALL __cdecl diff --git a/contrib/libs/libxml/include/libxml/xmlreader.h b/contrib/libs/libxml/include/libxml/xmlreader.h index 70ca548651..8eb24a13f1 100644 --- a/contrib/libs/libxml/include/libxml/xmlreader.h +++ b/contrib/libs/libxml/include/libxml/xmlreader.h @@ -393,7 +393,7 @@ typedef void * xmlTextReaderLocatorPtr; * @arg: the user argument * @msg: the message * @severity: the severity of the error - * @locator: a locator indicating where the error occurred + * @locator: a locator indicating where the error occurred * * Signature of an error callback from a reader parser */ diff --git a/contrib/libs/libxml/include/libxml/xmlstring.h b/contrib/libs/libxml/include/libxml/xmlstring.h index f286ae176b..154cd48594 100644 --- a/contrib/libs/libxml/include/libxml/xmlstring.h +++ b/contrib/libs/libxml/include/libxml/xmlstring.h @@ -97,13 +97,13 @@ XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN int XMLCALL xmlStrPrintf (xmlChar *buf, int len, - const char *msg, - ...) LIBXML_ATTR_FORMAT(3,4); + const char *msg, + ...) LIBXML_ATTR_FORMAT(3,4); XMLPUBFUN int XMLCALL xmlStrVPrintf (xmlChar *buf, int len, - const char *msg, - va_list ap) LIBXML_ATTR_FORMAT(3,0); + const char *msg, + va_list ap) LIBXML_ATTR_FORMAT(3,0); XMLPUBFUN int XMLCALL xmlGetUTF8Char (const unsigned char *utf, diff --git a/contrib/libs/libxml/include/libxml/xmlversion.h b/contrib/libs/libxml/include/libxml/xmlversion.h index 5d6da6276d..8d910e5731 100644 --- a/contrib/libs/libxml/include/libxml/xmlversion.h +++ b/contrib/libs/libxml/include/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.10" +#define LIBXML_DOTTED_VERSION "2.9.10" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20910 +#define LIBXML_VERSION 20910 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20910" +#define LIBXML_VERSION_STRING "20910" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "" +#define LIBXML_VERSION_EXTRA "" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20910); +#define LIBXML_TEST_VERSION xmlCheckVersion(20910); #ifndef VMS #if 0 @@ -288,7 +288,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether ISO-8859-* support is made available in case iconv is not */ -#if 1 +#if 1 #define LIBXML_ISO8859X_ENABLED #endif @@ -350,10 +350,10 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * LIBXML_EXPR_ENABLED: * * Whether the formal expressions interfaces are compiled in - * - * This code is unused and disabled unconditionally for now. + * + * This code is unused and disabled unconditionally for now. */ -#if 0 +#if 0 #define LIBXML_EXPR_ENABLED #endif @@ -387,7 +387,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the string suffix used by dynamic modules (usually shared libraries) */ -#define LIBXML_MODULE_EXTENSION ".so" +#define LIBXML_MODULE_EXTENSION ".so" #endif /** @@ -395,7 +395,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the Zlib support is compiled in */ -#if 1 +#if 1 #define LIBXML_ZLIB_ENABLED #endif @@ -404,7 +404,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the Lzma support is compiled in */ -#if 0 +#if 0 #define LIBXML_LZMA_ENABLED #endif @@ -431,7 +431,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef LIBXML_ATTR_ALLOC_SIZE -# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) +# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # else # define LIBXML_ATTR_ALLOC_SIZE(x) diff --git a/contrib/libs/libxml/include/libxml/xpath.h b/contrib/libs/libxml/include/libxml/xpath.h index 0ba30a4356..91c7578768 100644 --- a/contrib/libs/libxml/include/libxml/xpath.h +++ b/contrib/libs/libxml/include/libxml/xpath.h @@ -70,9 +70,9 @@ typedef enum { XPATH_INVALID_CHAR_ERROR, XPATH_INVALID_CTXT, XPATH_STACK_ERROR, - XPATH_FORBID_VARIABLE_ERROR, - XPATH_OP_LIMIT_EXCEEDED, - XPATH_RECURSION_LIMIT_EXCEEDED + XPATH_FORBID_VARIABLE_ERROR, + XPATH_OP_LIMIT_EXCEEDED, + XPATH_RECURSION_LIMIT_EXCEEDED } xmlXPathError; /* @@ -84,7 +84,7 @@ struct _xmlNodeSet { int nodeNr; /* number of nodes in the set */ int nodeMax; /* size of the array as allocated */ xmlNodePtr *nodeTab; /* array of nodes in no particular order */ - /* @@ with_ns to check whether namespace nodes should be looked at @@ */ + /* @@ with_ns to check whether namespace nodes should be looked at @@ */ }; /* @@ -354,13 +354,13 @@ struct _xmlXPathContext { /* Cache for reusal of XPath objects */ void *cache; - - /* Resource limits */ - unsigned long opLimit; - unsigned long opCount; - int depth; - int maxDepth; - int maxParserDepth; + + /* Resource limits */ + unsigned long opLimit; + unsigned long opCount; + int depth; + int maxDepth; + int maxParserDepth; }; /* diff --git a/contrib/libs/libxml/include/libxml/xpathInternals.h b/contrib/libs/libxml/include/libxml/xpathInternals.h index aa851bf627..87f1f00990 100644 --- a/contrib/libs/libxml/include/libxml/xpathInternals.h +++ b/contrib/libs/libxml/include/libxml/xpathInternals.h @@ -229,7 +229,7 @@ XMLPUBFUN void * XMLCALL * Empties a node-set. */ #define xmlXPathEmptyNodeSet(ns) \ - { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; } + { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; } /** * CHECK_ERROR: diff --git a/contrib/libs/libxml/libxml.h b/contrib/libs/libxml/libxml.h index 39c98f3e64..648de30e64 100644 --- a/contrib/libs/libxml/libxml.h +++ b/contrib/libs/libxml/libxml.h @@ -9,8 +9,8 @@ #ifndef __XML_LIBXML_H__ #define __XML_LIBXML_H__ -#include <libxml/xmlstring.h> - +#include <libxml/xmlstring.h> + #ifndef NO_LARGEFILE_SOURCE #ifndef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE @@ -34,7 +34,7 @@ /* * Currently supported platforms use either autoconf or * copy to config.h own "preset" configuration file. - * As result ifdef HAVE_CONFIG_H is omitted here. + * As result ifdef HAVE_CONFIG_H is omitted here. */ #include "config.h" #include <libxml/xmlversion.h> @@ -53,32 +53,32 @@ int vfprintf(FILE *, const char *, va_list); /** * TRIO_REPLACE_STDIO: * - * This macro is defined if the trio string formatting functions are to + * This macro is defined if the trio string formatting functions are to * be used instead of the default stdio ones. */ #define TRIO_REPLACE_STDIO -#error #include "trio.h" +#error #include "trio.h" +#endif + +#if defined(__clang__) || \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) +#define XML_IGNORE_PEDANTIC_WARNINGS \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wpedantic\"") +#define XML_POP_WARNINGS \ + _Pragma("GCC diagnostic pop") +#else +#define XML_IGNORE_PEDANTIC_WARNINGS +#define XML_POP_WARNINGS +#endif + +#if defined(__clang__) || \ + (defined(__GNUC__) && (__GNUC__ >= 8)) +#define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg))) +#else +#define ATTRIBUTE_NO_SANITIZE(arg) #endif -#if defined(__clang__) || \ - (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) -#define XML_IGNORE_PEDANTIC_WARNINGS \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wpedantic\"") -#define XML_POP_WARNINGS \ - _Pragma("GCC diagnostic pop") -#else -#define XML_IGNORE_PEDANTIC_WARNINGS -#define XML_POP_WARNINGS -#endif - -#if defined(__clang__) || \ - (defined(__GNUC__) && (__GNUC__ >= 8)) -#define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg))) -#else -#define ATTRIBUTE_NO_SANITIZE(arg) -#endif - /* * Internal variable indicating if a callback has been registered for * node creation/destruction. It avoids spending a lot of time in locking @@ -86,10 +86,10 @@ int vfprintf(FILE *, const char *, va_list); */ extern int __xmlRegisterCallbacks; /* - * internal error reporting routines, shared but not part of the API. + * internal error reporting routines, shared but not part of the API. */ void __xmlIOErr(int domain, int code, const char *extra); -void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0); +void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0); #ifdef LIBXML_HTML_ENABLED /* * internal function of HTML parser needed for xmlParseInNodeContext @@ -114,13 +114,13 @@ int __xmlInitializeDict(void); int __xmlRandom(void); #endif -XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg); -int xmlInputReadCallbackNop(void *context, char *buffer, int len); +XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg); +int xmlInputReadCallbackNop(void *context, char *buffer, int len); #ifdef IN_LIBXML #ifdef __GNUC__ #ifdef PIC -#ifdef __linux__ +#ifdef __linux__ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) #include "elfgcchack.h" #endif @@ -128,7 +128,7 @@ int xmlInputReadCallbackNop(void *context, char *buffer, int len); #endif #endif #endif -#if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC) +#if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC) # define LIBXML_STATIC #endif #endif /* ! __XML_LIBXML_H__ */ diff --git a/contrib/libs/libxml/libxml2.syms b/contrib/libs/libxml/libxml2.syms index c685d47790..c17d3d98d2 100644 --- a/contrib/libs/libxml/libxml2.syms +++ b/contrib/libs/libxml/libxml2.syms @@ -1,2288 +1,2288 @@ -# -# Officially exported symbols, for which header -# file definitions are installed in /usr/include/libxml2 -# -# Automatically generated from symbols.xml and syms.xsl -# -# Versions here are *fixed* to match the libxml2 version -# at which the symbol was introduced. This ensures that -# a new client app requiring symbol foo() can't accidentally -# run with old libxml2.so not providing foo() - the global -# soname version info can't enforce this since we never -# change the soname -# - -LIBXML2_2.4.30 { - global: - -# debugXML - xmlBoolToText; - xmlDebugDumpAttr; - xmlDebugDumpAttrList; - xmlDebugDumpDTD; - xmlDebugDumpDocument; - xmlDebugDumpDocumentHead; - xmlDebugDumpEntities; - xmlDebugDumpNode; - xmlDebugDumpNodeList; - xmlDebugDumpOneNode; - xmlDebugDumpString; - xmlLsCountNode; - xmlLsOneNode; - xmlShell; - xmlShellBase; - xmlShellCat; - xmlShellDir; - xmlShellDu; - xmlShellList; - xmlShellLoad; - xmlShellPrintNode; - xmlShellPrintXPathError; - xmlShellPrintXPathResult; - xmlShellPwd; - xmlShellSave; - xmlShellValidate; - xmlShellWrite; - -# xpointer - xmlXPtrBuildNodeList; - xmlXPtrEval; - xmlXPtrEvalRangePredicate; - xmlXPtrFreeLocationSet; - xmlXPtrLocationSetAdd; - xmlXPtrLocationSetCreate; - xmlXPtrLocationSetDel; - xmlXPtrLocationSetMerge; - xmlXPtrLocationSetRemove; - xmlXPtrNewCollapsedRange; - xmlXPtrNewContext; - xmlXPtrNewLocationSetNodeSet; - xmlXPtrNewLocationSetNodes; - xmlXPtrNewRange; - xmlXPtrNewRangeNodeObject; - xmlXPtrNewRangeNodePoint; - xmlXPtrNewRangeNodes; - xmlXPtrNewRangePointNode; - xmlXPtrNewRangePoints; - xmlXPtrRangeToFunction; - xmlXPtrWrapLocationSet; - -# SAX - attribute; - attributeDecl; - cdataBlock; - characters; - checkNamespace; - comment; - -# SAX2 - docbDefaultSAXHandlerInit; - -# SAX - elementDecl; - endDocument; - endElement; - entityDecl; - externalSubset; - getColumnNumber; - getEntity; - getLineNumber; - getNamespace; - getParameterEntity; - getPublicId; - getSystemId; - globalNamespace; - hasExternalSubset; - hasInternalSubset; - -# SAX2 - htmlDefaultSAXHandlerInit; - -# SAX - ignorableWhitespace; - initdocbDefaultSAXHandler; - inithtmlDefaultSAXHandler; - initxmlDefaultSAXHandler; - internalSubset; - isStandalone; - namespaceDecl; - notationDecl; - processingInstruction; - reference; - resolveEntity; - setDocumentLocator; - setNamespace; - startDocument; - startElement; - unparsedEntityDecl; - -# SAX2 - xmlDefaultSAXHandlerInit; - -# parserInternals - htmlCreateFileParserCtxt; - htmlInitAutoClose; - inputPop; - inputPush; - namePop; - namePush; - nodePop; - nodePush; - xmlCheckLanguageID; - xmlCopyChar; - xmlCopyCharMultiByte; - xmlCreateEntityParserCtxt; - xmlCreateFileParserCtxt; - xmlCreateMemoryParserCtxt; - xmlCurrentChar; - xmlDecodeEntities; - xmlFreeInputStream; - xmlHandleEntity; - -# chvalid - xmlIsBaseChar; - xmlIsBlank; - xmlIsChar; - xmlIsCombining; - xmlIsDigit; - xmlIsExtender; - xmlIsIdeographic; - -# parserInternals - xmlIsLetter; - -# chvalid - xmlIsPubidChar; - -# parserInternals - xmlNamespaceParseNCName; - xmlNamespaceParseNSDef; - xmlNamespaceParseQName; - xmlNewEntityInputStream; - xmlNewInputFromFile; - xmlNewInputStream; - -# parser - xmlNewParserCtxt; - -# parserInternals - xmlNewStringInputStream; - xmlNextChar; - xmlParseAttValue; - xmlParseAttribute; - xmlParseAttributeListDecl; - xmlParseAttributeType; - xmlParseCDSect; - xmlParseCharData; - xmlParseCharRef; - xmlParseComment; - xmlParseContent; - xmlParseDefaultDecl; - xmlParseDocTypeDecl; - xmlParseElement; - xmlParseElementChildrenContentDecl; - xmlParseElementContentDecl; - xmlParseElementDecl; - xmlParseElementMixedContentDecl; - xmlParseEncName; - xmlParseEncodingDecl; - xmlParseEndTag; - xmlParseEntityDecl; - xmlParseEntityRef; - xmlParseEntityValue; - xmlParseEnumeratedType; - xmlParseEnumerationType; - xmlParseExternalID; - xmlParseExternalSubset; - xmlParseMarkupDecl; - xmlParseMisc; - xmlParseName; - xmlParseNamespace; - xmlParseNmtoken; - xmlParseNotationDecl; - xmlParseNotationType; - xmlParsePEReference; - xmlParsePI; - xmlParsePITarget; - xmlParsePubidLiteral; - xmlParseQuotedString; - xmlParseReference; - xmlParseSDDecl; - xmlParseStartTag; - xmlParseSystemLiteral; - xmlParseTextDecl; - xmlParseVersionInfo; - xmlParseVersionNum; - xmlParseXMLDecl; - xmlParserHandlePEReference; - xmlParserHandleReference; - xmlParserInputShrink; - xmlPopInput; - xmlPushInput; - xmlScanName; - xmlSetEntityReferenceFunc; - xmlSkipBlankChars; - xmlSplitQName; - xmlStringComment; # variable - xmlStringCurrentChar; - xmlStringDecodeEntities; - xmlStringText; # variable - xmlStringTextNoenc; # variable - xmlSwitchEncoding; - xmlSwitchToEncoding; - -# c14n - xmlC14NDocDumpMemory; - xmlC14NDocSave; - xmlC14NDocSaveTo; - xmlC14NExecute; - -# catalog - xmlACatalogAdd; - xmlACatalogDump; - xmlACatalogRemove; - xmlACatalogResolve; - xmlACatalogResolvePublic; - xmlACatalogResolveSystem; - xmlACatalogResolveURI; - xmlCatalogAdd; - xmlCatalogAddLocal; - xmlCatalogCleanup; - xmlCatalogConvert; - xmlCatalogDump; - xmlCatalogFreeLocal; - xmlCatalogGetDefaults; - xmlCatalogGetPublic; - xmlCatalogGetSystem; - xmlCatalogIsEmpty; - xmlCatalogLocalResolve; - xmlCatalogLocalResolveURI; - xmlCatalogRemove; - xmlCatalogResolve; - xmlCatalogResolvePublic; - xmlCatalogResolveSystem; - xmlCatalogResolveURI; - xmlCatalogSetDebug; - xmlCatalogSetDefaultPrefer; - xmlCatalogSetDefaults; - xmlConvertSGMLCatalog; - xmlFreeCatalog; - xmlInitializeCatalog; - xmlLoadACatalog; - xmlLoadCatalog; - xmlLoadCatalogs; - xmlLoadSGMLSuperCatalog; - xmlNewCatalog; - xmlParseCatalogFile; - -# xpathInternals - valuePop; - valuePush; - xmlXPathAddValues; - xmlXPathBooleanFunction; - xmlXPathCeilingFunction; - xmlXPathCompareValues; - xmlXPathConcatFunction; - xmlXPathContainsFunction; - xmlXPathCountFunction; - xmlXPathDebugDumpCompExpr; - xmlXPathDebugDumpObject; - xmlXPathDifference; - xmlXPathDistinct; - xmlXPathDistinctSorted; - xmlXPathDivValues; - xmlXPathEqualValues; - xmlXPathEvalExpr; - xmlXPathEvaluatePredicateResult; - xmlXPathFalseFunction; - xmlXPathFloorFunction; - xmlXPathFreeParserContext; - xmlXPathFunctionLookup; - xmlXPathFunctionLookupNS; - xmlXPathHasSameNodes; - xmlXPathIdFunction; - xmlXPathIntersection; - xmlXPathIsNodeType; - xmlXPathLangFunction; - xmlXPathLastFunction; - xmlXPathLeading; - xmlXPathLeadingSorted; - xmlXPathLocalNameFunction; - xmlXPathModValues; - xmlXPathMultValues; - xmlXPathNamespaceURIFunction; - xmlXPathNewBoolean; - xmlXPathNewCString; - xmlXPathNewFloat; - xmlXPathNewNodeSet; - xmlXPathNewNodeSetList; - xmlXPathNewParserContext; - xmlXPathNewString; - xmlXPathNewValueTree; - xmlXPathNextAncestor; - xmlXPathNextAncestorOrSelf; - xmlXPathNextAttribute; - xmlXPathNextChild; - xmlXPathNextDescendant; - xmlXPathNextDescendantOrSelf; - xmlXPathNextFollowing; - xmlXPathNextFollowingSibling; - xmlXPathNextNamespace; - xmlXPathNextParent; - xmlXPathNextPreceding; - xmlXPathNextPrecedingSibling; - xmlXPathNextSelf; - xmlXPathNodeLeading; - xmlXPathNodeLeadingSorted; - xmlXPathNodeSetAdd; - xmlXPathNodeSetAddNs; - xmlXPathNodeSetAddUnique; - xmlXPathNodeSetContains; - xmlXPathNodeSetDel; - xmlXPathNodeSetFreeNs; - xmlXPathNodeSetMerge; - xmlXPathNodeSetRemove; - xmlXPathNodeSetSort; - xmlXPathNodeTrailing; - xmlXPathNodeTrailingSorted; - xmlXPathNormalizeFunction; - xmlXPathNotEqualValues; - xmlXPathNotFunction; - xmlXPathNsLookup; - xmlXPathNumberFunction; - xmlXPathParseNCName; - xmlXPathParseName; - xmlXPathPopBoolean; - xmlXPathPopExternal; - xmlXPathPopNodeSet; - xmlXPathPopNumber; - xmlXPathPopString; - xmlXPathPositionFunction; - xmlXPathRegisterAllFunctions; - xmlXPathRegisterFunc; - xmlXPathRegisterFuncLookup; - xmlXPathRegisterFuncNS; - xmlXPathRegisterNs; - xmlXPathRegisterVariable; - xmlXPathRegisterVariableLookup; - xmlXPathRegisterVariableNS; - xmlXPathRegisteredFuncsCleanup; - xmlXPathRegisteredNsCleanup; - xmlXPathRegisteredVariablesCleanup; - xmlXPathRoot; - xmlXPathRoundFunction; - xmlXPathStartsWithFunction; - xmlXPathStringEvalNumber; - xmlXPathStringFunction; - xmlXPathStringLengthFunction; - xmlXPathSubValues; - xmlXPathSubstringAfterFunction; - xmlXPathSubstringBeforeFunction; - xmlXPathSubstringFunction; - xmlXPathSumFunction; - xmlXPathTrailing; - xmlXPathTrailingSorted; - xmlXPathTranslateFunction; - xmlXPathTrueFunction; - xmlXPathValueFlipSign; - xmlXPathVariableLookup; - xmlXPathVariableLookupNS; - xmlXPathWrapCString; - xmlXPathWrapExternal; - xmlXPathWrapNodeSet; - xmlXPathWrapString; - xmlXPatherror; - -# xmlautomata - xmlAutomataCompile; - xmlAutomataGetInitState; - xmlAutomataIsDeterminist; - xmlAutomataNewAllTrans; - xmlAutomataNewCountTrans; - xmlAutomataNewCountedTrans; - xmlAutomataNewCounter; - xmlAutomataNewCounterTrans; - xmlAutomataNewEpsilon; - xmlAutomataNewOnceTrans; - xmlAutomataNewState; - xmlAutomataNewTransition; - xmlAutomataSetFinalState; - xmlFreeAutomata; - xmlNewAutomata; - -# HTMLtree - htmlDocContentDumpFormatOutput; - htmlDocContentDumpOutput; - htmlDocDump; - htmlDocDumpMemory; - htmlGetMetaEncoding; - htmlIsBooleanAttr; - htmlNewDoc; - htmlNewDocNoDtD; - htmlNodeDump; - htmlNodeDumpFile; - htmlNodeDumpFileFormat; - htmlNodeDumpFormatOutput; - htmlNodeDumpOutput; - htmlSaveFile; - htmlSaveFileEnc; - htmlSaveFileFormat; - htmlSetMetaEncoding; - -# nanoftp - xmlNanoFTPCheckResponse; - xmlNanoFTPCleanup; - xmlNanoFTPClose; - xmlNanoFTPCloseConnection; - xmlNanoFTPConnect; - xmlNanoFTPConnectTo; - xmlNanoFTPCwd; - xmlNanoFTPFreeCtxt; - xmlNanoFTPGet; - xmlNanoFTPGetConnection; - xmlNanoFTPGetResponse; - xmlNanoFTPGetSocket; - xmlNanoFTPInit; - xmlNanoFTPList; - xmlNanoFTPNewCtxt; - xmlNanoFTPOpen; - xmlNanoFTPProxy; - xmlNanoFTPQuit; - xmlNanoFTPRead; - xmlNanoFTPScanProxy; - xmlNanoFTPUpdateURL; - -# DOCBparser - docbCreateFileParserCtxt; - docbCreatePushParserCtxt; - docbEncodeEntities; - docbFreeParserCtxt; - docbParseChunk; - docbParseDoc; - docbParseDocument; - docbParseFile; - docbSAXParseDoc; - docbSAXParseFile; - -# xpath - xmlXPathCastBooleanToNumber; - xmlXPathCastBooleanToString; - xmlXPathCastNodeSetToBoolean; - xmlXPathCastNodeSetToNumber; - xmlXPathCastNodeSetToString; - xmlXPathCastNodeToNumber; - xmlXPathCastNodeToString; - xmlXPathCastNumberToBoolean; - xmlXPathCastNumberToString; - xmlXPathCastStringToBoolean; - xmlXPathCastStringToNumber; - xmlXPathCastToBoolean; - xmlXPathCastToNumber; - xmlXPathCastToString; - xmlXPathCmpNodes; - xmlXPathCompile; - xmlXPathCompiledEval; - xmlXPathConvertBoolean; - xmlXPathConvertNumber; - xmlXPathConvertString; - xmlXPathEval; - xmlXPathEvalExpression; - xmlXPathEvalPredicate; - xmlXPathFreeCompExpr; - xmlXPathFreeContext; - xmlXPathFreeNodeSet; - xmlXPathFreeNodeSetList; - xmlXPathFreeObject; - xmlXPathInit; - xmlXPathIsInf; - xmlXPathIsNaN; - xmlXPathNAN; # variable - xmlXPathNINF; # variable - xmlXPathNewContext; - xmlXPathNodeSetCreate; - xmlXPathObjectCopy; - xmlXPathPINF; # variable - -# xlink - xlinkGetDefaultDetect; - xlinkGetDefaultHandler; - xlinkIsLink; - xlinkSetDefaultDetect; - xlinkSetDefaultHandler; - -# entities - xmlAddDocEntity; - xmlAddDtdEntity; - xmlCleanupPredefinedEntities; - xmlCopyEntitiesTable; - xmlCreateEntitiesTable; - xmlDumpEntitiesTable; - xmlDumpEntityDecl; - xmlEncodeEntities; - xmlEncodeEntitiesReentrant; - xmlEncodeSpecialChars; - xmlFreeEntitiesTable; - xmlGetDocEntity; - xmlGetDtdEntity; - xmlGetParameterEntity; - xmlGetPredefinedEntity; - xmlInitializePredefinedEntities; - -# xinclude - xmlXIncludeProcess; - -# list - xmlLinkGetData; - xmlListAppend; - xmlListClear; - xmlListCopy; - xmlListCreate; - xmlListDelete; - xmlListDup; - xmlListEmpty; - xmlListEnd; - xmlListFront; - xmlListInsert; - xmlListMerge; - xmlListPopBack; - xmlListPopFront; - xmlListPushBack; - xmlListPushFront; - xmlListRemoveAll; - xmlListRemoveFirst; - xmlListRemoveLast; - xmlListReverse; - xmlListReverseSearch; - xmlListReverseWalk; - xmlListSearch; - xmlListSize; - xmlListSort; - xmlListWalk; - -# xmlmemory - xmlInitMemory; - xmlMallocLoc; - xmlMemDisplay; - xmlMemFree; - xmlMemGet; - xmlMemMalloc; - xmlMemRealloc; - xmlMemSetup; - xmlMemShow; - xmlMemStrdupLoc; - xmlMemUsed; - xmlMemoryDump; - xmlMemoryStrdup; - xmlReallocLoc; - -# xmlIO - xmlAllocOutputBuffer; - xmlAllocParserInputBuffer; - xmlCheckFilename; - xmlCleanupInputCallbacks; - xmlCleanupOutputCallbacks; - xmlFileClose; - xmlFileMatch; - xmlFileOpen; - xmlFileRead; - xmlFreeParserInputBuffer; - xmlIOFTPClose; - xmlIOFTPMatch; - xmlIOFTPOpen; - xmlIOFTPRead; - xmlIOHTTPClose; - xmlIOHTTPMatch; - xmlIOHTTPOpen; - xmlIOHTTPOpenW; - xmlIOHTTPRead; - xmlNoNetExternalEntityLoader; - xmlNormalizeWindowsPath; - xmlOutputBufferClose; - xmlOutputBufferCreateFd; - xmlOutputBufferCreateFile; - xmlOutputBufferCreateFilename; - xmlOutputBufferCreateIO; - xmlOutputBufferFlush; - xmlOutputBufferWrite; - xmlOutputBufferWriteString; - xmlParserGetDirectory; - xmlParserInputBufferCreateFd; - xmlParserInputBufferCreateFile; - xmlParserInputBufferCreateFilename; - xmlParserInputBufferCreateIO; - xmlParserInputBufferCreateMem; - xmlParserInputBufferGrow; - xmlParserInputBufferPush; - xmlParserInputBufferRead; - xmlRegisterDefaultInputCallbacks; - xmlRegisterDefaultOutputCallbacks; - xmlRegisterHTTPPostCallbacks; - xmlRegisterInputCallbacks; - xmlRegisterOutputCallbacks; - -# xmlversion - xmlCheckVersion; - -# valid - xmlAddAttributeDecl; - xmlAddElementDecl; - xmlAddID; - xmlAddNotationDecl; - xmlAddRef; - xmlCopyAttributeTable; - xmlCopyElementContent; - xmlCopyElementTable; - xmlCopyEnumeration; - xmlCopyNotationTable; - xmlCreateEnumeration; - xmlDumpAttributeDecl; - xmlDumpAttributeTable; - xmlDumpElementDecl; - xmlDumpElementTable; - xmlDumpNotationDecl; - xmlDumpNotationTable; - xmlFreeAttributeTable; - xmlFreeElementContent; - xmlFreeElementTable; - xmlFreeEnumeration; - xmlFreeIDTable; - xmlFreeNotationTable; - xmlFreeRefTable; - xmlGetDtdAttrDesc; - xmlGetDtdElementDesc; - xmlGetDtdNotationDesc; - xmlGetDtdQAttrDesc; - xmlGetDtdQElementDesc; - xmlGetID; - xmlGetRefs; - xmlIsID; - xmlIsMixedElement; - xmlIsRef; - xmlNewElementContent; - xmlRemoveID; - xmlRemoveRef; - xmlSnprintfElementContent; - -# tree - xmlSplitQName2; - -# valid - xmlSprintfElementContent; - xmlValidBuildContentModel; - xmlValidCtxtNormalizeAttributeValue; - xmlValidGetPotentialChildren; - xmlValidGetValidElements; - xmlValidNormalizeAttributeValue; - xmlValidateAttributeDecl; - xmlValidateAttributeValue; - xmlValidateDocument; - xmlValidateDocumentFinal; - xmlValidateDtd; - xmlValidateDtdFinal; - xmlValidateElement; - xmlValidateElementDecl; - xmlValidateNameValue; - xmlValidateNamesValue; - xmlValidateNmtokenValue; - xmlValidateNmtokensValue; - xmlValidateNotationDecl; - xmlValidateNotationUse; - xmlValidateOneAttribute; - xmlValidateOneElement; - xmlValidateOneNamespace; - xmlValidateRoot; - -# HTMLparser - UTF8ToHtml; - htmlAutoCloseTag; - htmlCreatePushParserCtxt; - htmlEncodeEntities; - htmlEntityLookup; - htmlEntityValueLookup; - htmlFreeParserCtxt; - htmlHandleOmittedElem; - htmlIsAutoClosed; - htmlIsScriptAttribute; - htmlParseCharRef; - htmlParseChunk; - htmlParseDoc; - htmlParseDocument; - htmlParseElement; - htmlParseEntityRef; - htmlParseFile; - htmlSAXParseDoc; - htmlSAXParseFile; - htmlTagLookup; - -# xmlstring - xmlCharStrdup; - xmlCharStrndup; - -# parser - xmlCleanupParser; - xmlClearNodeInfoSeq; - xmlClearParserCtxt; - xmlCreateDocParserCtxt; - xmlCreateIOParserCtxt; - xmlCreatePushParserCtxt; - xmlFreeParserCtxt; - xmlGetExternalEntityLoader; - xmlGetFeature; - xmlGetFeaturesList; - -# globals - xmlGetWarningsDefaultValue; # variable - -# parser - xmlIOParseDTD; - xmlInitNodeInfoSeq; - xmlInitParser; - xmlInitParserCtxt; - xmlKeepBlanksDefault; - xmlLineNumbersDefault; - xmlLoadExternalEntity; - xmlNewIOInputStream; - xmlParseBalancedChunkMemory; - xmlParseBalancedChunkMemoryRecover; - xmlParseChunk; - xmlParseCtxtExternalEntity; - xmlParseDTD; - xmlParseDoc; - xmlParseDocument; - xmlParseEntity; - xmlParseExtParsedEnt; - xmlParseExternalEntity; - xmlParseFile; - xmlParseMemory; - xmlParserAddNodeInfo; - xmlParserFindNodeInfo; - xmlParserFindNodeInfoIndex; - xmlParserInputGrow; - xmlParserInputRead; - xmlPedanticParserDefault; - xmlRecoverDoc; - xmlRecoverFile; - xmlRecoverMemory; - xmlSAXParseDTD; - xmlSAXParseDoc; - xmlSAXParseEntity; - xmlSAXParseFile; - xmlSAXParseFileWithData; - xmlSAXParseMemory; - xmlSAXParseMemoryWithData; - xmlSAXUserParseFile; - xmlSAXUserParseMemory; - xmlSetExternalEntityLoader; - xmlSetFeature; - xmlSetupParserForBuffer; - xmlStopParser; - -# xmlstring - xmlStrEqual; - xmlStrcasecmp; - xmlStrcasestr; - xmlStrcat; - xmlStrchr; - xmlStrcmp; - xmlStrdup; - xmlStrlen; - xmlStrncasecmp; - xmlStrncat; - xmlStrncmp; - xmlStrndup; - xmlStrstr; - xmlStrsub; - -# parser - xmlSubstituteEntitiesDefault; - -# xmlreader - xmlFreeTextReader; - xmlNewTextReader; - xmlNewTextReaderFilename; - xmlTextReaderAttributeCount; - xmlTextReaderBaseUri; - xmlTextReaderDepth; - xmlTextReaderHasAttributes; - xmlTextReaderHasValue; - xmlTextReaderIsDefault; - xmlTextReaderIsEmptyElement; - xmlTextReaderLocalName; - xmlTextReaderName; - xmlTextReaderNamespaceUri; - xmlTextReaderNodeType; - xmlTextReaderPrefix; - xmlTextReaderQuoteChar; - xmlTextReaderRead; - xmlTextReaderValue; - xmlTextReaderXmlLang; - -# globals - docbDefaultSAXHandler; # variable - htmlDefaultSAXHandler; # variable - xmlDefaultSAXHandler; # variable - xmlDefaultSAXLocator; # variable - xmlDoValidityCheckingDefaultValue; # variable - xmlFree; # variable - xmlGenericError; # variable - xmlGenericErrorContext; # variable - xmlInitializeGlobalState; - xmlKeepBlanksDefaultValue; # variable - xmlLineNumbersDefaultValue; # variable - xmlLoadExtDtdDefaultValue; # variable - xmlMalloc; # variable - xmlMemStrdup; # variable - xmlParserDebugEntities; # variable - xmlParserVersion; # variable - xmlPedanticParserDefaultValue; # variable - xmlRealloc; # variable - xmlSaveNoEmptyTags; # variable - xmlSubstituteEntitiesDefaultValue; # variable - xmlTreeIndentString; # variable - -# threads - xmlCleanupThreads; - xmlFreeMutex; - xmlFreeRMutex; - xmlGetGlobalState; - xmlGetThreadId; - xmlInitThreads; - xmlIsMainThread; - xmlLockLibrary; - xmlMutexLock; - xmlMutexUnlock; - xmlNewMutex; - xmlNewRMutex; - xmlRMutexLock; - xmlRMutexUnlock; - xmlUnlockLibrary; - -# hash - xmlHashAddEntry; - xmlHashAddEntry2; - xmlHashAddEntry3; - xmlHashCopy; - xmlHashCreate; - xmlHashFree; - xmlHashLookup; - xmlHashLookup2; - xmlHashLookup3; - xmlHashRemoveEntry; - xmlHashRemoveEntry2; - xmlHashRemoveEntry3; - xmlHashScan; - xmlHashScan3; - xmlHashScanFull; - xmlHashScanFull3; - xmlHashSize; - xmlHashUpdateEntry; - xmlHashUpdateEntry2; - xmlHashUpdateEntry3; - -# xmlerror - initGenericErrorDefaultFunc; - xmlParserError; - xmlParserPrintFileContext; - xmlParserPrintFileInfo; - xmlParserValidityError; - xmlParserValidityWarning; - xmlParserWarning; - xmlSetGenericErrorFunc; - -# globals - oldXMLWDcompatibility; # variable - -# tree - xmlAddChild; - xmlAddChildList; - xmlAddNextSibling; - xmlAddPrevSibling; - xmlAddSibling; - xmlBufferAdd; - xmlBufferAddHead; - -# globals - xmlBufferAllocScheme; # variable - -# tree - xmlBufferCCat; - xmlBufferCat; - xmlBufferContent; - xmlBufferCreate; - xmlBufferCreateSize; - xmlBufferDump; - xmlBufferEmpty; - xmlBufferFree; - xmlBufferGrow; - xmlBufferLength; - xmlBufferResize; - xmlBufferSetAllocationScheme; - xmlBufferShrink; - xmlBufferWriteCHAR; - xmlBufferWriteChar; - xmlBufferWriteQuotedString; - xmlCopyDoc; - xmlCopyDtd; - xmlCopyNamespace; - xmlCopyNamespaceList; - xmlCopyNode; - xmlCopyNodeList; - xmlCopyProp; - xmlCopyPropList; - xmlCreateIntSubset; - -# globals - xmlDefaultBufferSize; # variable - -# tree - xmlDocCopyNode; - xmlDocDump; - xmlDocDumpFormatMemory; - xmlDocDumpFormatMemoryEnc; - xmlDocDumpMemory; - xmlDocDumpMemoryEnc; - xmlDocFormatDump; - xmlDocGetRootElement; - xmlDocSetRootElement; - xmlElemDump; - xmlFreeDoc; - xmlFreeDtd; - xmlFreeNode; - xmlFreeNodeList; - xmlFreeNs; - xmlFreeNsList; - xmlFreeProp; - xmlFreePropList; - xmlGetBufferAllocationScheme; - xmlGetCompressMode; - xmlGetDocCompressMode; - xmlGetIntSubset; - xmlGetLastChild; - xmlGetLineNo; - xmlGetNodePath; - xmlGetNsList; - xmlGetNsProp; - xmlGetProp; - xmlHasNsProp; - xmlHasProp; - -# globals - xmlIndentTreeOutput; # variable - -# tree - xmlIsBlankNode; - xmlIsXHTML; - xmlNewCDataBlock; - xmlNewCharRef; - xmlNewChild; - xmlNewComment; - xmlNewDoc; - xmlNewDocComment; - xmlNewDocFragment; - xmlNewDocNode; - xmlNewDocNodeEatName; - xmlNewDocProp; - xmlNewDocRawNode; - xmlNewDocText; - xmlNewDocTextLen; - xmlNewDtd; - xmlNewGlobalNs; - xmlNewNode; - xmlNewNodeEatName; - xmlNewNs; - xmlNewNsProp; - xmlNewNsPropEatName; - xmlNewPI; - xmlNewProp; - xmlNewReference; - xmlNewText; - xmlNewTextChild; - xmlNewTextLen; - xmlNodeAddContent; - xmlNodeAddContentLen; - xmlNodeDump; - xmlNodeDumpOutput; - xmlNodeGetBase; - xmlNodeGetContent; - xmlNodeGetLang; - xmlNodeGetSpacePreserve; - xmlNodeIsText; - xmlNodeListGetRawString; - xmlNodeListGetString; - xmlNodeSetBase; - xmlNodeSetContent; - xmlNodeSetContentLen; - xmlNodeSetLang; - xmlNodeSetName; - xmlNodeSetSpacePreserve; - xmlReconciliateNs; - xmlRemoveProp; - xmlReplaceNode; - xmlSaveFile; - xmlSaveFileEnc; - xmlSaveFileTo; - xmlSaveFormatFile; - xmlSaveFormatFileEnc; - xmlSaveFormatFileTo; - xmlSearchNs; - xmlSearchNsByHref; - xmlSetBufferAllocationScheme; - xmlSetCompressMode; - xmlSetDocCompressMode; - xmlSetListDoc; - xmlSetNs; - xmlSetNsProp; - xmlSetProp; - xmlSetTreeDoc; - xmlStringGetNodeList; - xmlStringLenGetNodeList; - xmlTextConcat; - xmlTextMerge; - xmlUnlinkNode; - xmlUnsetNsProp; - xmlUnsetProp; - -# xmlregexp - xmlRegExecPushString; - xmlRegFreeExecCtxt; - xmlRegFreeRegexp; - xmlRegNewExecCtxt; - xmlRegexpCompile; - xmlRegexpExec; - xmlRegexpIsDeterminist; - xmlRegexpPrint; - -# nanohttp - xmlNanoHTTPAuthHeader; - xmlNanoHTTPCleanup; - xmlNanoHTTPClose; - xmlNanoHTTPFetch; - xmlNanoHTTPInit; - xmlNanoHTTPMethod; - xmlNanoHTTPMethodRedir; - xmlNanoHTTPOpen; - xmlNanoHTTPOpenRedir; - xmlNanoHTTPRead; - xmlNanoHTTPReturnCode; - xmlNanoHTTPSave; - xmlNanoHTTPScanProxy; - -# xmlunicode - xmlUCSIsAlphabeticPresentationForms; - xmlUCSIsArabic; - xmlUCSIsArabicPresentationFormsA; - xmlUCSIsArabicPresentationFormsB; - xmlUCSIsArmenian; - xmlUCSIsArrows; - xmlUCSIsBasicLatin; - xmlUCSIsBengali; - xmlUCSIsBlock; - xmlUCSIsBlockElements; - xmlUCSIsBopomofo; - xmlUCSIsBopomofoExtended; - xmlUCSIsBoxDrawing; - xmlUCSIsBraillePatterns; - xmlUCSIsByzantineMusicalSymbols; - xmlUCSIsCJKCompatibility; - xmlUCSIsCJKCompatibilityForms; - xmlUCSIsCJKCompatibilityIdeographs; - xmlUCSIsCJKCompatibilityIdeographsSupplement; - xmlUCSIsCJKRadicalsSupplement; - xmlUCSIsCJKSymbolsandPunctuation; - xmlUCSIsCJKUnifiedIdeographs; - xmlUCSIsCJKUnifiedIdeographsExtensionA; - xmlUCSIsCJKUnifiedIdeographsExtensionB; - xmlUCSIsCat; - xmlUCSIsCatC; - xmlUCSIsCatCc; - xmlUCSIsCatCf; - xmlUCSIsCatCo; - xmlUCSIsCatCs; - xmlUCSIsCatL; - xmlUCSIsCatLl; - xmlUCSIsCatLm; - xmlUCSIsCatLo; - xmlUCSIsCatLt; - xmlUCSIsCatLu; - xmlUCSIsCatM; - xmlUCSIsCatMc; - xmlUCSIsCatMe; - xmlUCSIsCatMn; - xmlUCSIsCatN; - xmlUCSIsCatNd; - xmlUCSIsCatNl; - xmlUCSIsCatNo; - xmlUCSIsCatP; - xmlUCSIsCatPc; - xmlUCSIsCatPd; - xmlUCSIsCatPe; - xmlUCSIsCatPf; - xmlUCSIsCatPi; - xmlUCSIsCatPo; - xmlUCSIsCatPs; - xmlUCSIsCatS; - xmlUCSIsCatSc; - xmlUCSIsCatSk; - xmlUCSIsCatSm; - xmlUCSIsCatSo; - xmlUCSIsCatZ; - xmlUCSIsCatZl; - xmlUCSIsCatZp; - xmlUCSIsCatZs; - xmlUCSIsCherokee; - xmlUCSIsCombiningDiacriticalMarks; - xmlUCSIsCombiningHalfMarks; - xmlUCSIsCombiningMarksforSymbols; - xmlUCSIsControlPictures; - xmlUCSIsCurrencySymbols; - xmlUCSIsCyrillic; - xmlUCSIsDeseret; - xmlUCSIsDevanagari; - xmlUCSIsDingbats; - xmlUCSIsEnclosedAlphanumerics; - xmlUCSIsEnclosedCJKLettersandMonths; - xmlUCSIsEthiopic; - xmlUCSIsGeneralPunctuation; - xmlUCSIsGeometricShapes; - xmlUCSIsGeorgian; - xmlUCSIsGothic; - xmlUCSIsGreek; - xmlUCSIsGreekExtended; - xmlUCSIsGujarati; - xmlUCSIsGurmukhi; - xmlUCSIsHalfwidthandFullwidthForms; - xmlUCSIsHangulCompatibilityJamo; - xmlUCSIsHangulJamo; - xmlUCSIsHangulSyllables; - xmlUCSIsHebrew; - xmlUCSIsHighPrivateUseSurrogates; - xmlUCSIsHighSurrogates; - xmlUCSIsHiragana; - xmlUCSIsIPAExtensions; - xmlUCSIsIdeographicDescriptionCharacters; - xmlUCSIsKanbun; - xmlUCSIsKangxiRadicals; - xmlUCSIsKannada; - xmlUCSIsKatakana; - xmlUCSIsKhmer; - xmlUCSIsLao; - xmlUCSIsLatin1Supplement; - xmlUCSIsLatinExtendedA; - xmlUCSIsLatinExtendedAdditional; - xmlUCSIsLatinExtendedB; - xmlUCSIsLetterlikeSymbols; - xmlUCSIsLowSurrogates; - xmlUCSIsMalayalam; - xmlUCSIsMathematicalAlphanumericSymbols; - xmlUCSIsMathematicalOperators; - xmlUCSIsMiscellaneousSymbols; - xmlUCSIsMiscellaneousTechnical; - xmlUCSIsMongolian; - xmlUCSIsMusicalSymbols; - xmlUCSIsMyanmar; - xmlUCSIsNumberForms; - xmlUCSIsOgham; - xmlUCSIsOldItalic; - xmlUCSIsOpticalCharacterRecognition; - xmlUCSIsOriya; - xmlUCSIsPrivateUse; - xmlUCSIsRunic; - xmlUCSIsSinhala; - xmlUCSIsSmallFormVariants; - xmlUCSIsSpacingModifierLetters; - xmlUCSIsSpecials; - xmlUCSIsSuperscriptsandSubscripts; - xmlUCSIsSyriac; - xmlUCSIsTags; - xmlUCSIsTamil; - xmlUCSIsTelugu; - xmlUCSIsThaana; - xmlUCSIsThai; - xmlUCSIsTibetan; - xmlUCSIsUnifiedCanadianAboriginalSyllabics; - xmlUCSIsYiRadicals; - xmlUCSIsYiSyllables; - -# uri - xmlBuildURI; - xmlCreateURI; - xmlFreeURI; - xmlNormalizeURIPath; - xmlParseURI; - xmlParseURIReference; - xmlPrintURI; - xmlSaveUri; - xmlURIEscape; - xmlURIEscapeStr; - xmlURIUnescapeString; - -# encoding - UTF8Toisolat1; - isolat1ToUTF8; - xmlAddEncodingAlias; - xmlCharEncCloseFunc; - xmlCharEncFirstLine; - xmlCharEncInFunc; - xmlCharEncOutFunc; - -# xmlstring - xmlCheckUTF8; - -# encoding - xmlCleanupCharEncodingHandlers; - xmlCleanupEncodingAliases; - xmlDelEncodingAlias; - xmlDetectCharEncoding; - xmlFindCharEncodingHandler; - xmlGetCharEncodingHandler; - xmlGetCharEncodingName; - xmlGetEncodingAlias; - -# xmlstring - xmlGetUTF8Char; - -# encoding - xmlInitCharEncodingHandlers; - xmlNewCharEncodingHandler; - xmlParseCharEncoding; - xmlRegisterCharEncodingHandler; - -# xmlstring - xmlUTF8Strlen; - xmlUTF8Strloc; - xmlUTF8Strndup; - xmlUTF8Strpos; - xmlUTF8Strsize; - xmlUTF8Strsub; -} ; - -LIBXML2_2.5.0 { - global: - -# globals - xmlDeregisterNodeDefault; - xmlDeregisterNodeDefaultValue; # variable - xmlRegisterNodeDefault; - xmlRegisterNodeDefaultValue; # variable - -# xmlreader - xmlTextReaderClose; - xmlTextReaderCurrentDoc; - xmlTextReaderCurrentNode; - xmlTextReaderGetAttributeNo; - xmlTextReaderGetAttributeNs; - xmlTextReaderGetAttribute; - xmlTextReaderGetParserProp; - xmlTextReaderGetRemainder; - xmlTextReaderLookupNamespace; - xmlTextReaderMoveToAttributeNo; - xmlTextReaderMoveToAttributeNs; - xmlTextReaderMoveToAttribute; - xmlTextReaderMoveToElement; - xmlTextReaderMoveToFirstAttribute; - xmlTextReaderMoveToNextAttribute; - xmlTextReaderNormalization; - xmlTextReaderReadAttributeValue; - xmlTextReaderReadInnerXml; - xmlTextReaderReadOuterXml; - xmlTextReaderReadState; - xmlTextReaderReadString; - xmlTextReaderSetParserProp; - -# valid - xmlValidatePopElement; - xmlValidatePushCData; - xmlValidatePushElement; -} LIBXML2_2.4.30; - -LIBXML2_2.5.2 { - global: - -# tree - xmlGetNoNsProp; - -# HTMLparser - htmlAttrAllowed; - htmlElementAllowedHere; - htmlElementStatusHere; - htmlNodeStatus; - -# relaxng - xmlRelaxNGCleanupTypes; - xmlRelaxNGDump; - xmlRelaxNGFreeParserCtxt; - xmlRelaxNGFree; - xmlRelaxNGFreeValidCtxt; - xmlRelaxNGNewMemParserCtxt; - xmlRelaxNGNewParserCtxt; - xmlRelaxNGNewValidCtxt; - xmlRelaxNGParse; - xmlRelaxNGSetParserErrors; - xmlRelaxNGSetValidErrors; - xmlRelaxNGValidateDoc; - -# xmlreader - xmlTextReaderGetErrorHandler; - xmlTextReaderLocatorBaseURI; - xmlTextReaderLocatorLineNumber; - xmlTextReaderSetErrorHandler; - -# relaxng -# xmlRelaxNGValidateStream; removed in 2.5.5 -} LIBXML2_2.5.0; - -LIBXML2_2.5.4 { - global: - -# uri - xmlCanonicPath; - -# relaxng - xmlRelaxNGDumpTree; - -# tree - xmlValidateName; - xmlValidateNCName; - xmlValidateNMToken; - xmlValidateQName; -} LIBXML2_2.5.2; - -LIBXML2_2.5.5 { - global: - -# nanoftp - xmlNanoFTPDele; -} LIBXML2_2.5.4; - -LIBXML2_2.5.6 { - global: - -# xpath - xmlXPathOrderDocElems; -} LIBXML2_2.5.5; - -LIBXML2_2.5.7 { - global: - -# HTMLparser - htmlCreateMemoryParserCtxt; - -# xmlautomata - xmlAutomataNewTransition2; - -# tree - xmlBuildQName; - -# xmlmemory - xmlGcMemGet; - xmlGcMemSetup; - -# globals - xmlMallocAtomic; # variable - -# xmlregexp - xmlRegExecPushString2; - -# relaxng - xmlRelaxNGNewDocParserCtxt; - xmlRelaxNGValidateFullElement; - xmlRelaxNGValidatePopElement; - xmlRelaxNGValidatePushCData; - xmlRelaxNGValidatePushElement; - -# xmlreader - xmlTextReaderExpand; - xmlTextReaderIsValid; - xmlTextReaderNext; - xmlTextReaderRelaxNGSetSchema; - xmlTextReaderRelaxNGValidate; -} LIBXML2_2.5.6; - -LIBXML2_2.5.8 { - global: - -# globals - xmlCleanupGlobals; - xmlInitGlobals; - -# valid - xmlFreeValidCtxt; - xmlNewValidCtxt; - -# schemasInternals - xmlSchemaFreeType; - -# xmlschemas - xmlSchemaDump; - xmlSchemaFreeParserCtxt; - xmlSchemaFreeValidCtxt; - xmlSchemaFree; - xmlSchemaNewMemParserCtxt; - xmlSchemaNewParserCtxt; - xmlSchemaNewValidCtxt; - xmlSchemaParse; - xmlSchemaSetParserErrors; - xmlSchemaSetValidErrors; - xmlSchemaValidateDoc; - xmlSchemaValidateStream; - -# xmlschemastypes - xmlSchemaCheckFacet; - xmlSchemaCleanupTypes; - xmlSchemaCompareValues; - xmlSchemaFreeFacet; - xmlSchemaFreeValue; - xmlSchemaGetPredefinedType; - xmlSchemaInitTypes; - xmlSchemaNewFacet; - xmlSchemaValidateFacet; - xmlSchemaValidatePredefinedType; - xmlSchemaValPredefTypeNode; - -# globals - xmlThrDefBufferAllocScheme; - xmlThrDefDefaultBufferSize; - xmlThrDefDeregisterNodeDefault; - xmlThrDefDoValidityCheckingDefaultValue; - xmlThrDefGetWarningsDefaultValue; - xmlThrDefIndentTreeOutput; - xmlThrDefKeepBlanksDefaultValue; - xmlThrDefLineNumbersDefaultValue; - xmlThrDefLoadExtDtdDefaultValue; - xmlThrDefParserDebugEntities; - xmlThrDefPedanticParserDefaultValue; - xmlThrDefRegisterNodeDefault; - xmlThrDefSaveNoEmptyTags; - xmlThrDefSetGenericErrorFunc; - xmlThrDefSubstituteEntitiesDefaultValue; - xmlThrDefTreeIndentString; -} LIBXML2_2.5.7; - -LIBXML2_2.5.9 { - global: - -# xmlmemory - xmlMallocAtomicLoc; - -# relaxng - xmlRelaxNGGetParserErrors; - xmlRelaxNGGetValidErrors; - -# tree - xmlSplitQName3; - -# xmlstring - xmlUTF8Charcmp; - xmlUTF8Size; - -# xinclude - xmlXIncludeProcessTree; -} LIBXML2_2.5.8; - -LIBXML2_2.6.0 { - global: - -# SAX2 - xmlSAX2AttributeDecl; - xmlSAX2CDataBlock; - xmlSAX2Characters; - xmlSAX2Comment; - xmlSAX2ElementDecl; - xmlSAX2EndDocument; - xmlSAX2EndElementNs; - xmlSAX2EndElement; - xmlSAX2EntityDecl; - xmlSAX2ExternalSubset; - xmlSAX2GetColumnNumber; - xmlSAX2GetEntity; - xmlSAX2GetLineNumber; - xmlSAX2GetParameterEntity; - xmlSAX2GetPublicId; - xmlSAX2GetSystemId; - xmlSAX2HasExternalSubset; - xmlSAX2HasInternalSubset; - xmlSAX2IgnorableWhitespace; - xmlSAX2InitDefaultSAXHandler; - xmlSAX2InitDocbDefaultSAXHandler; - xmlSAX2InitHtmlDefaultSAXHandler; - xmlSAX2InternalSubset; - xmlSAX2IsStandalone; - xmlSAX2NotationDecl; - xmlSAX2ProcessingInstruction; - xmlSAX2Reference; - xmlSAX2ResolveEntity; - xmlSAX2SetDocumentLocator; - xmlSAX2StartDocument; - xmlSAX2StartElementNs; - xmlSAX2StartElement; - xmlSAX2UnparsedEntityDecl; - xmlSAXDefaultVersion; - xmlSAXVersion; - -# HTMLparser - htmlCtxtReadDoc; - htmlCtxtReadFd; - htmlCtxtReadFile; - htmlCtxtReadIO; - htmlCtxtReadMemory; - htmlCtxtReset; - htmlCtxtUseOptions; - htmlReadDoc; - htmlReadFd; - htmlReadFile; - htmlReadIO; - htmlReadMemory; - -# tree - xmlBufferCreateStatic; - -# chvalid - xmlCharInRange; - -# xmlIO - xmlCheckHTTPInput; - -# xmlerror - xmlCopyError; - xmlCtxtGetLastError; - xmlGetLastError; - xmlResetError; - xmlResetLastError; - xmlSetStructuredErrorFunc; - -# parser - xmlCtxtReadDoc; - xmlCtxtReadFd; - xmlCtxtReadFile; - xmlCtxtReadIO; - xmlCtxtReadMemory; - -# xmlerror - xmlCtxtResetLastError; - -# parser - xmlCtxtReset; - xmlCtxtUseOptions; - xmlReadDoc; - xmlReadFd; - xmlReadFile; - xmlReadIO; - xmlReadMemory; - -# xmlstring - xmlStrPrintf; - xmlStrQEqual; - -# dict - xmlDictCreate; - xmlDictFree; - xmlDictLookup; - xmlDictOwns; - xmlDictQLookup; - xmlDictReference; - xmlDictSize; - -# parserInternals - xmlErrMemory; - xmlParserMaxDepth; # variable - xmlStringLenDecodeEntities; - xmlSwitchInputEncoding; - -# xmlwriter - xmlFreeTextWriter; - xmlNewTextWriterFilename; - xmlNewTextWriterMemory; - xmlNewTextWriter; - xmlTextWriterEndAttribute; - xmlTextWriterEndCDATA; - xmlTextWriterEndDocument; - xmlTextWriterEndDTD; - xmlTextWriterEndElement; - xmlTextWriterEndPI; - xmlTextWriterFlush; - xmlTextWriterFullEndElement; - xmlTextWriterStartAttributeNS; - xmlTextWriterStartAttribute; - xmlTextWriterStartCDATA; - xmlTextWriterStartDocument; - xmlTextWriterStartDTDAttlist; - xmlTextWriterStartDTDElement; - xmlTextWriterStartDTDEntity; - xmlTextWriterStartDTD; - xmlTextWriterStartElementNS; - xmlTextWriterStartElement; - xmlTextWriterStartPI; - xmlTextWriterWriteAttributeNS; - xmlTextWriterWriteAttribute; - xmlTextWriterWriteBase64; - xmlTextWriterWriteBinHex; - xmlTextWriterWriteCDATA; - xmlTextWriterWriteComment; - xmlTextWriterWriteDTDAttlist; - xmlTextWriterWriteDTDElement; - xmlTextWriterWriteDTDEntity; - xmlTextWriterWriteDTDExternalEntity; - xmlTextWriterWriteDTDInternalEntity; - xmlTextWriterWriteDTDNotation; - xmlTextWriterWriteDTD; - xmlTextWriterWriteElementNS; - xmlTextWriterWriteElement; - xmlTextWriterWriteFormatAttributeNS; - xmlTextWriterWriteFormatAttribute; - xmlTextWriterWriteFormatCDATA; - xmlTextWriterWriteFormatComment; - xmlTextWriterWriteFormatDTDAttlist; - xmlTextWriterWriteFormatDTDElement; - xmlTextWriterWriteFormatDTDInternalEntity; - xmlTextWriterWriteFormatDTD; - xmlTextWriterWriteFormatElementNS; - xmlTextWriterWriteFormatElement; - xmlTextWriterWriteFormatPI; - xmlTextWriterWriteFormatRaw; - xmlTextWriterWriteFormatString; - xmlTextWriterWritePI; - xmlTextWriterWriteRawLen; - xmlTextWriterWriteRaw; - xmlTextWriterWriteString; - xmlTextWriterWriteVFormatAttributeNS; - xmlTextWriterWriteVFormatAttribute; - xmlTextWriterWriteVFormatCDATA; - xmlTextWriterWriteVFormatComment; - xmlTextWriterWriteVFormatDTDAttlist; - xmlTextWriterWriteVFormatDTDElement; - xmlTextWriterWriteVFormatDTDInternalEntity; - xmlTextWriterWriteVFormatDTD; - xmlTextWriterWriteVFormatElementNS; - xmlTextWriterWriteVFormatElement; - xmlTextWriterWriteVFormatPI; - xmlTextWriterWriteVFormatRaw; - xmlTextWriterWriteVFormatString; - -# hash - xmlHashQLookup2; - xmlHashQLookup3; - xmlHashQLookup; - -# chvalid - xmlIsBaseCharGroup; # variable - xmlIsCharGroup; # variable - xmlIsCombiningGroup; # variable - xmlIsDigitGroup; # variable - xmlIsExtenderGroup; # variable - xmlIsIdeographicGroup; # variable - xmlIsPubidChar_tab; # variable - -# globals - xmlLastError; # variable - -# nanohttp - xmlNanoHTTPEncoding; - xmlNanoHTTPMimeType; - xmlNanoHTTPRedir; - -# tree - xmlNodeBufGetContent; - -# xmlIO - xmlParserInputBufferCreateStatic; - -# xmlreader - xmlReaderForDoc; - xmlReaderForFd; - xmlReaderForFile; - xmlReaderForIO; - xmlReaderForMemory; - xmlReaderNewDoc; - xmlReaderNewFd; - xmlReaderNewFile; - xmlReaderNewIO; - xmlReaderNewMemory; - xmlReaderNewWalker; - xmlReaderWalker; - xmlTextReaderConstBaseUri; - xmlTextReaderConstLocalName; - xmlTextReaderConstNamespaceUri; - xmlTextReaderConstName; - xmlTextReaderConstPrefix; - xmlTextReaderConstString; - xmlTextReaderConstValue; - xmlTextReaderConstXmlLang; - xmlTextReaderNextSibling; - xmlTextReaderPreserve; - -# globals - xmlStructuredError; # variable - xmlThrDefSetStructuredErrorFunc; - -# xpathInternals - xmlXPathErr; - -# SAX2 -# xmlSAX2CheckNamespace; removed in 2.6.10 -# xmlSAX2GetNamespace; removed in 2.6.10 -# xmlSAX2GlobalNamespace; removed in 2.6.10 -# xmlSAX2NamespaceDecl; removed in 2.6.10 -# xmlSAX2SetNamespace; removed in 2.6.10 -} LIBXML2_2.5.9; - -LIBXML2_2.6.1 { - global: - -# parser - xmlCtxtResetPush; -} LIBXML2_2.6.0; - -LIBXML2_2.6.2 { - global: - -# parserInternals - xmlCreateURLParserCtxt; - -# xmlschemas - xmlSchemaNewDocParserCtxt; - -# xmlstring - xmlStrVPrintf; - -# xinclude - xmlXIncludeFreeContext; - xmlXIncludeNewContext; - xmlXIncludeProcessNode; -} LIBXML2_2.6.1; - -LIBXML2_2.6.3 { - global: - -# pattern - xmlFreePatternList; - xmlFreePattern; - xmlPatterncompile; - xmlPatternMatch; - -# xmlwriter - xmlNewTextWriterDoc; - xmlNewTextWriterPushParser; - xmlNewTextWriterTree; - -# xmlreader - xmlTextReaderPreservePattern; - -# xmlunicode - xmlUCSIsAegeanNumbers; - xmlUCSIsBuhid; - xmlUCSIsCombiningDiacriticalMarksforSymbols; - xmlUCSIsCypriotSyllabary; - xmlUCSIsCyrillicSupplement; - xmlUCSIsGreekandCoptic; - xmlUCSIsHanunoo; - xmlUCSIsKatakanaPhoneticExtensions; - xmlUCSIsKhmerSymbols; - xmlUCSIsLimbu; - xmlUCSIsLinearBIdeograms; - xmlUCSIsLinearBSyllabary; - xmlUCSIsMiscellaneousMathematicalSymbolsA; - xmlUCSIsMiscellaneousMathematicalSymbolsB; - xmlUCSIsMiscellaneousSymbolsandArrows; - xmlUCSIsOsmanya; - xmlUCSIsPhoneticExtensions; - xmlUCSIsPrivateUseArea; - xmlUCSIsShavian; - xmlUCSIsSupplementalArrowsA; - xmlUCSIsSupplementalArrowsB; - xmlUCSIsSupplementalMathematicalOperators; - xmlUCSIsSupplementaryPrivateUseAreaA; - xmlUCSIsSupplementaryPrivateUseAreaB; - xmlUCSIsTagalog; - xmlUCSIsTagbanwa; - xmlUCSIsTaiLe; - xmlUCSIsTaiXuanJingSymbols; - xmlUCSIsUgaritic; - xmlUCSIsVariationSelectorsSupplement; - xmlUCSIsVariationSelectors; - xmlUCSIsYijingHexagramSymbols; - -# xinclude - xmlXIncludeProcessFlags; - xmlXIncludeProcessTreeFlags; - xmlXIncludeSetFlags; -} LIBXML2_2.6.2; - -LIBXML2_2.6.5 { - global: - -# xmlmemory - xmlCleanupMemory; - -# dict - xmlDictCreateSub; - -# relaxng - xmlRelaxParserSetFlag; - -# xmlstring - xmlStrncatNew; - -# xmlwriter - xmlTextWriterSetIndentString; - xmlTextWriterSetIndent; - -# xpath - xmlXPathCtxtCompile; -} LIBXML2_2.6.3; - -LIBXML2_2.6.6 { - global: - -# tree - xmlAttrSerializeTxtContent; - -# parser - xmlByteConsumed; - -# xmlreader - xmlTextReaderSetStructuredErrorHandler; -} LIBXML2_2.6.5; - -LIBXML2_2.6.7 { - global: - -# xmlwriter - xmlTextWriterEndComment; - xmlTextWriterStartComment; -} LIBXML2_2.6.6; - -LIBXML2_2.6.8 { - global: - -# xmlsave - xmlSaveClose; - xmlSaveDoc; - xmlSaveFlush; - xmlSaveToFd; - xmlSaveToFilename; - xmlSaveToIO; - xmlSaveTree; - -# xmlwriter - xmlTextWriterEndDTDAttlist; - xmlTextWriterEndDTDElement; - xmlTextWriterEndDTDEntity; - xmlTextWriterWriteDTDExternalEntityContents; -} LIBXML2_2.6.7; - -LIBXML2_2.6.10 { - global: - -# xmlIO - xmlOutputBufferWriteEscape; - xmlPopInputCallbacks; - -# xmlsave - xmlSaveSetAttrEscape; - xmlSaveSetEscape; -} LIBXML2_2.6.8; - -LIBXML2_2.6.11 { - global: - -# uri - xmlBuildRelativeURI; - -# globals - xmlOutputBufferCreateFilenameDefault; - xmlOutputBufferCreateFilenameValue; # variable - xmlParserInputBufferCreateFilenameDefault; - xmlParserInputBufferCreateFilenameValue; # variable - xmlThrDefOutputBufferCreateFilenameDefault; - xmlThrDefParserInputBufferCreateFilenameDefault; - -# schemasInternals - xmlSchemaFreeWildcard; - -# xmlschemastypes - xmlSchemaCollapseString; - xmlSchemaGetBuiltInListSimpleTypeItemType; - xmlSchemaGetBuiltInType; - xmlSchemaIsBuiltInTypeFacet; - xmlSchemaValidateListSimpleTypeFacet; -} LIBXML2_2.6.10; - -LIBXML2_2.6.12 { - global: - -# parser - xmlParseInNodeContext; - -# xmlschemastypes - xmlSchemaGetFacetValueAsULong; - xmlSchemaValidateLengthFacet; - xmlSchemaValPredefTypeNodeNoNorm; - -# xmlschemas - xmlSchemaGetParserErrors; - xmlSchemaGetValidErrors; -} LIBXML2_2.6.11; - -LIBXML2_2.6.14 { - global: - -# xmlautomata - xmlAutomataNewCountTrans2; - xmlAutomataNewOnceTrans2; - -# nanohttp - xmlNanoHTTPContentLength; - -# xmlschemas - xmlSchemaSetValidOptions; - xmlSchemaValidateOneElement; - xmlSchemaValidCtxtGetOptions; -} LIBXML2_2.6.12; - -LIBXML2_2.6.15 { - global: - -# debugXML - xmlDebugCheckDocument; - -# tree - xmlDocCopyNodeList; - xmlNewDocPI; - -# xmlreader - xmlTextReaderConstEncoding; - xmlTextReaderConstXmlVersion; - xmlTextReaderIsNamespaceDecl; - xmlTextReaderStandalone; -} LIBXML2_2.6.14; - -LIBXML2_2.6.16 { - global: - -# xmlmemory - xmlMemBlocks; - -# relaxng - xmlRelaxNGInitTypes; -} LIBXML2_2.6.15; - -LIBXML2_2.6.17 { - global: - -# dict - xmlDictExists; - -# xmlmodule - xmlModuleClose; - xmlModuleFree; - xmlModuleOpen; - xmlModuleSymbol; - -# xmlregexp - xmlRegExecErrInfo; - xmlRegExecNextValues; - -# xmlschemastypes - xmlSchemaWhiteSpaceReplace; - -# xmlreader - xmlTextReaderGetParserColumnNumber; - xmlTextReaderGetParserLineNumber; -} LIBXML2_2.6.16; - -LIBXML2_2.6.18 { - global: - -# valid - xmlCopyDocElementContent; - xmlFreeDocElementContent; - xmlNewDocElementContent; - -# dict - xmlDictCleanup; - -# hash - xmlHashCreateDict; - -# pattern - xmlFreeStreamCtxt; - xmlPatternFromRoot; - xmlPatternGetStreamCtxt; - xmlPatternMaxDepth; - xmlPatternStreamable; - xmlStreamPop; - xmlStreamPushAttr; - xmlStreamPush; - -# xmlschemastypes - xmlSchemaCompareValuesWhtsp; - xmlSchemaCopyValue; - xmlSchemaGetCanonValue; - xmlSchemaNewNOTATIONValue; - xmlSchemaNewStringValue; - -# xmlreader - xmlTextReaderByteConsumed; -} LIBXML2_2.6.17; - -LIBXML2_2.6.19 { - global: - -# xmlschemastypes - xmlSchemaGetValType; - xmlSchemaValidateFacetWhtsp; - xmlSchemaValidateLengthFacetWhtsp; -} LIBXML2_2.6.18; - -LIBXML2_2.6.20 { - global: - -# tree - xmlDOMWrapAdoptNode; - xmlDOMWrapFreeCtxt; - xmlDOMWrapNewCtxt; - xmlDOMWrapReconcileNamespaces; - xmlDOMWrapRemoveNode; - -# xmlschemastypes - xmlSchemaGetCanonValueWhtsp; - xmlSchemaNewQNameValue; - xmlSchemaValueAppend; - xmlSchemaValueGetAsBoolean; - xmlSchemaValueGetAsString; - xmlSchemaValueGetNext; - -# xmlschemas - xmlSchemaIsValid; - xmlSchemaSAXPlug; - xmlSchemaSAXUnplug; - xmlSchemaValidateFile; - -# xmlreader - xmlTextReaderSchemaValidate; - xmlTextReaderSetSchema; -} LIBXML2_2.6.19; - -LIBXML2_2.6.21 { - global: - -# xmlautomata - xmlAutomataNewNegTrans; - -# xmlregexp -# emptyExp; removed in 2.9.10 -# forbiddenExp; removed in 2.9.10 -# xmlExpCtxtNbCons; removed in 2.9.10 -# xmlExpCtxtNbNodes; removed in 2.9.10 -# xmlExpDump; removed in 2.9.10 -# xmlExpExpDerive; removed in 2.9.10 -# xmlExpFreeCtxt; removed in 2.9.10 -# xmlExpFree; removed in 2.9.10 -# xmlExpGetLanguage; removed in 2.9.10 -# xmlExpGetStart; removed in 2.9.10 -# xmlExpIsNillable; removed in 2.9.10 -# xmlExpMaxToken; removed in 2.9.10 -# xmlExpNewAtom; removed in 2.9.10 -# xmlExpNewCtxt; removed in 2.9.10 -# xmlExpNewOr; removed in 2.9.10 -# xmlExpNewRange; removed in 2.9.10 -# xmlExpNewSeq; removed in 2.9.10 -# xmlExpParse; removed in 2.9.10 -# xmlExpRef; removed in 2.9.10 -# xmlExpStringDerive; removed in 2.9.10 -# xmlExpSubsume; removed in 2.9.10 - -# parser - xmlHasFeature; - -# uri - xmlParseURIRaw; - -# pattern - xmlPatternMinDepth; - -# relaxng - xmlRelaxNGSetValidStructuredErrors; - -# xmlschemas - xmlSchemaSetValidStructuredErrors; - -# schematron - xmlSchematronFreeParserCtxt; - xmlSchematronFree; - xmlSchematronFreeValidCtxt; - xmlSchematronNewDocParserCtxt; - xmlSchematronNewMemParserCtxt; - xmlSchematronNewParserCtxt; - xmlSchematronNewValidCtxt; - xmlSchematronParse; - xmlSchematronValidateDoc; -} LIBXML2_2.6.20; - -LIBXML2_2.6.23 { - global: - -# HTMLtree - htmlDocDumpMemoryFormat; - -# xmlIO - xmlOutputBufferCreateBuffer; - -# xmlsave - xmlSaveToBuffer;# suppressed in 2.6.11, readded in 2.6.23 - - -# xmlschemas - xmlSchemaSetParserStructuredErrors; - -# pattern - xmlStreamPushNode; - xmlStreamWantsAnyNode; - -# xmlreader - xmlTextReaderSchemaValidateCtxt; -} LIBXML2_2.6.21; - -LIBXML2_2.6.24 { - global: - -# tree - xmlDOMWrapCloneNode; - -# relaxng - xmlRelaxNGSetParserStructuredErrors; -} LIBXML2_2.6.23; - -LIBXML2_2.6.25 { - global: - -# xpath - xmlXPathContextSetCache; -} LIBXML2_2.6.24; - -LIBXML2_2.6.27 { - global: - -# HTMLparser - htmlNewParserCtxt; - -# uri - xmlPathToURI; - -# xinclude - xmlXIncludeProcessFlagsData; - -# xpath - xmlXPathCompiledEvalToBoolean; -} LIBXML2_2.6.25; - -LIBXML2_2.6.28 { - global: - -# xmlreader - xmlTextReaderSetup; -} LIBXML2_2.6.27; - -LIBXML2_2.6.29 { - global: - -# threads - xmlDllMain; -} LIBXML2_2.6.28; - -LIBXML2_2.6.32 { - global: - -# schematron - xmlSchematronSetValidStructuredErrors; -} LIBXML2_2.6.29; - -LIBXML2_2.7.0 { - global: - -# xmlmemory - xmlMemDisplayLast; - -# entities - xmlNewEntity; - -# xmlschemas - xmlSchemaValidCtxtGetParserCtxt; -} LIBXML2_2.6.32; - -LIBXML2_2.7.3 { - global: - -# tree - xmlChildElementCount; - xmlFirstElementChild; - xmlLastElementChild; - xmlNextElementSibling; - xmlPreviousElementSibling; -} LIBXML2_2.7.0; - -LIBXML2_2.7.4 { - global: - -# globals - xmlStructuredErrorContext; # variable - -# xinclude - xmlXIncludeProcessTreeFlagsData; -} LIBXML2_2.7.3; - -LIBXML2_2.8.0 { - global: - -# xmlreader - xmlTextReaderRelaxNGValidateCtxt; - -# tree - xmlBufferDetach; - -# dict - xmlInitializeDict; -} LIBXML2_2.7.4; - -LIBXML2_2.9.0 { - global: - -# tree - xmlBufContent; - xmlBufEnd; - xmlBufGetNodeContent; - xmlBufNodeDump; - xmlBufShrink; - xmlBufUse; - -# dict - xmlDictGetUsage; - xmlDictSetLimit; - -# xmlschemas - xmlSchemaValidateSetFilename; - xmlSchemaValidateSetLocator; - -# xmlIO - xmlOutputBufferGetContent; - xmlOutputBufferGetSize; - -# xmlwriter - xmlTextWriterSetQuoteChar; -} LIBXML2_2.8.0; - -LIBXML2_2.9.1 { - global: - -# xpath - xmlXPathNodeEval; - xmlXPathSetContextNode; -} LIBXML2_2.9.0; - -LIBXML2_2.9.8 { - global: - -# hash - xmlHashDefaultDeallocator; -} LIBXML2_2.9.1; - +# +# Officially exported symbols, for which header +# file definitions are installed in /usr/include/libxml2 +# +# Automatically generated from symbols.xml and syms.xsl +# +# Versions here are *fixed* to match the libxml2 version +# at which the symbol was introduced. This ensures that +# a new client app requiring symbol foo() can't accidentally +# run with old libxml2.so not providing foo() - the global +# soname version info can't enforce this since we never +# change the soname +# + +LIBXML2_2.4.30 { + global: + +# debugXML + xmlBoolToText; + xmlDebugDumpAttr; + xmlDebugDumpAttrList; + xmlDebugDumpDTD; + xmlDebugDumpDocument; + xmlDebugDumpDocumentHead; + xmlDebugDumpEntities; + xmlDebugDumpNode; + xmlDebugDumpNodeList; + xmlDebugDumpOneNode; + xmlDebugDumpString; + xmlLsCountNode; + xmlLsOneNode; + xmlShell; + xmlShellBase; + xmlShellCat; + xmlShellDir; + xmlShellDu; + xmlShellList; + xmlShellLoad; + xmlShellPrintNode; + xmlShellPrintXPathError; + xmlShellPrintXPathResult; + xmlShellPwd; + xmlShellSave; + xmlShellValidate; + xmlShellWrite; + +# xpointer + xmlXPtrBuildNodeList; + xmlXPtrEval; + xmlXPtrEvalRangePredicate; + xmlXPtrFreeLocationSet; + xmlXPtrLocationSetAdd; + xmlXPtrLocationSetCreate; + xmlXPtrLocationSetDel; + xmlXPtrLocationSetMerge; + xmlXPtrLocationSetRemove; + xmlXPtrNewCollapsedRange; + xmlXPtrNewContext; + xmlXPtrNewLocationSetNodeSet; + xmlXPtrNewLocationSetNodes; + xmlXPtrNewRange; + xmlXPtrNewRangeNodeObject; + xmlXPtrNewRangeNodePoint; + xmlXPtrNewRangeNodes; + xmlXPtrNewRangePointNode; + xmlXPtrNewRangePoints; + xmlXPtrRangeToFunction; + xmlXPtrWrapLocationSet; + +# SAX + attribute; + attributeDecl; + cdataBlock; + characters; + checkNamespace; + comment; + +# SAX2 + docbDefaultSAXHandlerInit; + +# SAX + elementDecl; + endDocument; + endElement; + entityDecl; + externalSubset; + getColumnNumber; + getEntity; + getLineNumber; + getNamespace; + getParameterEntity; + getPublicId; + getSystemId; + globalNamespace; + hasExternalSubset; + hasInternalSubset; + +# SAX2 + htmlDefaultSAXHandlerInit; + +# SAX + ignorableWhitespace; + initdocbDefaultSAXHandler; + inithtmlDefaultSAXHandler; + initxmlDefaultSAXHandler; + internalSubset; + isStandalone; + namespaceDecl; + notationDecl; + processingInstruction; + reference; + resolveEntity; + setDocumentLocator; + setNamespace; + startDocument; + startElement; + unparsedEntityDecl; + +# SAX2 + xmlDefaultSAXHandlerInit; + +# parserInternals + htmlCreateFileParserCtxt; + htmlInitAutoClose; + inputPop; + inputPush; + namePop; + namePush; + nodePop; + nodePush; + xmlCheckLanguageID; + xmlCopyChar; + xmlCopyCharMultiByte; + xmlCreateEntityParserCtxt; + xmlCreateFileParserCtxt; + xmlCreateMemoryParserCtxt; + xmlCurrentChar; + xmlDecodeEntities; + xmlFreeInputStream; + xmlHandleEntity; + +# chvalid + xmlIsBaseChar; + xmlIsBlank; + xmlIsChar; + xmlIsCombining; + xmlIsDigit; + xmlIsExtender; + xmlIsIdeographic; + +# parserInternals + xmlIsLetter; + +# chvalid + xmlIsPubidChar; + +# parserInternals + xmlNamespaceParseNCName; + xmlNamespaceParseNSDef; + xmlNamespaceParseQName; + xmlNewEntityInputStream; + xmlNewInputFromFile; + xmlNewInputStream; + +# parser + xmlNewParserCtxt; + +# parserInternals + xmlNewStringInputStream; + xmlNextChar; + xmlParseAttValue; + xmlParseAttribute; + xmlParseAttributeListDecl; + xmlParseAttributeType; + xmlParseCDSect; + xmlParseCharData; + xmlParseCharRef; + xmlParseComment; + xmlParseContent; + xmlParseDefaultDecl; + xmlParseDocTypeDecl; + xmlParseElement; + xmlParseElementChildrenContentDecl; + xmlParseElementContentDecl; + xmlParseElementDecl; + xmlParseElementMixedContentDecl; + xmlParseEncName; + xmlParseEncodingDecl; + xmlParseEndTag; + xmlParseEntityDecl; + xmlParseEntityRef; + xmlParseEntityValue; + xmlParseEnumeratedType; + xmlParseEnumerationType; + xmlParseExternalID; + xmlParseExternalSubset; + xmlParseMarkupDecl; + xmlParseMisc; + xmlParseName; + xmlParseNamespace; + xmlParseNmtoken; + xmlParseNotationDecl; + xmlParseNotationType; + xmlParsePEReference; + xmlParsePI; + xmlParsePITarget; + xmlParsePubidLiteral; + xmlParseQuotedString; + xmlParseReference; + xmlParseSDDecl; + xmlParseStartTag; + xmlParseSystemLiteral; + xmlParseTextDecl; + xmlParseVersionInfo; + xmlParseVersionNum; + xmlParseXMLDecl; + xmlParserHandlePEReference; + xmlParserHandleReference; + xmlParserInputShrink; + xmlPopInput; + xmlPushInput; + xmlScanName; + xmlSetEntityReferenceFunc; + xmlSkipBlankChars; + xmlSplitQName; + xmlStringComment; # variable + xmlStringCurrentChar; + xmlStringDecodeEntities; + xmlStringText; # variable + xmlStringTextNoenc; # variable + xmlSwitchEncoding; + xmlSwitchToEncoding; + +# c14n + xmlC14NDocDumpMemory; + xmlC14NDocSave; + xmlC14NDocSaveTo; + xmlC14NExecute; + +# catalog + xmlACatalogAdd; + xmlACatalogDump; + xmlACatalogRemove; + xmlACatalogResolve; + xmlACatalogResolvePublic; + xmlACatalogResolveSystem; + xmlACatalogResolveURI; + xmlCatalogAdd; + xmlCatalogAddLocal; + xmlCatalogCleanup; + xmlCatalogConvert; + xmlCatalogDump; + xmlCatalogFreeLocal; + xmlCatalogGetDefaults; + xmlCatalogGetPublic; + xmlCatalogGetSystem; + xmlCatalogIsEmpty; + xmlCatalogLocalResolve; + xmlCatalogLocalResolveURI; + xmlCatalogRemove; + xmlCatalogResolve; + xmlCatalogResolvePublic; + xmlCatalogResolveSystem; + xmlCatalogResolveURI; + xmlCatalogSetDebug; + xmlCatalogSetDefaultPrefer; + xmlCatalogSetDefaults; + xmlConvertSGMLCatalog; + xmlFreeCatalog; + xmlInitializeCatalog; + xmlLoadACatalog; + xmlLoadCatalog; + xmlLoadCatalogs; + xmlLoadSGMLSuperCatalog; + xmlNewCatalog; + xmlParseCatalogFile; + +# xpathInternals + valuePop; + valuePush; + xmlXPathAddValues; + xmlXPathBooleanFunction; + xmlXPathCeilingFunction; + xmlXPathCompareValues; + xmlXPathConcatFunction; + xmlXPathContainsFunction; + xmlXPathCountFunction; + xmlXPathDebugDumpCompExpr; + xmlXPathDebugDumpObject; + xmlXPathDifference; + xmlXPathDistinct; + xmlXPathDistinctSorted; + xmlXPathDivValues; + xmlXPathEqualValues; + xmlXPathEvalExpr; + xmlXPathEvaluatePredicateResult; + xmlXPathFalseFunction; + xmlXPathFloorFunction; + xmlXPathFreeParserContext; + xmlXPathFunctionLookup; + xmlXPathFunctionLookupNS; + xmlXPathHasSameNodes; + xmlXPathIdFunction; + xmlXPathIntersection; + xmlXPathIsNodeType; + xmlXPathLangFunction; + xmlXPathLastFunction; + xmlXPathLeading; + xmlXPathLeadingSorted; + xmlXPathLocalNameFunction; + xmlXPathModValues; + xmlXPathMultValues; + xmlXPathNamespaceURIFunction; + xmlXPathNewBoolean; + xmlXPathNewCString; + xmlXPathNewFloat; + xmlXPathNewNodeSet; + xmlXPathNewNodeSetList; + xmlXPathNewParserContext; + xmlXPathNewString; + xmlXPathNewValueTree; + xmlXPathNextAncestor; + xmlXPathNextAncestorOrSelf; + xmlXPathNextAttribute; + xmlXPathNextChild; + xmlXPathNextDescendant; + xmlXPathNextDescendantOrSelf; + xmlXPathNextFollowing; + xmlXPathNextFollowingSibling; + xmlXPathNextNamespace; + xmlXPathNextParent; + xmlXPathNextPreceding; + xmlXPathNextPrecedingSibling; + xmlXPathNextSelf; + xmlXPathNodeLeading; + xmlXPathNodeLeadingSorted; + xmlXPathNodeSetAdd; + xmlXPathNodeSetAddNs; + xmlXPathNodeSetAddUnique; + xmlXPathNodeSetContains; + xmlXPathNodeSetDel; + xmlXPathNodeSetFreeNs; + xmlXPathNodeSetMerge; + xmlXPathNodeSetRemove; + xmlXPathNodeSetSort; + xmlXPathNodeTrailing; + xmlXPathNodeTrailingSorted; + xmlXPathNormalizeFunction; + xmlXPathNotEqualValues; + xmlXPathNotFunction; + xmlXPathNsLookup; + xmlXPathNumberFunction; + xmlXPathParseNCName; + xmlXPathParseName; + xmlXPathPopBoolean; + xmlXPathPopExternal; + xmlXPathPopNodeSet; + xmlXPathPopNumber; + xmlXPathPopString; + xmlXPathPositionFunction; + xmlXPathRegisterAllFunctions; + xmlXPathRegisterFunc; + xmlXPathRegisterFuncLookup; + xmlXPathRegisterFuncNS; + xmlXPathRegisterNs; + xmlXPathRegisterVariable; + xmlXPathRegisterVariableLookup; + xmlXPathRegisterVariableNS; + xmlXPathRegisteredFuncsCleanup; + xmlXPathRegisteredNsCleanup; + xmlXPathRegisteredVariablesCleanup; + xmlXPathRoot; + xmlXPathRoundFunction; + xmlXPathStartsWithFunction; + xmlXPathStringEvalNumber; + xmlXPathStringFunction; + xmlXPathStringLengthFunction; + xmlXPathSubValues; + xmlXPathSubstringAfterFunction; + xmlXPathSubstringBeforeFunction; + xmlXPathSubstringFunction; + xmlXPathSumFunction; + xmlXPathTrailing; + xmlXPathTrailingSorted; + xmlXPathTranslateFunction; + xmlXPathTrueFunction; + xmlXPathValueFlipSign; + xmlXPathVariableLookup; + xmlXPathVariableLookupNS; + xmlXPathWrapCString; + xmlXPathWrapExternal; + xmlXPathWrapNodeSet; + xmlXPathWrapString; + xmlXPatherror; + +# xmlautomata + xmlAutomataCompile; + xmlAutomataGetInitState; + xmlAutomataIsDeterminist; + xmlAutomataNewAllTrans; + xmlAutomataNewCountTrans; + xmlAutomataNewCountedTrans; + xmlAutomataNewCounter; + xmlAutomataNewCounterTrans; + xmlAutomataNewEpsilon; + xmlAutomataNewOnceTrans; + xmlAutomataNewState; + xmlAutomataNewTransition; + xmlAutomataSetFinalState; + xmlFreeAutomata; + xmlNewAutomata; + +# HTMLtree + htmlDocContentDumpFormatOutput; + htmlDocContentDumpOutput; + htmlDocDump; + htmlDocDumpMemory; + htmlGetMetaEncoding; + htmlIsBooleanAttr; + htmlNewDoc; + htmlNewDocNoDtD; + htmlNodeDump; + htmlNodeDumpFile; + htmlNodeDumpFileFormat; + htmlNodeDumpFormatOutput; + htmlNodeDumpOutput; + htmlSaveFile; + htmlSaveFileEnc; + htmlSaveFileFormat; + htmlSetMetaEncoding; + +# nanoftp + xmlNanoFTPCheckResponse; + xmlNanoFTPCleanup; + xmlNanoFTPClose; + xmlNanoFTPCloseConnection; + xmlNanoFTPConnect; + xmlNanoFTPConnectTo; + xmlNanoFTPCwd; + xmlNanoFTPFreeCtxt; + xmlNanoFTPGet; + xmlNanoFTPGetConnection; + xmlNanoFTPGetResponse; + xmlNanoFTPGetSocket; + xmlNanoFTPInit; + xmlNanoFTPList; + xmlNanoFTPNewCtxt; + xmlNanoFTPOpen; + xmlNanoFTPProxy; + xmlNanoFTPQuit; + xmlNanoFTPRead; + xmlNanoFTPScanProxy; + xmlNanoFTPUpdateURL; + +# DOCBparser + docbCreateFileParserCtxt; + docbCreatePushParserCtxt; + docbEncodeEntities; + docbFreeParserCtxt; + docbParseChunk; + docbParseDoc; + docbParseDocument; + docbParseFile; + docbSAXParseDoc; + docbSAXParseFile; + +# xpath + xmlXPathCastBooleanToNumber; + xmlXPathCastBooleanToString; + xmlXPathCastNodeSetToBoolean; + xmlXPathCastNodeSetToNumber; + xmlXPathCastNodeSetToString; + xmlXPathCastNodeToNumber; + xmlXPathCastNodeToString; + xmlXPathCastNumberToBoolean; + xmlXPathCastNumberToString; + xmlXPathCastStringToBoolean; + xmlXPathCastStringToNumber; + xmlXPathCastToBoolean; + xmlXPathCastToNumber; + xmlXPathCastToString; + xmlXPathCmpNodes; + xmlXPathCompile; + xmlXPathCompiledEval; + xmlXPathConvertBoolean; + xmlXPathConvertNumber; + xmlXPathConvertString; + xmlXPathEval; + xmlXPathEvalExpression; + xmlXPathEvalPredicate; + xmlXPathFreeCompExpr; + xmlXPathFreeContext; + xmlXPathFreeNodeSet; + xmlXPathFreeNodeSetList; + xmlXPathFreeObject; + xmlXPathInit; + xmlXPathIsInf; + xmlXPathIsNaN; + xmlXPathNAN; # variable + xmlXPathNINF; # variable + xmlXPathNewContext; + xmlXPathNodeSetCreate; + xmlXPathObjectCopy; + xmlXPathPINF; # variable + +# xlink + xlinkGetDefaultDetect; + xlinkGetDefaultHandler; + xlinkIsLink; + xlinkSetDefaultDetect; + xlinkSetDefaultHandler; + +# entities + xmlAddDocEntity; + xmlAddDtdEntity; + xmlCleanupPredefinedEntities; + xmlCopyEntitiesTable; + xmlCreateEntitiesTable; + xmlDumpEntitiesTable; + xmlDumpEntityDecl; + xmlEncodeEntities; + xmlEncodeEntitiesReentrant; + xmlEncodeSpecialChars; + xmlFreeEntitiesTable; + xmlGetDocEntity; + xmlGetDtdEntity; + xmlGetParameterEntity; + xmlGetPredefinedEntity; + xmlInitializePredefinedEntities; + +# xinclude + xmlXIncludeProcess; + +# list + xmlLinkGetData; + xmlListAppend; + xmlListClear; + xmlListCopy; + xmlListCreate; + xmlListDelete; + xmlListDup; + xmlListEmpty; + xmlListEnd; + xmlListFront; + xmlListInsert; + xmlListMerge; + xmlListPopBack; + xmlListPopFront; + xmlListPushBack; + xmlListPushFront; + xmlListRemoveAll; + xmlListRemoveFirst; + xmlListRemoveLast; + xmlListReverse; + xmlListReverseSearch; + xmlListReverseWalk; + xmlListSearch; + xmlListSize; + xmlListSort; + xmlListWalk; + +# xmlmemory + xmlInitMemory; + xmlMallocLoc; + xmlMemDisplay; + xmlMemFree; + xmlMemGet; + xmlMemMalloc; + xmlMemRealloc; + xmlMemSetup; + xmlMemShow; + xmlMemStrdupLoc; + xmlMemUsed; + xmlMemoryDump; + xmlMemoryStrdup; + xmlReallocLoc; + +# xmlIO + xmlAllocOutputBuffer; + xmlAllocParserInputBuffer; + xmlCheckFilename; + xmlCleanupInputCallbacks; + xmlCleanupOutputCallbacks; + xmlFileClose; + xmlFileMatch; + xmlFileOpen; + xmlFileRead; + xmlFreeParserInputBuffer; + xmlIOFTPClose; + xmlIOFTPMatch; + xmlIOFTPOpen; + xmlIOFTPRead; + xmlIOHTTPClose; + xmlIOHTTPMatch; + xmlIOHTTPOpen; + xmlIOHTTPOpenW; + xmlIOHTTPRead; + xmlNoNetExternalEntityLoader; + xmlNormalizeWindowsPath; + xmlOutputBufferClose; + xmlOutputBufferCreateFd; + xmlOutputBufferCreateFile; + xmlOutputBufferCreateFilename; + xmlOutputBufferCreateIO; + xmlOutputBufferFlush; + xmlOutputBufferWrite; + xmlOutputBufferWriteString; + xmlParserGetDirectory; + xmlParserInputBufferCreateFd; + xmlParserInputBufferCreateFile; + xmlParserInputBufferCreateFilename; + xmlParserInputBufferCreateIO; + xmlParserInputBufferCreateMem; + xmlParserInputBufferGrow; + xmlParserInputBufferPush; + xmlParserInputBufferRead; + xmlRegisterDefaultInputCallbacks; + xmlRegisterDefaultOutputCallbacks; + xmlRegisterHTTPPostCallbacks; + xmlRegisterInputCallbacks; + xmlRegisterOutputCallbacks; + +# xmlversion + xmlCheckVersion; + +# valid + xmlAddAttributeDecl; + xmlAddElementDecl; + xmlAddID; + xmlAddNotationDecl; + xmlAddRef; + xmlCopyAttributeTable; + xmlCopyElementContent; + xmlCopyElementTable; + xmlCopyEnumeration; + xmlCopyNotationTable; + xmlCreateEnumeration; + xmlDumpAttributeDecl; + xmlDumpAttributeTable; + xmlDumpElementDecl; + xmlDumpElementTable; + xmlDumpNotationDecl; + xmlDumpNotationTable; + xmlFreeAttributeTable; + xmlFreeElementContent; + xmlFreeElementTable; + xmlFreeEnumeration; + xmlFreeIDTable; + xmlFreeNotationTable; + xmlFreeRefTable; + xmlGetDtdAttrDesc; + xmlGetDtdElementDesc; + xmlGetDtdNotationDesc; + xmlGetDtdQAttrDesc; + xmlGetDtdQElementDesc; + xmlGetID; + xmlGetRefs; + xmlIsID; + xmlIsMixedElement; + xmlIsRef; + xmlNewElementContent; + xmlRemoveID; + xmlRemoveRef; + xmlSnprintfElementContent; + +# tree + xmlSplitQName2; + +# valid + xmlSprintfElementContent; + xmlValidBuildContentModel; + xmlValidCtxtNormalizeAttributeValue; + xmlValidGetPotentialChildren; + xmlValidGetValidElements; + xmlValidNormalizeAttributeValue; + xmlValidateAttributeDecl; + xmlValidateAttributeValue; + xmlValidateDocument; + xmlValidateDocumentFinal; + xmlValidateDtd; + xmlValidateDtdFinal; + xmlValidateElement; + xmlValidateElementDecl; + xmlValidateNameValue; + xmlValidateNamesValue; + xmlValidateNmtokenValue; + xmlValidateNmtokensValue; + xmlValidateNotationDecl; + xmlValidateNotationUse; + xmlValidateOneAttribute; + xmlValidateOneElement; + xmlValidateOneNamespace; + xmlValidateRoot; + +# HTMLparser + UTF8ToHtml; + htmlAutoCloseTag; + htmlCreatePushParserCtxt; + htmlEncodeEntities; + htmlEntityLookup; + htmlEntityValueLookup; + htmlFreeParserCtxt; + htmlHandleOmittedElem; + htmlIsAutoClosed; + htmlIsScriptAttribute; + htmlParseCharRef; + htmlParseChunk; + htmlParseDoc; + htmlParseDocument; + htmlParseElement; + htmlParseEntityRef; + htmlParseFile; + htmlSAXParseDoc; + htmlSAXParseFile; + htmlTagLookup; + +# xmlstring + xmlCharStrdup; + xmlCharStrndup; + +# parser + xmlCleanupParser; + xmlClearNodeInfoSeq; + xmlClearParserCtxt; + xmlCreateDocParserCtxt; + xmlCreateIOParserCtxt; + xmlCreatePushParserCtxt; + xmlFreeParserCtxt; + xmlGetExternalEntityLoader; + xmlGetFeature; + xmlGetFeaturesList; + +# globals + xmlGetWarningsDefaultValue; # variable + +# parser + xmlIOParseDTD; + xmlInitNodeInfoSeq; + xmlInitParser; + xmlInitParserCtxt; + xmlKeepBlanksDefault; + xmlLineNumbersDefault; + xmlLoadExternalEntity; + xmlNewIOInputStream; + xmlParseBalancedChunkMemory; + xmlParseBalancedChunkMemoryRecover; + xmlParseChunk; + xmlParseCtxtExternalEntity; + xmlParseDTD; + xmlParseDoc; + xmlParseDocument; + xmlParseEntity; + xmlParseExtParsedEnt; + xmlParseExternalEntity; + xmlParseFile; + xmlParseMemory; + xmlParserAddNodeInfo; + xmlParserFindNodeInfo; + xmlParserFindNodeInfoIndex; + xmlParserInputGrow; + xmlParserInputRead; + xmlPedanticParserDefault; + xmlRecoverDoc; + xmlRecoverFile; + xmlRecoverMemory; + xmlSAXParseDTD; + xmlSAXParseDoc; + xmlSAXParseEntity; + xmlSAXParseFile; + xmlSAXParseFileWithData; + xmlSAXParseMemory; + xmlSAXParseMemoryWithData; + xmlSAXUserParseFile; + xmlSAXUserParseMemory; + xmlSetExternalEntityLoader; + xmlSetFeature; + xmlSetupParserForBuffer; + xmlStopParser; + +# xmlstring + xmlStrEqual; + xmlStrcasecmp; + xmlStrcasestr; + xmlStrcat; + xmlStrchr; + xmlStrcmp; + xmlStrdup; + xmlStrlen; + xmlStrncasecmp; + xmlStrncat; + xmlStrncmp; + xmlStrndup; + xmlStrstr; + xmlStrsub; + +# parser + xmlSubstituteEntitiesDefault; + +# xmlreader + xmlFreeTextReader; + xmlNewTextReader; + xmlNewTextReaderFilename; + xmlTextReaderAttributeCount; + xmlTextReaderBaseUri; + xmlTextReaderDepth; + xmlTextReaderHasAttributes; + xmlTextReaderHasValue; + xmlTextReaderIsDefault; + xmlTextReaderIsEmptyElement; + xmlTextReaderLocalName; + xmlTextReaderName; + xmlTextReaderNamespaceUri; + xmlTextReaderNodeType; + xmlTextReaderPrefix; + xmlTextReaderQuoteChar; + xmlTextReaderRead; + xmlTextReaderValue; + xmlTextReaderXmlLang; + +# globals + docbDefaultSAXHandler; # variable + htmlDefaultSAXHandler; # variable + xmlDefaultSAXHandler; # variable + xmlDefaultSAXLocator; # variable + xmlDoValidityCheckingDefaultValue; # variable + xmlFree; # variable + xmlGenericError; # variable + xmlGenericErrorContext; # variable + xmlInitializeGlobalState; + xmlKeepBlanksDefaultValue; # variable + xmlLineNumbersDefaultValue; # variable + xmlLoadExtDtdDefaultValue; # variable + xmlMalloc; # variable + xmlMemStrdup; # variable + xmlParserDebugEntities; # variable + xmlParserVersion; # variable + xmlPedanticParserDefaultValue; # variable + xmlRealloc; # variable + xmlSaveNoEmptyTags; # variable + xmlSubstituteEntitiesDefaultValue; # variable + xmlTreeIndentString; # variable + +# threads + xmlCleanupThreads; + xmlFreeMutex; + xmlFreeRMutex; + xmlGetGlobalState; + xmlGetThreadId; + xmlInitThreads; + xmlIsMainThread; + xmlLockLibrary; + xmlMutexLock; + xmlMutexUnlock; + xmlNewMutex; + xmlNewRMutex; + xmlRMutexLock; + xmlRMutexUnlock; + xmlUnlockLibrary; + +# hash + xmlHashAddEntry; + xmlHashAddEntry2; + xmlHashAddEntry3; + xmlHashCopy; + xmlHashCreate; + xmlHashFree; + xmlHashLookup; + xmlHashLookup2; + xmlHashLookup3; + xmlHashRemoveEntry; + xmlHashRemoveEntry2; + xmlHashRemoveEntry3; + xmlHashScan; + xmlHashScan3; + xmlHashScanFull; + xmlHashScanFull3; + xmlHashSize; + xmlHashUpdateEntry; + xmlHashUpdateEntry2; + xmlHashUpdateEntry3; + +# xmlerror + initGenericErrorDefaultFunc; + xmlParserError; + xmlParserPrintFileContext; + xmlParserPrintFileInfo; + xmlParserValidityError; + xmlParserValidityWarning; + xmlParserWarning; + xmlSetGenericErrorFunc; + +# globals + oldXMLWDcompatibility; # variable + +# tree + xmlAddChild; + xmlAddChildList; + xmlAddNextSibling; + xmlAddPrevSibling; + xmlAddSibling; + xmlBufferAdd; + xmlBufferAddHead; + +# globals + xmlBufferAllocScheme; # variable + +# tree + xmlBufferCCat; + xmlBufferCat; + xmlBufferContent; + xmlBufferCreate; + xmlBufferCreateSize; + xmlBufferDump; + xmlBufferEmpty; + xmlBufferFree; + xmlBufferGrow; + xmlBufferLength; + xmlBufferResize; + xmlBufferSetAllocationScheme; + xmlBufferShrink; + xmlBufferWriteCHAR; + xmlBufferWriteChar; + xmlBufferWriteQuotedString; + xmlCopyDoc; + xmlCopyDtd; + xmlCopyNamespace; + xmlCopyNamespaceList; + xmlCopyNode; + xmlCopyNodeList; + xmlCopyProp; + xmlCopyPropList; + xmlCreateIntSubset; + +# globals + xmlDefaultBufferSize; # variable + +# tree + xmlDocCopyNode; + xmlDocDump; + xmlDocDumpFormatMemory; + xmlDocDumpFormatMemoryEnc; + xmlDocDumpMemory; + xmlDocDumpMemoryEnc; + xmlDocFormatDump; + xmlDocGetRootElement; + xmlDocSetRootElement; + xmlElemDump; + xmlFreeDoc; + xmlFreeDtd; + xmlFreeNode; + xmlFreeNodeList; + xmlFreeNs; + xmlFreeNsList; + xmlFreeProp; + xmlFreePropList; + xmlGetBufferAllocationScheme; + xmlGetCompressMode; + xmlGetDocCompressMode; + xmlGetIntSubset; + xmlGetLastChild; + xmlGetLineNo; + xmlGetNodePath; + xmlGetNsList; + xmlGetNsProp; + xmlGetProp; + xmlHasNsProp; + xmlHasProp; + +# globals + xmlIndentTreeOutput; # variable + +# tree + xmlIsBlankNode; + xmlIsXHTML; + xmlNewCDataBlock; + xmlNewCharRef; + xmlNewChild; + xmlNewComment; + xmlNewDoc; + xmlNewDocComment; + xmlNewDocFragment; + xmlNewDocNode; + xmlNewDocNodeEatName; + xmlNewDocProp; + xmlNewDocRawNode; + xmlNewDocText; + xmlNewDocTextLen; + xmlNewDtd; + xmlNewGlobalNs; + xmlNewNode; + xmlNewNodeEatName; + xmlNewNs; + xmlNewNsProp; + xmlNewNsPropEatName; + xmlNewPI; + xmlNewProp; + xmlNewReference; + xmlNewText; + xmlNewTextChild; + xmlNewTextLen; + xmlNodeAddContent; + xmlNodeAddContentLen; + xmlNodeDump; + xmlNodeDumpOutput; + xmlNodeGetBase; + xmlNodeGetContent; + xmlNodeGetLang; + xmlNodeGetSpacePreserve; + xmlNodeIsText; + xmlNodeListGetRawString; + xmlNodeListGetString; + xmlNodeSetBase; + xmlNodeSetContent; + xmlNodeSetContentLen; + xmlNodeSetLang; + xmlNodeSetName; + xmlNodeSetSpacePreserve; + xmlReconciliateNs; + xmlRemoveProp; + xmlReplaceNode; + xmlSaveFile; + xmlSaveFileEnc; + xmlSaveFileTo; + xmlSaveFormatFile; + xmlSaveFormatFileEnc; + xmlSaveFormatFileTo; + xmlSearchNs; + xmlSearchNsByHref; + xmlSetBufferAllocationScheme; + xmlSetCompressMode; + xmlSetDocCompressMode; + xmlSetListDoc; + xmlSetNs; + xmlSetNsProp; + xmlSetProp; + xmlSetTreeDoc; + xmlStringGetNodeList; + xmlStringLenGetNodeList; + xmlTextConcat; + xmlTextMerge; + xmlUnlinkNode; + xmlUnsetNsProp; + xmlUnsetProp; + +# xmlregexp + xmlRegExecPushString; + xmlRegFreeExecCtxt; + xmlRegFreeRegexp; + xmlRegNewExecCtxt; + xmlRegexpCompile; + xmlRegexpExec; + xmlRegexpIsDeterminist; + xmlRegexpPrint; + +# nanohttp + xmlNanoHTTPAuthHeader; + xmlNanoHTTPCleanup; + xmlNanoHTTPClose; + xmlNanoHTTPFetch; + xmlNanoHTTPInit; + xmlNanoHTTPMethod; + xmlNanoHTTPMethodRedir; + xmlNanoHTTPOpen; + xmlNanoHTTPOpenRedir; + xmlNanoHTTPRead; + xmlNanoHTTPReturnCode; + xmlNanoHTTPSave; + xmlNanoHTTPScanProxy; + +# xmlunicode + xmlUCSIsAlphabeticPresentationForms; + xmlUCSIsArabic; + xmlUCSIsArabicPresentationFormsA; + xmlUCSIsArabicPresentationFormsB; + xmlUCSIsArmenian; + xmlUCSIsArrows; + xmlUCSIsBasicLatin; + xmlUCSIsBengali; + xmlUCSIsBlock; + xmlUCSIsBlockElements; + xmlUCSIsBopomofo; + xmlUCSIsBopomofoExtended; + xmlUCSIsBoxDrawing; + xmlUCSIsBraillePatterns; + xmlUCSIsByzantineMusicalSymbols; + xmlUCSIsCJKCompatibility; + xmlUCSIsCJKCompatibilityForms; + xmlUCSIsCJKCompatibilityIdeographs; + xmlUCSIsCJKCompatibilityIdeographsSupplement; + xmlUCSIsCJKRadicalsSupplement; + xmlUCSIsCJKSymbolsandPunctuation; + xmlUCSIsCJKUnifiedIdeographs; + xmlUCSIsCJKUnifiedIdeographsExtensionA; + xmlUCSIsCJKUnifiedIdeographsExtensionB; + xmlUCSIsCat; + xmlUCSIsCatC; + xmlUCSIsCatCc; + xmlUCSIsCatCf; + xmlUCSIsCatCo; + xmlUCSIsCatCs; + xmlUCSIsCatL; + xmlUCSIsCatLl; + xmlUCSIsCatLm; + xmlUCSIsCatLo; + xmlUCSIsCatLt; + xmlUCSIsCatLu; + xmlUCSIsCatM; + xmlUCSIsCatMc; + xmlUCSIsCatMe; + xmlUCSIsCatMn; + xmlUCSIsCatN; + xmlUCSIsCatNd; + xmlUCSIsCatNl; + xmlUCSIsCatNo; + xmlUCSIsCatP; + xmlUCSIsCatPc; + xmlUCSIsCatPd; + xmlUCSIsCatPe; + xmlUCSIsCatPf; + xmlUCSIsCatPi; + xmlUCSIsCatPo; + xmlUCSIsCatPs; + xmlUCSIsCatS; + xmlUCSIsCatSc; + xmlUCSIsCatSk; + xmlUCSIsCatSm; + xmlUCSIsCatSo; + xmlUCSIsCatZ; + xmlUCSIsCatZl; + xmlUCSIsCatZp; + xmlUCSIsCatZs; + xmlUCSIsCherokee; + xmlUCSIsCombiningDiacriticalMarks; + xmlUCSIsCombiningHalfMarks; + xmlUCSIsCombiningMarksforSymbols; + xmlUCSIsControlPictures; + xmlUCSIsCurrencySymbols; + xmlUCSIsCyrillic; + xmlUCSIsDeseret; + xmlUCSIsDevanagari; + xmlUCSIsDingbats; + xmlUCSIsEnclosedAlphanumerics; + xmlUCSIsEnclosedCJKLettersandMonths; + xmlUCSIsEthiopic; + xmlUCSIsGeneralPunctuation; + xmlUCSIsGeometricShapes; + xmlUCSIsGeorgian; + xmlUCSIsGothic; + xmlUCSIsGreek; + xmlUCSIsGreekExtended; + xmlUCSIsGujarati; + xmlUCSIsGurmukhi; + xmlUCSIsHalfwidthandFullwidthForms; + xmlUCSIsHangulCompatibilityJamo; + xmlUCSIsHangulJamo; + xmlUCSIsHangulSyllables; + xmlUCSIsHebrew; + xmlUCSIsHighPrivateUseSurrogates; + xmlUCSIsHighSurrogates; + xmlUCSIsHiragana; + xmlUCSIsIPAExtensions; + xmlUCSIsIdeographicDescriptionCharacters; + xmlUCSIsKanbun; + xmlUCSIsKangxiRadicals; + xmlUCSIsKannada; + xmlUCSIsKatakana; + xmlUCSIsKhmer; + xmlUCSIsLao; + xmlUCSIsLatin1Supplement; + xmlUCSIsLatinExtendedA; + xmlUCSIsLatinExtendedAdditional; + xmlUCSIsLatinExtendedB; + xmlUCSIsLetterlikeSymbols; + xmlUCSIsLowSurrogates; + xmlUCSIsMalayalam; + xmlUCSIsMathematicalAlphanumericSymbols; + xmlUCSIsMathematicalOperators; + xmlUCSIsMiscellaneousSymbols; + xmlUCSIsMiscellaneousTechnical; + xmlUCSIsMongolian; + xmlUCSIsMusicalSymbols; + xmlUCSIsMyanmar; + xmlUCSIsNumberForms; + xmlUCSIsOgham; + xmlUCSIsOldItalic; + xmlUCSIsOpticalCharacterRecognition; + xmlUCSIsOriya; + xmlUCSIsPrivateUse; + xmlUCSIsRunic; + xmlUCSIsSinhala; + xmlUCSIsSmallFormVariants; + xmlUCSIsSpacingModifierLetters; + xmlUCSIsSpecials; + xmlUCSIsSuperscriptsandSubscripts; + xmlUCSIsSyriac; + xmlUCSIsTags; + xmlUCSIsTamil; + xmlUCSIsTelugu; + xmlUCSIsThaana; + xmlUCSIsThai; + xmlUCSIsTibetan; + xmlUCSIsUnifiedCanadianAboriginalSyllabics; + xmlUCSIsYiRadicals; + xmlUCSIsYiSyllables; + +# uri + xmlBuildURI; + xmlCreateURI; + xmlFreeURI; + xmlNormalizeURIPath; + xmlParseURI; + xmlParseURIReference; + xmlPrintURI; + xmlSaveUri; + xmlURIEscape; + xmlURIEscapeStr; + xmlURIUnescapeString; + +# encoding + UTF8Toisolat1; + isolat1ToUTF8; + xmlAddEncodingAlias; + xmlCharEncCloseFunc; + xmlCharEncFirstLine; + xmlCharEncInFunc; + xmlCharEncOutFunc; + +# xmlstring + xmlCheckUTF8; + +# encoding + xmlCleanupCharEncodingHandlers; + xmlCleanupEncodingAliases; + xmlDelEncodingAlias; + xmlDetectCharEncoding; + xmlFindCharEncodingHandler; + xmlGetCharEncodingHandler; + xmlGetCharEncodingName; + xmlGetEncodingAlias; + +# xmlstring + xmlGetUTF8Char; + +# encoding + xmlInitCharEncodingHandlers; + xmlNewCharEncodingHandler; + xmlParseCharEncoding; + xmlRegisterCharEncodingHandler; + +# xmlstring + xmlUTF8Strlen; + xmlUTF8Strloc; + xmlUTF8Strndup; + xmlUTF8Strpos; + xmlUTF8Strsize; + xmlUTF8Strsub; +} ; + +LIBXML2_2.5.0 { + global: + +# globals + xmlDeregisterNodeDefault; + xmlDeregisterNodeDefaultValue; # variable + xmlRegisterNodeDefault; + xmlRegisterNodeDefaultValue; # variable + +# xmlreader + xmlTextReaderClose; + xmlTextReaderCurrentDoc; + xmlTextReaderCurrentNode; + xmlTextReaderGetAttributeNo; + xmlTextReaderGetAttributeNs; + xmlTextReaderGetAttribute; + xmlTextReaderGetParserProp; + xmlTextReaderGetRemainder; + xmlTextReaderLookupNamespace; + xmlTextReaderMoveToAttributeNo; + xmlTextReaderMoveToAttributeNs; + xmlTextReaderMoveToAttribute; + xmlTextReaderMoveToElement; + xmlTextReaderMoveToFirstAttribute; + xmlTextReaderMoveToNextAttribute; + xmlTextReaderNormalization; + xmlTextReaderReadAttributeValue; + xmlTextReaderReadInnerXml; + xmlTextReaderReadOuterXml; + xmlTextReaderReadState; + xmlTextReaderReadString; + xmlTextReaderSetParserProp; + +# valid + xmlValidatePopElement; + xmlValidatePushCData; + xmlValidatePushElement; +} LIBXML2_2.4.30; + +LIBXML2_2.5.2 { + global: + +# tree + xmlGetNoNsProp; + +# HTMLparser + htmlAttrAllowed; + htmlElementAllowedHere; + htmlElementStatusHere; + htmlNodeStatus; + +# relaxng + xmlRelaxNGCleanupTypes; + xmlRelaxNGDump; + xmlRelaxNGFreeParserCtxt; + xmlRelaxNGFree; + xmlRelaxNGFreeValidCtxt; + xmlRelaxNGNewMemParserCtxt; + xmlRelaxNGNewParserCtxt; + xmlRelaxNGNewValidCtxt; + xmlRelaxNGParse; + xmlRelaxNGSetParserErrors; + xmlRelaxNGSetValidErrors; + xmlRelaxNGValidateDoc; + +# xmlreader + xmlTextReaderGetErrorHandler; + xmlTextReaderLocatorBaseURI; + xmlTextReaderLocatorLineNumber; + xmlTextReaderSetErrorHandler; + +# relaxng +# xmlRelaxNGValidateStream; removed in 2.5.5 +} LIBXML2_2.5.0; + +LIBXML2_2.5.4 { + global: + +# uri + xmlCanonicPath; + +# relaxng + xmlRelaxNGDumpTree; + +# tree + xmlValidateName; + xmlValidateNCName; + xmlValidateNMToken; + xmlValidateQName; +} LIBXML2_2.5.2; + +LIBXML2_2.5.5 { + global: + +# nanoftp + xmlNanoFTPDele; +} LIBXML2_2.5.4; + +LIBXML2_2.5.6 { + global: + +# xpath + xmlXPathOrderDocElems; +} LIBXML2_2.5.5; + +LIBXML2_2.5.7 { + global: + +# HTMLparser + htmlCreateMemoryParserCtxt; + +# xmlautomata + xmlAutomataNewTransition2; + +# tree + xmlBuildQName; + +# xmlmemory + xmlGcMemGet; + xmlGcMemSetup; + +# globals + xmlMallocAtomic; # variable + +# xmlregexp + xmlRegExecPushString2; + +# relaxng + xmlRelaxNGNewDocParserCtxt; + xmlRelaxNGValidateFullElement; + xmlRelaxNGValidatePopElement; + xmlRelaxNGValidatePushCData; + xmlRelaxNGValidatePushElement; + +# xmlreader + xmlTextReaderExpand; + xmlTextReaderIsValid; + xmlTextReaderNext; + xmlTextReaderRelaxNGSetSchema; + xmlTextReaderRelaxNGValidate; +} LIBXML2_2.5.6; + +LIBXML2_2.5.8 { + global: + +# globals + xmlCleanupGlobals; + xmlInitGlobals; + +# valid + xmlFreeValidCtxt; + xmlNewValidCtxt; + +# schemasInternals + xmlSchemaFreeType; + +# xmlschemas + xmlSchemaDump; + xmlSchemaFreeParserCtxt; + xmlSchemaFreeValidCtxt; + xmlSchemaFree; + xmlSchemaNewMemParserCtxt; + xmlSchemaNewParserCtxt; + xmlSchemaNewValidCtxt; + xmlSchemaParse; + xmlSchemaSetParserErrors; + xmlSchemaSetValidErrors; + xmlSchemaValidateDoc; + xmlSchemaValidateStream; + +# xmlschemastypes + xmlSchemaCheckFacet; + xmlSchemaCleanupTypes; + xmlSchemaCompareValues; + xmlSchemaFreeFacet; + xmlSchemaFreeValue; + xmlSchemaGetPredefinedType; + xmlSchemaInitTypes; + xmlSchemaNewFacet; + xmlSchemaValidateFacet; + xmlSchemaValidatePredefinedType; + xmlSchemaValPredefTypeNode; + +# globals + xmlThrDefBufferAllocScheme; + xmlThrDefDefaultBufferSize; + xmlThrDefDeregisterNodeDefault; + xmlThrDefDoValidityCheckingDefaultValue; + xmlThrDefGetWarningsDefaultValue; + xmlThrDefIndentTreeOutput; + xmlThrDefKeepBlanksDefaultValue; + xmlThrDefLineNumbersDefaultValue; + xmlThrDefLoadExtDtdDefaultValue; + xmlThrDefParserDebugEntities; + xmlThrDefPedanticParserDefaultValue; + xmlThrDefRegisterNodeDefault; + xmlThrDefSaveNoEmptyTags; + xmlThrDefSetGenericErrorFunc; + xmlThrDefSubstituteEntitiesDefaultValue; + xmlThrDefTreeIndentString; +} LIBXML2_2.5.7; + +LIBXML2_2.5.9 { + global: + +# xmlmemory + xmlMallocAtomicLoc; + +# relaxng + xmlRelaxNGGetParserErrors; + xmlRelaxNGGetValidErrors; + +# tree + xmlSplitQName3; + +# xmlstring + xmlUTF8Charcmp; + xmlUTF8Size; + +# xinclude + xmlXIncludeProcessTree; +} LIBXML2_2.5.8; + +LIBXML2_2.6.0 { + global: + +# SAX2 + xmlSAX2AttributeDecl; + xmlSAX2CDataBlock; + xmlSAX2Characters; + xmlSAX2Comment; + xmlSAX2ElementDecl; + xmlSAX2EndDocument; + xmlSAX2EndElementNs; + xmlSAX2EndElement; + xmlSAX2EntityDecl; + xmlSAX2ExternalSubset; + xmlSAX2GetColumnNumber; + xmlSAX2GetEntity; + xmlSAX2GetLineNumber; + xmlSAX2GetParameterEntity; + xmlSAX2GetPublicId; + xmlSAX2GetSystemId; + xmlSAX2HasExternalSubset; + xmlSAX2HasInternalSubset; + xmlSAX2IgnorableWhitespace; + xmlSAX2InitDefaultSAXHandler; + xmlSAX2InitDocbDefaultSAXHandler; + xmlSAX2InitHtmlDefaultSAXHandler; + xmlSAX2InternalSubset; + xmlSAX2IsStandalone; + xmlSAX2NotationDecl; + xmlSAX2ProcessingInstruction; + xmlSAX2Reference; + xmlSAX2ResolveEntity; + xmlSAX2SetDocumentLocator; + xmlSAX2StartDocument; + xmlSAX2StartElementNs; + xmlSAX2StartElement; + xmlSAX2UnparsedEntityDecl; + xmlSAXDefaultVersion; + xmlSAXVersion; + +# HTMLparser + htmlCtxtReadDoc; + htmlCtxtReadFd; + htmlCtxtReadFile; + htmlCtxtReadIO; + htmlCtxtReadMemory; + htmlCtxtReset; + htmlCtxtUseOptions; + htmlReadDoc; + htmlReadFd; + htmlReadFile; + htmlReadIO; + htmlReadMemory; + +# tree + xmlBufferCreateStatic; + +# chvalid + xmlCharInRange; + +# xmlIO + xmlCheckHTTPInput; + +# xmlerror + xmlCopyError; + xmlCtxtGetLastError; + xmlGetLastError; + xmlResetError; + xmlResetLastError; + xmlSetStructuredErrorFunc; + +# parser + xmlCtxtReadDoc; + xmlCtxtReadFd; + xmlCtxtReadFile; + xmlCtxtReadIO; + xmlCtxtReadMemory; + +# xmlerror + xmlCtxtResetLastError; + +# parser + xmlCtxtReset; + xmlCtxtUseOptions; + xmlReadDoc; + xmlReadFd; + xmlReadFile; + xmlReadIO; + xmlReadMemory; + +# xmlstring + xmlStrPrintf; + xmlStrQEqual; + +# dict + xmlDictCreate; + xmlDictFree; + xmlDictLookup; + xmlDictOwns; + xmlDictQLookup; + xmlDictReference; + xmlDictSize; + +# parserInternals + xmlErrMemory; + xmlParserMaxDepth; # variable + xmlStringLenDecodeEntities; + xmlSwitchInputEncoding; + +# xmlwriter + xmlFreeTextWriter; + xmlNewTextWriterFilename; + xmlNewTextWriterMemory; + xmlNewTextWriter; + xmlTextWriterEndAttribute; + xmlTextWriterEndCDATA; + xmlTextWriterEndDocument; + xmlTextWriterEndDTD; + xmlTextWriterEndElement; + xmlTextWriterEndPI; + xmlTextWriterFlush; + xmlTextWriterFullEndElement; + xmlTextWriterStartAttributeNS; + xmlTextWriterStartAttribute; + xmlTextWriterStartCDATA; + xmlTextWriterStartDocument; + xmlTextWriterStartDTDAttlist; + xmlTextWriterStartDTDElement; + xmlTextWriterStartDTDEntity; + xmlTextWriterStartDTD; + xmlTextWriterStartElementNS; + xmlTextWriterStartElement; + xmlTextWriterStartPI; + xmlTextWriterWriteAttributeNS; + xmlTextWriterWriteAttribute; + xmlTextWriterWriteBase64; + xmlTextWriterWriteBinHex; + xmlTextWriterWriteCDATA; + xmlTextWriterWriteComment; + xmlTextWriterWriteDTDAttlist; + xmlTextWriterWriteDTDElement; + xmlTextWriterWriteDTDEntity; + xmlTextWriterWriteDTDExternalEntity; + xmlTextWriterWriteDTDInternalEntity; + xmlTextWriterWriteDTDNotation; + xmlTextWriterWriteDTD; + xmlTextWriterWriteElementNS; + xmlTextWriterWriteElement; + xmlTextWriterWriteFormatAttributeNS; + xmlTextWriterWriteFormatAttribute; + xmlTextWriterWriteFormatCDATA; + xmlTextWriterWriteFormatComment; + xmlTextWriterWriteFormatDTDAttlist; + xmlTextWriterWriteFormatDTDElement; + xmlTextWriterWriteFormatDTDInternalEntity; + xmlTextWriterWriteFormatDTD; + xmlTextWriterWriteFormatElementNS; + xmlTextWriterWriteFormatElement; + xmlTextWriterWriteFormatPI; + xmlTextWriterWriteFormatRaw; + xmlTextWriterWriteFormatString; + xmlTextWriterWritePI; + xmlTextWriterWriteRawLen; + xmlTextWriterWriteRaw; + xmlTextWriterWriteString; + xmlTextWriterWriteVFormatAttributeNS; + xmlTextWriterWriteVFormatAttribute; + xmlTextWriterWriteVFormatCDATA; + xmlTextWriterWriteVFormatComment; + xmlTextWriterWriteVFormatDTDAttlist; + xmlTextWriterWriteVFormatDTDElement; + xmlTextWriterWriteVFormatDTDInternalEntity; + xmlTextWriterWriteVFormatDTD; + xmlTextWriterWriteVFormatElementNS; + xmlTextWriterWriteVFormatElement; + xmlTextWriterWriteVFormatPI; + xmlTextWriterWriteVFormatRaw; + xmlTextWriterWriteVFormatString; + +# hash + xmlHashQLookup2; + xmlHashQLookup3; + xmlHashQLookup; + +# chvalid + xmlIsBaseCharGroup; # variable + xmlIsCharGroup; # variable + xmlIsCombiningGroup; # variable + xmlIsDigitGroup; # variable + xmlIsExtenderGroup; # variable + xmlIsIdeographicGroup; # variable + xmlIsPubidChar_tab; # variable + +# globals + xmlLastError; # variable + +# nanohttp + xmlNanoHTTPEncoding; + xmlNanoHTTPMimeType; + xmlNanoHTTPRedir; + +# tree + xmlNodeBufGetContent; + +# xmlIO + xmlParserInputBufferCreateStatic; + +# xmlreader + xmlReaderForDoc; + xmlReaderForFd; + xmlReaderForFile; + xmlReaderForIO; + xmlReaderForMemory; + xmlReaderNewDoc; + xmlReaderNewFd; + xmlReaderNewFile; + xmlReaderNewIO; + xmlReaderNewMemory; + xmlReaderNewWalker; + xmlReaderWalker; + xmlTextReaderConstBaseUri; + xmlTextReaderConstLocalName; + xmlTextReaderConstNamespaceUri; + xmlTextReaderConstName; + xmlTextReaderConstPrefix; + xmlTextReaderConstString; + xmlTextReaderConstValue; + xmlTextReaderConstXmlLang; + xmlTextReaderNextSibling; + xmlTextReaderPreserve; + +# globals + xmlStructuredError; # variable + xmlThrDefSetStructuredErrorFunc; + +# xpathInternals + xmlXPathErr; + +# SAX2 +# xmlSAX2CheckNamespace; removed in 2.6.10 +# xmlSAX2GetNamespace; removed in 2.6.10 +# xmlSAX2GlobalNamespace; removed in 2.6.10 +# xmlSAX2NamespaceDecl; removed in 2.6.10 +# xmlSAX2SetNamespace; removed in 2.6.10 +} LIBXML2_2.5.9; + +LIBXML2_2.6.1 { + global: + +# parser + xmlCtxtResetPush; +} LIBXML2_2.6.0; + +LIBXML2_2.6.2 { + global: + +# parserInternals + xmlCreateURLParserCtxt; + +# xmlschemas + xmlSchemaNewDocParserCtxt; + +# xmlstring + xmlStrVPrintf; + +# xinclude + xmlXIncludeFreeContext; + xmlXIncludeNewContext; + xmlXIncludeProcessNode; +} LIBXML2_2.6.1; + +LIBXML2_2.6.3 { + global: + +# pattern + xmlFreePatternList; + xmlFreePattern; + xmlPatterncompile; + xmlPatternMatch; + +# xmlwriter + xmlNewTextWriterDoc; + xmlNewTextWriterPushParser; + xmlNewTextWriterTree; + +# xmlreader + xmlTextReaderPreservePattern; + +# xmlunicode + xmlUCSIsAegeanNumbers; + xmlUCSIsBuhid; + xmlUCSIsCombiningDiacriticalMarksforSymbols; + xmlUCSIsCypriotSyllabary; + xmlUCSIsCyrillicSupplement; + xmlUCSIsGreekandCoptic; + xmlUCSIsHanunoo; + xmlUCSIsKatakanaPhoneticExtensions; + xmlUCSIsKhmerSymbols; + xmlUCSIsLimbu; + xmlUCSIsLinearBIdeograms; + xmlUCSIsLinearBSyllabary; + xmlUCSIsMiscellaneousMathematicalSymbolsA; + xmlUCSIsMiscellaneousMathematicalSymbolsB; + xmlUCSIsMiscellaneousSymbolsandArrows; + xmlUCSIsOsmanya; + xmlUCSIsPhoneticExtensions; + xmlUCSIsPrivateUseArea; + xmlUCSIsShavian; + xmlUCSIsSupplementalArrowsA; + xmlUCSIsSupplementalArrowsB; + xmlUCSIsSupplementalMathematicalOperators; + xmlUCSIsSupplementaryPrivateUseAreaA; + xmlUCSIsSupplementaryPrivateUseAreaB; + xmlUCSIsTagalog; + xmlUCSIsTagbanwa; + xmlUCSIsTaiLe; + xmlUCSIsTaiXuanJingSymbols; + xmlUCSIsUgaritic; + xmlUCSIsVariationSelectorsSupplement; + xmlUCSIsVariationSelectors; + xmlUCSIsYijingHexagramSymbols; + +# xinclude + xmlXIncludeProcessFlags; + xmlXIncludeProcessTreeFlags; + xmlXIncludeSetFlags; +} LIBXML2_2.6.2; + +LIBXML2_2.6.5 { + global: + +# xmlmemory + xmlCleanupMemory; + +# dict + xmlDictCreateSub; + +# relaxng + xmlRelaxParserSetFlag; + +# xmlstring + xmlStrncatNew; + +# xmlwriter + xmlTextWriterSetIndentString; + xmlTextWriterSetIndent; + +# xpath + xmlXPathCtxtCompile; +} LIBXML2_2.6.3; + +LIBXML2_2.6.6 { + global: + +# tree + xmlAttrSerializeTxtContent; + +# parser + xmlByteConsumed; + +# xmlreader + xmlTextReaderSetStructuredErrorHandler; +} LIBXML2_2.6.5; + +LIBXML2_2.6.7 { + global: + +# xmlwriter + xmlTextWriterEndComment; + xmlTextWriterStartComment; +} LIBXML2_2.6.6; + +LIBXML2_2.6.8 { + global: + +# xmlsave + xmlSaveClose; + xmlSaveDoc; + xmlSaveFlush; + xmlSaveToFd; + xmlSaveToFilename; + xmlSaveToIO; + xmlSaveTree; + +# xmlwriter + xmlTextWriterEndDTDAttlist; + xmlTextWriterEndDTDElement; + xmlTextWriterEndDTDEntity; + xmlTextWriterWriteDTDExternalEntityContents; +} LIBXML2_2.6.7; + +LIBXML2_2.6.10 { + global: + +# xmlIO + xmlOutputBufferWriteEscape; + xmlPopInputCallbacks; + +# xmlsave + xmlSaveSetAttrEscape; + xmlSaveSetEscape; +} LIBXML2_2.6.8; + +LIBXML2_2.6.11 { + global: + +# uri + xmlBuildRelativeURI; + +# globals + xmlOutputBufferCreateFilenameDefault; + xmlOutputBufferCreateFilenameValue; # variable + xmlParserInputBufferCreateFilenameDefault; + xmlParserInputBufferCreateFilenameValue; # variable + xmlThrDefOutputBufferCreateFilenameDefault; + xmlThrDefParserInputBufferCreateFilenameDefault; + +# schemasInternals + xmlSchemaFreeWildcard; + +# xmlschemastypes + xmlSchemaCollapseString; + xmlSchemaGetBuiltInListSimpleTypeItemType; + xmlSchemaGetBuiltInType; + xmlSchemaIsBuiltInTypeFacet; + xmlSchemaValidateListSimpleTypeFacet; +} LIBXML2_2.6.10; + +LIBXML2_2.6.12 { + global: + +# parser + xmlParseInNodeContext; + +# xmlschemastypes + xmlSchemaGetFacetValueAsULong; + xmlSchemaValidateLengthFacet; + xmlSchemaValPredefTypeNodeNoNorm; + +# xmlschemas + xmlSchemaGetParserErrors; + xmlSchemaGetValidErrors; +} LIBXML2_2.6.11; + +LIBXML2_2.6.14 { + global: + +# xmlautomata + xmlAutomataNewCountTrans2; + xmlAutomataNewOnceTrans2; + +# nanohttp + xmlNanoHTTPContentLength; + +# xmlschemas + xmlSchemaSetValidOptions; + xmlSchemaValidateOneElement; + xmlSchemaValidCtxtGetOptions; +} LIBXML2_2.6.12; + +LIBXML2_2.6.15 { + global: + +# debugXML + xmlDebugCheckDocument; + +# tree + xmlDocCopyNodeList; + xmlNewDocPI; + +# xmlreader + xmlTextReaderConstEncoding; + xmlTextReaderConstXmlVersion; + xmlTextReaderIsNamespaceDecl; + xmlTextReaderStandalone; +} LIBXML2_2.6.14; + +LIBXML2_2.6.16 { + global: + +# xmlmemory + xmlMemBlocks; + +# relaxng + xmlRelaxNGInitTypes; +} LIBXML2_2.6.15; + +LIBXML2_2.6.17 { + global: + +# dict + xmlDictExists; + +# xmlmodule + xmlModuleClose; + xmlModuleFree; + xmlModuleOpen; + xmlModuleSymbol; + +# xmlregexp + xmlRegExecErrInfo; + xmlRegExecNextValues; + +# xmlschemastypes + xmlSchemaWhiteSpaceReplace; + +# xmlreader + xmlTextReaderGetParserColumnNumber; + xmlTextReaderGetParserLineNumber; +} LIBXML2_2.6.16; + +LIBXML2_2.6.18 { + global: + +# valid + xmlCopyDocElementContent; + xmlFreeDocElementContent; + xmlNewDocElementContent; + +# dict + xmlDictCleanup; + +# hash + xmlHashCreateDict; + +# pattern + xmlFreeStreamCtxt; + xmlPatternFromRoot; + xmlPatternGetStreamCtxt; + xmlPatternMaxDepth; + xmlPatternStreamable; + xmlStreamPop; + xmlStreamPushAttr; + xmlStreamPush; + +# xmlschemastypes + xmlSchemaCompareValuesWhtsp; + xmlSchemaCopyValue; + xmlSchemaGetCanonValue; + xmlSchemaNewNOTATIONValue; + xmlSchemaNewStringValue; + +# xmlreader + xmlTextReaderByteConsumed; +} LIBXML2_2.6.17; + +LIBXML2_2.6.19 { + global: + +# xmlschemastypes + xmlSchemaGetValType; + xmlSchemaValidateFacetWhtsp; + xmlSchemaValidateLengthFacetWhtsp; +} LIBXML2_2.6.18; + +LIBXML2_2.6.20 { + global: + +# tree + xmlDOMWrapAdoptNode; + xmlDOMWrapFreeCtxt; + xmlDOMWrapNewCtxt; + xmlDOMWrapReconcileNamespaces; + xmlDOMWrapRemoveNode; + +# xmlschemastypes + xmlSchemaGetCanonValueWhtsp; + xmlSchemaNewQNameValue; + xmlSchemaValueAppend; + xmlSchemaValueGetAsBoolean; + xmlSchemaValueGetAsString; + xmlSchemaValueGetNext; + +# xmlschemas + xmlSchemaIsValid; + xmlSchemaSAXPlug; + xmlSchemaSAXUnplug; + xmlSchemaValidateFile; + +# xmlreader + xmlTextReaderSchemaValidate; + xmlTextReaderSetSchema; +} LIBXML2_2.6.19; + +LIBXML2_2.6.21 { + global: + +# xmlautomata + xmlAutomataNewNegTrans; + +# xmlregexp +# emptyExp; removed in 2.9.10 +# forbiddenExp; removed in 2.9.10 +# xmlExpCtxtNbCons; removed in 2.9.10 +# xmlExpCtxtNbNodes; removed in 2.9.10 +# xmlExpDump; removed in 2.9.10 +# xmlExpExpDerive; removed in 2.9.10 +# xmlExpFreeCtxt; removed in 2.9.10 +# xmlExpFree; removed in 2.9.10 +# xmlExpGetLanguage; removed in 2.9.10 +# xmlExpGetStart; removed in 2.9.10 +# xmlExpIsNillable; removed in 2.9.10 +# xmlExpMaxToken; removed in 2.9.10 +# xmlExpNewAtom; removed in 2.9.10 +# xmlExpNewCtxt; removed in 2.9.10 +# xmlExpNewOr; removed in 2.9.10 +# xmlExpNewRange; removed in 2.9.10 +# xmlExpNewSeq; removed in 2.9.10 +# xmlExpParse; removed in 2.9.10 +# xmlExpRef; removed in 2.9.10 +# xmlExpStringDerive; removed in 2.9.10 +# xmlExpSubsume; removed in 2.9.10 + +# parser + xmlHasFeature; + +# uri + xmlParseURIRaw; + +# pattern + xmlPatternMinDepth; + +# relaxng + xmlRelaxNGSetValidStructuredErrors; + +# xmlschemas + xmlSchemaSetValidStructuredErrors; + +# schematron + xmlSchematronFreeParserCtxt; + xmlSchematronFree; + xmlSchematronFreeValidCtxt; + xmlSchematronNewDocParserCtxt; + xmlSchematronNewMemParserCtxt; + xmlSchematronNewParserCtxt; + xmlSchematronNewValidCtxt; + xmlSchematronParse; + xmlSchematronValidateDoc; +} LIBXML2_2.6.20; + +LIBXML2_2.6.23 { + global: + +# HTMLtree + htmlDocDumpMemoryFormat; + +# xmlIO + xmlOutputBufferCreateBuffer; + +# xmlsave + xmlSaveToBuffer;# suppressed in 2.6.11, readded in 2.6.23 + + +# xmlschemas + xmlSchemaSetParserStructuredErrors; + +# pattern + xmlStreamPushNode; + xmlStreamWantsAnyNode; + +# xmlreader + xmlTextReaderSchemaValidateCtxt; +} LIBXML2_2.6.21; + +LIBXML2_2.6.24 { + global: + +# tree + xmlDOMWrapCloneNode; + +# relaxng + xmlRelaxNGSetParserStructuredErrors; +} LIBXML2_2.6.23; + +LIBXML2_2.6.25 { + global: + +# xpath + xmlXPathContextSetCache; +} LIBXML2_2.6.24; + +LIBXML2_2.6.27 { + global: + +# HTMLparser + htmlNewParserCtxt; + +# uri + xmlPathToURI; + +# xinclude + xmlXIncludeProcessFlagsData; + +# xpath + xmlXPathCompiledEvalToBoolean; +} LIBXML2_2.6.25; + +LIBXML2_2.6.28 { + global: + +# xmlreader + xmlTextReaderSetup; +} LIBXML2_2.6.27; + +LIBXML2_2.6.29 { + global: + +# threads + xmlDllMain; +} LIBXML2_2.6.28; + +LIBXML2_2.6.32 { + global: + +# schematron + xmlSchematronSetValidStructuredErrors; +} LIBXML2_2.6.29; + +LIBXML2_2.7.0 { + global: + +# xmlmemory + xmlMemDisplayLast; + +# entities + xmlNewEntity; + +# xmlschemas + xmlSchemaValidCtxtGetParserCtxt; +} LIBXML2_2.6.32; + +LIBXML2_2.7.3 { + global: + +# tree + xmlChildElementCount; + xmlFirstElementChild; + xmlLastElementChild; + xmlNextElementSibling; + xmlPreviousElementSibling; +} LIBXML2_2.7.0; + +LIBXML2_2.7.4 { + global: + +# globals + xmlStructuredErrorContext; # variable + +# xinclude + xmlXIncludeProcessTreeFlagsData; +} LIBXML2_2.7.3; + +LIBXML2_2.8.0 { + global: + +# xmlreader + xmlTextReaderRelaxNGValidateCtxt; + +# tree + xmlBufferDetach; + +# dict + xmlInitializeDict; +} LIBXML2_2.7.4; + +LIBXML2_2.9.0 { + global: + +# tree + xmlBufContent; + xmlBufEnd; + xmlBufGetNodeContent; + xmlBufNodeDump; + xmlBufShrink; + xmlBufUse; + +# dict + xmlDictGetUsage; + xmlDictSetLimit; + +# xmlschemas + xmlSchemaValidateSetFilename; + xmlSchemaValidateSetLocator; + +# xmlIO + xmlOutputBufferGetContent; + xmlOutputBufferGetSize; + +# xmlwriter + xmlTextWriterSetQuoteChar; +} LIBXML2_2.8.0; + +LIBXML2_2.9.1 { + global: + +# xpath + xmlXPathNodeEval; + xmlXPathSetContextNode; +} LIBXML2_2.9.0; + +LIBXML2_2.9.8 { + global: + +# hash + xmlHashDefaultDeallocator; +} LIBXML2_2.9.1; + diff --git a/contrib/libs/libxml/list.c b/contrib/libs/libxml/list.c index de91f80ae5..24da6b1e9b 100644 --- a/contrib/libs/libxml/list.c +++ b/contrib/libs/libxml/list.c @@ -347,7 +347,7 @@ void xmlListDelete(xmlListPtr l) * * Remove the first instance associated to data in the list * - * Returns 1 if a deallocation occurred, or 0 if not found + * Returns 1 if a deallocation occurred, or 0 if not found */ int xmlListRemoveFirst(xmlListPtr l, void *data) @@ -372,7 +372,7 @@ xmlListRemoveFirst(xmlListPtr l, void *data) * * Remove the last instance associated to data in the list * - * Returns 1 if a deallocation occurred, or 0 if not found + * Returns 1 if a deallocation occurred, or 0 if not found */ int xmlListRemoveLast(xmlListPtr l, void *data) @@ -673,7 +673,7 @@ xmlListSort(xmlListPtr l) * apply the walker function to it */ void -xmlListWalk(xmlListPtr l, xmlListWalker walker, void *user) { +xmlListWalk(xmlListPtr l, xmlListWalker walker, void *user) { xmlLinkPtr lk; if ((l == NULL) || (walker == NULL)) @@ -694,7 +694,7 @@ xmlListWalk(xmlListPtr l, xmlListWalker walker, void *user) { * apply the walker function to it */ void -xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, void *user) { +xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, void *user) { xmlLinkPtr lk; if ((l == NULL) || (walker == NULL)) diff --git a/contrib/libs/libxml/nanoftp.c b/contrib/libs/libxml/nanoftp.c index 303958dede..54fa026d1b 100644 --- a/contrib/libs/libxml/nanoftp.c +++ b/contrib/libs/libxml/nanoftp.c @@ -75,7 +75,7 @@ #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include <wsockcompat.h> #endif @@ -503,8 +503,8 @@ xmlNanoFTPFreeCtxt(void * ctx) { if (ctxt->hostname != NULL) xmlFree(ctxt->hostname); if (ctxt->protocol != NULL) xmlFree(ctxt->protocol); if (ctxt->path != NULL) xmlFree(ctxt->path); - if (ctxt->user != NULL) xmlFree(ctxt->user); - if (ctxt->passwd != NULL) xmlFree(ctxt->passwd); + if (ctxt->user != NULL) xmlFree(ctxt->user); + if (ctxt->passwd != NULL) xmlFree(ctxt->passwd); ctxt->passive = 1; if (ctxt->controlFd != INVALID_SOCKET) closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET; @@ -901,7 +901,7 @@ xmlNanoFTPConnect(void *ctx) { __xmlIOErr(XML_FROM_FTP, 0, "getaddrinfo failed"); return (-1); } - if ((size_t)tmp->ai_addrlen > sizeof(ctxt->ftpAddr)) { + if ((size_t)tmp->ai_addrlen > sizeof(ctxt->ftpAddr)) { if (result) freeaddrinfo (result); __xmlIOErr(XML_FROM_FTP, 0, "gethostbyname address mismatch"); @@ -1036,7 +1036,7 @@ xmlNanoFTPConnect(void *ctx) { case 2: if (proxyPasswd == NULL) break; - /* Falls through. */ + /* Falls through. */ case 3: if (proxyPasswd != NULL) snprintf(buf, sizeof(buf), "PASS %s\r\n", proxyPasswd); @@ -1106,7 +1106,7 @@ xmlNanoFTPConnect(void *ctx) { ctxt->controlFd = INVALID_SOCKET; return(-1); } - /* Falls through. */ + /* Falls through. */ case 2: /* USER user@host command */ if (ctxt->user == NULL) @@ -1160,7 +1160,7 @@ xmlNanoFTPConnect(void *ctx) { ctxt->controlFd = INVALID_SOCKET; return(-1); } - /* Falls through. */ + /* Falls through. */ case 3: /* * If you need support for other Proxy authentication scheme @@ -1209,7 +1209,7 @@ xmlNanoFTPConnect(void *ctx) { case 3: __xmlIOErr(XML_FROM_FTP, XML_FTP_ACCNT, "FTP server asking for ACCNT on anonymous\n"); - /* Falls through. */ + /* Falls through. */ case 1: case 4: case 5: diff --git a/contrib/libs/libxml/nanohttp.c b/contrib/libs/libxml/nanohttp.c index 24af6cb31c..018b7e189b 100644 --- a/contrib/libs/libxml/nanohttp.c +++ b/contrib/libs/libxml/nanohttp.c @@ -63,8 +63,8 @@ #ifdef HAVE_STRINGS_H #include <strings.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif @@ -73,7 +73,7 @@ #define XML_SOCKLEN_T unsigned int #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include <wsockcompat.h> #endif @@ -145,7 +145,7 @@ typedef struct xmlNanoHTTPCtxt { char *authHeader; /* contents of {WWW,Proxy}-Authenticate header */ char *encoding; /* encoding extracted from the contentType */ char *mimeType; /* Mime-Type extracted from the contentType */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED z_stream *strm; /* Zlib stream object */ int usesGzip; /* "Content-Encoding: gzip" was detected */ #endif @@ -175,21 +175,21 @@ xmlHTTPErrMemory(const char *extra) */ static int socket_errno(void) { #ifdef _WINSOCKAPI_ - int err = WSAGetLastError(); - switch(err) { - case WSAECONNRESET: - return(ECONNRESET); - case WSAEINPROGRESS: - return(EINPROGRESS); - case WSAEINTR: - return(EINTR); - case WSAESHUTDOWN: - return(ESHUTDOWN); - case WSAEWOULDBLOCK: - return(EWOULDBLOCK); - default: - return(err); - } + int err = WSAGetLastError(); + switch(err) { + case WSAECONNRESET: + return(ECONNRESET); + case WSAEINPROGRESS: + return(EINPROGRESS); + case WSAEINTR: + return(EINTR); + case WSAESHUTDOWN: + return(ESHUTDOWN); + case WSAEWOULDBLOCK: + return(EWOULDBLOCK); + default: + return(err); + } #else return(errno); #endif @@ -434,7 +434,7 @@ xmlNanoHTTPFreeCtxt(xmlNanoHTTPCtxtPtr ctxt) { if (ctxt->mimeType != NULL) xmlFree(ctxt->mimeType); if (ctxt->location != NULL) xmlFree(ctxt->location); if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (ctxt->strm != NULL) { inflateEnd(ctxt->strm); xmlFree(ctxt->strm); @@ -636,7 +636,7 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) if ((select(ctxt->fd + 1, &rfd, NULL, NULL, &tv) < 1) #if defined(EINTR) - && (socket_errno() != EINTR) + && (socket_errno() != EINTR) #endif ) return (0); @@ -817,7 +817,7 @@ xmlNanoHTTPScanAnswer(xmlNanoHTTPCtxtPtr ctxt, const char *line) { if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); ctxt->authHeader = xmlMemStrdup(cur); -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED } else if ( !xmlStrncasecmp( BAD_CAST line, BAD_CAST"Content-Encoding:", 17) ) { cur += 17; while ((*cur == ' ') || (*cur == '\t')) cur++; @@ -1088,7 +1088,7 @@ xmlNanoHTTPConnectHost(const char *host, int port) for (res = result; res; res = res->ai_next) { if (res->ai_family == AF_INET) { - if ((size_t)res->ai_addrlen > sizeof(sockin)) { + if ((size_t)res->ai_addrlen > sizeof(sockin)) { __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); freeaddrinfo (result); return INVALID_SOCKET; @@ -1098,7 +1098,7 @@ xmlNanoHTTPConnectHost(const char *host, int port) addr = (struct sockaddr *)&sockin; #ifdef SUPPORT_IP6 } else if (have_ipv6 () && (res->ai_family == AF_INET6)) { - if ((size_t)res->ai_addrlen > sizeof(sockin6)) { + if ((size_t)res->ai_addrlen > sizeof(sockin6)) { __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); freeaddrinfo (result); return INVALID_SOCKET; @@ -1126,10 +1126,10 @@ xmlNanoHTTPConnectHost(const char *host, int port) #endif #if !defined(HAVE_GETADDRINFO) || !defined(_WIN32) { - struct hostent *h; - struct in_addr ia; - int i; - + struct hostent *h; + struct in_addr ia; + int i; + h = gethostbyname (GETHOSTBYNAME_ARG_CAST host); if (h == NULL) { @@ -1138,17 +1138,17 @@ xmlNanoHTTPConnectHost(const char *host, int port) * extraction code. it work on Linux, if it work on your platform * and one want to enable it, send me the defined(foobar) needed */ -#if defined(HAVE_NETDB_H) && defined(HOST_NOT_FOUND) && defined(__linux__) +#if defined(HAVE_NETDB_H) && defined(HOST_NOT_FOUND) && defined(__linux__) const char *h_err_txt = ""; switch (h_errno) { case HOST_NOT_FOUND: - h_err_txt = "Authoritative host not found"; + h_err_txt = "Authoritative host not found"; break; case TRY_AGAIN: h_err_txt = - "Non-authoritative host not found or server failure."; + "Non-authoritative host not found or server failure."; break; case NO_RECOVERY: @@ -1273,7 +1273,7 @@ xmlNanoHTTPOpenRedir(const char *URL, char **contentType, char **redir) { int xmlNanoHTTPRead(void *ctx, void *dest, int len) { xmlNanoHTTPCtxtPtr ctxt = (xmlNanoHTTPCtxtPtr) ctx; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED int bytes_read = 0; int orig_avail_in; int z_ret; @@ -1283,7 +1283,7 @@ xmlNanoHTTPRead(void *ctx, void *dest, int len) { if (dest == NULL) return(-1); if (len <= 0) return(0); -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (ctxt->usesGzip == 1) { if (ctxt->strm == NULL) return(0); @@ -1424,16 +1424,16 @@ retry: /* 1 for '?' */ blen += strlen(ctxt->query) + 1; blen += strlen(method) + strlen(ctxt->path) + 24; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /* reserve for possible 'Accept-Encoding: gzip' string */ blen += 23; #endif if (ctxt->port != 80) { /* reserve space for ':xxxxx', incl. potential proxy */ if (proxy) - blen += 17; + blen += 17; else - blen += 11; + blen += 11; } bp = (char*)xmlMallocAtomic(blen); if ( bp == NULL ) { @@ -1468,7 +1468,7 @@ retry: ctxt->hostname, ctxt->port); } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED p += snprintf(p, blen - (p - bp), "Accept-Encoding: gzip\r\n"); #endif @@ -1542,8 +1542,8 @@ retry: xmlGenericError(xmlGenericErrorContext, "\nRedirect to: %s\n", ctxt->location); #endif - while ( xmlNanoHTTPRecv(ctxt) > 0 ) - ; + while ( xmlNanoHTTPRecv(ctxt) > 0 ) + ; if (nbRedirects < XML_NANO_HTTP_MAX_REDIR) { nbRedirects++; if (redirURL != NULL) diff --git a/contrib/libs/libxml/parser.c b/contrib/libs/libxml/parser.c index ccf215c294..a34bb6cdd8 100644 --- a/contrib/libs/libxml/parser.c +++ b/contrib/libs/libxml/parser.c @@ -30,15 +30,15 @@ * daniel@veillard.com */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) && !defined (__CYGWIN__) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' @@ -48,7 +48,7 @@ #include <limits.h> #include <string.h> #include <stdarg.h> -#include <stddef.h> +#include <stddef.h> #include <libxml/xmlmemory.h> #include <libxml/threads.h> #include <libxml/globals.h> @@ -94,14 +94,14 @@ static xmlParserCtxtPtr xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID, const xmlChar *base, xmlParserCtxtPtr pctx); -static void xmlHaltParser(xmlParserCtxtPtr ctxt); - -static int -xmlParseElementStart(xmlParserCtxtPtr ctxt); - -static void -xmlParseElementEnd(xmlParserCtxtPtr ctxt); - +static void xmlHaltParser(xmlParserCtxtPtr ctxt); + +static int +xmlParseElementStart(xmlParserCtxtPtr ctxt); + +static void +xmlParseElementEnd(xmlParserCtxtPtr ctxt); + /************************************************************************ * * * Arbitrary limits set in the parser. See XML_PARSE_HUGE * @@ -114,7 +114,7 @@ xmlParseElementEnd(xmlParserCtxtPtr ctxt); /* * XML_PARSER_NON_LINEAR is the threshold where the ratio of parsed entity * replacement over the size in byte of the input indicates that you have - * and exponential behaviour. A value of 10 correspond to at least 3 entity + * and exponential behaviour. A value of 10 correspond to at least 3 entity * replacement per byte of input. */ #define XML_PARSER_NON_LINEAR 10 @@ -144,25 +144,25 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, * entities problems */ if ((ent != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && - (ent->content != NULL) && (ent->checked == 0) && - (ctxt->errNo != XML_ERR_ENTITY_LOOP)) { - unsigned long oldnbent = ctxt->nbentities, diff; + (ent->content != NULL) && (ent->checked == 0) && + (ctxt->errNo != XML_ERR_ENTITY_LOOP)) { + unsigned long oldnbent = ctxt->nbentities, diff; xmlChar *rep; ent->checked = 1; - ++ctxt->depth; + ++ctxt->depth; rep = xmlStringDecodeEntities(ctxt, ent->content, XML_SUBSTITUTE_REF, 0, 0, 0); - --ctxt->depth; - if ((rep == NULL) || (ctxt->errNo == XML_ERR_ENTITY_LOOP)) { - ent->content[0] = 0; - } - - diff = ctxt->nbentities - oldnbent + 1; - if (diff > INT_MAX / 2) - diff = INT_MAX / 2; - ent->checked = diff * 2; + --ctxt->depth; + if ((rep == NULL) || (ctxt->errNo == XML_ERR_ENTITY_LOOP)) { + ent->content[0] = 0; + } + + diff = ctxt->nbentities - oldnbent + 1; + if (diff > INT_MAX / 2) + diff = INT_MAX / 2; + ent->checked = diff * 2; if (rep != NULL) { if (xmlStrchr(rep, '<')) ent->checked |= 1; @@ -547,15 +547,15 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info) } if (ctxt != NULL) ctxt->errNo = error; - if (info == NULL) { - __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, - XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s\n", - errmsg); - } else { - __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, - XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s: %s\n", - errmsg, info); - } + if (info == NULL) { + __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, + XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s\n", + errmsg); + } else { + __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, + XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s: %s\n", + errmsg, info); + } if (ctxt != NULL) { ctxt->wellFormed = 0; if (ctxt->recovery == 0) @@ -571,7 +571,7 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info) * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg) { @@ -599,7 +599,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a warning. */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -637,7 +637,7 @@ xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a validity error. */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { @@ -677,7 +677,7 @@ xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { @@ -707,7 +707,7 @@ xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, int val, const xmlChar *str2) @@ -737,7 +737,7 @@ xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * val) { @@ -766,7 +766,7 @@ xmlFatalErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a non fatal parser error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * val) { @@ -791,7 +791,7 @@ xmlErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * info1, const xmlChar * info2, @@ -820,7 +820,7 @@ xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a namespace warning error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlNsWarn(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * info1, const xmlChar * info2, @@ -1069,7 +1069,7 @@ xmlHasFeature(xmlFeature feature) * xmlDetectSAX2: * @ctxt: an XML parser context * - * Do the SAX2 detection and specific initialization + * Do the SAX2 detection and specific initialization */ static void xmlDetectSAX2(xmlParserCtxtPtr ctxt) { @@ -1096,12 +1096,12 @@ typedef xmlDefAttrs *xmlDefAttrsPtr; struct _xmlDefAttrs { int nbAttrs; /* number of defaulted attributes on that element */ int maxAttrs; /* the size of the array */ -#if __STDC_VERSION__ >= 199901L - /* Using a C99 flexible array member avoids UBSan errors. */ - const xmlChar *values[]; /* array of localname/prefix/values/external */ -#else - const xmlChar *values[5]; -#endif +#if __STDC_VERSION__ >= 199901L + /* Using a C99 flexible array member avoids UBSan errors. */ + const xmlChar *values[]; /* array of localname/prefix/values/external */ +#else + const xmlChar *values[5]; +#endif }; /** @@ -1338,7 +1338,7 @@ xmlAddSpecialAttr(xmlParserCtxtPtr ctxt, return; xmlHashAddEntry2(ctxt->attsSpecial, fullname, fullattr, - (void *) (ptrdiff_t) type); + (void *) (ptrdiff_t) type); return; mem_error: @@ -1357,7 +1357,7 @@ xmlCleanSpecialAttrCallback(void *payload, void *data, const xmlChar *unused ATTRIBUTE_UNUSED) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data; - if (((ptrdiff_t) payload) == XML_ATTRIBUTE_CDATA) { + if (((ptrdiff_t) payload) == XML_ATTRIBUTE_CDATA) { xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL); } } @@ -1401,7 +1401,7 @@ xmlCleanSpecialAttr(xmlParserCtxtPtr ctxt) * [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ * [38] Subcode ::= ([a-z] | [A-Z])+ * - * The current REC reference the successors of RFC 1766, currently 5646 + * The current REC reference the successors of RFC 1766, currently 5646 * * http://www.rfc-editor.org/rfc/rfc5646.txt * langtag = language @@ -1794,7 +1794,7 @@ nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value) xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR, "Excessive depth in document: %d use XML_PARSE_HUGE option\n", xmlParserMaxDepth); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); return(-1); } ctxt->nodeTab[ctxt->nodeNr] = value; @@ -1863,23 +1863,23 @@ nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value, goto mem_error; } ctxt->pushTab = tmp2; - } else if (ctxt->pushTab == NULL) { - ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 * - sizeof(ctxt->pushTab[0])); - if (ctxt->pushTab == NULL) - goto mem_error; + } else if (ctxt->pushTab == NULL) { + ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 * + sizeof(ctxt->pushTab[0])); + if (ctxt->pushTab == NULL) + goto mem_error; } ctxt->nameTab[ctxt->nameNr] = value; ctxt->name = value; ctxt->pushTab[ctxt->nameNr * 3] = (void *) prefix; ctxt->pushTab[ctxt->nameNr * 3 + 1] = (void *) URI; - ctxt->pushTab[ctxt->nameNr * 3 + 2] = (void *) (ptrdiff_t) nsNr; + ctxt->pushTab[ctxt->nameNr * 3 + 2] = (void *) (ptrdiff_t) nsNr; return (ctxt->nameNr++); mem_error: xmlErrMemory(ctxt, NULL); return (-1); } -#ifdef LIBXML_PUSH_ENABLED +#ifdef LIBXML_PUSH_ENABLED /** * nameNsPop: * @ctxt: an XML parser context @@ -2034,7 +2034,7 @@ static int spacePop(xmlParserCtxtPtr ctxt) { #define CUR (*ctxt->input->cur) #define NXT(val) ctxt->input->cur[(val)] #define CUR_PTR ctxt->input->cur -#define BASE_PTR ctxt->input->base +#define BASE_PTR ctxt->input->base #define CMP4( s, c1, c2, c3, c4 ) \ ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \ @@ -2056,8 +2056,8 @@ static int spacePop(xmlParserCtxtPtr ctxt) { #define SKIP(val) do { \ ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val); \ - if (*ctxt->input->cur == 0) \ - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ + if (*ctxt->input->cur == 0) \ + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ } while (0) #define SKIPL(val) do { \ @@ -2069,8 +2069,8 @@ static int spacePop(xmlParserCtxtPtr ctxt) { ctxt->nbChars++; \ ctxt->input->cur++; \ } \ - if (*ctxt->input->cur == 0) \ - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ + if (*ctxt->input->cur == 0) \ + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \ } while (0) #define SHRINK if ((ctxt->progressive == 0) && \ @@ -2080,36 +2080,36 @@ static int spacePop(xmlParserCtxtPtr ctxt) { static void xmlSHRINK (xmlParserCtxtPtr ctxt) { xmlParserInputShrink(ctxt->input); - if (*ctxt->input->cur == 0) - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); -} + if (*ctxt->input->cur == 0) + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); +} #define GROW if ((ctxt->progressive == 0) && \ (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \ xmlGROW (ctxt); static void xmlGROW (xmlParserCtxtPtr ctxt) { - ptrdiff_t curEnd = ctxt->input->end - ctxt->input->cur; - ptrdiff_t curBase = ctxt->input->cur - ctxt->input->base; + ptrdiff_t curEnd = ctxt->input->end - ctxt->input->cur; + ptrdiff_t curBase = ctxt->input->cur - ctxt->input->base; - if (((curEnd > XML_MAX_LOOKUP_LIMIT) || - (curBase > XML_MAX_LOOKUP_LIMIT)) && - ((ctxt->input->buf) && - (ctxt->input->buf->readcallback != xmlInputReadCallbackNop)) && + if (((curEnd > XML_MAX_LOOKUP_LIMIT) || + (curBase > XML_MAX_LOOKUP_LIMIT)) && + ((ctxt->input->buf) && + (ctxt->input->buf->readcallback != xmlInputReadCallbackNop)) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup"); - xmlHaltParser(ctxt); - return; + xmlHaltParser(ctxt); + return; } xmlParserInputGrow(ctxt->input, INPUT_CHUNK); - if ((ctxt->input->cur > ctxt->input->end) || - (ctxt->input->cur < ctxt->input->base)) { - xmlHaltParser(ctxt); - xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "cur index out of bound"); - return; - } - if ((ctxt->input->cur != NULL) && (*ctxt->input->cur == 0)) - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); + if ((ctxt->input->cur > ctxt->input->end) || + (ctxt->input->cur < ctxt->input->base)) { + xmlHaltParser(ctxt); + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "cur index out of bound"); + return; + } + if ((ctxt->input->cur != NULL) && (*ctxt->input->cur == 0)) + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); } #define SKIP_BLANKS xmlSkipBlankChars(ctxt) @@ -2178,35 +2178,35 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) { } ctxt->input->cur = cur; } else { - int expandPE = ((ctxt->external != 0) || (ctxt->inputNr != 1)); - - while (1) { - if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */ + int expandPE = ((ctxt->external != 0) || (ctxt->inputNr != 1)); + + while (1) { + if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */ NEXT; - } else if (CUR == '%') { - /* - * Need to handle support of entities branching here - */ - if ((expandPE == 0) || (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0)) - break; - xmlParsePEReference(ctxt); - } else if (CUR == 0) { - if (ctxt->inputNr <= 1) - break; - xmlPopInput(ctxt); - } else { - break; - } - - /* - * Also increase the counter when entering or exiting a PERef. - * The spec says: "When a parameter-entity reference is recognized - * in the DTD and included, its replacement text MUST be enlarged - * by the attachment of one leading and one following space (#x20) - * character." - */ - res++; - } + } else if (CUR == '%') { + /* + * Need to handle support of entities branching here + */ + if ((expandPE == 0) || (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0)) + break; + xmlParsePEReference(ctxt); + } else if (CUR == 0) { + if (ctxt->inputNr <= 1) + break; + xmlPopInput(ctxt); + } else { + break; + } + + /* + * Also increase the counter when entering or exiting a PERef. + * The spec says: "When a parameter-entity reference is recognized + * in the DTD and included, its replacement text MUST be enlarged + * by the attachment of one leading and one following space (#x20) + * character." + */ + res++; + } } return(res); } @@ -2232,13 +2232,13 @@ xmlPopInput(xmlParserCtxtPtr ctxt) { if (xmlParserDebugEntities) xmlGenericError(xmlGenericErrorContext, "Popping input %d\n", ctxt->inputNr); - if ((ctxt->inputNr > 1) && (ctxt->inSubset == 0) && - (ctxt->instate != XML_PARSER_EOF)) - xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, - "Unfinished entity outside the DTD"); + if ((ctxt->inputNr > 1) && (ctxt->inSubset == 0) && + (ctxt->instate != XML_PARSER_EOF)) + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, + "Unfinished entity outside the DTD"); xmlFreeInputStream(inputPop(ctxt)); - if (*ctxt->input->cur == 0) - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); + if (*ctxt->input->cur == 0) + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); return(CUR); } @@ -2264,13 +2264,13 @@ xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) { xmlGenericError(xmlGenericErrorContext, "Pushing input %d : %.30s\n", ctxt->inputNr+1, input->cur); } - if (((ctxt->inputNr > 40) && ((ctxt->options & XML_PARSE_HUGE) == 0)) || - (ctxt->inputNr > 1024)) { - xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); - while (ctxt->inputNr > 1) - xmlFreeInputStream(inputPop(ctxt)); - return(-1); - } + if (((ctxt->inputNr > 40) && ((ctxt->options & XML_PARSE_HUGE) == 0)) || + (ctxt->inputNr > 1024)) { + xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); + while (ctxt->inputNr > 1) + xmlFreeInputStream(inputPop(ctxt)); + return(-1); + } ret = inputPush(ctxt, input); if (ctxt->instate == XML_PARSER_EOF) return(-1); @@ -2295,7 +2295,7 @@ xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) { */ int xmlParseCharRef(xmlParserCtxtPtr ctxt) { - int val = 0; + int val = 0; int count = 0; /* @@ -2323,8 +2323,8 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { val = 0; break; } - if (val > 0x110000) - val = 0x110000; + if (val > 0x110000) + val = 0x110000; NEXT; count++; @@ -2352,8 +2352,8 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { val = 0; break; } - if (val > 0x110000) - val = 0x110000; + if (val > 0x110000) + val = 0x110000; NEXT; count++; @@ -2373,11 +2373,11 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { * Characters referred to using character references must match the * production for Char. */ - if (val >= 0x110000) { - xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, - "xmlParseCharRef: character reference out of bounds\n", - val); - } else if (IS_CHAR(val)) { + if (val >= 0x110000) { + xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, + "xmlParseCharRef: character reference out of bounds\n", + val); + } else if (IS_CHAR(val)) { return(val); } else { xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, @@ -2409,7 +2409,7 @@ static int xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { const xmlChar *ptr; xmlChar cur; - int val = 0; + int val = 0; if ((str == NULL) || (*str == NULL)) return(0); ptr = *str; @@ -2429,8 +2429,8 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { val = 0; break; } - if (val > 0x110000) - val = 0x110000; + if (val > 0x110000) + val = 0x110000; ptr++; cur = *ptr; @@ -2448,8 +2448,8 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { val = 0; break; } - if (val > 0x110000) - val = 0x110000; + if (val > 0x110000) + val = 0x110000; ptr++; cur = *ptr; @@ -2467,11 +2467,11 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { * Characters referred to using character references must match the * production for Char. */ - if (val >= 0x110000) { - xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, - "xmlParseStringCharRef: character reference out of bounds\n", - val); - } else if (IS_CHAR(val)) { + if (val >= 0x110000) { + xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, + "xmlParseStringCharRef: character reference out of bounds\n", + val); + } else if (IS_CHAR(val)) { return(val); } else { xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, @@ -2569,7 +2569,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { return; } - xmlParsePEReference(ctxt); + xmlParsePEReference(ctxt); } /* @@ -2646,15 +2646,15 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, else c = 0; while ((c != 0) && (c != end) && /* non input consuming loop */ - (c != end2) && (c != end3) && - (ctxt->instate != XML_PARSER_EOF)) { + (c != end2) && (c != end3) && + (ctxt->instate != XML_PARSER_EOF)) { if (c == 0) break; if ((c == '&') && (str[1] == '#')) { int val = xmlParseStringCharRef(ctxt, &str); - if (val == 0) - goto int_error; - COPY_BUF(0,buffer,nbchars,val); + if (val == 0) + goto int_error; + COPY_BUF(0,buffer,nbchars,val); if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } @@ -2677,27 +2677,27 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, } else { xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR, "predefined entity has no content\n"); - goto int_error; + goto int_error; } } else if ((ent != NULL) && (ent->content != NULL)) { ctxt->depth++; rep = xmlStringDecodeEntities(ctxt, ent->content, what, 0, 0, 0); ctxt->depth--; - if (rep == NULL) - goto int_error; - - current = rep; - while (*current != 0) { /* non input consuming loop */ - buffer[nbchars++] = *current++; - if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { - if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) - goto int_error; - growBuffer(buffer, XML_PARSER_BUFFER_SIZE); - } - } - xmlFree(rep); - rep = NULL; + if (rep == NULL) + goto int_error; + + current = rep; + while (*current != 0) { /* non input consuming loop */ + buffer[nbchars++] = *current++; + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) + goto int_error; + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + } + } + xmlFree(rep); + rep = NULL; } else if (ent != NULL) { int i = xmlStrlen(ent->name); const xmlChar *cur = ent->name; @@ -2720,39 +2720,39 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, ctxt->nbentities += ent->checked / 2; if (ent != NULL) { if (ent->content == NULL) { - /* - * Note: external parsed entities will not be loaded, - * it is not required for a non-validating parser to - * complete external PEReferences coming from the - * internal subset - */ - if (((ctxt->options & XML_PARSE_NOENT) != 0) || - ((ctxt->options & XML_PARSE_DTDVALID) != 0) || - (ctxt->validate != 0)) { - xmlLoadEntityContent(ctxt, ent); - } else { - xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING, - "not validating will not read content for PE entity %s\n", - ent->name, NULL); - } + /* + * Note: external parsed entities will not be loaded, + * it is not required for a non-validating parser to + * complete external PEReferences coming from the + * internal subset + */ + if (((ctxt->options & XML_PARSE_NOENT) != 0) || + ((ctxt->options & XML_PARSE_DTDVALID) != 0) || + (ctxt->validate != 0)) { + xmlLoadEntityContent(ctxt, ent); + } else { + xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING, + "not validating will not read content for PE entity %s\n", + ent->name, NULL); + } } ctxt->depth++; rep = xmlStringDecodeEntities(ctxt, ent->content, what, 0, 0, 0); ctxt->depth--; - if (rep == NULL) - goto int_error; - current = rep; - while (*current != 0) { /* non input consuming loop */ - buffer[nbchars++] = *current++; - if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { - if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) - goto int_error; - growBuffer(buffer, XML_PARSER_BUFFER_SIZE); - } - } - xmlFree(rep); - rep = NULL; + if (rep == NULL) + goto int_error; + current = rep; + while (*current != 0) { /* non input consuming loop */ + buffer[nbchars++] = *current++; + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) + goto int_error; + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + } + } + xmlFree(rep); + rep = NULL; } } else { COPY_BUF(l,buffer,nbchars,c); @@ -3267,16 +3267,16 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name"); return(NULL); } - if (ctxt->input->cur - ctxt->input->base < len) { - /* - * There were a couple of bugs where PERefs lead to to a change - * of the buffer. Check the buffer size to avoid passing an invalid - * pointer to xmlDictLookup. - */ - xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, - "unexpected change of input buffer"); - return (NULL); - } + if (ctxt->input->cur - ctxt->input->base < len) { + /* + * There were a couple of bugs where PERefs lead to to a change + * of the buffer. Check the buffer size to avoid passing an invalid + * pointer to xmlDictLookup. + */ + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, + "unexpected change of input buffer"); + return (NULL); + } if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r')) return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len)); return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); @@ -3349,7 +3349,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { int len = 0, l; int c; int count = 0; - size_t startPosition = 0; + size_t startPosition = 0; #ifdef DEBUG nbParseNCNameComplex++; @@ -3359,7 +3359,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { * Handler for more complex cases */ GROW; - startPosition = CUR_PTR - BASE_PTR; + startPosition = CUR_PTR - BASE_PTR; c = CUR_CHAR(l); if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { @@ -3384,16 +3384,16 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { c = CUR_CHAR(l); if (c == 0) { count = 0; - /* - * when shrinking to extend the buffer we really need to preserve - * the part of the name we already parsed. Hence rolling back - * by current length. - */ - ctxt->input->cur -= l; + /* + * when shrinking to extend the buffer we really need to preserve + * the part of the name we already parsed. Hence rolling back + * by current length. + */ + ctxt->input->cur -= l; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); - ctxt->input->cur += l; + ctxt->input->cur += l; c = CUR_CHAR(l); } } @@ -3402,7 +3402,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); return(NULL); } - return(xmlDictLookup(ctxt->dict, (BASE_PTR + startPosition), len)); + return(xmlDictLookup(ctxt->dict, (BASE_PTR + startPosition), len)); } /** @@ -3422,7 +3422,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { static const xmlChar * xmlParseNCName(xmlParserCtxtPtr ctxt) { - const xmlChar *in, *e; + const xmlChar *in, *e; const xmlChar *ret; int count = 0; @@ -3434,19 +3434,19 @@ xmlParseNCName(xmlParserCtxtPtr ctxt) { * Accelerator for simple ASCII names */ in = ctxt->input->cur; - e = ctxt->input->end; - if ((((*in >= 0x61) && (*in <= 0x7A)) || - ((*in >= 0x41) && (*in <= 0x5A)) || - (*in == '_')) && (in < e)) { + e = ctxt->input->end; + if ((((*in >= 0x61) && (*in <= 0x7A)) || + ((*in >= 0x41) && (*in <= 0x5A)) || + (*in == '_')) && (in < e)) { in++; - while ((((*in >= 0x61) && (*in <= 0x7A)) || - ((*in >= 0x41) && (*in <= 0x5A)) || - ((*in >= 0x30) && (*in <= 0x39)) || - (*in == '_') || (*in == '-') || - (*in == '.')) && (in < e)) + while ((((*in >= 0x61) && (*in <= 0x7A)) || + ((*in >= 0x41) && (*in <= 0x5A)) || + ((*in >= 0x30) && (*in <= 0x39)) || + (*in == '_') || (*in == '-') || + (*in == '.')) && (in < e)) in++; - if (in >= e) - goto complex; + if (in >= e) + goto complex; if ((*in > 0) && (*in < 0x80)) { count = in - ctxt->input->cur; if ((count > XML_MAX_NAME_LENGTH) && @@ -3464,7 +3464,7 @@ xmlParseNCName(xmlParserCtxtPtr ctxt) { return(ret); } } -complex: +complex: return(xmlParseNCNameComplex(ctxt)); } @@ -3481,8 +3481,8 @@ complex: static const xmlChar * xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) { - register const xmlChar *cmp = other; - register const xmlChar *in; + register const xmlChar *cmp = other; + register const xmlChar *in; const xmlChar *ret; GROW; @@ -3502,7 +3502,7 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) { } /* failure (or end of input buffer), check with full function */ ret = xmlParseName (ctxt); - /* strings coming from the dictionary direct compare possible */ + /* strings coming from the dictionary direct compare possible */ if (ret == other) { return (const xmlChar*) 1; } @@ -3749,8 +3749,8 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { ctxt->instate = XML_PARSER_ENTITY_VALUE; input = ctxt->input; GROW; - if (ctxt->instate == XML_PARSER_EOF) - goto error; + if (ctxt->instate == XML_PARSER_EOF) + goto error; NEXT; c = CUR_CHAR(l); /* @@ -3771,7 +3771,7 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); - goto error; + goto error; } buf = tmp; } @@ -3786,13 +3786,13 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { } } buf[len] = 0; - if (ctxt->instate == XML_PARSER_EOF) - goto error; - if (c != stop) { - xmlFatalErr(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL); - goto error; + if (ctxt->instate == XML_PARSER_EOF) + goto error; + if (c != stop) { + xmlFatalErr(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL); + goto error; } - NEXT; + NEXT; /* * Raise problem w.r.t. '&' and '%' being used in non-entities @@ -3804,24 +3804,24 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { if ((*cur == '%') || ((*cur == '&') && (cur[1] != '#'))) { xmlChar *name; xmlChar tmp = *cur; - int nameOk = 0; + int nameOk = 0; cur++; name = xmlParseStringName(ctxt, &cur); - if (name != NULL) { - nameOk = 1; - xmlFree(name); - } - if ((nameOk == 0) || (*cur != ';')) { + if (name != NULL) { + nameOk = 1; + xmlFree(name); + } + if ((nameOk == 0) || (*cur != ';')) { xmlFatalErrMsgInt(ctxt, XML_ERR_ENTITY_CHAR_ERROR, "EntityValue: '%c' forbidden except for entities references\n", tmp); - goto error; + goto error; } if ((tmp == '%') && (ctxt->inSubset == 1) && (ctxt->inputNr == 1)) { xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL); - goto error; + goto error; } if (*cur == 0) break; @@ -3831,24 +3831,24 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { /* * Then PEReference entities are substituted. - * - * NOTE: 4.4.7 Bypassed - * When a general entity reference appears in the EntityValue in - * an entity declaration, it is bypassed and left as is. - * so XML_SUBSTITUTE_REF is not set here. - */ - ++ctxt->depth; - ret = xmlStringDecodeEntities(ctxt, buf, XML_SUBSTITUTE_PEREF, - 0, 0, 0); - --ctxt->depth; - if (orig != NULL) { - *orig = buf; - buf = NULL; - } - -error: - if (buf != NULL) - xmlFree(buf); + * + * NOTE: 4.4.7 Bypassed + * When a general entity reference appears in the EntityValue in + * an entity declaration, it is bypassed and left as is. + * so XML_SUBSTITUTE_REF is not set here. + */ + ++ctxt->depth; + ret = xmlStringDecodeEntities(ctxt, buf, XML_SUBSTITUTE_PEREF, + 0, 0, 0); + --ctxt->depth; + if (orig != NULL) { + *orig = buf; + buf = NULL; + } + +error: + if (buf != NULL) + xmlFree(buf); return(ret); } @@ -3856,7 +3856,7 @@ error: * xmlParseAttValueComplex: * @ctxt: an XML parser context * @len: the resulting attribute len - * @normalize: whether to apply the inner normalization + * @normalize: whether to apply the inner normalization * * parse a value for an attribute, this is the fallback function * of xmlParseAttValue() when the attribute parsing requires handling @@ -3967,11 +3967,11 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { } else if ((ent != NULL) && (ctxt->replaceEntities != 0)) { if (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) { - ++ctxt->depth; + ++ctxt->depth; rep = xmlStringDecodeEntities(ctxt, ent->content, XML_SUBSTITUTE_REF, 0, 0, 0); - --ctxt->depth; + --ctxt->depth; if (rep != NULL) { current = rep; while (*current != 0) { /* non input consuming */ @@ -4005,25 +4005,25 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { */ if ((ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && (ent->content != NULL) && (ent->checked == 0)) { - unsigned long oldnbent = ctxt->nbentities, diff; + unsigned long oldnbent = ctxt->nbentities, diff; - ++ctxt->depth; + ++ctxt->depth; rep = xmlStringDecodeEntities(ctxt, ent->content, XML_SUBSTITUTE_REF, 0, 0, 0); - --ctxt->depth; + --ctxt->depth; - diff = ctxt->nbentities - oldnbent + 1; - if (diff > INT_MAX / 2) - diff = INT_MAX / 2; - ent->checked = diff * 2; + diff = ctxt->nbentities - oldnbent + 1; + if (diff > INT_MAX / 2) + diff = INT_MAX / 2; + ent->checked = diff * 2; if (rep != NULL) { if (xmlStrchr(rep, '<')) ent->checked |= 1; xmlFree(rep); rep = NULL; - } else { - ent->content[0] = 0; - } + } else { + ent->content[0] = 0; + } } /* @@ -4083,7 +4083,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { /* * There we potentially risk an overflow, don't allow attribute value of - * length more than INT_MAX it is a very reasonable assumption ! + * length more than INT_MAX it is a very reasonable assumption ! */ if (len >= INT_MAX) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, @@ -4447,7 +4447,7 @@ get_more: if (*in == ']') { if ((in[1] == ']') && (in[2] == '>')) { xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL); - ctxt->input->cur = in + 1; + ctxt->input->cur = in + 1; return; } in++; @@ -4640,7 +4640,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { *publicID = NULL; if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) { SKIP(6); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after 'SYSTEM'\n"); } @@ -4650,7 +4650,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { } } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) { SKIP(6); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after 'PUBLIC'\n"); } @@ -4662,19 +4662,19 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { /* * We don't handle [83] so "S SystemLiteral" is required. */ - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the Public Identifier\n"); } } else { /* * We handle [83] so we return immediately, if - * "S SystemLiteral" is not detected. We skip blanks if no - * system literal was found, but this is harmless since we must - * be at the end of a NotationDecl. + * "S SystemLiteral" is not detected. We skip blanks if no + * system literal was found, but this is harmless since we must + * be at the end of a NotationDecl. */ - if (SKIP_BLANKS == 0) return(NULL); - if ((CUR != '\'') && (CUR != '"')) return(NULL); + if (SKIP_BLANKS == 0) return(NULL); + if ((CUR != '\'') && (CUR != '"')) return(NULL); } URI = xmlParseSystemLiteral(ctxt); if (URI == NULL) { @@ -4688,7 +4688,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { * xmlParseCommentComplex: * @ctxt: an XML parser context * @buf: the already parsed part of the buffer - * @len: number of bytes in the buffer + * @len: number of bytes in the buffer * @size: allocated size of the buffer * * Skip an XML (SGML) comment <!-- .... --> @@ -4805,8 +4805,8 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, } else { if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Comment doesn't start and stop in the same" - " entity\n"); + "Comment doesn't start and stop in the same" + " entity\n"); } NEXT; if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) && @@ -4954,8 +4954,8 @@ get_more: if (in[2] == '>') { if (ctxt->input->id != inputid) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "comment doesn't start and stop in the" - " same entity\n"); + "comment doesn't start and stop in the" + " same entity\n"); } SKIP(3); if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) && @@ -4979,10 +4979,10 @@ get_more: } else xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, "Double hyphen within comment\n", NULL); - if (ctxt->instate == XML_PARSER_EOF) { - xmlFree(buf); - return; - } + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return; + } in++; ctxt->input->col++; } @@ -5113,7 +5113,7 @@ error: * * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' * - * The processing is transferred to SAX once parsed. + * The processing is transferred to SAX once parsed. */ void @@ -5127,7 +5127,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { int count = 0; if ((RAW == '<') && (NXT(1) == '?')) { - int inputid = ctxt->input->id; + int inputid = ctxt->input->id; state = ctxt->instate; ctxt->instate = XML_PARSER_PI; /* @@ -5143,10 +5143,10 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { target = xmlParsePITarget(ctxt); if (target != NULL) { if ((RAW == '?') && (NXT(1) == '>')) { - if (inputid != ctxt->input->id) { + if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "PI declaration doesn't start and stop in" - " the same entity\n"); + "PI declaration doesn't start and stop in" + " the same entity\n"); } SKIP(2); @@ -5167,7 +5167,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { ctxt->instate = state; return; } - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED, "ParsePI: PI %s space expected\n", target); } @@ -5226,10 +5226,10 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "ParsePI: PI %s never end ...\n", target); } else { - if (inputid != ctxt->input->id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "PI declaration doesn't start and stop in" - " the same entity\n"); + if (inputid != ctxt->input->id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "PI declaration doesn't start and stop in" + " the same entity\n"); } SKIP(2); @@ -5285,10 +5285,10 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) { xmlChar *Systemid; if (CMP10(CUR_PTR, '<', '!', 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) { - int inputid = ctxt->input->id; + int inputid = ctxt->input->id; SHRINK; SKIP(10); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after '<!NOTATION'\n"); return; @@ -5304,11 +5304,11 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) { "colons are forbidden from notation names '%s'\n", name, NULL, NULL); } - if (SKIP_BLANKS == 0) { - xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, - "Space required after the NOTATION name'\n"); - return; - } + if (SKIP_BLANKS == 0) { + xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, + "Space required after the NOTATION name'\n"); + return; + } /* * Parse the IDs. @@ -5317,10 +5317,10 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) { SKIP_BLANKS; if (RAW == '>') { - if (inputid != ctxt->input->id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Notation declaration doesn't start and stop" - " in the same entity\n"); + if (inputid != ctxt->input->id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "Notation declaration doesn't start and stop" + " in the same entity\n"); } NEXT; if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && @@ -5367,19 +5367,19 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { /* GROW; done in the caller */ if (CMP8(CUR_PTR, '<', '!', 'E', 'N', 'T', 'I', 'T', 'Y')) { - int inputid = ctxt->input->id; + int inputid = ctxt->input->id; SHRINK; SKIP(8); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after '<!ENTITY'\n"); } if (RAW == '%') { NEXT; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, - "Space required after '%%'\n"); + "Space required after '%%'\n"); } isParameter = 1; } @@ -5395,7 +5395,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { "colons are forbidden from entities names '%s'\n", name, NULL, NULL); } - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the entity name\n"); } @@ -5506,13 +5506,13 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { xmlFreeURI(uri); } } - if ((RAW != '>') && (SKIP_BLANKS == 0)) { + if ((RAW != '>') && (SKIP_BLANKS == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required before 'NDATA'\n"); } if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) { SKIP(5); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after 'NDATA'\n"); } @@ -5529,7 +5529,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { literal, URI, NULL); /* * For expat compatibility in SAX mode. - * assuming the entity replacement was asked for + * assuming the entity replacement was asked for */ if ((ctxt->replaceEntities != 0) && ((ctxt->myDoc == NULL) || @@ -5554,17 +5554,17 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { } } if (ctxt->instate == XML_PARSER_EOF) - goto done; + goto done; SKIP_BLANKS; if (RAW != '>') { xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED, "xmlParseEntityDecl: entity %s not terminated\n", name); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); } else { - if (inputid != ctxt->input->id) { + if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Entity declaration doesn't start and stop in" - " the same entity\n"); + "Entity declaration doesn't start and stop in" + " the same entity\n"); } NEXT; } @@ -5586,17 +5586,17 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { cur = xmlSAX2GetEntity(ctxt, name); } } - if ((cur != NULL) && (cur->orig == NULL)) { - cur->orig = orig; - orig = NULL; - } + if ((cur != NULL) && (cur->orig == NULL)) { + cur->orig = orig; + orig = NULL; + } } - -done: + +done: if (value != NULL) xmlFree(value); if (URI != NULL) xmlFree(URI); if (literal != NULL) xmlFree(literal); - if (orig != NULL) xmlFree(orig); + if (orig != NULL) xmlFree(orig); } } @@ -5647,7 +5647,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value) { if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) { SKIP(6); val = XML_ATTRIBUTE_FIXED; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after '#FIXED'\n"); } @@ -5822,7 +5822,7 @@ int xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) { if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) { SKIP(8); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after 'NOTATION'\n"); return(0); @@ -5930,10 +5930,10 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { xmlEnumerationPtr tree; if (CMP9(CUR_PTR, '<', '!', 'A', 'T', 'T', 'L', 'I', 'S', 'T')) { - int inputid = ctxt->input->id; + int inputid = ctxt->input->id; SKIP(9); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after '<!ATTLIST'\n"); } @@ -5959,7 +5959,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { break; } GROW; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the attribute name\n"); break; @@ -5971,7 +5971,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { } GROW; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the attribute type\n"); if (tree != NULL) @@ -5992,7 +5992,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { GROW; if (RAW != '>') { - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the attribute default value\n"); if (defaultValue != NULL) @@ -6022,10 +6022,10 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { GROW; } if (RAW == '>') { - if (inputid != ctxt->input->id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Attribute list declaration doesn't start and" - " stop in the same entity\n"); + if (inputid != ctxt->input->id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "Attribute list declaration doesn't start and" + " stop in the same entity\n"); } NEXT; } @@ -6062,10 +6062,10 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) { SKIP_BLANKS; SHRINK; if (RAW == ')') { - if (ctxt->input->id != inputchk) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Element content declaration doesn't start and" - " stop in the same entity\n"); + if (ctxt->input->id != inputchk) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "Element content declaration doesn't start and" + " stop in the same entity\n"); } NEXT; ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA); @@ -6106,7 +6106,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) { if (elem == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, "xmlParseElementMixedContentDecl : Name expected\n"); - xmlFreeDocElementContent(ctxt->myDoc, ret); + xmlFreeDocElementContent(ctxt->myDoc, ret); return(NULL); } SKIP_BLANKS; @@ -6121,10 +6121,10 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) { } if (ret != NULL) ret->ocur = XML_ELEMENT_CONTENT_MULT; - if (ctxt->input->id != inputchk) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Element content declaration doesn't start and" - " stop in the same entity\n"); + if (ctxt->input->id != inputchk) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "Element content declaration doesn't start and" + " stop in the same entity\n"); } SKIP(2); } else { @@ -6364,10 +6364,10 @@ xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk, if (last != NULL) last->parent = cur; } - if (ctxt->input->id != inputchk) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Element content declaration doesn't start and stop in" - " the same entity\n"); + if (ctxt->input->id != inputchk) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "Element content declaration doesn't start and stop in" + " the same entity\n"); } NEXT; if (RAW == '?') { @@ -6540,13 +6540,13 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { /* GROW; done in the caller */ if (CMP9(CUR_PTR, '<', '!', 'E', 'L', 'E', 'M', 'E', 'N', 'T')) { - int inputid = ctxt->input->id; + int inputid = ctxt->input->id; SKIP(9); - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after 'ELEMENT'\n"); - return(-1); + return(-1); } name = xmlParseName(ctxt); if (name == NULL) { @@ -6554,7 +6554,7 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { "xmlParseElementDecl: no name for Element\n"); return(-1); } - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space required after the element name\n"); } @@ -6596,10 +6596,10 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { xmlFreeDocElementContent(ctxt->myDoc, content); } } else { - if (inputid != ctxt->input->id) { + if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "Element declaration doesn't start and stop in" - " the same entity\n"); + "Element declaration doesn't start and stop in" + " the same entity\n"); } NEXT; @@ -6639,143 +6639,143 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { static void xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { - int *inputIds = NULL; - size_t inputIdsSize = 0; - size_t depth = 0; - - while (ctxt->instate != XML_PARSER_EOF) { - if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { - int id = ctxt->input->id; - - SKIP(3); - SKIP_BLANKS; - - if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) { - SKIP(7); - SKIP_BLANKS; - if (RAW != '[') { - xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); - xmlHaltParser(ctxt); - goto error; - } - if (ctxt->input->id != id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "All markup of the conditional section is" - " not in the same entity\n"); - } - NEXT; - - if (inputIdsSize <= depth) { - int *tmp; - - inputIdsSize = (inputIdsSize == 0 ? 4 : inputIdsSize * 2); - tmp = (int *) xmlRealloc(inputIds, - inputIdsSize * sizeof(int)); - if (tmp == NULL) { - xmlErrMemory(ctxt, NULL); - goto error; - } - inputIds = tmp; - } - inputIds[depth] = id; - depth++; - } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) { - int state; - xmlParserInputState instate; - size_t ignoreDepth = 0; - - SKIP(6); - SKIP_BLANKS; - if (RAW != '[') { - xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); - xmlHaltParser(ctxt); - goto error; - } - if (ctxt->input->id != id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "All markup of the conditional section is" - " not in the same entity\n"); - } - NEXT; - - /* - * Parse up to the end of the conditional section but disable - * SAX event generating DTD building in the meantime - */ - state = ctxt->disableSAX; - instate = ctxt->instate; - if (ctxt->recovery == 0) ctxt->disableSAX = 1; - ctxt->instate = XML_PARSER_IGNORE; - - while (RAW != 0) { - if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { - SKIP(3); - ignoreDepth++; - /* Check for integer overflow */ - if (ignoreDepth == 0) { - xmlErrMemory(ctxt, NULL); - goto error; - } - } else if ((RAW == ']') && (NXT(1) == ']') && - (NXT(2) == '>')) { - if (ignoreDepth == 0) - break; - SKIP(3); - ignoreDepth--; - } else { - NEXT; - } - } - - ctxt->disableSAX = state; - ctxt->instate = instate; - - if (RAW == 0) { - xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL); - goto error; - } - if (ctxt->input->id != id) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "All markup of the conditional section is" - " not in the same entity\n"); - } - SKIP(3); - } else { - xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL); - xmlHaltParser(ctxt); - goto error; - } - } else if ((depth > 0) && - (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) { - depth--; - if (ctxt->input->id != inputIds[depth]) { - xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, - "All markup of the conditional section is not" - " in the same entity\n"); - } - SKIP(3); - } else { - const xmlChar *check = CUR_PTR; - unsigned int cons = ctxt->input->consumed; - - xmlParseMarkupDecl(ctxt); - - if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) { - xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL); - xmlHaltParser(ctxt); - goto error; - } - } - - if (depth == 0) - break; - - SKIP_BLANKS; - GROW; - } - -error: - xmlFree(inputIds); + int *inputIds = NULL; + size_t inputIdsSize = 0; + size_t depth = 0; + + while (ctxt->instate != XML_PARSER_EOF) { + if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { + int id = ctxt->input->id; + + SKIP(3); + SKIP_BLANKS; + + if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) { + SKIP(7); + SKIP_BLANKS; + if (RAW != '[') { + xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); + xmlHaltParser(ctxt); + goto error; + } + if (ctxt->input->id != id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "All markup of the conditional section is" + " not in the same entity\n"); + } + NEXT; + + if (inputIdsSize <= depth) { + int *tmp; + + inputIdsSize = (inputIdsSize == 0 ? 4 : inputIdsSize * 2); + tmp = (int *) xmlRealloc(inputIds, + inputIdsSize * sizeof(int)); + if (tmp == NULL) { + xmlErrMemory(ctxt, NULL); + goto error; + } + inputIds = tmp; + } + inputIds[depth] = id; + depth++; + } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) { + int state; + xmlParserInputState instate; + size_t ignoreDepth = 0; + + SKIP(6); + SKIP_BLANKS; + if (RAW != '[') { + xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); + xmlHaltParser(ctxt); + goto error; + } + if (ctxt->input->id != id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "All markup of the conditional section is" + " not in the same entity\n"); + } + NEXT; + + /* + * Parse up to the end of the conditional section but disable + * SAX event generating DTD building in the meantime + */ + state = ctxt->disableSAX; + instate = ctxt->instate; + if (ctxt->recovery == 0) ctxt->disableSAX = 1; + ctxt->instate = XML_PARSER_IGNORE; + + while (RAW != 0) { + if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { + SKIP(3); + ignoreDepth++; + /* Check for integer overflow */ + if (ignoreDepth == 0) { + xmlErrMemory(ctxt, NULL); + goto error; + } + } else if ((RAW == ']') && (NXT(1) == ']') && + (NXT(2) == '>')) { + if (ignoreDepth == 0) + break; + SKIP(3); + ignoreDepth--; + } else { + NEXT; + } + } + + ctxt->disableSAX = state; + ctxt->instate = instate; + + if (RAW == 0) { + xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL); + goto error; + } + if (ctxt->input->id != id) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "All markup of the conditional section is" + " not in the same entity\n"); + } + SKIP(3); + } else { + xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL); + xmlHaltParser(ctxt); + goto error; + } + } else if ((depth > 0) && + (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) { + depth--; + if (ctxt->input->id != inputIds[depth]) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, + "All markup of the conditional section is not" + " in the same entity\n"); + } + SKIP(3); + } else { + const xmlChar *check = CUR_PTR; + unsigned int cons = ctxt->input->consumed; + + xmlParseMarkupDecl(ctxt); + + if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) { + xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL); + xmlHaltParser(ctxt); + goto error; + } + } + + if (depth == 0) + break; + + SKIP_BLANKS; + GROW; + } + +error: + xmlFree(inputIds); } /** @@ -6831,11 +6831,11 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) { } /* - * detect requirement to exit there and act accordingly - * and avoid having instate overridden later on + * detect requirement to exit there and act accordingly + * and avoid having instate overridden later on */ - if (ctxt->instate == XML_PARSER_EOF) - return; + if (ctxt->instate == XML_PARSER_EOF) + return; ctxt->instate = XML_PARSER_DTD; } @@ -6864,7 +6864,7 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) { return; } - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed after '<?xml'\n"); } @@ -6876,7 +6876,7 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) { if (version == NULL) version = xmlCharStrdup(XML_DEFAULT_VERSION); else { - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed here\n"); } @@ -6950,7 +6950,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, /* * The XML REC instructs us to stop parsing right here */ - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); return; } } @@ -6967,10 +6967,10 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, ctxt->instate = XML_PARSER_DTD; ctxt->external = 1; - SKIP_BLANKS; + SKIP_BLANKS; while (((RAW == '<') && (NXT(1) == '?')) || ((RAW == '<') && (NXT(1) == '!')) || - (RAW == '%')) { + (RAW == '%')) { const xmlChar *check = CUR_PTR; unsigned int cons = ctxt->input->consumed; @@ -6979,7 +6979,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, xmlParseConditionalSections(ctxt); } else xmlParseMarkupDecl(ctxt); - SKIP_BLANKS; + SKIP_BLANKS; if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) { xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL); @@ -7021,7 +7021,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { */ if (NXT(1) == '#') { int i = 0; - xmlChar out[16]; + xmlChar out[16]; int hex = NXT(2); int value = xmlParseCharRef(ctxt); @@ -7094,11 +7094,11 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { * far more secure as the parser will only process data coming from * the document entity by default. */ - if (((ent->checked == 0) || - ((ent->children == NULL) && (ctxt->options & XML_PARSE_NOENT))) && + if (((ent->checked == 0) || + ((ent->children == NULL) && (ctxt->options & XML_PARSE_NOENT))) && ((ent->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY) || (ctxt->options & (XML_PARSE_NOENT | XML_PARSE_DTDVALID)))) { - unsigned long oldnbent = ctxt->nbentities, diff; + unsigned long oldnbent = ctxt->nbentities, diff; /* * This is a bit hackish but this seems the best @@ -7139,10 +7139,10 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { * Store the number of entities needing parsing for this entity * content and do checkings */ - diff = ctxt->nbentities - oldnbent + 1; - if (diff > INT_MAX / 2) - diff = INT_MAX / 2; - ent->checked = diff * 2; + diff = ctxt->nbentities - oldnbent + 1; + if (diff > INT_MAX / 2) + diff = INT_MAX / 2; + ent->checked = diff * 2; if ((ent->content != NULL) && (xmlStrchr(ent->content, '<'))) ent->checked |= 1; if (ret == XML_ERR_ENTITY_LOOP) { @@ -7204,8 +7204,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { (ret != XML_WAR_UNDECLARED_ENTITY)) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "Entity '%s' failed to parse\n", ent->name); - if (ent->content != NULL) - ent->content[0] = 0; + if (ent->content != NULL) + ent->content[0] = 0; xmlParserEntityCheck(ctxt, 0, ent, 0); } else if (list != NULL) { xmlFreeNodeList(list); @@ -7213,9 +7213,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { } if (ent->checked == 0) ent->checked = 2; - - /* Prevent entity from being parsed and expanded twice (Bug 760367). */ - was_checked = 0; + + /* Prevent entity from being parsed and expanded twice (Bug 760367). */ + was_checked = 0; } else if (ent->checked != 1) { ctxt->nbentities += ent->checked / 2; } @@ -7581,7 +7581,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { * not contain a <. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && - (ent != NULL) && + (ent != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) { if (((ent->checked & 1) || (ent->checked == 0)) && (ent->content != NULL) && (xmlStrchr(ent->content, '<'))) { @@ -7690,7 +7690,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { } /* - * Increase the number of entity references parsed + * Increase the number of entity references parsed */ ctxt->nbentities++; @@ -7852,21 +7852,21 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) NEXT; name = xmlParseName(ctxt); if (name == NULL) { - xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n"); + xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n"); return; } - if (xmlParserDebugEntities) - xmlGenericError(xmlGenericErrorContext, - "PEReference: %s\n", name); + if (xmlParserDebugEntities) + xmlGenericError(xmlGenericErrorContext, + "PEReference: %s\n", name); if (RAW != ';') { - xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL); + xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL); return; } NEXT; /* - * Increase the number of entity references parsed + * Increase the number of entity references parsed */ ctxt->nbentities++; @@ -7901,15 +7901,15 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) * ... The declaration of a parameter entity must * precede any reference to it... */ - if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { - xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, - "PEReference: %%%s; not found\n", - name, NULL); - } else - xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, - "PEReference: %%%s; not found\n", - name, NULL); - ctxt->valid = 0; + if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { + xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + } else + xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + ctxt->valid = 0; } xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { @@ -7921,54 +7921,54 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "Internal: %%%s; is not a parameter entity\n", name, NULL); - } else { - xmlChar start[4]; - xmlCharEncoding enc; - - if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && - ((ctxt->options & XML_PARSE_NOENT) == 0) && - ((ctxt->options & XML_PARSE_DTDVALID) == 0) && - ((ctxt->options & XML_PARSE_DTDLOAD) == 0) && - ((ctxt->options & XML_PARSE_DTDATTR) == 0) && - (ctxt->replaceEntities == 0) && - (ctxt->validate == 0)) + } else { + xmlChar start[4]; + xmlCharEncoding enc; + + if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && + ((ctxt->options & XML_PARSE_NOENT) == 0) && + ((ctxt->options & XML_PARSE_DTDVALID) == 0) && + ((ctxt->options & XML_PARSE_DTDLOAD) == 0) && + ((ctxt->options & XML_PARSE_DTDATTR) == 0) && + (ctxt->replaceEntities == 0) && + (ctxt->validate == 0)) return; - + input = xmlNewEntityInputStream(ctxt, entity); - if (xmlPushInput(ctxt, input) < 0) { - xmlFreeInputStream(input); + if (xmlPushInput(ctxt, input) < 0) { + xmlFreeInputStream(input); return; - } - - if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) { - /* - * Get the 4 first bytes and decode the charset - * if enc != XML_CHAR_ENCODING_NONE - * plug some encoding conversion routines. - * Note that, since we may have some non-UTF8 - * encoding (like UTF16, bug 135229), the 'length' - * is not known, but we can calculate based upon - * the amount of data in the buffer. - */ - GROW - if (ctxt->instate == XML_PARSER_EOF) - return; - if ((ctxt->input->end - ctxt->input->cur)>=4) { - start[0] = RAW; - start[1] = NXT(1); - start[2] = NXT(2); - start[3] = NXT(3); - enc = xmlDetectCharEncoding(start, 4); - if (enc != XML_CHAR_ENCODING_NONE) { - xmlSwitchEncoding(ctxt, enc); - } - } - - if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && - (IS_BLANK_CH(NXT(5)))) { - xmlParseTextDecl(ctxt); - } - } + } + + if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) { + /* + * Get the 4 first bytes and decode the charset + * if enc != XML_CHAR_ENCODING_NONE + * plug some encoding conversion routines. + * Note that, since we may have some non-UTF8 + * encoding (like UTF16, bug 135229), the 'length' + * is not known, but we can calculate based upon + * the amount of data in the buffer. + */ + GROW + if (ctxt->instate == XML_PARSER_EOF) + return; + if ((ctxt->input->end - ctxt->input->cur)>=4) { + start[0] = RAW; + start[1] = NXT(1); + start[2] = NXT(2); + start[3] = NXT(3); + enc = xmlDetectCharEncoding(start, 4); + if (enc != XML_CHAR_ENCODING_NONE) { + xmlSwitchEncoding(ctxt, enc); + } + } + + if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && + (IS_BLANK_CH(NXT(5)))) { + xmlParseTextDecl(ctxt); + } + } } } ctxt->hasPErefs = 1; @@ -8132,7 +8132,7 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { ptr++; /* - * Increase the number of entity references parsed + * Increase the number of entity references parsed */ ctxt->nbentities++; @@ -8144,7 +8144,7 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { entity = ctxt->sax->getParameterEntity(ctxt->userData, name); if (ctxt->instate == XML_PARSER_EOF) { xmlFree(name); - *str = ptr; + *str = ptr; return(NULL); } if (entity == NULL) { @@ -8283,7 +8283,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { * Is there any DTD definition ? */ if (RAW == '[') { - int baseInputNr = ctxt->inputNr; + int baseInputNr = ctxt->inputNr; ctxt->instate = XML_PARSER_DTD; NEXT; /* @@ -8291,8 +8291,8 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { * PEReferences. * Subsequence (markupdecl | PEReference | S)* */ - while (((RAW != ']') || (ctxt->inputNr > baseInputNr)) && - (ctxt->instate != XML_PARSER_EOF)) { + while (((RAW != ']') || (ctxt->inputNr > baseInputNr)) && + (ctxt->instate != XML_PARSER_EOF)) { const xmlChar *check = CUR_PTR; unsigned int cons = ctxt->input->consumed; @@ -8300,22 +8300,22 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { xmlParseMarkupDecl(ctxt); xmlParsePEReference(ctxt); - /* - * Conditional sections are allowed from external entities included - * by PE References in the internal subset. - */ - if ((ctxt->inputNr > 1) && (ctxt->input->filename != NULL) && - (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { - xmlParseConditionalSections(ctxt); - } + /* + * Conditional sections are allowed from external entities included + * by PE References in the internal subset. + */ + if ((ctxt->inputNr > 1) && (ctxt->input->filename != NULL) && + (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { + xmlParseConditionalSections(ctxt); + } if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "xmlParseInternalSubset: error detected in Markup declaration\n"); - if (ctxt->inputNr > baseInputNr) - xmlPopInput(ctxt); - else - break; + if (ctxt->inputNr > baseInputNr) + xmlPopInput(ctxt); + else + break; } } if (RAW == ']') { @@ -8329,7 +8329,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { */ if (RAW != '>') { xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL); - return; + return; } NEXT; } @@ -8393,7 +8393,7 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) { ctxt->instate = XML_PARSER_CONTENT; } else { xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE, - "Specification mandates value for attribute %s\n", name); + "Specification mandates value for attribute %s\n", name); return(NULL); } @@ -8550,7 +8550,7 @@ failed: GROW if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>')))) break; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "attributes construct error\n"); } @@ -8679,7 +8679,7 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt) { * @prefix: the prefix to lookup * * Lookup the namespace name for the @prefix (which ca be NULL) - * The prefix must come from the @ctxt->dict dictionary + * The prefix must come from the @ctxt->dict dictionary * * Returns the namespace name or NULL if not bound */ @@ -8737,16 +8737,16 @@ xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) { if (l == NULL) { xmlChar *tmp; - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); xmlNsErr(ctxt, XML_NS_ERR_QNAME, "Failed to parse QName '%s:'\n", p, NULL, NULL); l = xmlParseNmtoken(ctxt); - if (l == NULL) { - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); + if (l == NULL) { + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); tmp = xmlBuildQName(BAD_CAST "", p, NULL, 0); - } else { + } else { tmp = xmlBuildQName(l, p, NULL, 0); xmlFree((char *)l); } @@ -8769,8 +8769,8 @@ xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) { *prefix = p; return(l); } - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); tmp = xmlBuildQName(BAD_CAST "", l, NULL, 0); l = xmlDictLookup(ctxt->dict, tmp, -1); if (tmp != NULL) xmlFree(tmp); @@ -8870,18 +8870,18 @@ xmlParseQNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *name, * caller if it was copied, this can be detected by val[*len] == 0. */ -#define GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) \ - const xmlChar *oldbase = ctxt->input->base;\ - GROW;\ - if (ctxt->instate == XML_PARSER_EOF)\ - return(NULL);\ - if (oldbase != ctxt->input->base) {\ - ptrdiff_t delta = ctxt->input->base - oldbase;\ - start = start + delta;\ - in = in + delta;\ - }\ - end = ctxt->input->end; - +#define GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) \ + const xmlChar *oldbase = ctxt->input->base;\ + GROW;\ + if (ctxt->instate == XML_PARSER_EOF)\ + return(NULL);\ + if (oldbase != ctxt->input->base) {\ + ptrdiff_t delta = ctxt->input->base - oldbase;\ + start = start + delta;\ + in = in + delta;\ + }\ + end = ctxt->input->end; + static xmlChar * xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, int normalize) @@ -8911,7 +8911,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, end = ctxt->input->end; start = in; if (in >= end) { - GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) + GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) } if (normalize) { /* @@ -8928,7 +8928,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, in++; start = in; if (in >= end) { - GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) + GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, @@ -8942,7 +8942,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, col++; if ((*in++ == 0x20) && (*in == 0x20)) break; if (in >= end) { - GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) + GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, @@ -8971,7 +8971,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (ctxt->instate == XML_PARSER_EOF) return(NULL); if (oldbase != ctxt->input->base) { - ptrdiff_t delta = ctxt->input->base - oldbase; + ptrdiff_t delta = ctxt->input->base - oldbase; start = start + delta; in = in + delta; last = last + delta; @@ -8998,7 +8998,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, in++; col++; if (in >= end) { - GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) + GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, @@ -9075,8 +9075,8 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt, if (ctxt->attsSpecial != NULL) { int type; - type = (int) (ptrdiff_t) xmlHashQLookup2(ctxt->attsSpecial, - pref, elem, *prefix, name); + type = (int) (ptrdiff_t) xmlHashQLookup2(ctxt->attsSpecial, + pref, elem, *prefix, name); if (type != 0) normalize = 1; } @@ -9092,7 +9092,7 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt, if (normalize) { /* * Sometimes a second normalisation pass for spaces is needed - * but that only happens if charrefs or entities references + * but that only happens if charrefs or entities references * have been used in the attribute value, i.e. the attribute * value have been extracted in an allocated string already. */ @@ -9109,7 +9109,7 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt, ctxt->instate = XML_PARSER_CONTENT; } else { xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE, - "Specification mandates value for attribute %s\n", + "Specification mandates value for attribute %s\n", name); return (NULL); } @@ -9192,8 +9192,8 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref, xmlChar *attvalue; const xmlChar **atts = ctxt->atts; int maxatts = ctxt->maxatts; - int nratts, nbatts, nbdef, inputid; - int i, j, nbNs, attval; + int nratts, nbatts, nbdef, inputid; + int i, j, nbNs, attval; unsigned long cur; int nsNr = ctxt->nsNr; @@ -9209,7 +9209,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref, */ SHRINK; cur = ctxt->input->cur - ctxt->input->base; - inputid = ctxt->input->id; + inputid = ctxt->input->id; nbatts = 0; nratts = 0; nbdef = 0; @@ -9243,178 +9243,178 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref, attname = xmlParseAttribute2(ctxt, prefix, localname, &aprefix, &attvalue, &len, &alloc); - if ((attname == NULL) || (attvalue == NULL)) - goto next_attr; - if (len < 0) len = xmlStrlen(attvalue); - - if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) { - const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len); - xmlURIPtr uri; - - if (URL == NULL) { - xmlErrMemory(ctxt, "dictionary allocation failure"); - if ((attvalue != NULL) && (alloc != 0)) - xmlFree(attvalue); - localname = NULL; - goto done; - } - if (*URL != 0) { - uri = xmlParseURI((const char *) URL); - if (uri == NULL) { - xmlNsErr(ctxt, XML_WAR_NS_URI, - "xmlns: '%s' is not a valid URI\n", - URL, NULL, NULL); - } else { - if (uri->scheme == NULL) { - xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE, - "xmlns: URI %s is not absolute\n", - URL, NULL, NULL); - } - xmlFreeURI(uri); - } + if ((attname == NULL) || (attvalue == NULL)) + goto next_attr; + if (len < 0) len = xmlStrlen(attvalue); + + if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) { + const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len); + xmlURIPtr uri; + + if (URL == NULL) { + xmlErrMemory(ctxt, "dictionary allocation failure"); + if ((attvalue != NULL) && (alloc != 0)) + xmlFree(attvalue); + localname = NULL; + goto done; + } + if (*URL != 0) { + uri = xmlParseURI((const char *) URL); + if (uri == NULL) { + xmlNsErr(ctxt, XML_WAR_NS_URI, + "xmlns: '%s' is not a valid URI\n", + URL, NULL, NULL); + } else { + if (uri->scheme == NULL) { + xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE, + "xmlns: URI %s is not absolute\n", + URL, NULL, NULL); + } + xmlFreeURI(uri); + } if (URL == ctxt->str_xml_ns) { - if (attname != ctxt->str_xml) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "xml namespace URI cannot be the default namespace\n", - NULL, NULL, NULL); - } - goto next_attr; - } - if ((len == 29) && - (xmlStrEqual(URL, - BAD_CAST "http://www.w3.org/2000/xmlns/"))) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "reuse of the xmlns namespace name is forbidden\n", - NULL, NULL, NULL); - goto next_attr; - } - } - /* - * check that it's not a defined namespace - */ - for (j = 1;j <= nbNs;j++) - if (ctxt->nsTab[ctxt->nsNr - 2 * j] == NULL) - break; - if (j <= nbNs) - xmlErrAttributeDup(ctxt, NULL, attname); - else - if (nsPush(ctxt, NULL, URL) > 0) nbNs++; - - } else if (aprefix == ctxt->str_xmlns) { - const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len); - xmlURIPtr uri; - - if (attname == ctxt->str_xml) { - if (URL != ctxt->str_xml_ns) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "xml namespace prefix mapped to wrong URI\n", - NULL, NULL, NULL); - } - /* - * Do not keep a namespace definition node - */ - goto next_attr; - } - if (URL == ctxt->str_xml_ns) { - if (attname != ctxt->str_xml) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "xml namespace URI mapped to wrong prefix\n", - NULL, NULL, NULL); - } - goto next_attr; - } - if (attname == ctxt->str_xmlns) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "redefinition of the xmlns prefix is forbidden\n", - NULL, NULL, NULL); - goto next_attr; - } - if ((len == 29) && - (xmlStrEqual(URL, - BAD_CAST "http://www.w3.org/2000/xmlns/"))) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "reuse of the xmlns namespace name is forbidden\n", - NULL, NULL, NULL); - goto next_attr; - } - if ((URL == NULL) || (URL[0] == 0)) { - xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, - "xmlns:%s: Empty XML namespace is not allowed\n", - attname, NULL, NULL); - goto next_attr; - } else { - uri = xmlParseURI((const char *) URL); - if (uri == NULL) { - xmlNsErr(ctxt, XML_WAR_NS_URI, - "xmlns:%s: '%s' is not a valid URI\n", - attname, URL, NULL); - } else { - if ((ctxt->pedantic) && (uri->scheme == NULL)) { - xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE, - "xmlns:%s: URI %s is not absolute\n", - attname, URL, NULL); - } - xmlFreeURI(uri); - } - } - - /* - * check that it's not a defined namespace - */ - for (j = 1;j <= nbNs;j++) - if (ctxt->nsTab[ctxt->nsNr - 2 * j] == attname) - break; - if (j <= nbNs) - xmlErrAttributeDup(ctxt, aprefix, attname); - else - if (nsPush(ctxt, attname, URL) > 0) nbNs++; - - } else { - /* - * Add the pair to atts - */ - if ((atts == NULL) || (nbatts + 5 > maxatts)) { - if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) { - goto next_attr; - } - maxatts = ctxt->maxatts; - atts = ctxt->atts; - } - ctxt->attallocs[nratts++] = alloc; - atts[nbatts++] = attname; - atts[nbatts++] = aprefix; - /* - * The namespace URI field is used temporarily to point at the - * base of the current input buffer for non-alloced attributes. - * When the input buffer is reallocated, all the pointers become - * invalid, but they can be reconstructed later. - */ - if (alloc) - atts[nbatts++] = NULL; - else - atts[nbatts++] = ctxt->input->base; - atts[nbatts++] = attvalue; - attvalue += len; - atts[nbatts++] = attvalue; - /* - * tag if some deallocation is needed - */ - if (alloc != 0) attval = 1; - attvalue = NULL; /* moved into atts */ - } - -next_attr: - if ((attvalue != NULL) && (alloc != 0)) { - xmlFree(attvalue); - attvalue = NULL; - } - + if (attname != ctxt->str_xml) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "xml namespace URI cannot be the default namespace\n", + NULL, NULL, NULL); + } + goto next_attr; + } + if ((len == 29) && + (xmlStrEqual(URL, + BAD_CAST "http://www.w3.org/2000/xmlns/"))) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "reuse of the xmlns namespace name is forbidden\n", + NULL, NULL, NULL); + goto next_attr; + } + } + /* + * check that it's not a defined namespace + */ + for (j = 1;j <= nbNs;j++) + if (ctxt->nsTab[ctxt->nsNr - 2 * j] == NULL) + break; + if (j <= nbNs) + xmlErrAttributeDup(ctxt, NULL, attname); + else + if (nsPush(ctxt, NULL, URL) > 0) nbNs++; + + } else if (aprefix == ctxt->str_xmlns) { + const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len); + xmlURIPtr uri; + + if (attname == ctxt->str_xml) { + if (URL != ctxt->str_xml_ns) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "xml namespace prefix mapped to wrong URI\n", + NULL, NULL, NULL); + } + /* + * Do not keep a namespace definition node + */ + goto next_attr; + } + if (URL == ctxt->str_xml_ns) { + if (attname != ctxt->str_xml) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "xml namespace URI mapped to wrong prefix\n", + NULL, NULL, NULL); + } + goto next_attr; + } + if (attname == ctxt->str_xmlns) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "redefinition of the xmlns prefix is forbidden\n", + NULL, NULL, NULL); + goto next_attr; + } + if ((len == 29) && + (xmlStrEqual(URL, + BAD_CAST "http://www.w3.org/2000/xmlns/"))) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "reuse of the xmlns namespace name is forbidden\n", + NULL, NULL, NULL); + goto next_attr; + } + if ((URL == NULL) || (URL[0] == 0)) { + xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE, + "xmlns:%s: Empty XML namespace is not allowed\n", + attname, NULL, NULL); + goto next_attr; + } else { + uri = xmlParseURI((const char *) URL); + if (uri == NULL) { + xmlNsErr(ctxt, XML_WAR_NS_URI, + "xmlns:%s: '%s' is not a valid URI\n", + attname, URL, NULL); + } else { + if ((ctxt->pedantic) && (uri->scheme == NULL)) { + xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE, + "xmlns:%s: URI %s is not absolute\n", + attname, URL, NULL); + } + xmlFreeURI(uri); + } + } + + /* + * check that it's not a defined namespace + */ + for (j = 1;j <= nbNs;j++) + if (ctxt->nsTab[ctxt->nsNr - 2 * j] == attname) + break; + if (j <= nbNs) + xmlErrAttributeDup(ctxt, aprefix, attname); + else + if (nsPush(ctxt, attname, URL) > 0) nbNs++; + + } else { + /* + * Add the pair to atts + */ + if ((atts == NULL) || (nbatts + 5 > maxatts)) { + if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) { + goto next_attr; + } + maxatts = ctxt->maxatts; + atts = ctxt->atts; + } + ctxt->attallocs[nratts++] = alloc; + atts[nbatts++] = attname; + atts[nbatts++] = aprefix; + /* + * The namespace URI field is used temporarily to point at the + * base of the current input buffer for non-alloced attributes. + * When the input buffer is reallocated, all the pointers become + * invalid, but they can be reconstructed later. + */ + if (alloc) + atts[nbatts++] = NULL; + else + atts[nbatts++] = ctxt->input->base; + atts[nbatts++] = attvalue; + attvalue += len; + atts[nbatts++] = attvalue; + /* + * tag if some deallocation is needed + */ + if (alloc != 0) attval = 1; + attvalue = NULL; /* moved into atts */ + } + +next_attr: + if ((attvalue != NULL) && (alloc != 0)) { + xmlFree(attvalue); + attvalue = NULL; + } + GROW if (ctxt->instate == XML_PARSER_EOF) break; if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>')))) break; - if (SKIP_BLANKS == 0) { + if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "attributes construct error\n"); break; @@ -9428,27 +9428,27 @@ next_attr: GROW; } - if (ctxt->input->id != inputid) { - xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, - "Unexpected change of input\n"); - localname = NULL; - goto done; - } - - /* Reconstruct attribute value pointers. */ - for (i = 0, j = 0; j < nratts; i += 5, j++) { - if (atts[i+2] != NULL) { - /* - * Arithmetic on dangling pointers is technically undefined - * behavior, but well... - */ - ptrdiff_t offset = ctxt->input->base - atts[i+2]; - atts[i+2] = NULL; /* Reset repurposed namespace URI */ - atts[i+3] += offset; /* value */ - atts[i+4] += offset; /* valuend */ - } - } - + if (ctxt->input->id != inputid) { + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, + "Unexpected change of input\n"); + localname = NULL; + goto done; + } + + /* Reconstruct attribute value pointers. */ + for (i = 0, j = 0; j < nratts; i += 5, j++) { + if (atts[i+2] != NULL) { + /* + * Arithmetic on dangling pointers is technically undefined + * behavior, but well... + */ + ptrdiff_t offset = ctxt->input->base - atts[i+2]; + atts[i+2] = NULL; /* Reset repurposed namespace URI */ + atts[i+3] += offset; /* value */ + atts[i+4] += offset; /* valuend */ + } + } + /* * The attributes defaulting */ @@ -9506,8 +9506,8 @@ next_attr: if ((atts == NULL) || (nbatts + 5 > maxatts)) { if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) { - localname = NULL; - goto done; + localname = NULL; + goto done; } maxatts = ctxt->maxatts; atts = ctxt->atts; @@ -9594,7 +9594,7 @@ next_attr: nsname, 0, NULL, nbatts / 5, nbdef, atts); } -done: +done: /* * Free up attribute allocated strings if needed */ @@ -9626,7 +9626,7 @@ static void xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URI, int line, int nsNr, int tlen) { const xmlChar *name; - size_t curLength; + size_t curLength; GROW; if ((RAW != '<') || (NXT(1) != '/')) { @@ -9635,11 +9635,11 @@ xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix, } SKIP(2); - curLength = ctxt->input->end - ctxt->input->cur; - if ((tlen > 0) && (curLength >= (size_t)tlen) && - (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { - if ((curLength >= (size_t)(tlen + 1)) && - (ctxt->input->cur[tlen] == '>')) { + curLength = ctxt->input->end - ctxt->input->cur; + if ((tlen > 0) && (curLength >= (size_t)tlen) && + (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { + if ((curLength >= (size_t)(tlen + 1)) && + (ctxt->input->cur[tlen] == '>')) { ctxt->input->cur += tlen + 1; ctxt->input->col += tlen + 1; goto done; @@ -9817,8 +9817,8 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) { void xmlParseContent(xmlParserCtxtPtr ctxt) { - int nameNr = ctxt->nameNr; - + int nameNr = ctxt->nameNr; + GROW; while ((RAW != 0) && (ctxt->instate != XML_PARSER_EOF)) { @@ -9854,13 +9854,13 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { * Fourth case : a sub-element. */ else if (*cur == '<') { - if (NXT(1) == '/') { - if (ctxt->nameNr <= nameNr) - break; - xmlParseElementEnd(ctxt); - } else { - xmlParseElementStart(ctxt); - } + if (NXT(1) == '/') { + if (ctxt->nameNr <= nameNr) + break; + xmlParseElementEnd(ctxt); + } else { + xmlParseElementStart(ctxt); + } } /* @@ -9885,7 +9885,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { if ((cons == ctxt->input->consumed) && (test == CUR_PTR)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "detected an error in element content\n"); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); break; } } @@ -9895,7 +9895,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { * xmlParseElement: * @ctxt: an XML parser context * - * parse an XML element + * parse an XML element * * [39] element ::= EmptyElemTag | STag content ETag * @@ -9907,23 +9907,23 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { void xmlParseElement(xmlParserCtxtPtr ctxt) { - if (xmlParseElementStart(ctxt) != 0) - return; - xmlParseContent(ctxt); - if (ctxt->instate == XML_PARSER_EOF) - return; - xmlParseElementEnd(ctxt); -} - -/** - * xmlParseElementStart: - * @ctxt: an XML parser context - * - * Parse the start of an XML element. Returns -1 in case of error, 0 if an - * opening tag was parsed, 1 if an empty element was parsed. - */ -static int -xmlParseElementStart(xmlParserCtxtPtr ctxt) { + if (xmlParseElementStart(ctxt) != 0) + return; + xmlParseContent(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + return; + xmlParseElementEnd(ctxt); +} + +/** + * xmlParseElementStart: + * @ctxt: an XML parser context + * + * Parse the start of an XML element. Returns -1 in case of error, 0 if an + * opening tag was parsed, 1 if an empty element was parsed. + */ +static int +xmlParseElementStart(xmlParserCtxtPtr ctxt) { const xmlChar *name; const xmlChar *prefix = NULL; const xmlChar *URI = NULL; @@ -9937,8 +9937,8 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) { xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR, "Excessive depth in document: %d use XML_PARSE_HUGE option\n", xmlParserMaxDepth); - xmlHaltParser(ctxt); - return(-1); + xmlHaltParser(ctxt); + return(-1); } /* Capture start position */ @@ -9965,17 +9965,17 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) { name = xmlParseStartTag(ctxt); #endif /* LIBXML_SAX1_ENABLED */ if (ctxt->instate == XML_PARSER_EOF) - return(-1); + return(-1); if (name == NULL) { spacePop(ctxt); - return(-1); - } - if (ctxt->sax2) - nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr); -#ifdef LIBXML_SAX1_ENABLED - else - namePush(ctxt, name); -#endif /* LIBXML_SAX1_ENABLED */ + return(-1); + } + if (ctxt->sax2) + nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr); +#ifdef LIBXML_SAX1_ENABLED + else + namePush(ctxt, name); +#endif /* LIBXML_SAX1_ENABLED */ ret = ctxt->node; #ifdef LIBXML_VALID_ENABLED @@ -10016,7 +10016,7 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) { node_info.node = ret; xmlParserAddNodeInfo(ctxt, &node_info); } - return(1); + return(1); } if (RAW == '>') { NEXT1; @@ -10044,39 +10044,39 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) { node_info.node = ret; xmlParserAddNodeInfo(ctxt, &node_info); } - return(-1); + return(-1); } - return(0); -} + return(0); +} + +/** + * xmlParseElementEnd: + * @ctxt: an XML parser context + * + * Parse the end of an XML element. + */ +static void +xmlParseElementEnd(xmlParserCtxtPtr ctxt) { + xmlParserNodeInfo node_info; + xmlNodePtr ret = ctxt->node; -/** - * xmlParseElementEnd: - * @ctxt: an XML parser context - * - * Parse the end of an XML element. - */ -static void -xmlParseElementEnd(xmlParserCtxtPtr ctxt) { - xmlParserNodeInfo node_info; - xmlNodePtr ret = ctxt->node; + if (ctxt->nameNr <= 0) + return; - if (ctxt->nameNr <= 0) - return; - /* * parse the end of tag: '</' should be here. */ if (ctxt->sax2) { - const xmlChar *prefix = ctxt->pushTab[ctxt->nameNr * 3 - 3]; - const xmlChar *URI = ctxt->pushTab[ctxt->nameNr * 3 - 2]; - int nsNr = (ptrdiff_t) ctxt->pushTab[ctxt->nameNr * 3 - 1]; - xmlParseEndTag2(ctxt, prefix, URI, 0, nsNr, 0); + const xmlChar *prefix = ctxt->pushTab[ctxt->nameNr * 3 - 3]; + const xmlChar *URI = ctxt->pushTab[ctxt->nameNr * 3 - 2]; + int nsNr = (ptrdiff_t) ctxt->pushTab[ctxt->nameNr * 3 - 1]; + xmlParseEndTag2(ctxt, prefix, URI, 0, nsNr, 0); namePop(ctxt); } #ifdef LIBXML_SAX1_ENABLED - else - xmlParseEndTag1(ctxt, 0); + else + xmlParseEndTag1(ctxt, 0); #endif /* LIBXML_SAX1_ENABLED */ /* @@ -10292,8 +10292,8 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { encoding = xmlParseEncName(ctxt); if (RAW != '"') { xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL); - xmlFree((xmlChar *) encoding); - return(NULL); + xmlFree((xmlChar *) encoding); + return(NULL); } else NEXT; } else if (RAW == '\''){ @@ -10301,8 +10301,8 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { encoding = xmlParseEncName(ctxt); if (RAW != '\'') { xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL); - xmlFree((xmlChar *) encoding); - return(NULL); + xmlFree((xmlChar *) encoding); + return(NULL); } else NEXT; } else { @@ -10318,7 +10318,7 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { } /* - * UTF-16 encoding switch has already taken place at this stage, + * UTF-16 encoding switch has already taken place at this stage, * more over the little-endian/big-endian selection is already done */ if ((encoding != NULL) && @@ -10359,11 +10359,11 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { handler = xmlFindCharEncodingHandler((const char *) encoding); if (handler != NULL) { - if (xmlSwitchToEncoding(ctxt, handler) < 0) { - /* failed to convert */ - ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; - return(NULL); - } + if (xmlSwitchToEncoding(ctxt, handler) < 0) { + /* failed to convert */ + ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; + return(NULL); + } } else { xmlFatalErrMsgStr(ctxt, XML_ERR_UNSUPPORTED_ENCODING, "Unsupported encoding %s\n", encoding); @@ -10532,8 +10532,8 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n"); } xmlParseEncodingDecl(ctxt); - if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) || - (ctxt->instate == XML_PARSER_EOF)) { + if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) || + (ctxt->instate == XML_PARSER_EOF)) { /* * The XML REC instructs us to stop parsing right here */ @@ -10657,7 +10657,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { if (CUR == 0) { xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL); - return(-1); + return(-1); } /* @@ -10675,8 +10675,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { * Note that we will switch encoding on the fly. */ xmlParseXMLDecl(ctxt); - if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) || - (ctxt->instate == XML_PARSER_EOF)) { + if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) || + (ctxt->instate == XML_PARSER_EOF)) { /* * The XML REC instructs us to stop parsing right here */ @@ -11045,17 +11045,17 @@ xmlParseGetLasts(xmlParserCtxtPtr ctxt, const xmlChar **lastlt, } /** * xmlCheckCdataPush: - * @cur: pointer to the block of characters + * @cur: pointer to the block of characters * @len: length of the block in bytes - * @complete: 1 if complete CDATA block is passed in, 0 if partial block + * @complete: 1 if complete CDATA block is passed in, 0 if partial block * * Check that the block of characters is okay as SCdata content [20] * * Returns the number of bytes to pass if okay, a negative index where an - * UTF-8 error occurred otherwise + * UTF-8 error occurred otherwise */ static int -xmlCheckCdataPush(const xmlChar *utf, int len, int complete) { +xmlCheckCdataPush(const xmlChar *utf, int len, int complete) { int ix; unsigned char c; int codepoint; @@ -11073,7 +11073,7 @@ xmlCheckCdataPush(const xmlChar *utf, int len, int complete) { else return(-ix); } else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */ - if (ix + 2 > len) return(complete ? -ix : ix); + if (ix + 2 > len) return(complete ? -ix : ix); if ((utf[ix+1] & 0xc0 ) != 0x80) return(-ix); codepoint = (utf[ix] & 0x1f) << 6; @@ -11082,7 +11082,7 @@ xmlCheckCdataPush(const xmlChar *utf, int len, int complete) { return(-ix); ix += 2; } else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */ - if (ix + 3 > len) return(complete ? -ix : ix); + if (ix + 3 > len) return(complete ? -ix : ix); if (((utf[ix+1] & 0xc0) != 0x80) || ((utf[ix+2] & 0xc0) != 0x80)) return(-ix); @@ -11093,7 +11093,7 @@ xmlCheckCdataPush(const xmlChar *utf, int len, int complete) { return(-ix); ix += 3; } else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */ - if (ix + 4 > len) return(complete ? -ix : ix); + if (ix + 4 > len) return(complete ? -ix : ix); if (((utf[ix+1] & 0xc0) != 0x80) || ((utf[ix+2] & 0xc0) != 0x80) || ((utf[ix+3] & 0xc0) != 0x80)) @@ -11201,7 +11201,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { else { /* * If we are operating on converted input, try to flush - * remaining chars to avoid them stalling in the non-converted + * remaining chars to avoid them stalling in the non-converted * buffer. But do not do this in document start where * encoding="..." may not have been read and we work on a * guessed encoding. @@ -11264,7 +11264,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "PP: entering EOF\n"); @@ -11297,7 +11297,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { * The XML REC instructs us to stop parsing right * here */ - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); return(0); } ctxt->standalone = ctxt->input->standalone; @@ -11353,7 +11353,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { cur = ctxt->input->cur[0]; if (cur != '<') { xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) ctxt->sax->endDocument(ctxt->userData); goto done; @@ -11385,7 +11385,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { goto done; if (name == NULL) { spacePop(ctxt); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) ctxt->sax->endDocument(ctxt->userData); goto done; @@ -11547,7 +11547,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { if ((cons == ctxt->input->consumed) && (test == CUR_PTR)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "detected an error in element content\n"); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); break; } break; @@ -11566,10 +11566,10 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { } if (ctxt->sax2) { xmlParseEndTag2(ctxt, - (void *) ctxt->pushTab[ctxt->nameNr * 3 - 3], - (void *) ctxt->pushTab[ctxt->nameNr * 3 - 2], 0, - (int) (ptrdiff_t) - ctxt->pushTab[ctxt->nameNr * 3 - 1], 0); + (void *) ctxt->pushTab[ctxt->nameNr * 3 - 3], + (void *) ctxt->pushTab[ctxt->nameNr * 3 - 2], 0, + (int) (ptrdiff_t) + ctxt->pushTab[ctxt->nameNr * 3 - 1], 0); nameNsPop(ctxt); } #ifdef LIBXML_SAX1_ENABLED @@ -11597,7 +11597,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { int tmp; tmp = xmlCheckCdataPush(ctxt->input->cur, - XML_PARSER_BIG_BUFFER_SIZE, 0); + XML_PARSER_BIG_BUFFER_SIZE, 0); if (tmp < 0) { tmp = -tmp; ctxt->input->cur += tmp; @@ -11620,7 +11620,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { } else { int tmp; - tmp = xmlCheckCdataPush(ctxt->input->cur, base, 1); + tmp = xmlCheckCdataPush(ctxt->input->cur, base, 1); if ((tmp < 0) || (tmp != base)) { tmp = -tmp; ctxt->input->cur += tmp; @@ -11869,7 +11869,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { goto done; } else { xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "PP: entering EOF\n"); @@ -12233,7 +12233,7 @@ xmldecl_done: res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk); if (res < 0) { ctxt->errNo = XML_PARSER_EOF; - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); return (XML_PARSER_EOF); } xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur); @@ -12255,7 +12255,7 @@ xmldecl_done: /* TODO 2.6.0 */ xmlGenericError(xmlGenericErrorContext, "xmlParseChunk: encoder error\n"); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); return(XML_ERR_INVALID_ENCODING); } xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current); @@ -12288,7 +12288,7 @@ xmldecl_done: ((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup"); - xmlHaltParser(ctxt); + xmlHaltParser(ctxt); } if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) return(ctxt->errNo); @@ -12469,55 +12469,55 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, #endif /* LIBXML_PUSH_ENABLED */ /** - * xmlHaltParser: + * xmlHaltParser: * @ctxt: an XML parser context * - * Blocks further parser processing don't override error - * for internal use + * Blocks further parser processing don't override error + * for internal use */ -static void -xmlHaltParser(xmlParserCtxtPtr ctxt) { +static void +xmlHaltParser(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; ctxt->instate = XML_PARSER_EOF; ctxt->disableSAX = 1; - while (ctxt->inputNr > 1) - xmlFreeInputStream(inputPop(ctxt)); + while (ctxt->inputNr > 1) + xmlFreeInputStream(inputPop(ctxt)); if (ctxt->input != NULL) { - /* - * in case there was a specific allocation deallocate before - * overriding base - */ - if (ctxt->input->free != NULL) { - ctxt->input->free((xmlChar *) ctxt->input->base); - ctxt->input->free = NULL; - } - if (ctxt->input->buf != NULL) { - xmlFreeParserInputBuffer(ctxt->input->buf); - ctxt->input->buf = NULL; - } + /* + * in case there was a specific allocation deallocate before + * overriding base + */ + if (ctxt->input->free != NULL) { + ctxt->input->free((xmlChar *) ctxt->input->base); + ctxt->input->free = NULL; + } + if (ctxt->input->buf != NULL) { + xmlFreeParserInputBuffer(ctxt->input->buf); + ctxt->input->buf = NULL; + } ctxt->input->cur = BAD_CAST""; - ctxt->input->length = 0; + ctxt->input->length = 0; ctxt->input->base = ctxt->input->cur; - ctxt->input->end = ctxt->input->cur; + ctxt->input->end = ctxt->input->cur; } } /** - * xmlStopParser: - * @ctxt: an XML parser context - * - * Blocks further parser processing - */ -void -xmlStopParser(xmlParserCtxtPtr ctxt) { - if (ctxt == NULL) - return; - xmlHaltParser(ctxt); - ctxt->errNo = XML_ERR_USER_STOP; -} - -/** + * xmlStopParser: + * @ctxt: an XML parser context + * + * Blocks further parser processing + */ +void +xmlStopParser(xmlParserCtxtPtr ctxt) { + if (ctxt == NULL) + return; + xmlHaltParser(ctxt); + ctxt->errNo = XML_ERR_USER_STOP; +} + +/** * xmlCreateIOParserCtxt: * @sax: a SAX handler * @user_data: The user data returned on SAX callbacks @@ -13261,23 +13261,23 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, /* * Also record the size of the entity parsed */ - if (ctxt->input != NULL && oldctxt != NULL) { + if (ctxt->input != NULL && oldctxt != NULL) { oldctxt->sizeentities += ctxt->input->consumed; oldctxt->sizeentities += (ctxt->input->cur - ctxt->input->base); } /* * And record the last error if any */ - if ((oldctxt != NULL) && (ctxt->lastError.code != XML_ERR_OK)) + if ((oldctxt != NULL) && (ctxt->lastError.code != XML_ERR_OK)) xmlCopyError(&ctxt->lastError, &oldctxt->lastError); if (sax != NULL) ctxt->sax = oldsax; - if (oldctxt != NULL) { - oldctxt->node_seq.maximum = ctxt->node_seq.maximum; - oldctxt->node_seq.length = ctxt->node_seq.length; - oldctxt->node_seq.buffer = ctxt->node_seq.buffer; - } + if (oldctxt != NULL) { + oldctxt->node_seq.maximum = ctxt->node_seq.maximum; + oldctxt->node_seq.length = ctxt->node_seq.length; + oldctxt->node_seq.buffer = ctxt->node_seq.buffer; + } ctxt->node_seq.maximum = 0; ctxt->node_seq.length = 0; ctxt->node_seq.buffer = NULL; @@ -13402,7 +13402,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, ctxt->userData = ctxt; if (ctxt->dict != NULL) xmlDictFree(ctxt->dict); ctxt->dict = oldctxt->dict; - ctxt->input_id = oldctxt->input_id + 1; + ctxt->input_id = oldctxt->input_id + 1; ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3); ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5); ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36); @@ -13656,7 +13656,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, xmlDetectSAX2(ctxt); ctxt->myDoc = doc; /* parsing in context, i.e. as within existing content */ - ctxt->input_id = 2; + ctxt->input_id = 2; ctxt->instate = XML_PARSER_CONTENT; fake = xmlNewComment(NULL); @@ -13869,7 +13869,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, newDoc->oldNs = doc->oldNs; } ctxt->instate = XML_PARSER_CONTENT; - ctxt->input_id = 2; + ctxt->input_id = 2; ctxt->depth = depth; /* @@ -13928,8 +13928,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, xmlFreeParserCtxt(ctxt); newDoc->intSubset = NULL; newDoc->extSubset = NULL; - if(doc != NULL) - newDoc->oldNs = NULL; + if(doc != NULL) + newDoc->oldNs = NULL; xmlFreeDoc(newDoc); return(ret); @@ -14031,17 +14031,17 @@ xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID, if (pctx != NULL) { ctxt->options = pctx->options; ctxt->_private = pctx->_private; - /* - * this is a subparser of pctx, so the input_id should be - * incremented to distinguish from main entity - */ - ctxt->input_id = pctx->input_id + 1; + /* + * this is a subparser of pctx, so the input_id should be + * incremented to distinguish from main entity + */ + ctxt->input_id = pctx->input_id + 1; } - /* Don't read from stdin. */ - if (xmlStrcmp(URL, BAD_CAST "-") == 0) - URL = BAD_CAST "./-"; - + /* Don't read from stdin. */ + if (xmlStrcmp(URL, BAD_CAST "-") == 0) + URL = BAD_CAST "./-"; + uri = xmlBuildURI(URL, base); if (uri == NULL) { @@ -14830,7 +14830,7 @@ xmlCleanupParser(void) { * DICT_FREE: * @str: a string * - * Free a string if it is not owned by the "dict" dictionary in the + * Free a string if it is not owned by the "dict" dictionary in the * current scope */ #define DICT_FREE(str) \ @@ -14921,7 +14921,7 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt) xmlInitNodeInfoSeq(&ctxt->node_seq); if (ctxt->attsDefault != NULL) { - xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); + xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); ctxt->attsDefault = NULL; } if (ctxt->attsSpecial != NULL) { diff --git a/contrib/libs/libxml/parserInternals.c b/contrib/libs/libxml/parserInternals.c index 271de8816e..b00cd08ec2 100644 --- a/contrib/libs/libxml/parserInternals.c +++ b/contrib/libs/libxml/parserInternals.c @@ -10,7 +10,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) && !defined (__CYGWIN__) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' @@ -32,8 +32,8 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif #include <libxml/xmlmemory.h> @@ -55,10 +55,10 @@ #include <libxml/globals.h> #include <libxml/chvalid.h> -#define CUR(ctxt) ctxt->input->cur -#define END(ctxt) ctxt->input->end -#define VALID_CTXT(ctxt) (CUR(ctxt) <= END(ctxt)) - +#define CUR(ctxt) ctxt->input->cur +#define END(ctxt) ctxt->input->end +#define VALID_CTXT(ctxt) (CUR(ctxt) <= END(ctxt)) + #include "buf.h" #include "enc.h" @@ -169,7 +169,7 @@ __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr, * * Handle an internal error */ -static void LIBXML_ATTR_FORMAT(2,0) +static void LIBXML_ATTR_FORMAT(2,0) xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str) { if ((ctxt != NULL) && (ctxt->disableSAX != 0) && @@ -197,7 +197,7 @@ xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str) * * n encoding error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlErrEncodingInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { @@ -298,7 +298,7 @@ xmlParserInputRead(xmlParserInputPtr in ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUS */ int xmlParserInputGrow(xmlParserInputPtr in, int len) { - int ret; + int ret; size_t indx; const xmlChar *content; @@ -426,101 +426,101 @@ xmlNextChar(xmlParserCtxtPtr ctxt) (ctxt->input == NULL)) return; - if (!(VALID_CTXT(ctxt))) { - xmlErrInternal(ctxt, "Parser input data memory error\n", NULL); - ctxt->errNo = XML_ERR_INTERNAL_ERROR; - xmlStopParser(ctxt); - return; - } - - if ((*ctxt->input->cur == 0) && - (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) { - return; - } - + if (!(VALID_CTXT(ctxt))) { + xmlErrInternal(ctxt, "Parser input data memory error\n", NULL); + ctxt->errNo = XML_ERR_INTERNAL_ERROR; + xmlStopParser(ctxt); + return; + } + + if ((*ctxt->input->cur == 0) && + (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) { + return; + } + if (ctxt->charset == XML_CHAR_ENCODING_UTF8) { - const unsigned char *cur; - unsigned char c; - - /* - * 2.11 End-of-Line Handling - * the literal two-character sequence "#xD#xA" or a standalone - * literal #xD, an XML processor must pass to the application - * the single character #xA. - */ - if (*(ctxt->input->cur) == '\n') { - ctxt->input->line++; ctxt->input->col = 1; - } else - ctxt->input->col++; - - /* - * We are supposed to handle UTF8, check it's valid - * From rfc2044: encoding of the Unicode values on UTF-8: - * - * UCS-4 range (hex.) UTF-8 octet sequence (binary) - * 0000 0000-0000 007F 0xxxxxxx - * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx - * - * Check for the 0x110000 limit too - */ - cur = ctxt->input->cur; - - c = *cur; - if (c & 0x80) { - if (c == 0xC0) - goto encoding_error; - if (cur[1] == 0) { - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); - cur = ctxt->input->cur; - } - if ((cur[1] & 0xc0) != 0x80) - goto encoding_error; - if ((c & 0xe0) == 0xe0) { - unsigned int val; - - if (cur[2] == 0) { + const unsigned char *cur; + unsigned char c; + + /* + * 2.11 End-of-Line Handling + * the literal two-character sequence "#xD#xA" or a standalone + * literal #xD, an XML processor must pass to the application + * the single character #xA. + */ + if (*(ctxt->input->cur) == '\n') { + ctxt->input->line++; ctxt->input->col = 1; + } else + ctxt->input->col++; + + /* + * We are supposed to handle UTF8, check it's valid + * From rfc2044: encoding of the Unicode values on UTF-8: + * + * UCS-4 range (hex.) UTF-8 octet sequence (binary) + * 0000 0000-0000 007F 0xxxxxxx + * 0000 0080-0000 07FF 110xxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * + * Check for the 0x110000 limit too + */ + cur = ctxt->input->cur; + + c = *cur; + if (c & 0x80) { + if (c == 0xC0) + goto encoding_error; + if (cur[1] == 0) { + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); + cur = ctxt->input->cur; + } + if ((cur[1] & 0xc0) != 0x80) + goto encoding_error; + if ((c & 0xe0) == 0xe0) { + unsigned int val; + + if (cur[2] == 0) { xmlParserInputGrow(ctxt->input, INPUT_CHUNK); cur = ctxt->input->cur; } - if ((cur[2] & 0xc0) != 0x80) + if ((cur[2] & 0xc0) != 0x80) goto encoding_error; - if ((c & 0xf0) == 0xf0) { - if (cur[3] == 0) { + if ((c & 0xf0) == 0xf0) { + if (cur[3] == 0) { xmlParserInputGrow(ctxt->input, INPUT_CHUNK); cur = ctxt->input->cur; } - if (((c & 0xf8) != 0xf0) || - ((cur[3] & 0xc0) != 0x80)) + if (((c & 0xf8) != 0xf0) || + ((cur[3] & 0xc0) != 0x80)) goto encoding_error; - /* 4-byte code */ - ctxt->input->cur += 4; - val = (cur[0] & 0x7) << 18; - val |= (cur[1] & 0x3f) << 12; - val |= (cur[2] & 0x3f) << 6; - val |= cur[3] & 0x3f; - } else { - /* 3-byte code */ - ctxt->input->cur += 3; - val = (cur[0] & 0xf) << 12; - val |= (cur[1] & 0x3f) << 6; - val |= cur[2] & 0x3f; - } - if (((val > 0xd7ff) && (val < 0xe000)) || - ((val > 0xfffd) && (val < 0x10000)) || - (val >= 0x110000)) { - xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR, - "Char 0x%X out of allowed range\n", - val); - } + /* 4-byte code */ + ctxt->input->cur += 4; + val = (cur[0] & 0x7) << 18; + val |= (cur[1] & 0x3f) << 12; + val |= (cur[2] & 0x3f) << 6; + val |= cur[3] & 0x3f; + } else { + /* 3-byte code */ + ctxt->input->cur += 3; + val = (cur[0] & 0xf) << 12; + val |= (cur[1] & 0x3f) << 6; + val |= cur[2] & 0x3f; + } + if (((val > 0xd7ff) && (val < 0xe000)) || + ((val > 0xfffd) && (val < 0x10000)) || + (val >= 0x110000)) { + xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR, + "Char 0x%X out of allowed range\n", + val); + } } else - /* 2-byte code */ - ctxt->input->cur += 2; - } else - /* 1-byte code */ - ctxt->input->cur++; + /* 2-byte code */ + ctxt->input->cur += 2; + } else + /* 1-byte code */ + ctxt->input->cur++; - ctxt->nbChars++; + ctxt->nbChars++; } else { /* * Assume it's a fixed length encoding (1) with @@ -535,8 +535,8 @@ xmlNextChar(xmlParserCtxtPtr ctxt) ctxt->input->cur++; ctxt->nbChars++; } - if (*ctxt->input->cur == 0) - xmlParserInputGrow(ctxt->input, INPUT_CHUNK); + if (*ctxt->input->cur == 0) + xmlParserInputGrow(ctxt->input, INPUT_CHUNK); return; encoding_error: /* @@ -703,7 +703,7 @@ encoding_error: /* * An encoding problem may arise from a truncated input buffer * splitting a character in the middle. In that case do not raise - * an error but return 0 to indicate an end of stream problem + * an error but return 0 to indicate an end of stream problem */ if (ctxt->input->end - ctxt->input->cur < 4) { *len = 0; @@ -816,7 +816,7 @@ encoding_error: /* * An encoding problem may arise from a truncated input buffer * splitting a character in the middle. In that case do not raise - * an error but return 0 to indicate an end of stream problem + * an error but return 0 to indicate an end of stream problem */ if ((ctxt == NULL) || (ctxt->input == NULL) || (ctxt->input->end - ctxt->input->cur < 4)) { @@ -934,7 +934,7 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc) { xmlCharEncodingHandlerPtr handler; int len = -1; - int ret; + int ret; if (ctxt == NULL) return(-1); switch (enc) { @@ -1092,25 +1092,25 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc) break; } } - /* - * TODO: We could recover from errors in external entities if we - * didn't stop the parser. But most callers of this function don't - * check the return value. - */ - if (handler == NULL) { - xmlStopParser(ctxt); + /* + * TODO: We could recover from errors in external entities if we + * didn't stop the parser. But most callers of this function don't + * check the return value. + */ + if (handler == NULL) { + xmlStopParser(ctxt); return(-1); - } + } ctxt->charset = XML_CHAR_ENCODING_UTF8; - ret = xmlSwitchToEncodingInt(ctxt, handler, len); - if ((ret < 0) || (ctxt->errNo == XML_I18N_CONV_FAILED)) { - /* - * on encoding conversion errors, stop the parser - */ - xmlStopParser(ctxt); - ctxt->errNo = XML_I18N_CONV_FAILED; - } - return(ret); + ret = xmlSwitchToEncodingInt(ctxt, handler, len); + if ((ret < 0) || (ctxt->errNo == XML_I18N_CONV_FAILED)) { + /* + * on encoding conversion errors, stop the parser + */ + xmlStopParser(ctxt); + ctxt->errNo = XML_I18N_CONV_FAILED; + } + return(ret); } /** @@ -1138,7 +1138,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, if (input->buf != NULL) { if (input->buf->encoder != NULL) { /* - * Check in case the auto encoding detection triggered + * Check in case the auto encoding detection triggered * in already. */ if (input->buf->encoder == handler) @@ -1224,7 +1224,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, */ nbchars = xmlCharEncFirstLineInput(input->buf, len); } - xmlBufResetInput(input->buf->buffer, input); + xmlBufResetInput(input->buf->buffer, input); if (nbchars < 0) { xmlErrInternal(ctxt, "switching encoding: encoder error\n", @@ -1240,18 +1240,18 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, * size to be able to convert the buffer. */ xmlErrInternal(ctxt, "switching encoding : no input\n", NULL); - /* - * Callers assume that the input buffer takes ownership of the - * encoding handler. xmlCharEncCloseFunc frees unregistered - * handlers and avoids a memory leak. - */ - xmlCharEncCloseFunc(handler); + /* + * Callers assume that the input buffer takes ownership of the + * encoding handler. xmlCharEncCloseFunc frees unregistered + * handlers and avoids a memory leak. + */ + xmlCharEncCloseFunc(handler); return (-1); } - /* - * We should actually raise an error here, see issue #34. - */ - xmlCharEncCloseFunc(handler); + /* + * We should actually raise an error here, see issue #34. + */ + xmlCharEncCloseFunc(handler); return (0); } @@ -1473,8 +1473,8 @@ xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { if (entity->URI != NULL) input->filename = (char *) xmlStrdup((xmlChar *) entity->URI); input->base = entity->content; - if (entity->length == 0) - entity->length = xmlStrlen(entity->content); + if (entity->length == 0) + entity->length = xmlStrlen(entity->content); input->cur = entity->content; input->length = entity->length; input->end = &entity->content[input->length]; @@ -1805,7 +1805,7 @@ xmlFreeParserCtxt(xmlParserCtxtPtr ctxt) if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab); if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs); if (ctxt->attsDefault != NULL) - xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); + xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator); if (ctxt->attsSpecial != NULL) xmlHashFree(ctxt->attsSpecial, NULL); if (ctxt->freeElems != NULL) { diff --git a/contrib/libs/libxml/pattern.c b/contrib/libs/libxml/pattern.c index 10faaa421b..27e96946b6 100644 --- a/contrib/libs/libxml/pattern.c +++ b/contrib/libs/libxml/pattern.c @@ -1,5 +1,5 @@ /* - * pattern.c: Implementation of selectors for nodes + * pattern.c: Implementation of selectors for nodes * * Reference: * http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/ @@ -55,7 +55,7 @@ /* * NOTE: Those private flags (XML_STREAM_xxx) are used * in _xmlStreamCtxt->flag. They extend the public -* xmlPatternFlags, so be careful not to interfere with the +* xmlPatternFlags, so be careful not to interfere with the * reserved values for xmlPatternFlags. */ #define XML_STREAM_FINAL_IS_ANY_NODE 1<<14 @@ -229,11 +229,11 @@ xmlNewPattern(void) { */ void xmlFreePattern(xmlPatternPtr comp) { - xmlFreePatternList(comp); -} - -static void -xmlFreePatternInternal(xmlPatternPtr comp) { + xmlFreePatternList(comp); +} + +static void +xmlFreePatternInternal(xmlPatternPtr comp) { xmlStepOpPtr op; int i; @@ -276,7 +276,7 @@ xmlFreePatternList(xmlPatternPtr comp) { cur = comp; comp = comp->next; cur->next = NULL; - xmlFreePatternInternal(cur); + xmlFreePatternInternal(cur); } } @@ -745,7 +745,7 @@ rollback: * xmlPatScanLiteral: * @ctxt: the XPath Parser context * - * Parse an XPath Literal: + * Parse an XPath Literal: * * [29] Literal ::= '"' [^"]* '"' * | "'" [^']* "'" @@ -972,7 +972,7 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { ERROR5(NULL, NULL, NULL, "xmlCompileAttributeTest : no namespace bound to prefix %s\n", prefix); - XML_PAT_FREE_STRING(ctxt, prefix); + XML_PAT_FREE_STRING(ctxt, prefix); ctxt->error = 1; goto error; } @@ -1976,7 +1976,7 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, } else { /* * If there are "//", then we need to process every "//" - * occurring in the states, plus any other state for this + * occurring in the states, plus any other state for this * level. */ stepNr = stream->states[2 * i]; diff --git a/contrib/libs/libxml/relaxng.c b/contrib/libs/libxml/relaxng.c index 65aadd8a00..13fd954c7d 100644 --- a/contrib/libs/libxml/relaxng.c +++ b/contrib/libs/libxml/relaxng.c @@ -20,7 +20,7 @@ #include <string.h> #include <stdio.h> -#include <stddef.h> +#include <stddef.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> #include <libxml/parserInternals.h> @@ -125,11 +125,11 @@ typedef enum { XML_RELAXNG_EXCEPT, /* except present in nameclass defs */ XML_RELAXNG_TEXT, /* textual content */ XML_RELAXNG_ELEMENT, /* an element */ - XML_RELAXNG_DATATYPE, /* external data type definition */ - XML_RELAXNG_PARAM, /* external data type parameter */ - XML_RELAXNG_VALUE, /* value from an external data type definition */ + XML_RELAXNG_DATATYPE, /* external data type definition */ + XML_RELAXNG_PARAM, /* external data type parameter */ + XML_RELAXNG_VALUE, /* value from an external data type definition */ XML_RELAXNG_LIST, /* a list of patterns */ - XML_RELAXNG_ATTRIBUTE, /* an attribute following a pattern */ + XML_RELAXNG_ATTRIBUTE, /* an attribute following a pattern */ XML_RELAXNG_DEF, /* a definition */ XML_RELAXNG_REF, /* reference to a definition */ XML_RELAXNG_EXTERNALREF, /* reference to an external def */ @@ -228,7 +228,7 @@ struct _xmlRelaxNGParserCtxt { xmlDocPtr document; int defNr; /* number of defines used */ - int defMax; /* number of defines allocated */ + int defMax; /* number of defines allocated */ xmlRelaxNGDefinePtr *defTab; /* pointer to the allocated definitions */ const char *buffer; @@ -508,7 +508,7 @@ xmlRngVErrMemory(xmlRelaxNGValidCtxtPtr ctxt, const char *extra) * * Handle a Relax NG Parsing error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlRngPErr(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar * str1, const xmlChar * str2) { @@ -542,7 +542,7 @@ xmlRngPErr(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, int error, * * Handle a Relax NG Validation error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar * str1, const xmlChar * str2) { @@ -1128,7 +1128,7 @@ xmlRelaxNGAddStates(xmlRelaxNGValidCtxtPtr ctxt, /** * xmlRelaxNGFreeStates: * @ctxt: a Relax-NG validation context - * @states: the container + * @states: the container * * Free a RelaxNG validation state container */ @@ -1340,7 +1340,7 @@ xmlRelaxNGCopyValidState(xmlRelaxNGValidCtxtPtr ctxt, * * Compare the validation states for equality * - * Returns 1 if equal, 0 otherwise + * Returns 1 if equal, 0 otherwise */ static int xmlRelaxNGEqualValidState(xmlRelaxNGValidCtxtPtr ctxt ATTRIBUTE_UNUSED, @@ -1573,9 +1573,9 @@ xmlRelaxNGRemoveRedefine(xmlRelaxNGParserCtxtPtr ctxt, #endif } } - if (xmlRelaxNGRemoveRedefine(ctxt, URL, tmp->children, name) == 1) { - found = 1; - } + if (xmlRelaxNGRemoveRedefine(ctxt, URL, tmp->children, name) == 1) { + found = 1; + } } tmp = tmp2; } @@ -1742,18 +1742,18 @@ xmlRelaxNGLoadInclude(xmlRelaxNGParserCtxtPtr ctxt, const xmlChar * URL, xmlFree(name); } } - if (IS_RELAXNG(cur, "div") && cur->children != NULL) { - cur = cur->children; - } else { - if (cur->next != NULL) { - cur = cur->next; - } else { - while (cur->parent != node && cur->parent->next == NULL) { - cur = cur->parent; - } - cur = cur->parent != node ? cur->parent->next : NULL; - } - } + if (IS_RELAXNG(cur, "div") && cur->children != NULL) { + cur = cur->children; + } else { + if (cur->next != NULL) { + cur = cur->next; + } else { + while (cur->parent != node && cur->parent->next == NULL) { + cur = cur->parent; + } + cur = cur->parent != node ? cur->parent->next : NULL; + } + } } @@ -2103,7 +2103,7 @@ xmlRelaxNGGetErrorString(xmlRelaxNGValidErr err, const xmlChar * arg1, const xmlChar * arg2) { char msg[1000]; - xmlChar *result; + xmlChar *result; if (arg1 == NULL) arg1 = BAD_CAST ""; @@ -2231,8 +2231,8 @@ xmlRelaxNGGetErrorString(xmlRelaxNGValidErr err, const xmlChar * arg1, snprintf(msg, 1000, "Unknown error code %d\n", err); } msg[1000 - 1] = 0; - result = xmlCharStrdup(msg); - return (xmlEscapeFormatString(&result)); + result = xmlCharStrdup(msg); + return (xmlEscapeFormatString(&result)); } /** @@ -2743,10 +2743,10 @@ static xmlHashTablePtr xmlRelaxNGRegisteredTypes = NULL; * Free the structure associated to the type library */ static void -xmlRelaxNGFreeTypeLibrary(void *payload, +xmlRelaxNGFreeTypeLibrary(void *payload, const xmlChar * namespace ATTRIBUTE_UNUSED) { - xmlRelaxNGTypeLibraryPtr lib = (xmlRelaxNGTypeLibraryPtr) payload; + xmlRelaxNGTypeLibraryPtr lib = (xmlRelaxNGTypeLibraryPtr) payload; if (lib == NULL) return; if (lib->namespace != NULL) @@ -2815,7 +2815,7 @@ xmlRelaxNGRegisterTypeLibrary(const xmlChar * namespace, void *data, /** * xmlRelaxNGInitTypes: * - * Initialize the default type libraries. + * Initialize the default type libraries. * * Returns 0 in case of success and -1 in case of error. */ @@ -2857,7 +2857,7 @@ xmlRelaxNGCleanupTypes(void) xmlSchemaCleanupTypes(); if (xmlRelaxNGTypeInitialized == 0) return; - xmlHashFree(xmlRelaxNGRegisteredTypes, xmlRelaxNGFreeTypeLibrary); + xmlHashFree(xmlRelaxNGRegisteredTypes, xmlRelaxNGFreeTypeLibrary); xmlRelaxNGTypeInitialized = 0; } @@ -2878,7 +2878,7 @@ static int xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, xmlRelaxNGDefinePtr def); /** - * xmlRelaxNGIsCompilable: + * xmlRelaxNGIsCompilable: * @define: the definition to check * * Check if a definition is nullable. @@ -2886,7 +2886,7 @@ static int xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, * Returns 1 if yes, 0 if no and -1 in case of error */ static int -xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) +xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) { int ret = -1; @@ -2901,7 +2901,7 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) return (0); switch (def->type) { case XML_RELAXNG_NOOP: - ret = xmlRelaxNGIsCompilable(def->content); + ret = xmlRelaxNGIsCompilable(def->content); break; case XML_RELAXNG_TEXT: case XML_RELAXNG_EMPTY: @@ -2909,7 +2909,7 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) break; case XML_RELAXNG_ELEMENT: /* - * Check if the element content is compilable + * Check if the element content is compilable */ if (((def->dflags & IS_NOT_COMPILABLE) == 0) && ((def->dflags & IS_COMPILABLE) == 0)) { @@ -2917,7 +2917,7 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) list = def->content; while (list != NULL) { - ret = xmlRelaxNGIsCompilable(list); + ret = xmlRelaxNGIsCompilable(list); if (ret != 1) break; list = list->next; @@ -2943,13 +2943,13 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) def->name); } else { xmlGenericError(xmlGenericErrorContext, - "Problem in RelaxNGIsCompilable for element %s\n", + "Problem in RelaxNGIsCompilable for element %s\n", def->name); } #endif } /* - * All elements return a compilable status unless they + * All elements return a compilable status unless they * are generic like anyName */ if ((def->nameClass != NULL) || (def->name == NULL)) @@ -2968,7 +2968,7 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) def->depth = -20; list = def->content; while (list != NULL) { - ret = xmlRelaxNGIsCompilable(list); + ret = xmlRelaxNGIsCompilable(list); if (ret != 1) break; list = list->next; @@ -2986,7 +2986,7 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) list = def->content; while (list != NULL) { - ret = xmlRelaxNGIsCompilable(list); + ret = xmlRelaxNGIsCompilable(list); if (ret != 1) break; list = list->next; @@ -3011,15 +3011,15 @@ xmlRelaxNGIsCompilable(xmlRelaxNGDefinePtr def) #ifdef DEBUG_COMPILE if (ret == 1) { xmlGenericError(xmlGenericErrorContext, - "RelaxNGIsCompilable %s : true\n", + "RelaxNGIsCompilable %s : true\n", xmlRelaxNGDefName(def)); } else if (ret == 0) { xmlGenericError(xmlGenericErrorContext, - "RelaxNGIsCompilable %s : false\n", + "RelaxNGIsCompilable %s : false\n", xmlRelaxNGDefName(def)); } else { xmlGenericError(xmlGenericErrorContext, - "Problem in RelaxNGIsCompilable %s\n", + "Problem in RelaxNGIsCompilable %s\n", xmlRelaxNGDefName(def)); } #endif @@ -3047,7 +3047,7 @@ xmlRelaxNGCompile(xmlRelaxNGParserCtxtPtr ctxt, xmlRelaxNGDefinePtr def) switch (def->type) { case XML_RELAXNG_START: - if ((xmlRelaxNGIsCompilable(def) == 1) && (def->depth != -25)) { + if ((xmlRelaxNGIsCompilable(def) == 1) && (def->depth != -25)) { xmlAutomataPtr oldam = ctxt->am; xmlAutomataStatePtr oldstate = ctxt->state; @@ -3273,7 +3273,7 @@ xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, xmlRelaxNGDefinePtr def) if ((def->type == XML_RELAXNG_START) || (def->type == XML_RELAXNG_ELEMENT)) { - ret = xmlRelaxNGIsCompilable(def); + ret = xmlRelaxNGIsCompilable(def); if ((def->dflags & IS_COMPILABLE) && (def->depth != -25)) { ctxt->am = NULL; ret = xmlRelaxNGCompile(ctxt, def); @@ -3478,7 +3478,7 @@ xmlRelaxNGIsBlank(xmlChar * str) * * Applies algorithm from 4.3. datatypeLibrary attribute * - * Returns the datatypeLibrary value or NULL if not found + * Returns the datatypeLibrary value or NULL if not found */ static xmlChar * xmlRelaxNGGetDataTypeLibrary(xmlRelaxNGParserCtxtPtr ctxt ATTRIBUTE_UNUSED, @@ -3788,7 +3788,7 @@ static const xmlChar *invalidName = BAD_CAST "\1"; * that if both lists do not accept the same QNames, it returns 1 * If the 2 lists can accept the same QName the comparison returns 0 * - * Returns 1 distinct, 0 if equal + * Returns 1 distinct, 0 if equal */ static int xmlRelaxNGCompareNameClasses(xmlRelaxNGDefinePtr def1, @@ -3836,11 +3836,11 @@ xmlRelaxNGCompareNameClasses(xmlRelaxNGDefinePtr def1, return (0); return (1); } else if (def1->type == XML_RELAXNG_EXCEPT) { - ret = xmlRelaxNGCompareNameClasses(def1->content, def2); - if (ret == 0) - ret = 1; - else if (ret == 1) - ret = 0; + ret = xmlRelaxNGCompareNameClasses(def1->content, def2); + if (ret == 0) + ret = 1; + else if (ret == 1) + ret = 0; } else { TODO ret = 0; } @@ -3889,7 +3889,7 @@ xmlRelaxNGCompareNameClasses(xmlRelaxNGDefinePtr def1, * is that if both lists do not accept the same QNames, it returns 1 * If the 2 lists can accept the same QName the comparison returns 0 * - * Returns 1 distinct, 0 if equal + * Returns 1 distinct, 0 if equal */ static int xmlRelaxNGCompareElemDefLists(xmlRelaxNGParserCtxtPtr ctxt @@ -3993,7 +3993,7 @@ xmlRelaxNGGenerateAttributes(xmlRelaxNGParserCtxtPtr ctxt, * xmlRelaxNGGetElements: * @ctxt: a Relax-NG parser context * @def: the definition definition - * @eora: gather elements (0), attributes (1) or elements and text (2) + * @eora: gather elements (0), attributes (1) or elements and text (2) * * Compute the list of top elements a definition can generate * @@ -4019,12 +4019,12 @@ xmlRelaxNGGetElements(xmlRelaxNGParserCtxtPtr ctxt, while (cur != NULL) { if (((eora == 0) && ((cur->type == XML_RELAXNG_ELEMENT) || (cur->type == XML_RELAXNG_TEXT))) || - ((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE)) || - ((eora == 2) && ((cur->type == XML_RELAXNG_DATATYPE) || - (cur->type == XML_RELAXNG_ELEMENT) || - (cur->type == XML_RELAXNG_LIST) || - (cur->type == XML_RELAXNG_TEXT) || - (cur->type == XML_RELAXNG_VALUE)))) { + ((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE)) || + ((eora == 2) && ((cur->type == XML_RELAXNG_DATATYPE) || + (cur->type == XML_RELAXNG_ELEMENT) || + (cur->type == XML_RELAXNG_LIST) || + (cur->type == XML_RELAXNG_TEXT) || + (cur->type == XML_RELAXNG_VALUE)))) { if (ret == NULL) { max = 10; ret = (xmlRelaxNGDefinePtr *) @@ -4330,11 +4330,11 @@ xmlRelaxNGCheckGroupAttrs(xmlRelaxNGParserCtxtPtr ctxt, * algorithm */ static void -xmlRelaxNGComputeInterleaves(void *payload, void *data, - const xmlChar * name ATTRIBUTE_UNUSED) +xmlRelaxNGComputeInterleaves(void *payload, void *data, + const xmlChar * name ATTRIBUTE_UNUSED) { - xmlRelaxNGDefinePtr def = (xmlRelaxNGDefinePtr) payload; - xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; + xmlRelaxNGDefinePtr def = (xmlRelaxNGDefinePtr) payload; + xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; xmlRelaxNGDefinePtr cur, *tmp; xmlRelaxNGPartitionPtr partitions = NULL; @@ -4379,7 +4379,7 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data, if (cur->type == XML_RELAXNG_TEXT) is_mixed++; groups[nbgroups]->rule = cur; - groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 2); + groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 2); groups[nbgroups]->attrs = xmlRelaxNGGetElements(ctxt, cur, 1); nbgroups++; cur = cur->next; @@ -4425,7 +4425,7 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data, if ((*tmp)->type == XML_RELAXNG_TEXT) { res = xmlHashAddEntry2(partitions->triage, BAD_CAST "#text", NULL, - (void *) (ptrdiff_t) (i + 1)); + (void *) (ptrdiff_t) (i + 1)); if (res != 0) is_determinist = -1; } else if (((*tmp)->type == XML_RELAXNG_ELEMENT) && @@ -4433,22 +4433,22 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data, if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0)) res = xmlHashAddEntry2(partitions->triage, (*tmp)->name, NULL, - (void *) (ptrdiff_t) (i + 1)); + (void *) (ptrdiff_t) (i + 1)); else res = xmlHashAddEntry2(partitions->triage, (*tmp)->name, (*tmp)->ns, - (void *) (ptrdiff_t) (i + 1)); + (void *) (ptrdiff_t) (i + 1)); if (res != 0) is_determinist = -1; } else if ((*tmp)->type == XML_RELAXNG_ELEMENT) { if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0)) res = xmlHashAddEntry2(partitions->triage, BAD_CAST "#any", NULL, - (void *) (ptrdiff_t) (i + 1)); + (void *) (ptrdiff_t) (i + 1)); else res = xmlHashAddEntry2(partitions->triage, BAD_CAST "#any", (*tmp)->ns, - (void *) (ptrdiff_t) (i + 1)); + (void *) (ptrdiff_t) (i + 1)); if ((*tmp)->nameClass != NULL) is_determinist = 2; if (res != 0) @@ -4683,7 +4683,7 @@ xmlRelaxNGParseDefine(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) * Import import one references into the current grammar */ static void -xmlRelaxNGParseImportRef(void *payload, void *data, const xmlChar *name) { +xmlRelaxNGParseImportRef(void *payload, void *data, const xmlChar *name) { xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; xmlRelaxNGDefinePtr def = (xmlRelaxNGDefinePtr) payload; int tmp; @@ -4743,9 +4743,9 @@ xmlRelaxNGParseImportRefs(xmlRelaxNGParserCtxtPtr ctxt, /** * xmlRelaxNGProcessExternalRef: * @ctxt: the parser context - * @node: the externalRef node + * @node: the externalRef node * - * Process and compile an externalRef node + * Process and compile an externalRef node * * Returns the xmlRelaxNGDefinePtr or NULL in case of error */ @@ -5366,15 +5366,15 @@ xmlRelaxNGParseNameClass(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, xmlNodePtr child; xmlRelaxNGDefinePtr last = NULL; - if (def->type == XML_RELAXNG_CHOICE) { - ret = def; - } else { - ret = xmlRelaxNGNewDefine(ctxt, node); - if (ret == NULL) - return (NULL); - ret->parent = def; - ret->type = XML_RELAXNG_CHOICE; - } + if (def->type == XML_RELAXNG_CHOICE) { + ret = def; + } else { + ret = xmlRelaxNGNewDefine(ctxt, node); + if (ret == NULL) + return (NULL); + ret->parent = def; + ret->type = XML_RELAXNG_CHOICE; + } if (node->children == NULL) { xmlRngPErr(ctxt, node, XML_RNGP_CHOICE_EMPTY, @@ -5386,7 +5386,7 @@ xmlRelaxNGParseNameClass(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, tmp = xmlRelaxNGParseNameClass(ctxt, child, ret); if (tmp != NULL) { if (last == NULL) { - last = tmp; + last = tmp; } else { last->next = tmp; last = tmp; @@ -5548,16 +5548,16 @@ xmlRelaxNGParsePatterns(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes, while (nodes != NULL) { if (IS_RELAXNG(nodes, "element")) { cur = xmlRelaxNGParseElement(ctxt, nodes); - if (cur == NULL) - return (NULL); + if (cur == NULL) + return (NULL); if (def == NULL) { def = last = cur; } else { if ((group == 1) && (def->type == XML_RELAXNG_ELEMENT) && (def == last)) { def = xmlRelaxNGNewDefine(ctxt, nodes); - if (def == NULL) - return (NULL); + if (def == NULL) + return (NULL); def->type = XML_RELAXNG_GROUP; def->content = last; } @@ -5698,10 +5698,10 @@ xmlRelaxNGParseGrammarContent(xmlRelaxNGParserCtxtPtr ctxt, * element of a given grammar using the same name. */ static void -xmlRelaxNGCheckReference(void *payload, void *data, const xmlChar * name) +xmlRelaxNGCheckReference(void *payload, void *data, const xmlChar * name) { - xmlRelaxNGDefinePtr ref = (xmlRelaxNGDefinePtr) payload; - xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; + xmlRelaxNGDefinePtr ref = (xmlRelaxNGDefinePtr) payload; + xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; xmlRelaxNGGrammarPtr grammar; xmlRelaxNGDefinePtr def, cur; @@ -5754,10 +5754,10 @@ xmlRelaxNGCheckReference(void *payload, void *data, const xmlChar * name) * element of a given grammar using the same name. */ static void -xmlRelaxNGCheckCombine(void *payload, void *data, const xmlChar * name) +xmlRelaxNGCheckCombine(void *payload, void *data, const xmlChar * name) { - xmlRelaxNGDefinePtr define = (xmlRelaxNGDefinePtr) payload; - xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; + xmlRelaxNGDefinePtr define = (xmlRelaxNGDefinePtr) payload; + xmlRelaxNGParserCtxtPtr ctxt = (xmlRelaxNGParserCtxtPtr) data; xmlChar *combine; int choiceOrInterleave = -1; int missing = 0; @@ -6016,7 +6016,7 @@ xmlRelaxNGCheckCycles(xmlRelaxNGParserCtxtPtr ctxt, * @parent: the parent definition * @prev: the previous sibling definition * - * Try to unlink a definition. If not possible make it a NOOP + * Try to unlink a definition. If not possible make it a NOOP * * Returns the new prev definition */ @@ -6399,10 +6399,10 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt, NULL, NULL); } if ((!(flags & XML_RELAXNG_IN_ONEORMORE)) - && cur->name == NULL - /* following is checking alternative name class readiness - in case it went the "choice" route */ - && cur->nameClass == NULL) { + && cur->name == NULL + /* following is checking alternative name class readiness + in case it went the "choice" route */ + && cur->nameClass == NULL) { if (cur->ns == NULL) { xmlRngPErr(ctxt, cur->node, XML_RNGP_ANYNAME_ATTR_ANCESTOR, "Found anyName attribute without oneOrMore ancestor\n", @@ -6643,14 +6643,14 @@ xmlRelaxNGParseGrammar(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes) */ xmlRelaxNGCombineStart(ctxt, ret); if (ret->defs != NULL) { - xmlHashScan(ret->defs, xmlRelaxNGCheckCombine, ctxt); + xmlHashScan(ret->defs, xmlRelaxNGCheckCombine, ctxt); } /* * link together defines and refs in this grammar */ if (ret->refs != NULL) { - xmlHashScan(ret->refs, xmlRelaxNGCheckReference, ctxt); + xmlHashScan(ret->refs, xmlRelaxNGCheckReference, ctxt); } @@ -6666,7 +6666,7 @@ xmlRelaxNGParseGrammar(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes) * @node: the root node of the RelaxNG schema * * parse a Relax-NG definition resource and build an internal - * xmlRelaxNG structure which can be used to validate instances. + * xmlRelaxNG structure which can be used to validate instances. * * Returns the internal XML RelaxNG structure built or * NULL in case of error @@ -7497,7 +7497,7 @@ xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, xmlDocPtr doc) * @ctxt: a Relax-NG parser context * * parse a schema definition resource and build an internal - * XML Schema structure which can be used to validate instances. + * XML Schema structure which can be used to validate instances. * * Returns the internal XML RelaxNG structure built from the resource or * NULL in case of error @@ -7581,7 +7581,7 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt) * try to preprocess interleaves */ if (ctxt->interleaves != NULL) { - xmlHashScan(ctxt->interleaves, xmlRelaxNGComputeInterleaves, ctxt); + xmlHashScan(ctxt->interleaves, xmlRelaxNGComputeInterleaves, ctxt); } /* @@ -8610,7 +8610,7 @@ xmlRelaxNGNormalize(xmlRelaxNGValidCtxtPtr ctxt, const xmlChar * str) * @type: the datatype definition * @node: the node * - * Validate the given value against the datatype + * Validate the given value against the datatype * * Returns 0 if the validation succeeded or an error code. */ @@ -8920,7 +8920,7 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt, if (ret != 0) { break; } - /* Falls through. */ + /* Falls through. */ case XML_RELAXNG_ZEROORMORE:{ xmlChar *cur, *temp; @@ -9292,10 +9292,10 @@ xmlRelaxNGNodeMatchesList(xmlNodePtr node, xmlRelaxNGDefinePtr * list) return (1); } else if (((node->type == XML_TEXT_NODE) || (node->type == XML_CDATA_SECTION_NODE)) && - ((cur->type == XML_RELAXNG_DATATYPE) || - (cur->type == XML_RELAXNG_LIST) || - (cur->type == XML_RELAXNG_TEXT) || - (cur->type == XML_RELAXNG_VALUE))) { + ((cur->type == XML_RELAXNG_DATATYPE) || + (cur->type == XML_RELAXNG_LIST) || + (cur->type == XML_RELAXNG_TEXT) || + (cur->type == XML_RELAXNG_VALUE))) { return (1); } cur = list[i++]; @@ -9420,7 +9420,7 @@ xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt, if (tmp == NULL) { i = nbgroups; } else { - i = ((ptrdiff_t) tmp) - 1; + i = ((ptrdiff_t) tmp) - 1; if (partitions->flags & IS_NEEDCHECK) { group = partitions->groups[i]; if (!xmlRelaxNGNodeMatchesList(cur, group->defs)) @@ -9483,17 +9483,17 @@ xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGFreeValidState(ctxt, oldstate); oldstate = ctxt->state; ctxt->state = NULL; - if (cur != NULL - /* there's a nasty violation of context-free unambiguities, - since in open-name-class context, interleave in the - production shall finish without caring about anything - else that is OK to follow in that case -- it would - otherwise get marked as "extra content" and would - hence fail the validation, hence this perhaps - dirty attempt to rectify such a situation */ - && (define->parent->type != XML_RELAXNG_DEF - || !xmlStrEqual(define->parent->name, - (const xmlChar *) "open-name-class"))) { + if (cur != NULL + /* there's a nasty violation of context-free unambiguities, + since in open-name-class context, interleave in the + production shall finish without caring about anything + else that is OK to follow in that case -- it would + otherwise get marked as "extra content" and would + hence fail the validation, hence this perhaps + dirty attempt to rectify such a situation */ + && (define->parent->type != XML_RELAXNG_DEF + || !xmlStrEqual(define->parent->name, + (const xmlChar *) "open-name-class"))) { VALID_ERR2(XML_RELAXNG_ERR_INTEREXTRA, cur->name); ret = -1; ctxt->state = oldstate; @@ -9766,7 +9766,7 @@ xmlRelaxNGElementMatch(xmlRelaxNGValidCtxtPtr ctxt, * Find the "best" state in the ctxt->states list of states to report * errors about. I.e. a state with no element left in the child list * or the one with the less attributes left. - * This is called only if a validation error was detected + * This is called only if a validation error was detected * * Returns the index of the "best" state or -1 in case of error */ @@ -10209,7 +10209,7 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt, } if (ctxt->errNr > errNr) xmlRelaxNGPopErrors(ctxt, errNr); - /* Falls through. */ + /* Falls through. */ case XML_RELAXNG_ZEROORMORE:{ int progress; xmlRelaxNGStatesPtr states = NULL, res = NULL; @@ -10373,7 +10373,7 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt, /* * Something we can optimize cleanly there is only one - * possible branch out ! + * possible branch out ! */ if ((node->type == XML_TEXT_NODE) || (node->type == XML_CDATA_SECTION_NODE)) { @@ -10626,7 +10626,7 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt, if (define->name != NULL) xmlGenericError(xmlGenericErrorContext, "%s ", define->name); if (ret == 0) - xmlGenericError(xmlGenericErrorContext, "succeeded\n"); + xmlGenericError(xmlGenericErrorContext, "succeeded\n"); else xmlGenericError(xmlGenericErrorContext, "failed\n"); #endif diff --git a/contrib/libs/libxml/save.h b/contrib/libs/libxml/save.h index 64b3ea2c79..192b674133 100644 --- a/contrib/libs/libxml/save.h +++ b/contrib/libs/libxml/save.h @@ -1,7 +1,7 @@ /* * Summary: Internal Interfaces for saving in libxml2 * Description: this module describes a few interfaces which were - * added along with the API changes in 2.9.0 + * added along with the API changes in 2.9.0 * those are private routines at this point * * Copy: See Copyright for the status of this software. @@ -27,8 +27,8 @@ void xmlBufDumpAttributeDecl(xmlBufPtr buf, xmlAttributePtr attr); void xmlBufDumpEntityDecl(xmlBufPtr buf, xmlEntityPtr ent); #endif -xmlChar *xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input); - +xmlChar *xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input); + #ifdef __cplusplus } #endif diff --git a/contrib/libs/libxml/schematron.c b/contrib/libs/libxml/schematron.c index 692beff45e..258ce4091f 100644 --- a/contrib/libs/libxml/schematron.c +++ b/contrib/libs/libxml/schematron.c @@ -133,7 +133,7 @@ struct _xmlSchematron { int flags; /* specific to this schematron */ void *_private; /* unused by the library */ - xmlDictPtr dict; /* the dictionary used internally */ + xmlDictPtr dict; /* the dictionary used internally */ const xmlChar *title; /* the title if any */ @@ -186,7 +186,7 @@ struct _xmlSchematronParserCtxt { const char *buffer; int size; - xmlDictPtr dict; /* dictionary for interned string names */ + xmlDictPtr dict; /* dictionary for interned string names */ int nberrors; int err; @@ -245,7 +245,7 @@ xmlSchematronPErrMemory(xmlSchematronParserCtxtPtr ctxt, * * Handle a parser error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar * str1, const xmlChar * str2) { @@ -1068,7 +1068,7 @@ done: * @ctxt: a schema validation context * * parse a schema definition resource and build an internal - * XML Schema structure which can be used to validate instances. + * XML Schema structure which can be used to validate instances. * * Returns the internal XML Schematron structure built from the resource or * NULL in case of error @@ -1287,7 +1287,7 @@ xmlSchematronReportOutput(xmlSchematronValidCtxtPtr ctxt ATTRIBUTE_UNUSED, * Build the string being reported to the user. * * Returns a report string or NULL in case of error. The string needs - * to be deallocated by the caller + * to be deallocated by the caller */ static xmlChar * xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt, @@ -1591,7 +1591,7 @@ xmlSchematronNextNode(xmlNodePtr cur) { * xmlSchematronRunTest: * @ctxt: the schema validation context * @test: the current test - * @instance: the document instance tree + * @instance: the document instance tree * @cur: the current node in the instance * * Validate a rule against a tree instance at a given position @@ -1655,7 +1655,7 @@ xmlSchematronRunTest(xmlSchematronValidCtxtPtr ctxt, /** * xmlSchematronValidateDoc: * @ctxt: the schema validation context - * @instance: the document instance tree + * @instance: the document instance tree * * Validate a tree instance against the schematron * diff --git a/contrib/libs/libxml/threads.c b/contrib/libs/libxml/threads.c index 1f92940618..72df9ba997 100644 --- a/contrib/libs/libxml/threads.c +++ b/contrib/libs/libxml/threads.c @@ -27,7 +27,7 @@ #ifdef HAVE_PTHREAD_H #include <pthread.h> #elif defined HAVE_WIN32_THREADS -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #include <windows.h> #ifndef HAVE_COMPILER_TLS #include <process.h> @@ -47,42 +47,42 @@ #ifdef HAVE_PTHREAD_H -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 303) && \ - defined(__GLIBC__) && defined(__linux__) - +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 303) && \ + defined(__GLIBC__) && defined(__linux__) + static int libxml_is_threaded = -1; - -#define XML_PTHREAD_WEAK - -#pragma weak pthread_once -#pragma weak pthread_getspecific -#pragma weak pthread_setspecific -#pragma weak pthread_key_create -#pragma weak pthread_key_delete -#pragma weak pthread_mutex_init -#pragma weak pthread_mutex_destroy -#pragma weak pthread_mutex_lock -#pragma weak pthread_mutex_unlock -#pragma weak pthread_cond_init -#pragma weak pthread_cond_destroy -#pragma weak pthread_cond_wait -#pragma weak pthread_equal -#pragma weak pthread_self -#pragma weak pthread_key_create -#pragma weak pthread_key_delete -#pragma weak pthread_cond_signal - -#else /* __GNUC__, __GLIBC__, __linux__ */ - -static int libxml_is_threaded = 1; - -#endif /* __GNUC__, __GLIBC__, __linux__ */ - + +#define XML_PTHREAD_WEAK + +#pragma weak pthread_once +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific +#pragma weak pthread_key_create +#pragma weak pthread_key_delete +#pragma weak pthread_mutex_init +#pragma weak pthread_mutex_destroy +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_unlock +#pragma weak pthread_cond_init +#pragma weak pthread_cond_destroy +#pragma weak pthread_cond_wait +#pragma weak pthread_equal +#pragma weak pthread_self +#pragma weak pthread_key_create +#pragma weak pthread_key_delete +#pragma weak pthread_cond_signal + +#else /* __GNUC__, __GLIBC__, __linux__ */ + +static int libxml_is_threaded = 1; + +#endif /* __GNUC__, __GLIBC__, __linux__ */ + #endif /* HAVE_PTHREAD_H */ /* * TODO: this module still uses malloc/free and not xmlMalloc/xmlFree - * to avoid some craziness since xmlMalloc/xmlFree may actually + * to avoid some craziness since xmlMalloc/xmlFree may actually * be hosted on allocated blocks needing them for the allocation ... */ @@ -146,7 +146,7 @@ static DWORD globalkey = TLS_OUT_OF_INDEXES; static DWORD mainthread; static struct { DWORD done; - LONG control; + LONG control; } run_once = { 0, 0}; static volatile LPCRITICAL_SECTION global_init_lock = NULL; @@ -239,7 +239,7 @@ xmlMutexLock(xmlMutexPtr tok) if (acquire_sem(tok->sem) != B_NO_ERROR) { #ifdef DEBUG_THREADS xmlGenericError(xmlGenericErrorContext, - "xmlMutexLock():BeOS:Couldn't acquire semaphore\n"); + "xmlMutexLock():BeOS:Couldn't acquire semaphore\n"); #endif } tok->tid = find_thread(NULL); @@ -403,7 +403,7 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) pthread_mutex_unlock(&tok->lock); #elif defined HAVE_WIN32_THREADS if (tok->count > 0) { - tok->count--; + tok->count--; LeaveCriticalSection(&tok->cs); } #elif defined HAVE_BEOS_THREADS @@ -429,11 +429,11 @@ __xmlGlobalInitMutexLock(void) /* Make sure the global init lock is initialized and then lock it. */ #ifdef HAVE_PTHREAD_H /* The mutex is statically initialized, so we just lock it. */ -#ifdef XML_PTHREAD_WEAK - if (pthread_mutex_lock == NULL) - return; -#endif /* XML_PTHREAD_WEAK */ - pthread_mutex_lock(&global_init_lock); +#ifdef XML_PTHREAD_WEAK + if (pthread_mutex_lock == NULL) + return; +#endif /* XML_PTHREAD_WEAK */ + pthread_mutex_lock(&global_init_lock); #elif defined HAVE_WIN32_THREADS LPCRITICAL_SECTION cs; @@ -449,8 +449,8 @@ __xmlGlobalInitMutexLock(void) /* Swap it into the global_init_lock */ #ifdef InterlockedCompareExchangePointer - InterlockedCompareExchangePointer((void **) &global_init_lock, - cs, NULL); + InterlockedCompareExchangePointer((void **) &global_init_lock, + cs, NULL); #else /* Use older void* version */ InterlockedCompareExchange((void **) &global_init_lock, (void *) cs, NULL); @@ -502,11 +502,11 @@ void __xmlGlobalInitMutexUnlock(void) { #ifdef HAVE_PTHREAD_H -#ifdef XML_PTHREAD_WEAK - if (pthread_mutex_unlock == NULL) - return; -#endif /* XML_PTHREAD_WEAK */ - pthread_mutex_unlock(&global_init_lock); +#ifdef XML_PTHREAD_WEAK + if (pthread_mutex_unlock == NULL) + return; +#endif /* XML_PTHREAD_WEAK */ + pthread_mutex_unlock(&global_init_lock); #elif defined HAVE_WIN32_THREADS if (global_init_lock != NULL) { LeaveCriticalSection(global_init_lock); @@ -858,7 +858,7 @@ void xmlInitThreads(void) { #ifdef HAVE_PTHREAD_H -#ifdef XML_PTHREAD_WEAK +#ifdef XML_PTHREAD_WEAK if (libxml_is_threaded == -1) { if ((pthread_once != NULL) && (pthread_getspecific != NULL) && @@ -884,7 +884,7 @@ xmlInitThreads(void) libxml_is_threaded = 0; } } -#endif /* XML_PTHREAD_WEAK */ +#endif /* XML_PTHREAD_WEAK */ #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) InitializeCriticalSection(&cleanup_helpers_cs); #endif @@ -911,7 +911,7 @@ xmlCleanupThreads(void) xmlGenericError(xmlGenericErrorContext, "xmlCleanupThreads()\n"); #endif #ifdef HAVE_PTHREAD_H - if (libxml_is_threaded != 0) + if (libxml_is_threaded != 0) pthread_key_delete(globalkey); once_control = once_control_init; #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) @@ -996,23 +996,23 @@ xmlOnceInit(void) #ifdef HAVE_PTHREAD_H #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) #if defined(LIBXML_STATIC_FOR_DLL) -int XMLCALL -xmlDllMain(ATTRIBUTE_UNUSED void *hinstDLL, unsigned long fdwReason, - ATTRIBUTE_UNUSED void *lpvReserved) +int XMLCALL +xmlDllMain(ATTRIBUTE_UNUSED void *hinstDLL, unsigned long fdwReason, + ATTRIBUTE_UNUSED void *lpvReserved) #else -/* declare to avoid "no previous prototype for 'DllMain'" warning */ -/* Note that we do NOT want to include this function declaration in - a public header because it's meant to be called by Windows itself, - not a program that uses this library. This also has to be exported. */ - -XMLPUBFUN BOOL WINAPI -DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved); - +/* declare to avoid "no previous prototype for 'DllMain'" warning */ +/* Note that we do NOT want to include this function declaration in + a public header because it's meant to be called by Windows itself, + not a program that uses this library. This also has to be exported. */ + +XMLPUBFUN BOOL WINAPI +DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved); + BOOL WINAPI -DllMain(ATTRIBUTE_UNUSED HINSTANCE hinstDLL, DWORD fdwReason, - ATTRIBUTE_UNUSED LPVOID lpvReserved) +DllMain(ATTRIBUTE_UNUSED HINSTANCE hinstDLL, DWORD fdwReason, + ATTRIBUTE_UNUSED LPVOID lpvReserved) #endif { switch (fdwReason) { diff --git a/contrib/libs/libxml/timsort.h b/contrib/libs/libxml/timsort.h index 85fa5585f0..383584fb35 100644 --- a/contrib/libs/libxml/timsort.h +++ b/contrib/libs/libxml/timsort.h @@ -1,124 +1,124 @@ /* - * Taken from https://github.com/swenson/sort - * Revision: 05fd77bfec049ce8b7c408c4d3dd2d51ee061a15 - * Removed all code unrelated to Timsort and made minor adjustments for - * cross-platform compatibility. + * Taken from https://github.com/swenson/sort + * Revision: 05fd77bfec049ce8b7c408c4d3dd2d51ee061a15 + * Removed all code unrelated to Timsort and made minor adjustments for + * cross-platform compatibility. */ /* - * The MIT License (MIT) - * - * Copyright (c) 2010-2017 Christopher Swenson. - * Copyright (c) 2012 Vojtech Fried. - * Copyright (c) 2012 Google Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ + * The MIT License (MIT) + * + * Copyright (c) 2010-2017 Christopher Swenson. + * Copyright (c) 2012 Vojtech Fried. + * Copyright (c) 2012 Google Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ #include <stdlib.h> #include <stdio.h> #include <string.h> #ifdef HAVE_STDINT_H #include <stdint.h> -#elif defined(_WIN32) +#elif defined(_WIN32) typedef unsigned __int64 uint64_t; #endif - -#ifndef SORT_NAME -#error "Must declare SORT_NAME" + +#ifndef SORT_NAME +#error "Must declare SORT_NAME" +#endif + +#ifndef SORT_TYPE +#error "Must declare SORT_TYPE" #endif -#ifndef SORT_TYPE -#error "Must declare SORT_TYPE" +#ifndef SORT_CMP +#define SORT_CMP(x, y) ((x) < (y) ? -1 : ((x) == (y) ? 0 : 1)) #endif - -#ifndef SORT_CMP -#define SORT_CMP(x, y) ((x) < (y) ? -1 : ((x) == (y) ? 0 : 1)) + +#ifndef TIM_SORT_STACK_SIZE +#define TIM_SORT_STACK_SIZE 128 #endif -#ifndef TIM_SORT_STACK_SIZE -#define TIM_SORT_STACK_SIZE 128 -#endif - -#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;} - - -/* Common, type-agnostic functions and constants that we don't want to declare twice. */ -#ifndef SORT_COMMON_H -#define SORT_COMMON_H - +#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;} + + +/* Common, type-agnostic functions and constants that we don't want to declare twice. */ +#ifndef SORT_COMMON_H +#define SORT_COMMON_H + #ifndef MAX #define MAX(x,y) (((x) > (y) ? (x) : (y))) #endif - + #ifndef MIN #define MIN(x,y) (((x) < (y) ? (x) : (y))) #endif -static int compute_minrun(const uint64_t); +static int compute_minrun(const uint64_t); #ifndef CLZ #if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ > 3)) #define CLZ __builtin_clzll #else -static int clzll(uint64_t); +static int clzll(uint64_t); /* adapted from Hacker's Delight */ -static int clzll(uint64_t x) { +static int clzll(uint64_t x) { int n; - if (x == 0) { - return 64; - } - + if (x == 0) { + return 64; + } + n = 0; - - if (x <= 0x00000000FFFFFFFFL) { - n = n + 32; - x = x << 32; - } - - if (x <= 0x0000FFFFFFFFFFFFL) { - n = n + 16; - x = x << 16; - } - - if (x <= 0x00FFFFFFFFFFFFFFL) { - n = n + 8; - x = x << 8; - } - - if (x <= 0x0FFFFFFFFFFFFFFFL) { - n = n + 4; - x = x << 4; - } - - if (x <= 0x3FFFFFFFFFFFFFFFL) { - n = n + 2; - x = x << 2; - } - - if (x <= 0x7FFFFFFFFFFFFFFFL) { - n = n + 1; - } - + + if (x <= 0x00000000FFFFFFFFL) { + n = n + 32; + x = x << 32; + } + + if (x <= 0x0000FFFFFFFFFFFFL) { + n = n + 16; + x = x << 16; + } + + if (x <= 0x00FFFFFFFFFFFFFFL) { + n = n + 8; + x = x << 8; + } + + if (x <= 0x0FFFFFFFFFFFFFFFL) { + n = n + 4; + x = x << 4; + } + + if (x <= 0x3FFFFFFFFFFFFFFFL) { + n = n + 2; + x = x << 2; + } + + if (x <= 0x7FFFFFFFFFFFFFFFL) { + n = n + 1; + } + return n; } @@ -126,225 +126,225 @@ static int clzll(uint64_t x) { #endif #endif -static __inline int compute_minrun(const uint64_t size) { +static __inline int compute_minrun(const uint64_t size) { const int top_bit = 64 - CLZ(size); const int shift = MAX(top_bit, 6) - 6; const int minrun = size >> shift; - const uint64_t mask = (1ULL << shift) - 1; - - if (mask & size) { - return minrun + 1; - } - + const uint64_t mask = (1ULL << shift) - 1; + + if (mask & size) { + return minrun + 1; + } + return minrun; } -#endif /* SORT_COMMON_H */ +#endif /* SORT_COMMON_H */ #define SORT_CONCAT(x, y) x ## _ ## y #define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y) #define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x) -#define BINARY_INSERTION_FIND SORT_MAKE_STR(binary_insertion_find) -#define BINARY_INSERTION_SORT_START SORT_MAKE_STR(binary_insertion_sort_start) -#define BINARY_INSERTION_SORT SORT_MAKE_STR(binary_insertion_sort) -#define REVERSE_ELEMENTS SORT_MAKE_STR(reverse_elements) -#define COUNT_RUN SORT_MAKE_STR(count_run) -#define CHECK_INVARIANT SORT_MAKE_STR(check_invariant) -#define TIM_SORT SORT_MAKE_STR(tim_sort) -#define TIM_SORT_RESIZE SORT_MAKE_STR(tim_sort_resize) -#define TIM_SORT_MERGE SORT_MAKE_STR(tim_sort_merge) -#define TIM_SORT_COLLAPSE SORT_MAKE_STR(tim_sort_collapse) - -#ifndef MAX -#define MAX(x,y) (((x) > (y) ? (x) : (y))) -#endif -#ifndef MIN -#define MIN(x,y) (((x) < (y) ? (x) : (y))) -#endif +#define BINARY_INSERTION_FIND SORT_MAKE_STR(binary_insertion_find) +#define BINARY_INSERTION_SORT_START SORT_MAKE_STR(binary_insertion_sort_start) +#define BINARY_INSERTION_SORT SORT_MAKE_STR(binary_insertion_sort) +#define REVERSE_ELEMENTS SORT_MAKE_STR(reverse_elements) +#define COUNT_RUN SORT_MAKE_STR(count_run) +#define CHECK_INVARIANT SORT_MAKE_STR(check_invariant) +#define TIM_SORT SORT_MAKE_STR(tim_sort) +#define TIM_SORT_RESIZE SORT_MAKE_STR(tim_sort_resize) +#define TIM_SORT_MERGE SORT_MAKE_STR(tim_sort_merge) +#define TIM_SORT_COLLAPSE SORT_MAKE_STR(tim_sort_collapse) + +#ifndef MAX +#define MAX(x,y) (((x) > (y) ? (x) : (y))) +#endif +#ifndef MIN +#define MIN(x,y) (((x) < (y) ? (x) : (y))) +#endif typedef struct { - size_t start; - size_t length; + size_t start; + size_t length; } TIM_SORT_RUN_T; - + void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size); void TIM_SORT(SORT_TYPE *dst, const size_t size); - + /* Function used to do a binary search for binary insertion sort */ -static __inline size_t BINARY_INSERTION_FIND(SORT_TYPE *dst, const SORT_TYPE x, - const size_t size) { - size_t l, c, r; +static __inline size_t BINARY_INSERTION_FIND(SORT_TYPE *dst, const SORT_TYPE x, + const size_t size) { + size_t l, c, r; SORT_TYPE cx; l = 0; r = size - 1; c = r >> 1; - /* check for out of bounds at the beginning. */ - if (SORT_CMP(x, dst[0]) < 0) { + /* check for out of bounds at the beginning. */ + if (SORT_CMP(x, dst[0]) < 0) { return 0; - } else if (SORT_CMP(x, dst[r]) > 0) { - return r; + } else if (SORT_CMP(x, dst[r]) > 0) { + return r; } cx = dst[c]; - - while (1) { + + while (1) { const int val = SORT_CMP(x, cx); - - if (val < 0) { - if (c - l <= 1) { - return c; - } - + + if (val < 0) { + if (c - l <= 1) { + return c; + } + r = c; - } else { /* allow = for stability. The binary search favors the right. */ - if (r - c <= 1) { - return c + 1; - } - + } else { /* allow = for stability. The binary search favors the right. */ + if (r - c <= 1) { + return c + 1; + } + l = c; } - + c = l + ((r - l) >> 1); cx = dst[c]; } } /* Binary insertion sort, but knowing that the first "start" entries are sorted. Used in timsort. */ -static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) { - size_t i; - - for (i = start; i < size; i++) { - size_t j; +static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) { + size_t i; + + for (i = start; i < size; i++) { + size_t j; SORT_TYPE x; - size_t location; - + size_t location; + /* If this entry is already correct, just move along */ - if (SORT_CMP(dst[i - 1], dst[i]) <= 0) { - continue; - } + if (SORT_CMP(dst[i - 1], dst[i]) <= 0) { + continue; + } /* Else we need to find the right place, shift everything over, and squeeze in */ x = dst[i]; location = BINARY_INSERTION_FIND(dst, x, i); - - for (j = i - 1; j >= location; j--) { + + for (j = i - 1; j >= location; j--) { dst[j + 1] = dst[j]; - - if (j == 0) { /* check edge case because j is unsigned */ - break; - } + + if (j == 0) { /* check edge case because j is unsigned */ + break; + } } - + dst[location] = x; } } /* Binary insertion sort */ -void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) { - /* don't bother sorting an array of size <= 1 */ - if (size <= 1) { - return; - } - +void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) { + /* don't bother sorting an array of size <= 1 */ + if (size <= 1) { + return; + } + BINARY_INSERTION_SORT_START(dst, 1, size); } /* timsort implementation, based on timsort.txt */ -static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) { - while (1) { - if (start >= end) { - return; - } - +static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) { + while (1) { + if (start >= end) { + return; + } + SORT_SWAP(dst[start], dst[end]); start++; end--; } } -static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) { - size_t curr; - - if (size - start == 1) { - return 1; - } - - if (start >= size - 2) { - if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) { +static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) { + size_t curr; + + if (size - start == 1) { + return 1; + } + + if (start >= size - 2) { + if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) { SORT_SWAP(dst[size - 2], dst[size - 1]); - } - + } + return 2; } curr = start + 2; - if (SORT_CMP(dst[start], dst[start + 1]) <= 0) { + if (SORT_CMP(dst[start], dst[start + 1]) <= 0) { /* increasing run */ - while (1) { - if (curr == size - 1) { - break; - } - - if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) { - break; - } - + while (1) { + if (curr == size - 1) { + break; + } + + if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) { + break; + } + curr++; } - + return curr - start; - } else { + } else { /* decreasing run */ - while (1) { - if (curr == size - 1) { - break; - } - - if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) { - break; - } - + while (1) { + if (curr == size - 1) { + break; + } + + if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) { + break; + } + curr++; } - + /* reverse in-place */ REVERSE_ELEMENTS(dst, start, curr - 1); return curr - start; } } -static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) { - size_t A, B, C; +static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) { + size_t A, B, C; + + if (stack_curr < 2) { + return 1; + } + + if (stack_curr == 2) { + const size_t A1 = stack[stack_curr - 2].length; + const size_t B1 = stack[stack_curr - 1].length; + + if (A1 <= B1) { + return 0; + } - if (stack_curr < 2) { return 1; } - - if (stack_curr == 2) { - const size_t A1 = stack[stack_curr - 2].length; - const size_t B1 = stack[stack_curr - 1].length; - - if (A1 <= B1) { - return 0; - } - - return 1; - } - + A = stack[stack_curr - 3].length; B = stack[stack_curr - 2].length; C = stack[stack_curr - 1].length; - - if ((A <= B + C) || (B <= C)) { - return 0; - } - + + if ((A <= B + C) || (B <= C)) { + return 0; + } + return 1; } @@ -353,194 +353,194 @@ typedef struct { SORT_TYPE *storage; } TEMP_STORAGE_T; -static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) { - if (store->alloc < new_size) { - SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE)); +static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) { + if (store->alloc < new_size) { + SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE)); - if (tempstore == NULL) { - fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", - (unsigned long)(sizeof(SORT_TYPE) * new_size)); + if (tempstore == NULL) { + fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", + (unsigned long)(sizeof(SORT_TYPE) * new_size)); exit(1); } - + store->storage = tempstore; store->alloc = new_size; } } -static void TIM_SORT_MERGE(SORT_TYPE *dst, const TIM_SORT_RUN_T *stack, const int stack_curr, - TEMP_STORAGE_T *store) { - const size_t A = stack[stack_curr - 2].length; - const size_t B = stack[stack_curr - 1].length; - const size_t curr = stack[stack_curr - 2].start; +static void TIM_SORT_MERGE(SORT_TYPE *dst, const TIM_SORT_RUN_T *stack, const int stack_curr, + TEMP_STORAGE_T *store) { + const size_t A = stack[stack_curr - 2].length; + const size_t B = stack[stack_curr - 1].length; + const size_t curr = stack[stack_curr - 2].start; SORT_TYPE *storage; - size_t i, j, k; + size_t i, j, k; TIM_SORT_RESIZE(store, MIN(A, B)); storage = store->storage; /* left merge */ - if (A < B) { + if (A < B) { memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE)); i = 0; j = curr + A; - for (k = curr; k < curr + A + B; k++) { - if ((i < A) && (j < curr + A + B)) { - if (SORT_CMP(storage[i], dst[j]) <= 0) { + for (k = curr; k < curr + A + B; k++) { + if ((i < A) && (j < curr + A + B)) { + if (SORT_CMP(storage[i], dst[j]) <= 0) { dst[k] = storage[i++]; - } else { + } else { dst[k] = dst[j++]; - } - } else if (i < A) { + } + } else if (i < A) { dst[k] = storage[i++]; - } else { - break; + } else { + break; } } - } else { - /* right merge */ + } else { + /* right merge */ memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE)); - i = B; - j = curr + A; - k = curr + A + B; - - while (k > curr) { - k--; - if ((i > 0) && (j > curr)) { - if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) { - dst[k] = dst[--j]; - } else { - dst[k] = storage[--i]; - } - } else if (i > 0) { - dst[k] = storage[--i]; - } else { - break; + i = B; + j = curr + A; + k = curr + A + B; + + while (k > curr) { + k--; + if ((i > 0) && (j > curr)) { + if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) { + dst[k] = dst[--j]; + } else { + dst[k] = storage[--i]; + } + } else if (i > 0) { + dst[k] = storage[--i]; + } else { + break; } } } } -static int TIM_SORT_COLLAPSE(SORT_TYPE *dst, TIM_SORT_RUN_T *stack, int stack_curr, - TEMP_STORAGE_T *store, const size_t size) { - while (1) { - size_t A, B, C, D; - int ABC, BCD, CD; - +static int TIM_SORT_COLLAPSE(SORT_TYPE *dst, TIM_SORT_RUN_T *stack, int stack_curr, + TEMP_STORAGE_T *store, const size_t size) { + while (1) { + size_t A, B, C, D; + int ABC, BCD, CD; + /* if the stack only has one thing on it, we are done with the collapse */ - if (stack_curr <= 1) { - break; - } - + if (stack_curr <= 1) { + break; + } + /* if this is the last merge, just do it */ - if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) { + if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) { TIM_SORT_MERGE(dst, stack, stack_curr, store); stack[0].length += stack[1].length; stack_curr--; break; } /* check if the invariant is off for a stack of 2 elements */ - else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) { + else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) { TIM_SORT_MERGE(dst, stack, stack_curr, store); stack[0].length += stack[1].length; stack_curr--; break; - } else if (stack_curr == 2) { - break; + } else if (stack_curr == 2) { + break; + } + + B = stack[stack_curr - 3].length; + C = stack[stack_curr - 2].length; + D = stack[stack_curr - 1].length; + + if (stack_curr >= 4) { + A = stack[stack_curr - 4].length; + ABC = (A <= B + C); + } else { + ABC = 0; } - B = stack[stack_curr - 3].length; - C = stack[stack_curr - 2].length; - D = stack[stack_curr - 1].length; + BCD = (B <= C + D) || ABC; + CD = (C <= D); - if (stack_curr >= 4) { - A = stack[stack_curr - 4].length; - ABC = (A <= B + C); - } else { - ABC = 0; + /* Both invariants are good */ + if (!BCD && !CD) { + break; } - - BCD = (B <= C + D) || ABC; - CD = (C <= D); - - /* Both invariants are good */ - if (!BCD && !CD) { - break; - } - - /* left merge */ - if (BCD && !CD) { - TIM_SORT_MERGE(dst, stack, stack_curr - 1, store); - stack[stack_curr - 3].length += stack[stack_curr - 2].length; - stack[stack_curr - 2] = stack[stack_curr - 1]; - stack_curr--; - } else { - /* right merge */ + + /* left merge */ + if (BCD && !CD) { + TIM_SORT_MERGE(dst, stack, stack_curr - 1, store); + stack[stack_curr - 3].length += stack[stack_curr - 2].length; + stack[stack_curr - 2] = stack[stack_curr - 1]; + stack_curr--; + } else { + /* right merge */ TIM_SORT_MERGE(dst, stack, stack_curr, store); stack[stack_curr - 2].length += stack[stack_curr - 1].length; stack_curr--; } } - + return stack_curr; } -static __inline int PUSH_NEXT(SORT_TYPE *dst, - const size_t size, - TEMP_STORAGE_T *store, - const size_t minrun, - TIM_SORT_RUN_T *run_stack, - size_t *stack_curr, - size_t *curr) { - size_t len = COUNT_RUN(dst, *curr, size); - size_t run = minrun; - - if (run > size - *curr) { - run = size - *curr; - } - - if (run > len) { - BINARY_INSERTION_SORT_START(&dst[*curr], len, run); - len = run; - } - - run_stack[*stack_curr].start = *curr; - run_stack[*stack_curr].length = len; - (*stack_curr)++; - *curr += len; - - if (*curr == size) { - /* finish up */ - while (*stack_curr > 1) { - TIM_SORT_MERGE(dst, run_stack, *stack_curr, store); - run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length; - (*stack_curr)--; - } - - if (store->storage != NULL) { - free(store->storage); - store->storage = NULL; - } - - return 0; - } - - return 1; -} - -void TIM_SORT(SORT_TYPE *dst, const size_t size) { - size_t minrun; +static __inline int PUSH_NEXT(SORT_TYPE *dst, + const size_t size, + TEMP_STORAGE_T *store, + const size_t minrun, + TIM_SORT_RUN_T *run_stack, + size_t *stack_curr, + size_t *curr) { + size_t len = COUNT_RUN(dst, *curr, size); + size_t run = minrun; + + if (run > size - *curr) { + run = size - *curr; + } + + if (run > len) { + BINARY_INSERTION_SORT_START(&dst[*curr], len, run); + len = run; + } + + run_stack[*stack_curr].start = *curr; + run_stack[*stack_curr].length = len; + (*stack_curr)++; + *curr += len; + + if (*curr == size) { + /* finish up */ + while (*stack_curr > 1) { + TIM_SORT_MERGE(dst, run_stack, *stack_curr, store); + run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length; + (*stack_curr)--; + } + + if (store->storage != NULL) { + free(store->storage); + store->storage = NULL; + } + + return 0; + } + + return 1; +} + +void TIM_SORT(SORT_TYPE *dst, const size_t size) { + size_t minrun; TEMP_STORAGE_T _store, *store; - TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE]; - size_t stack_curr = 0; - size_t curr = 0; - - /* don't bother sorting an array of size 1 */ - if (size <= 1) { - return; - } - - if (size < 64) { + TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE]; + size_t stack_curr = 0; + size_t curr = 0; + + /* don't bother sorting an array of size 1 */ + if (size <= 1) { + return; + } + + if (size < 64) { BINARY_INSERTION_SORT(dst, size); return; } @@ -552,27 +552,27 @@ void TIM_SORT(SORT_TYPE *dst, const size_t size) { store->alloc = 0; store->storage = NULL; - if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { - return; - } - - if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { - return; - } - - if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { - return; - } - - while (1) { - if (!CHECK_INVARIANT(run_stack, stack_curr)) { + if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { + return; + } + + if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { + return; + } + + if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { + return; + } + + while (1) { + if (!CHECK_INVARIANT(run_stack, stack_curr)) { stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size); continue; } - - if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { - return; - } + + if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) { + return; + } } } diff --git a/contrib/libs/libxml/tree.c b/contrib/libs/libxml/tree.c index 4e38d9e3c2..08b1a5004d 100644 --- a/contrib/libs/libxml/tree.c +++ b/contrib/libs/libxml/tree.c @@ -10,16 +10,16 @@ * */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" #include <string.h> /* for memset() only ! */ -#include <stddef.h> +#include <stddef.h> #include <limits.h> #ifdef HAVE_CTYPE_H #include <ctype.h> @@ -27,8 +27,8 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif #include <libxml/xmlmemory.h> @@ -59,7 +59,7 @@ int __xmlRegisterCallbacks = 0; ************************************************************************/ static xmlNsPtr -xmlNewReconciledNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns); +xmlNewReconciledNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns); static xmlChar* xmlGetPropNodeValueInternal(const xmlAttr *prop); @@ -181,7 +181,7 @@ xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) { * @dtd: A pointer to the DTD to search * @name: The entity name * - * Do an entity lookup in the DTD parameter entity hash table and + * Do an entity lookup in the DTD parameter entity hash table and * return the corresponding entity, if found. * * Returns A pointer to the entity structure or NULL if not found. @@ -260,9 +260,9 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, * * [NS 7] LocalPart ::= NCName * - * Returns NULL if the name doesn't have a prefix. Otherwise, returns the - * local part, and prefix is updated to get the Prefix. Both the return value - * and the prefix must be freed by the caller. + * Returns NULL if the name doesn't have a prefix. Otherwise, returns the + * local part, and prefix is updated to get the Prefix. Both the return value + * and the prefix must be freed by the caller. */ xmlChar * xmlSplitQName2(const xmlChar *name, xmlChar **prefix) { @@ -1050,7 +1050,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, * DICT_FREE: * @str: a string * - * Free a string if it is not owned by the "dict" dictionary in the + * Free a string if it is not owned by the "dict" dictionary in the * current scope */ #define DICT_FREE(str) \ @@ -1063,7 +1063,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, * DICT_COPY: * @str: a string * - * Copy a string using a "dict" dictionary in the current scope, + * Copy a string using a "dict" dictionary in the current scope, * if availabe. */ #define DICT_COPY(str, cpy) \ @@ -1080,7 +1080,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, * DICT_CONST_COPY: * @str: a string * - * Copy a string using a "dict" dictionary in the current scope, + * Copy a string using a "dict" dictionary in the current scope, * if availabe. */ #define DICT_CONST_COPY(str, cpy) \ @@ -1407,8 +1407,8 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) { else if ((ent != NULL) && (ent->children == NULL)) { xmlNodePtr temp; - /* Set to non-NULL value to avoid recursion. */ - ent->children = (xmlNodePtr) -1; + /* Set to non-NULL value to avoid recursion. */ + ent->children = (xmlNodePtr) -1; ent->children = xmlStringGetNodeList(doc, (const xmlChar*)node->content); ent->owner = 1; @@ -1459,9 +1459,9 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) { node->content = xmlBufDetach(buf); if (last == NULL) { - ret = node; + ret = node; } else { - xmlAddNextSibling(last, node); + xmlAddNextSibling(last, node); } } else if (ret == NULL) { ret = xmlNewDocText(doc, BAD_CAST ""); @@ -1601,15 +1601,15 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) { else if ((ent != NULL) && (ent->children == NULL)) { xmlNodePtr temp; - /* Set to non-NULL value to avoid recursion. */ - ent->children = (xmlNodePtr) -1; + /* Set to non-NULL value to avoid recursion. */ + ent->children = (xmlNodePtr) -1; ent->children = xmlStringGetNodeList(doc, (const xmlChar*)node->content); ent->owner = 1; temp = ent->children; while (temp) { temp->parent = (xmlNodePtr)ent; - ent->last = temp; + ent->last = temp; temp = temp->next; } } @@ -1650,9 +1650,9 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) { node->content = xmlBufDetach(buf); if (last == NULL) { - ret = node; + ret = node; } else { - xmlAddNextSibling(last, node); + xmlAddNextSibling(last, node); } } @@ -2281,7 +2281,7 @@ xmlNewNodeEatName(xmlNsPtr ns, xmlChar *name) { cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); if (cur == NULL) { xmlTreeErrMemory("building node"); - /* we can't check here that name comes from the doc dictionary */ + /* we can't check here that name comes from the doc dictionary */ return(NULL); } memset(cur, 0, sizeof(xmlNode)); @@ -2361,7 +2361,7 @@ xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns, UPDATE_LAST_CHILD_AND_PARENT(cur) } } else { - /* if name don't come from the doc dictionary free it here */ + /* if name don't come from the doc dictionary free it here */ if ((name != NULL) && (doc != NULL) && (!(xmlDictOwns(doc->dict, name)))) xmlFree(name); @@ -2810,27 +2810,27 @@ xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) { if(tree->type == XML_ELEMENT_NODE) { prop = tree->properties; while (prop != NULL) { - if (prop->atype == XML_ATTRIBUTE_ID) { - xmlRemoveID(tree->doc, prop); - } - + if (prop->atype == XML_ATTRIBUTE_ID) { + xmlRemoveID(tree->doc, prop); + } + prop->doc = doc; xmlSetListDoc(prop->children, doc); - - /* - * TODO: ID attributes should be also added to the new - * document, but this breaks things like xmlReplaceNode. - * The underlying problem is that xmlRemoveID is only called - * if a node is destroyed, not if it's unlinked. - */ -#if 0 - if (xmlIsID(doc, tree, prop)) { - xmlChar *idVal = xmlNodeListGetString(doc, prop->children, - 1); - xmlAddID(NULL, doc, idVal, prop); - } -#endif - + + /* + * TODO: ID attributes should be also added to the new + * document, but this breaks things like xmlReplaceNode. + * The underlying problem is that xmlRemoveID is only called + * if a node is destroyed, not if it's unlinked. + */ +#if 0 + if (xmlIsID(doc, tree, prop)) { + xmlChar *idVal = xmlNodeListGetString(doc, prop->children, + 1); + xmlAddID(NULL, doc, idVal, prop); + } +#endif + prop = prop->next; } } @@ -2950,7 +2950,7 @@ xmlNewChild(xmlNodePtr parent, xmlNsPtr ns, * Add a new attribute after @prev using @cur as base attribute. * When inserting before @cur, @prev is passed as @cur->prev. * When inserting after @cur, @prev is passed as @cur. - * If an existing attribute is found it is destroyed prior to adding @prop. + * If an existing attribute is found it is destroyed prior to adding @prop. * * Returns the attribute being inserted or NULL in case of error. */ @@ -3664,9 +3664,9 @@ xmlNextElementSibling(xmlNodePtr node) { void xmlFreeNodeList(xmlNodePtr cur) { xmlNodePtr next; - xmlNodePtr parent; + xmlNodePtr parent; xmlDictPtr dict = NULL; - size_t depth = 0; + size_t depth = 0; if (cur == NULL) return; if (cur->type == XML_NAMESPACE_DECL) { @@ -3682,16 +3682,16 @@ xmlFreeNodeList(xmlNodePtr cur) { return; } if (cur->doc != NULL) dict = cur->doc->dict; - while (1) { - while ((cur->children != NULL) && - (cur->type != XML_DTD_NODE) && - (cur->type != XML_ENTITY_REF_NODE)) { - cur = cur->children; - depth += 1; - } - + while (1) { + while ((cur->children != NULL) && + (cur->type != XML_DTD_NODE) && + (cur->type != XML_ENTITY_REF_NODE)) { + cur = cur->children; + depth += 1; + } + next = cur->next; - parent = cur->parent; + parent = cur->parent; if (cur->type != XML_DTD_NODE) { if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue)) @@ -3719,7 +3719,7 @@ xmlFreeNodeList(xmlNodePtr cur) { * When a node is a text node or a comment, it uses a global static * variable for the name of the node. * Otherwise the node name might come from the document's - * dictionary + * dictionary */ if ((cur->name != NULL) && (cur->type != XML_TEXT_NODE) && @@ -3727,16 +3727,16 @@ xmlFreeNodeList(xmlNodePtr cur) { DICT_FREE(cur->name) xmlFree(cur); } - - if (next != NULL) { - cur = next; - } else { - if ((depth == 0) || (parent == NULL)) - break; - depth -= 1; - cur = parent; - cur->children = NULL; - } + + if (next != NULL) { + cur = next; + } else { + if ((depth == 0) || (parent == NULL)) + break; + depth -= 1; + cur = parent; + cur->children = NULL; + } } } @@ -3797,7 +3797,7 @@ xmlFreeNode(xmlNodePtr cur) { /* * When a node is a text node or a comment, it uses a global static * variable for the name of the node. - * Otherwise the node name might come from the document's dictionary + * Otherwise the node name might come from the document's dictionary */ if ((cur->name != NULL) && (cur->type != XML_TEXT_NODE) && @@ -4066,7 +4066,7 @@ xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { } else { /* * we have to find something appropriate here since - * we cant be sure, that the namespace we found is identified + * we cant be sure, that the namespace we found is identified * by the prefix */ if (xmlStrEqual(ns->href, cur->ns->href)) { @@ -4074,10 +4074,10 @@ xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { ret->ns = ns; } else { /* - * we are in trouble: we need a new reconciled namespace. + * we are in trouble: we need a new reconciled namespace. * This is expensive */ - ret->ns = xmlNewReconciledNs(target->doc, target, cur->ns); + ret->ns = xmlNewReconciledNs(target->doc, target, cur->ns); } } @@ -4170,8 +4170,8 @@ xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) { * say RPM:Copyright without changing the namespace pointer to * something else can produce stale links. One way to do it is * to keep a reference counter but this doesn't work as soon - * as one moves the element or the subtree out of the scope of - * the existing namespace. The actual solution seems to be to add + * as one moves the element or the subtree out of the scope of + * the existing namespace. The actual solution seems to be to add * a copy of the namespace at the top of the copied tree if * not available in the subtree. * Hence two functions, the public front-end call the inner ones @@ -4296,7 +4296,7 @@ xmlStaticCopyNode(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent, while (root->parent != NULL) root = root->parent; ret->ns = xmlNewNs(root, ns->href, ns->prefix); } else { - ret->ns = xmlNewReconciledNs(doc, ret, node->ns); + ret->ns = xmlNewReconciledNs(doc, ret, node->ns); } } else { /* @@ -4622,7 +4622,7 @@ xmlGetLineNoInternal(const xmlNode *node, int depth) (node->type == XML_PI_NODE)) { if (node->line == 65535) { if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL)) - result = (long) (ptrdiff_t) node->psvi; + result = (long) (ptrdiff_t) node->psvi; else if ((node->type == XML_ELEMENT_NODE) && (node->children != NULL)) result = xmlGetLineNoInternal(node->children, depth + 1); @@ -4735,7 +4735,7 @@ xmlGetNodePath(const xmlNode *node) /* * Thumbler index computation - * TODO: the occurrence test seems bogus for namespaced names + * TODO: the occurrence test seems bogus for namespaced names */ tmp = cur->prev; while (tmp != NULL) { @@ -4781,8 +4781,8 @@ xmlGetNodePath(const xmlNode *node) if (occur == 0) { tmp = cur->next; while (tmp != NULL && occur == 0) { - if (tmp->type == XML_COMMENT_NODE) - occur++; + if (tmp->type == XML_COMMENT_NODE) + occur++; tmp = tmp->next; } if (occur != 0) @@ -6230,7 +6230,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href) } /** - * xmlNewReconciledNs: + * xmlNewReconciledNs: * @doc: the document * @tree: a node expected to hold the new namespace * @ns: the original namespace @@ -6243,7 +6243,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href) * Returns the (new) namespace definition or NULL in case of error */ static xmlNsPtr -xmlNewReconciledNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) { +xmlNewReconciledNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) { xmlNsPtr def; xmlChar prefix[50]; int counter = 1; @@ -6251,14 +6251,14 @@ xmlNewReconciledNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) { if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, - "xmlNewReconciledNs : tree == NULL\n"); + "xmlNewReconciledNs : tree == NULL\n"); #endif return(NULL); } if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, - "xmlNewReconciledNs : ns == NULL\n"); + "xmlNewReconciledNs : ns == NULL\n"); #endif return(NULL); } @@ -6360,7 +6360,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { /* * OK we need to recreate a new namespace definition */ - n = xmlNewReconciledNs(doc, tree, node->ns); + n = xmlNewReconciledNs(doc, tree, node->ns); if (n != NULL) { /* :-( what if else ??? */ /* * check if we need to grow the cache buffers. @@ -6389,7 +6389,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { } } /* - * now check for namespace held by attributes on the node. + * now check for namespace held by attributes on the node. */ if (node->type == XML_ELEMENT_NODE) { attr = node->properties; @@ -6424,7 +6424,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { /* * OK we need to recreate a new namespace definition */ - n = xmlNewReconciledNs(doc, tree, attr->ns); + n = xmlNewReconciledNs(doc, tree, attr->ns); if (n != NULL) { /* :-( what if else ??? */ /* * check if we need to grow the cache buffers. @@ -7977,7 +7977,7 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position, * Creates or reuses an xmlNs struct on doc->oldNs with * the given prefix and namespace name. * -* Returns the acquired ns struct or NULL in case of an API +* Returns the acquired ns struct or NULL in case of an API * or internal error. */ static xmlNsPtr @@ -8275,7 +8275,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, ns = ns->next; } while (ns != NULL); } - /* Falls through. */ + /* Falls through. */ case XML_ATTRIBUTE_NODE: if (node->ns != NULL) { /* @@ -8591,7 +8591,7 @@ ns_next_prefix: } /* -* xmlDOMWrapNSNormAcquireNormalizedNs: +* xmlDOMWrapNSNormAcquireNormalizedNs: * @doc: the doc * @elem: the element-node to declare namespaces on * @ns: the ns-struct to use for the search @@ -8610,7 +8610,7 @@ ns_next_prefix: * Returns 0 if succeeded, -1 otherwise and on API/internal errors. */ static int -xmlDOMWrapNSNormAcquireNormalizedNs(xmlDocPtr doc, +xmlDOMWrapNSNormAcquireNormalizedNs(xmlDocPtr doc, xmlNodePtr elem, xmlNsPtr ns, xmlNsPtr *retNs, @@ -8866,7 +8866,7 @@ next_ns_decl: } if (! adoptns) goto ns_end; - /* Falls through. */ + /* Falls through. */ case XML_ATTRIBUTE_NODE: /* No ns, no fun. */ if (cur->ns == NULL) @@ -8909,9 +8909,9 @@ next_ns_decl: } } /* - * Acquire a normalized ns-decl and add it to the map. + * Acquire a normalized ns-decl and add it to the map. */ - if (xmlDOMWrapNSNormAcquireNormalizedNs(doc, curElem, + if (xmlDOMWrapNSNormAcquireNormalizedNs(doc, curElem, cur->ns, &ns, &nsMap, depth, ancestorsOnly, @@ -9049,7 +9049,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, nsMap = (xmlNsMapPtr) ctxt->namespaceMap; /* * Disable search for ns-decls in the parent-axis of the - * destination element, if: + * destination element, if: * 1) there's no destination parent * 2) custom ns-reference handling is used */ @@ -9147,7 +9147,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, goto internal_error; } } - /* Falls through. */ + /* Falls through. */ case XML_ATTRIBUTE_NODE: /* No namespace, no fun. */ if (cur->ns == NULL) @@ -9194,9 +9194,9 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, cur->ns = ns; } else { /* - * Acquire a normalized ns-decl and add it to the map. + * Acquire a normalized ns-decl and add it to the map. */ - if (xmlDOMWrapNSNormAcquireNormalizedNs(destDoc, + if (xmlDOMWrapNSNormAcquireNormalizedNs(destDoc, /* ns-decls on curElem or on destDoc->oldNs */ destParent ? curElem : NULL, cur->ns, &ns, @@ -9250,7 +9250,7 @@ ns_end: goto leave_node; case XML_ENTITY_REF_NODE: /* - * Remove reference to the entity-node. + * Remove reference to the entity-node. */ cur->content = NULL; cur->children = NULL; @@ -9484,7 +9484,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, } memset(clone, 0, sizeof(xmlNode)); /* - * Set hierarchical links. + * Set hierarchical links. */ if (resultClone != NULL) { clone->parent = parentClone; @@ -9508,7 +9508,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, } memset(clone, 0, sizeof(xmlAttr)); /* - * Set hierarchical links. + * Set hierarchical links. * TODO: Change this to add to the end of attributes. */ if (resultClone != NULL) { @@ -9736,9 +9736,9 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, clone->ns = ns; } else { /* - * Acquire a normalized ns-decl and add it to the map. + * Acquire a normalized ns-decl and add it to the map. */ - if (xmlDOMWrapNSNormAcquireNormalizedNs(destDoc, + if (xmlDOMWrapNSNormAcquireNormalizedNs(destDoc, /* ns-decls on curElem or on destDoc->oldNs */ destParent ? curElem : NULL, cur->ns, &ns, @@ -9975,7 +9975,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt, break; case XML_ENTITY_REF_NODE: /* - * Remove reference to the entity-node. + * Remove reference to the entity-node. */ cur->content = NULL; cur->children = NULL; @@ -10113,7 +10113,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, break; case XML_ENTITY_REF_NODE: /* - * Remove reference to the entity-node. + * Remove reference to the entity-node. */ node->content = NULL; node->children = NULL; diff --git a/contrib/libs/libxml/uri.c b/contrib/libs/libxml/uri.c index ed8c6084cd..05d81e5763 100644 --- a/contrib/libs/libxml/uri.c +++ b/contrib/libs/libxml/uri.c @@ -22,7 +22,7 @@ * MAX_URI_LENGTH: * * The definition of the URI regexp in the above RFC has no size limit - * In practice they are usually relatively short except for the + * In practice they are usually relatively short except for the * data URI scheme as defined in RFC 2397. Even for data URI the usual * maximum size before hitting random practical limits is around 64 KB * and 4KB is usually a maximum admitted limit for proper operations. @@ -314,7 +314,7 @@ xmlParse3986Query(xmlURIPtr uri, const char **str) * @uri: pointer to an URI structure * @str: the string to analyze * - * Parse a port part and fills in the appropriate fields + * Parse a port part and fills in the appropriate fields * of the @uri structure * * port = *DIGIT @@ -325,18 +325,18 @@ static int xmlParse3986Port(xmlURIPtr uri, const char **str) { const char *cur = *str; - int port = 0; + int port = 0; if (ISA_DIGIT(cur)) { while (ISA_DIGIT(cur)) { - port = port * 10 + (*cur - '0'); - if (port > 99999999) - port = 99999999; - + port = port * 10 + (*cur - '0'); + if (port > 99999999) + port = 99999999; + cur++; } - if (uri != NULL) - uri->port = port; + if (uri != NULL) + uri->port = port; *str = cur; return(0); } @@ -438,7 +438,7 @@ xmlParse3986Host(xmlURIPtr uri, const char **str) host = cur; /* - * IPv6 and future addressing scheme are enclosed between brackets + * IPv6 and future addressing scheme are enclosed between brackets */ if (*cur == '[') { cur++; @@ -1458,7 +1458,7 @@ xmlNormalizeURIPath(char *path) { goto done_cd; (out++)[0] = (cur++)[0]; } - /* normalize // */ + /* normalize // */ while ((cur[0] == '/') && (cur[1] == '/')) cur++; @@ -1963,9 +1963,9 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { res->scheme = xmlMemStrdup(bas->scheme); if (bas->authority != NULL) res->authority = xmlMemStrdup(bas->authority); - else if ((bas->server != NULL) || (bas->port == -1)) { - if (bas->server != NULL) - res->server = xmlMemStrdup(bas->server); + else if ((bas->server != NULL) || (bas->port == -1)) { + if (bas->server != NULL) + res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); res->port = bas->port; @@ -2027,9 +2027,9 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { } if (bas->authority != NULL) res->authority = xmlMemStrdup(bas->authority); - else if ((bas->server != NULL) || (bas->port == -1)) { - if (bas->server != NULL) - res->server = xmlMemStrdup(bas->server); + else if ((bas->server != NULL) || (bas->port == -1)) { + if (bas->server != NULL) + res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); res->port = bas->port; @@ -2152,7 +2152,7 @@ done: * http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif * * - * Note: if the URI reference is really weird or complicated, it may be + * Note: if the URI reference is really weird or complicated, it may be * worthwhile to first convert it into a "nice" one by calling * xmlBuildURI (using 'base') before calling this routine, * since this routine (for reasonable efficiency) assumes URI has @@ -2239,23 +2239,23 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) * two path components may be missing (bug 316224) */ bptr = (xmlChar *)bas->path; - { - xmlChar *rptr = (xmlChar *) ref->path; - int pos = 0; - - /* - * Next we compare the two strings and find where they first differ - */ - if ((*rptr == '.') && (rptr[1] == '/')) - rptr += 2; + { + xmlChar *rptr = (xmlChar *) ref->path; + int pos = 0; + + /* + * Next we compare the two strings and find where they first differ + */ + if ((*rptr == '.') && (rptr[1] == '/')) + rptr += 2; if ((*bptr == '.') && (bptr[1] == '/')) bptr += 2; - else if ((*bptr == '/') && (*rptr != '/')) + else if ((*bptr == '/') && (*rptr != '/')) bptr++; - while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0)) + while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0)) pos++; - if (bptr[pos] == rptr[pos]) { + if (bptr[pos] == rptr[pos]) { val = xmlStrdup(BAD_CAST ""); goto done; /* (I can't imagine why anyone would do this) */ } @@ -2266,27 +2266,27 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) */ ix = pos; for (; ix > 0; ix--) { - if (rptr[ix - 1] == '/') + if (rptr[ix - 1] == '/') break; } - uptr = (xmlChar *)&rptr[ix]; + uptr = (xmlChar *)&rptr[ix]; /* * In base, count the number of '/' from the differing point */ - for (; bptr[ix] != 0; ix++) { - if (bptr[ix] == '/') - nbslash++; + for (; bptr[ix] != 0; ix++) { + if (bptr[ix] == '/') + nbslash++; + } + + /* + * e.g: URI="foo/" base="foo/bar" -> "./" + */ + if (nbslash == 0 && !uptr[0]) { + val = xmlStrdup(BAD_CAST "./"); + goto done; } - - /* - * e.g: URI="foo/" base="foo/bar" -> "./" - */ - if (nbslash == 0 && !uptr[0]) { - val = xmlStrdup(BAD_CAST "./"); - goto done; - } - + len = xmlStrlen (uptr) + 1; } @@ -2377,7 +2377,7 @@ xmlCanonicPath(const xmlChar *path) */ #if defined(_WIN32) && !defined(__CYGWIN__) int len = 0; - char *p = NULL; + char *p = NULL; #endif xmlURIPtr uri; xmlChar *ret; @@ -2441,7 +2441,7 @@ xmlCanonicPath(const xmlChar *path) xmlFreeURI(uri); return escURI; } - xmlFree(escURI); + xmlFree(escURI); } } @@ -2459,26 +2459,26 @@ path_processing: len = xmlStrlen(path); if ((len > 2) && IS_WINDOWS_PATH(path)) { /* make the scheme 'file' */ - uri->scheme = (char *) xmlStrdup(BAD_CAST "file"); + uri->scheme = (char *) xmlStrdup(BAD_CAST "file"); /* allocate space for leading '/' + path + string terminator */ uri->path = xmlMallocAtomic(len + 2); if (uri->path == NULL) { - xmlFreeURI(uri); /* Guard against 'out of memory' */ + xmlFreeURI(uri); /* Guard against 'out of memory' */ return(NULL); } /* Put in leading '/' plus path */ uri->path[0] = '/'; p = uri->path + 1; - strncpy(p, (char *) path, len + 1); + strncpy(p, (char *) path, len + 1); } else { - uri->path = (char *) xmlStrdup(path); + uri->path = (char *) xmlStrdup(path); if (uri->path == NULL) { xmlFreeURI(uri); return(NULL); } p = uri->path; } - /* Now change all occurrences of '\' to '/' */ + /* Now change all occurrences of '\' to '/' */ while (*p != '\0') { if (*p == '\\') *p = '/'; @@ -2528,7 +2528,7 @@ xmlPathToURI(const xmlChar *path) return(NULL); #if defined(_WIN32) && !defined(__CYGWIN__) /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?) - If 'cal' is a valid URI already then we are done here, as continuing would make + If 'cal' is a valid URI already then we are done here, as continuing would make it invalid. */ if ((uri = xmlParseURI((const char *) cal)) != NULL) { xmlFreeURI(uri); diff --git a/contrib/libs/libxml/valid.c b/contrib/libs/libxml/valid.c index ccd9cd23c7..07963e7451 100644 --- a/contrib/libs/libxml/valid.c +++ b/contrib/libs/libxml/valid.c @@ -93,7 +93,7 @@ xmlVErrMemory(xmlValidCtxtPtr ctxt, const char *extra) * * Handle a validation error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error, const char *msg, const char *extra) { @@ -137,7 +137,7 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error, * * Handle a validation error, provide contextual informations */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlErrValidNode(xmlValidCtxtPtr ctxt, xmlNodePtr node, xmlParserErrors error, const char *msg, const xmlChar * str1, @@ -163,7 +163,7 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt, __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error, XML_ERR_ERROR, NULL, 0, (const char *) str1, - (const char *) str2, + (const char *) str2, (const char *) str3, 0, 0, msg, str1, str2, str3); } #endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ @@ -180,7 +180,7 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt, * * Handle a validation error, provide contextual informations */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlErrValidNodeNr(xmlValidCtxtPtr ctxt, xmlNodePtr node, xmlParserErrors error, const char *msg, const xmlChar * str1, @@ -221,7 +221,7 @@ xmlErrValidNodeNr(xmlValidCtxtPtr ctxt, * * Handle a validation error, provide contextual information */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlErrValidWarning(xmlValidCtxtPtr ctxt, xmlNodePtr node, xmlParserErrors error, const char *msg, const xmlChar * str1, @@ -247,7 +247,7 @@ xmlErrValidWarning(xmlValidCtxtPtr ctxt, __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error, XML_ERR_WARNING, NULL, 0, (const char *) str1, - (const char *) str2, + (const char *) str2, (const char *) str3, 0, 0, msg, str1, str2, str3); } @@ -1100,21 +1100,21 @@ xmlCopyElementContent(xmlElementContentPtr cur) { void xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { xmlDictPtr dict = NULL; - size_t depth = 0; + size_t depth = 0; - if (cur == NULL) - return; + if (cur == NULL) + return; if (doc != NULL) dict = doc->dict; - while (1) { - xmlElementContentPtr parent; - - while ((cur->c1 != NULL) || (cur->c2 != NULL)) { - cur = (cur->c1 != NULL) ? cur->c1 : cur->c2; - depth += 1; - } - + while (1) { + xmlElementContentPtr parent; + + while ((cur->c1 != NULL) || (cur->c2 != NULL)) { + cur = (cur->c1 != NULL) ? cur->c1 : cur->c2; + depth += 1; + } + switch (cur->type) { case XML_ELEMENT_CONTENT_PCDATA: case XML_ELEMENT_CONTENT_ELEMENT: @@ -1136,23 +1136,23 @@ xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { if (cur->name != NULL) xmlFree((xmlChar *) cur->name); if (cur->prefix != NULL) xmlFree((xmlChar *) cur->prefix); } - parent = cur->parent; - if ((depth == 0) || (parent == NULL)) { - xmlFree(cur); - break; - } - if (cur == parent->c1) - parent->c1 = NULL; - else - parent->c2 = NULL; + parent = cur->parent; + if ((depth == 0) || (parent == NULL)) { + xmlFree(cur); + break; + } + if (cur == parent->c1) + parent->c1 = NULL; + else + parent->c2 = NULL; xmlFree(cur); - - if (parent->c2 != NULL) { - cur = parent->c2; - } else { - depth -= 1; - cur = parent; - } + + if (parent->c2 != NULL) { + cur = parent->c2; + } else { + depth -= 1; + cur = parent; + } } } @@ -1170,105 +1170,105 @@ xmlFreeElementContent(xmlElementContentPtr cur) { #ifdef LIBXML_OUTPUT_ENABLED /** - * xmlDumpElementOccur: + * xmlDumpElementOccur: * @buf: An XML buffer - * @cur: An element table + * @cur: An element table * - * Dump the occurence operator of an element. + * Dump the occurence operator of an element. */ static void -xmlDumpElementOccur(xmlBufferPtr buf, xmlElementContentPtr cur) { - switch (cur->ocur) { +xmlDumpElementOccur(xmlBufferPtr buf, xmlElementContentPtr cur) { + switch (cur->ocur) { case XML_ELEMENT_CONTENT_ONCE: - break; + break; case XML_ELEMENT_CONTENT_OPT: - xmlBufferWriteChar(buf, "?"); - break; + xmlBufferWriteChar(buf, "?"); + break; case XML_ELEMENT_CONTENT_MULT: - xmlBufferWriteChar(buf, "*"); - break; + xmlBufferWriteChar(buf, "*"); + break; case XML_ELEMENT_CONTENT_PLUS: - xmlBufferWriteChar(buf, "+"); - break; + xmlBufferWriteChar(buf, "+"); + break; } } /** - * xmlDumpElementContent: - * @buf: An XML buffer - * @content: An element table - * - * This will dump the content of the element table as an XML DTD definition - */ -static void -xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content) { - xmlElementContentPtr cur; - - if (content == NULL) return; - - xmlBufferWriteChar(buf, "("); - cur = content; - - do { - if (cur == NULL) return; - - switch (cur->type) { - case XML_ELEMENT_CONTENT_PCDATA: - xmlBufferWriteChar(buf, "#PCDATA"); - break; - case XML_ELEMENT_CONTENT_ELEMENT: - if (cur->prefix != NULL) { - xmlBufferWriteCHAR(buf, cur->prefix); - xmlBufferWriteChar(buf, ":"); - } - xmlBufferWriteCHAR(buf, cur->name); - break; - case XML_ELEMENT_CONTENT_SEQ: - case XML_ELEMENT_CONTENT_OR: - if ((cur != content) && - (cur->parent != NULL) && - ((cur->type != cur->parent->type) || - (cur->ocur != XML_ELEMENT_CONTENT_ONCE))) - xmlBufferWriteChar(buf, "("); - cur = cur->c1; - continue; - default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, - "Internal: ELEMENT cur corrupted invalid type\n", - NULL); - } - - while (cur != content) { - xmlElementContentPtr parent = cur->parent; - - if (parent == NULL) return; - - if (((cur->type == XML_ELEMENT_CONTENT_OR) || - (cur->type == XML_ELEMENT_CONTENT_SEQ)) && - ((cur->type != parent->type) || - (cur->ocur != XML_ELEMENT_CONTENT_ONCE))) - xmlBufferWriteChar(buf, ")"); - xmlDumpElementOccur(buf, cur); - - if (cur == parent->c1) { - if (parent->type == XML_ELEMENT_CONTENT_SEQ) - xmlBufferWriteChar(buf, " , "); - else if (parent->type == XML_ELEMENT_CONTENT_OR) - xmlBufferWriteChar(buf, " | "); - - cur = parent->c2; - break; - } - - cur = parent; - } - } while (cur != content); - - xmlBufferWriteChar(buf, ")"); - xmlDumpElementOccur(buf, content); -} - -/** + * xmlDumpElementContent: + * @buf: An XML buffer + * @content: An element table + * + * This will dump the content of the element table as an XML DTD definition + */ +static void +xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content) { + xmlElementContentPtr cur; + + if (content == NULL) return; + + xmlBufferWriteChar(buf, "("); + cur = content; + + do { + if (cur == NULL) return; + + switch (cur->type) { + case XML_ELEMENT_CONTENT_PCDATA: + xmlBufferWriteChar(buf, "#PCDATA"); + break; + case XML_ELEMENT_CONTENT_ELEMENT: + if (cur->prefix != NULL) { + xmlBufferWriteCHAR(buf, cur->prefix); + xmlBufferWriteChar(buf, ":"); + } + xmlBufferWriteCHAR(buf, cur->name); + break; + case XML_ELEMENT_CONTENT_SEQ: + case XML_ELEMENT_CONTENT_OR: + if ((cur != content) && + (cur->parent != NULL) && + ((cur->type != cur->parent->type) || + (cur->ocur != XML_ELEMENT_CONTENT_ONCE))) + xmlBufferWriteChar(buf, "("); + cur = cur->c1; + continue; + default: + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + "Internal: ELEMENT cur corrupted invalid type\n", + NULL); + } + + while (cur != content) { + xmlElementContentPtr parent = cur->parent; + + if (parent == NULL) return; + + if (((cur->type == XML_ELEMENT_CONTENT_OR) || + (cur->type == XML_ELEMENT_CONTENT_SEQ)) && + ((cur->type != parent->type) || + (cur->ocur != XML_ELEMENT_CONTENT_ONCE))) + xmlBufferWriteChar(buf, ")"); + xmlDumpElementOccur(buf, cur); + + if (cur == parent->c1) { + if (parent->type == XML_ELEMENT_CONTENT_SEQ) + xmlBufferWriteChar(buf, " , "); + else if (parent->type == XML_ELEMENT_CONTENT_OR) + xmlBufferWriteChar(buf, " | "); + + cur = parent->c2; + break; + } + + cur = parent; + } + } while (cur != content); + + xmlBufferWriteChar(buf, ")"); + xmlDumpElementOccur(buf, content); +} + +/** * xmlSprintfElementContent: * @buf: an output buffer * @content: An element table @@ -1309,15 +1309,15 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int case XML_ELEMENT_CONTENT_PCDATA: strcat(buf, "#PCDATA"); break; - case XML_ELEMENT_CONTENT_ELEMENT: { - int qnameLen = xmlStrlen(content->name); - - if (content->prefix != NULL) - qnameLen += xmlStrlen(content->prefix) + 1; - if (size - len < qnameLen + 10) { - strcat(buf, " ..."); - return; - } + case XML_ELEMENT_CONTENT_ELEMENT: { + int qnameLen = xmlStrlen(content->name); + + if (content->prefix != NULL) + qnameLen += xmlStrlen(content->prefix) + 1; + if (size - len < qnameLen + 10) { + strcat(buf, " ..."); + return; + } if (content->prefix != NULL) { strcat(buf, (char *) content->prefix); strcat(buf, ":"); @@ -1325,7 +1325,7 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int if (content->name != NULL) strcat(buf, (char *) content->name); break; - } + } case XML_ELEMENT_CONTENT_SEQ: if ((content->c1->type == XML_ELEMENT_CONTENT_OR) || (content->c1->type == XML_ELEMENT_CONTENT_SEQ)) @@ -1367,7 +1367,7 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int xmlSnprintfElementContent(buf, size, content->c2, 0); break; } - if (size - strlen(buf) <= 2) return; + if (size - strlen(buf) <= 2) return; if (englob) strcat(buf, ")"); switch (content->ocur) { @@ -1640,11 +1640,11 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, return(ret); } -static void -xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeElement((xmlElementPtr) elem); -} - +static void +xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFreeElement((xmlElementPtr) elem); +} + /** * xmlFreeElementTable: * @table: An element table @@ -1653,7 +1653,7 @@ xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) { */ void xmlFreeElementTable(xmlElementTablePtr table) { - xmlHashFree(table, xmlFreeElementTableEntry); + xmlHashFree(table, xmlFreeElementTableEntry); } #ifdef LIBXML_TREE_ENABLED @@ -1665,9 +1665,9 @@ xmlFreeElementTable(xmlElementTablePtr table) { * * Returns the new xmlElementPtr or NULL in case of error. */ -static void * -xmlCopyElement(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlElementPtr elem = (xmlElementPtr) payload; +static void * +xmlCopyElement(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlElementPtr elem = (xmlElementPtr) payload; xmlElementPtr cur; cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement)); @@ -1702,7 +1702,7 @@ xmlCopyElement(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { */ xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table) { - return((xmlElementTablePtr) xmlHashCopy(table, xmlCopyElement)); + return((xmlElementTablePtr) xmlHashCopy(table, xmlCopyElement)); } #endif /* LIBXML_TREE_ENABLED */ @@ -1746,7 +1746,7 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) { } xmlBufferWriteCHAR(buf, elem->name); xmlBufferWriteChar(buf, " "); - xmlDumpElementContent(buf, elem->content); + xmlDumpElementContent(buf, elem->content); xmlBufferWriteChar(buf, ">\n"); break; case XML_ELEMENT_TYPE_ELEMENT: @@ -1757,7 +1757,7 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) { } xmlBufferWriteCHAR(buf, elem->name); xmlBufferWriteChar(buf, " "); - xmlDumpElementContent(buf, elem->content); + xmlDumpElementContent(buf, elem->content); xmlBufferWriteChar(buf, ">\n"); break; default: @@ -1776,9 +1776,9 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) { * the arguments. */ static void -xmlDumpElementDeclScan(void *elem, void *buf, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlDumpElementDecl((xmlBufferPtr) buf, (xmlElementPtr) elem); +xmlDumpElementDeclScan(void *elem, void *buf, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlDumpElementDecl((xmlBufferPtr) buf, (xmlElementPtr) elem); } /** @@ -1792,7 +1792,7 @@ void xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) { if ((buf == NULL) || (table == NULL)) return; - xmlHashScan(table, xmlDumpElementDeclScan, buf); + xmlHashScan(table, xmlDumpElementDeclScan, buf); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2192,11 +2192,11 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, return(ret); } -static void -xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeAttribute((xmlAttributePtr) attr); -} - +static void +xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFreeAttribute((xmlAttributePtr) attr); +} + /** * xmlFreeAttributeTable: * @table: An attribute table @@ -2205,7 +2205,7 @@ xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) { */ void xmlFreeAttributeTable(xmlAttributeTablePtr table) { - xmlHashFree(table, xmlFreeAttributeTableEntry); + xmlHashFree(table, xmlFreeAttributeTableEntry); } #ifdef LIBXML_TREE_ENABLED @@ -2217,9 +2217,9 @@ xmlFreeAttributeTable(xmlAttributeTablePtr table) { * * Returns the new xmlAttributePtr or NULL in case of error. */ -static void * -xmlCopyAttribute(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlAttributePtr attr = (xmlAttributePtr) payload; +static void * +xmlCopyAttribute(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlAttributePtr attr = (xmlAttributePtr) payload; xmlAttributePtr cur; cur = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute)); @@ -2253,7 +2253,7 @@ xmlCopyAttribute(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { */ xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table) { - return((xmlAttributeTablePtr) xmlHashCopy(table, xmlCopyAttribute)); + return((xmlAttributeTablePtr) xmlHashCopy(table, xmlCopyAttribute)); } #endif /* LIBXML_TREE_ENABLED */ @@ -2348,9 +2348,9 @@ xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) { * This is used with the hash scan function - just reverses arguments */ static void -xmlDumpAttributeDeclScan(void *attr, void *buf, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlDumpAttributeDecl((xmlBufferPtr) buf, (xmlAttributePtr) attr); +xmlDumpAttributeDeclScan(void *attr, void *buf, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlDumpAttributeDecl((xmlBufferPtr) buf, (xmlAttributePtr) attr); } /** @@ -2364,7 +2364,7 @@ void xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) { if ((buf == NULL) || (table == NULL)) return; - xmlHashScan(table, xmlDumpAttributeDeclScan, buf); + xmlHashScan(table, xmlDumpAttributeDeclScan, buf); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2470,11 +2470,11 @@ xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, return(ret); } -static void -xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeNotation((xmlNotationPtr) nota); -} - +static void +xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFreeNotation((xmlNotationPtr) nota); +} + /** * xmlFreeNotationTable: * @table: An notation table @@ -2483,7 +2483,7 @@ xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) { */ void xmlFreeNotationTable(xmlNotationTablePtr table) { - xmlHashFree(table, xmlFreeNotationTableEntry); + xmlHashFree(table, xmlFreeNotationTableEntry); } #ifdef LIBXML_TREE_ENABLED @@ -2495,9 +2495,9 @@ xmlFreeNotationTable(xmlNotationTablePtr table) { * * Returns the new xmlNotationPtr or NULL in case of error. */ -static void * -xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlNotationPtr nota = (xmlNotationPtr) payload; +static void * +xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlNotationPtr nota = (xmlNotationPtr) payload; xmlNotationPtr cur; cur = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation)); @@ -2530,7 +2530,7 @@ xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { */ xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table) { - return((xmlNotationTablePtr) xmlHashCopy(table, xmlCopyNotation)); + return((xmlNotationTablePtr) xmlHashCopy(table, xmlCopyNotation)); } #endif /* LIBXML_TREE_ENABLED */ @@ -2570,9 +2570,9 @@ xmlDumpNotationDecl(xmlBufferPtr buf, xmlNotationPtr nota) { * This is called with the hash scan function, and just reverses args */ static void -xmlDumpNotationDeclScan(void *nota, void *buf, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlDumpNotationDecl((xmlBufferPtr) buf, (xmlNotationPtr) nota); +xmlDumpNotationDeclScan(void *nota, void *buf, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlDumpNotationDecl((xmlBufferPtr) buf, (xmlNotationPtr) nota); } /** @@ -2586,7 +2586,7 @@ void xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) { if ((buf == NULL) || (table == NULL)) return; - xmlHashScan(table, xmlDumpNotationDeclScan, buf); + xmlHashScan(table, xmlDumpNotationDeclScan, buf); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2599,7 +2599,7 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) { * DICT_FREE: * @str: a string * - * Free a string if it is not owned by the "dict" dictionary in the + * Free a string if it is not owned by the "dict" dictionary in the * current scope */ #define DICT_FREE(str) \ @@ -2683,7 +2683,7 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, ret->doc = doc; if ((ctxt != NULL) && (ctxt->vstateNr != 0)) { /* - * Operating in streaming mode, attr is gonna disappear + * Operating in streaming mode, attr is gonna disappear */ if (doc->dict != NULL) ret->name = xmlDictLookup(doc->dict, attr->name, -1); @@ -2701,10 +2701,10 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, /* * The id is already defined in this DTD. */ - if (ctxt != NULL) { - xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED, - "ID %s already defined\n", value, NULL, NULL); - } + if (ctxt != NULL) { + xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED, + "ID %s already defined\n", value, NULL, NULL); + } #endif /* LIBXML_VALID_ENABLED */ xmlFreeID(ret); return(NULL); @@ -2714,11 +2714,11 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, return(ret); } -static void -xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeID((xmlIDPtr) id); -} - +static void +xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFreeID((xmlIDPtr) id); +} + /** * xmlFreeIDTable: * @table: An id table @@ -2727,7 +2727,7 @@ xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { */ void xmlFreeIDTable(xmlIDTablePtr table) { - xmlHashFree(table, xmlFreeIDTableEntry); + xmlHashFree(table, xmlFreeIDTableEntry); } /** @@ -2827,7 +2827,7 @@ xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { return(-1); } - xmlHashRemoveEntry(table, ID, xmlFreeIDTableEntry); + xmlHashRemoveEntry(table, ID, xmlFreeIDTableEntry); xmlFree(ID); attr->atype = 0; return(0); @@ -2911,14 +2911,14 @@ xmlFreeRef(xmlLinkPtr lk) { } /** - * xmlFreeRefTableEntry: + * xmlFreeRefTableEntry: * @list_ref: A list of references. * * Deallocate the memory used by a list of references */ static void -xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlListPtr list_ref = (xmlListPtr) payload; +xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlListPtr list_ref = (xmlListPtr) payload; if (list_ref == NULL) return; xmlListDelete(list_ref); } @@ -2931,7 +2931,7 @@ xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { * Returns 0 to abort the walk or 1 to continue */ static int -xmlWalkRemoveRef(const void *data, void *user) +xmlWalkRemoveRef(const void *data, void *user) { xmlAttrPtr attr0 = ((xmlRefPtr)data)->attr; xmlAttrPtr attr1 = ((xmlRemoveMemoPtr)user)->ap; @@ -3011,7 +3011,7 @@ xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, ret->value = xmlStrdup(value); if ((ctxt != NULL) && (ctxt->vstateNr != 0)) { /* - * Operating in streaming mode, attr is gonna disappear + * Operating in streaming mode, attr is gonna disappear */ ret->name = xmlStrdup(attr->name); ret->attr = NULL; @@ -3069,7 +3069,7 @@ failed: */ void xmlFreeRefTable(xmlRefTablePtr table) { - xmlHashFree(table, xmlFreeRefTableEntry); + xmlHashFree(table, xmlFreeRefTableEntry); } /** @@ -3166,7 +3166,7 @@ xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) { /*If the list is empty then remove the list entry in the hash */ if (xmlListEmpty(ref_list)) - xmlHashUpdateEntry(table, ID, NULL, xmlFreeRefTableEntry); + xmlHashUpdateEntry(table, ID, NULL, xmlFreeRefTableEntry); xmlFree(ID); return(0); } @@ -4162,10 +4162,10 @@ xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, } static void -xmlValidateAttributeIdCallback(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlAttributePtr attr = (xmlAttributePtr) payload; - int *count = (int *) data; +xmlValidateAttributeIdCallback(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlAttributePtr attr = (xmlAttributePtr) payload; + int *count = (int *) data; if (attr->atype == XML_ATTRIBUTE_ID) (*count)++; } @@ -4237,7 +4237,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, nbId = 0; if (doc->intSubset != NULL) { table = (xmlAttributeTablePtr) doc->intSubset->attributes; - xmlHashScan3(table, NULL, NULL, attr->elem, + xmlHashScan3(table, NULL, NULL, attr->elem, xmlValidateAttributeIdCallback, &nbId); } } @@ -4695,12 +4695,12 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) { } } - /* - * Casting ns to xmlAttrPtr is wrong. We'd need separate functions - * xmlAddID and xmlAddRef for namespace declarations, but it makes - * no practical sense to use ID types anyway. - */ -#if 0 + /* + * Casting ns to xmlAttrPtr is wrong. We'd need separate functions + * xmlAddID and xmlAddRef for namespace declarations, but it makes + * no practical sense to use ID types anyway. + */ +#if 0 /* Validity Constraint: ID uniqueness */ if (attrDecl->atype == XML_ATTRIBUTE_ID) { if (xmlAddID(ctxt, doc, value, (xmlAttrPtr) ns) == NULL) @@ -4712,7 +4712,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) { if (xmlAddRef(ctxt, doc, value, (xmlAttrPtr) ns) == NULL) ret = 0; } -#endif +#endif /* Validity Constraint: Notation Attributes */ if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) { @@ -5258,7 +5258,7 @@ xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) { case XML_TEXT_NODE: if (xmlIsBlankNode(cur)) break; - /* Falls through. */ + /* Falls through. */ case XML_CDATA_SECTION_NODE: case XML_ENTITY_REF_NODE: strcat(buf, "CDATA"); @@ -5807,7 +5807,7 @@ xmlValidatePushElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlElementPtr elemDecl; /* - * Check the new element against the content model of the new elem. + * Check the new element against the content model of the new elem. */ if (state->elemDecl != NULL) { elemDecl = state->elemDecl; @@ -5899,7 +5899,7 @@ xmlValidatePushCData(xmlValidCtxtPtr ctxt, const xmlChar *data, int len) { xmlElementPtr elemDecl; /* - * Check the new element against the content model of the new elem. + * Check the new element against the content model of the new elem. */ if (state->elemDecl != NULL) { elemDecl = state->elemDecl; @@ -5973,7 +5973,7 @@ xmlValidatePopElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc ATTRIBUTE_UNUSED, xmlElementPtr elemDecl; /* - * Check the new element against the content model of the new elem. + * Check the new element against the content model of the new elem. */ if (state->elemDecl != NULL) { elemDecl = state->elemDecl; @@ -6598,7 +6598,7 @@ xmlValidateRef(xmlRefPtr ref, xmlValidCtxtPtr ctxt, * Returns 0 to abort the walk or 1 to continue */ static int -xmlWalkValidateList(const void *data, void *user) +xmlWalkValidateList(const void *data, void *user) { xmlValidateMemoPtr memo = (xmlValidateMemoPtr)user; xmlValidateRef((xmlRefPtr)data, memo->ctxt, memo->name); @@ -6613,9 +6613,9 @@ xmlWalkValidateList(const void *data, void *user) * */ static void -xmlValidateCheckRefCallback(void *payload, void *data, const xmlChar *name) { - xmlListPtr ref_list = (xmlListPtr) payload; - xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; +xmlValidateCheckRefCallback(void *payload, void *data, const xmlChar *name) { + xmlListPtr ref_list = (xmlListPtr) payload; + xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; xmlValidateMemo memo; if (ref_list == NULL) @@ -6671,7 +6671,7 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { table = (xmlRefTablePtr) doc->refs; ctxt->doc = doc; ctxt->valid = 1; - xmlHashScan(table, xmlValidateCheckRefCallback, ctxt); + xmlHashScan(table, xmlValidateCheckRefCallback, ctxt); ctxt->finishDtd = save; return(ctxt->valid); @@ -6728,10 +6728,10 @@ xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) { } static void -xmlValidateNotationCallback(void *payload, void *data, +xmlValidateNotationCallback(void *payload, void *data, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlEntityPtr cur = (xmlEntityPtr) payload; - xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; + xmlEntityPtr cur = (xmlEntityPtr) payload; + xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; if (cur == NULL) return; if (cur->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { @@ -6749,10 +6749,10 @@ xmlValidateNotationCallback(void *payload, void *data, } static void -xmlValidateAttributeCallback(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlAttributePtr cur = (xmlAttributePtr) payload; - xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; +xmlValidateAttributeCallback(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlAttributePtr cur = (xmlAttributePtr) payload; + xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data; int ret; xmlDocPtr doc; xmlElementPtr elem = NULL; @@ -6851,20 +6851,20 @@ xmlValidateDtdFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { dtd = doc->intSubset; if ((dtd != NULL) && (dtd->attributes != NULL)) { table = (xmlAttributeTablePtr) dtd->attributes; - xmlHashScan(table, xmlValidateAttributeCallback, ctxt); + xmlHashScan(table, xmlValidateAttributeCallback, ctxt); } if ((dtd != NULL) && (dtd->entities != NULL)) { entities = (xmlEntitiesTablePtr) dtd->entities; - xmlHashScan(entities, xmlValidateNotationCallback, ctxt); + xmlHashScan(entities, xmlValidateNotationCallback, ctxt); } dtd = doc->extSubset; if ((dtd != NULL) && (dtd->attributes != NULL)) { table = (xmlAttributeTablePtr) dtd->attributes; - xmlHashScan(table, xmlValidateAttributeCallback, ctxt); + xmlHashScan(table, xmlValidateAttributeCallback, ctxt); } if ((dtd != NULL) && (dtd->entities != NULL)) { entities = (xmlEntitiesTablePtr) dtd->entities; - xmlHashScan(entities, xmlValidateNotationCallback, ctxt); + xmlHashScan(entities, xmlValidateNotationCallback, ctxt); } return(ctxt->valid); } diff --git a/contrib/libs/libxml/xinclude.c b/contrib/libs/libxml/xinclude.c index 99e88ca148..ba850fa538 100644 --- a/contrib/libs/libxml/xinclude.c +++ b/contrib/libs/libxml/xinclude.c @@ -125,7 +125,7 @@ xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, * * Handle an XInclude error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar *extra) { @@ -147,7 +147,7 @@ xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, * * Emit an XInclude warning. */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlXIncludeWarn(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar *extra) { @@ -449,10 +449,10 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); - /* Don't read from stdin. */ - if ((URL != NULL) && (strcmp(URL, "-") == 0)) - URL = "./-"; - + /* Don't read from stdin. */ + if ((URL != NULL) && (strcmp(URL, "-") == 0)) + URL = "./-"; + inputStream = xmlLoadExternalEntity(URL, NULL, pctxt); if (inputStream == NULL) { xmlFreeParserCtxt(pctxt); @@ -671,7 +671,7 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, int i; /* - * Avoid recursion in already substituted resources + * Avoid recursion in already substituted resources for (i = 0;i < ctxt->urlNr;i++) { if (xmlStrEqual(doc->URL, ctxt->urlTab[i])) return; @@ -756,7 +756,7 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, * @txt: the new text node * @url: the associated URL * - * Add a new text node to the list + * Add a new text node to the list */ static void xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) { @@ -1262,13 +1262,13 @@ struct _xmlXIncludeMergeData { * @doc: the including doc * @nr: the entity name * - * Implements the merge of one entity + * Implements the merge of one entity */ static void -xmlXIncludeMergeEntity(void *payload, void *vdata, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlEntityPtr ent = (xmlEntityPtr) payload; - xmlXIncludeMergeDataPtr data = (xmlXIncludeMergeDataPtr) vdata; +xmlXIncludeMergeEntity(void *payload, void *vdata, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlEntityPtr ent = (xmlEntityPtr) payload; + xmlXIncludeMergeDataPtr data = (xmlXIncludeMergeDataPtr) vdata; xmlEntityPtr ret, prev; xmlDocPtr doc; xmlXIncludeCtxtPtr ctxt; @@ -1339,7 +1339,7 @@ error: * @doc: the including doc * @from: the included doc * - * Implements the entity merge + * Implements the entity merge * * Returns 0 if merge succeeded, -1 if some processing failed */ @@ -1373,7 +1373,7 @@ xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, data.doc = doc; xmlHashScan((xmlHashTablePtr) source->entities, - xmlXIncludeMergeEntity, &data); + xmlXIncludeMergeEntity, &data); } source = from->extSubset; if ((source != NULL) && (source->entities != NULL)) { @@ -1388,7 +1388,7 @@ xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, if ((!xmlStrEqual(target->ExternalID, source->ExternalID)) && (!xmlStrEqual(target->SystemID, source->SystemID))) { xmlHashScan((xmlHashTablePtr) source->entities, - xmlXIncludeMergeEntity, &data); + xmlXIncludeMergeEntity, &data); } } return(0); @@ -1810,10 +1810,10 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { xmlParserInputPtr inputStream; int xinclude_multibyte_fallback_used = 0; - /* Don't read from stdin. */ - if (xmlStrcmp(url, BAD_CAST "-") == 0) - url = BAD_CAST "./-"; - + /* Don't read from stdin. */ + if (xmlStrcmp(url, BAD_CAST "-") == 0) + url = BAD_CAST "./-"; + /* * Check the URL and remove any fragment identifier */ @@ -1922,7 +1922,7 @@ xinclude_multibyte_fallback: cur = xmlStringCurrentChar(NULL, &content[i], &l); if (!IS_CHAR(cur)) { - /* Handle split multibyte char at buffer boundary */ + /* Handle split multibyte char at buffer boundary */ if (((len - i) < 4) && (!xinclude_multibyte_fallback_used)) { xinclude_multibyte_fallback_used = 1; xmlBufShrink(buf->buffer, i); @@ -1931,7 +1931,7 @@ xinclude_multibyte_fallback: xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_INVALID_CHAR, "%s contains invalid char\n", URL); - xmlFreeParserCtxt(pctxt); + xmlFreeParserCtxt(pctxt); xmlFreeParserInputBuffer(buf); xmlFree(URL); return(-1); @@ -1972,7 +1972,7 @@ static int xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { xmlXIncludeCtxtPtr newctxt; int ret = 0; - int oldNbErrors = ctxt->nbErrors; + int oldNbErrors = ctxt->nbErrors; if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) || (ctxt == NULL)) @@ -1989,7 +1989,7 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */ xmlXIncludeSetFlags(newctxt, ctxt->parseFlags); ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children); - if (ctxt->nbErrors > oldNbErrors) + if (ctxt->nbErrors > oldNbErrors) ret = -1; else if (ret > 0) ret = 0; /* xmlXIncludeDoProcess can return +ve number */ @@ -2143,7 +2143,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { xmlNodePtr children; /* - * Time to try a fallback if available + * Time to try a fallback if available */ #ifdef DEBUG_XINCLUDE xmlGenericError(xmlGenericErrorContext, "error looking for fallback\n"); @@ -2188,7 +2188,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { * @ctxt: an XInclude context * @nr: the node number * - * Implement the infoset replacement for the given node + * Implement the infoset replacement for the given node * * Returns 0 if substitution succeeded, -1 if some processing failed */ diff --git a/contrib/libs/libxml/xlink.c b/contrib/libs/libxml/xlink.c index 19e8faf9a7..ecf9f968a7 100644 --- a/contrib/libs/libxml/xlink.c +++ b/contrib/libs/libxml/xlink.c @@ -28,8 +28,8 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif #include <libxml/xmlmemory.h> diff --git a/contrib/libs/libxml/xmlIO.c b/contrib/libs/libxml/xmlIO.c index 0ff67ef947..7921e793a0 100644 --- a/contrib/libs/libxml/xmlIO.c +++ b/contrib/libs/libxml/xmlIO.c @@ -12,7 +12,7 @@ #include "libxml.h" #include <string.h> -#include <stddef.h> +#include <stddef.h> #ifdef HAVE_ERRNO_H #include <errno.h> #endif @@ -33,15 +33,15 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED #error #include <lzma.h> #endif -#if defined(_WIN32) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN +#if defined(_WIN32) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN #include <windows.h> #endif @@ -49,14 +49,14 @@ #include <winnls.h> /* for CP_UTF8 */ #endif -#ifndef S_ISDIR -# ifdef _S_ISDIR -# define S_ISDIR(x) _S_ISDIR(x) -# elif defined(S_IFDIR) -# ifdef S_IFMT -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# elif defined(_S_IFMT) -# define S_ISDIR(m) (((m) & _S_IFMT) == S_IFDIR) +#ifndef S_ISDIR +# ifdef _S_ISDIR +# define S_ISDIR(x) _S_ISDIR(x) +# elif defined(S_IFDIR) +# ifdef S_IFMT +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# elif defined(_S_IFMT) +# define S_ISDIR(m) (((m) & _S_IFMT) == S_IFDIR) # endif # endif #endif @@ -185,9 +185,9 @@ static const char *IOerr[] = { "already connected", /* EISCONN */ "connection refused", /* ECONNREFUSED */ "unreachable network", /* ENETUNREACH */ - "address in use", /* EADDRINUSE */ + "address in use", /* EADDRINUSE */ "already in use", /* EALREADY */ - "unknown address family", /* EAFNOSUPPORT */ + "unknown address family", /* EAFNOSUPPORT */ }; #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) @@ -597,7 +597,7 @@ xmlWrapOpenUtf8(const char *path,int mode) return fd; } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED static gzFile xmlWrapGzOpenUtf8(const char *path, const char *mode) { @@ -634,18 +634,18 @@ xmlWrapGzOpenUtf8(const char *path, const char *mode) * */ static int -xmlWrapStatUtf8(const char *path, struct _stat *info) { +xmlWrapStatUtf8(const char *path, struct _stat *info) { int retval = -1; wchar_t *wPath; wPath = __xmlIOWin32UTF8ToWChar(path); - if (wPath) { - retval = _wstat(wPath, info); + if (wPath) { + retval = _wstat(wPath, info); xmlFree(wPath); } /* maybe path in native encoding */ if(retval < 0) - retval = _stat(path, info); + retval = _stat(path, info); return retval; } @@ -669,12 +669,12 @@ int xmlCheckFilename (const char *path) { #ifdef HAVE_STAT -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - struct _stat stat_buffer; -#else +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + struct _stat stat_buffer; +#else struct stat stat_buffer; #endif -#endif +#endif if (path == NULL) return(0); @@ -688,7 +688,7 @@ xmlCheckFilename (const char *path) (path[3] == '\\') ) return 1; - if (xmlWrapStatUtf8(path, &stat_buffer) == -1) + if (xmlWrapStatUtf8(path, &stat_buffer) == -1) return 0; #else if (stat(path, &stat_buffer) == -1) @@ -703,16 +703,16 @@ xmlCheckFilename (const char *path) } /** - * xmlInputReadCallbackNop: + * xmlInputReadCallbackNop: * - * No Operation xmlInputReadCallback function, does nothing. + * No Operation xmlInputReadCallback function, does nothing. * * Returns zero */ int -xmlInputReadCallbackNop(void *context ATTRIBUTE_UNUSED, - char *buffer ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED) { +xmlInputReadCallbackNop(void *context ATTRIBUTE_UNUSED, + char *buffer ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED) { return(0); } @@ -730,7 +730,7 @@ static int xmlFdRead (void * context, char * buffer, int len) { int ret; - ret = read((int) (ptrdiff_t) context, &buffer[0], len); + ret = read((int) (ptrdiff_t) context, &buffer[0], len); if (ret < 0) xmlIOErr(0, "read()"); return(ret); } @@ -751,7 +751,7 @@ xmlFdWrite (void * context, const char * buffer, int len) { int ret = 0; if (len > 0) { - ret = write((int) (ptrdiff_t) context, &buffer[0], len); + ret = write((int) (ptrdiff_t) context, &buffer[0], len); if (ret < 0) xmlIOErr(0, "write()"); } return(ret); @@ -769,7 +769,7 @@ xmlFdWrite (void * context, const char * buffer, int len) { static int xmlFdClose (void * context) { int ret; - ret = close((int) (ptrdiff_t) context); + ret = close((int) (ptrdiff_t) context); if (ret < 0) xmlIOErr(0, "close()"); return(ret); } @@ -830,14 +830,14 @@ xmlFileOpen_real (const char *filename) { #endif } - /* Do not check DDNAME on zOS ! */ -#if !defined(__MVS__) + /* Do not check DDNAME on zOS ! */ +#if !defined(__MVS__) if (!xmlCheckFilename(path)) return(NULL); -#endif +#endif #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - fd = xmlWrapOpenUtf8(path, 0); + fd = xmlWrapOpenUtf8(path, 0); #else fd = fopen(path, "r"); #endif /* WIN32 */ @@ -910,14 +910,14 @@ xmlFileOpenW (const char *filename) { return(NULL); #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - fd = xmlWrapOpenUtf8(path, 1); -#elif(__MVS__) - fd = fopen(path, "w"); + fd = xmlWrapOpenUtf8(path, 1); +#elif(__MVS__) + fd = fopen(path, "w"); #else - fd = fopen(path, "wb"); + fd = fopen(path, "wb"); #endif /* WIN32 */ - if (fd == NULL) xmlIOErr(0, path); + if (fd == NULL) xmlIOErr(0, path); return((void *) fd); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -1038,7 +1038,7 @@ xmlBufferWrite (void * context, const char * buffer, int len) { } #endif -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /************************************************************************ * * * I/O for compressed file accesses * @@ -1102,7 +1102,7 @@ xmlGzfileOpen_real (const char *filename) { return(NULL); #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - fd = xmlWrapGzOpenUtf8(path, "rb"); + fd = xmlWrapGzOpenUtf8(path, "rb"); #else fd = gzopen(path, "rb"); #endif @@ -1179,7 +1179,7 @@ xmlGzfileOpenW (const char *filename, int compression) { return(NULL); #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - fd = xmlWrapGzOpenUtf8(path, mode); + fd = xmlWrapGzOpenUtf8(path, mode); #else fd = gzopen(path, mode); #endif @@ -1195,7 +1195,7 @@ xmlGzfileOpenW (const char *filename, int compression) { * * Read @len bytes to @buffer from the compressed I/O channel. * - * Returns the number of bytes read. + * Returns the number of bytes read. */ static int xmlGzfileRead (void * context, char * buffer, int len) { @@ -1241,15 +1241,15 @@ xmlGzfileClose (void * context) { if (ret < 0) xmlIOErr(0, "gzclose()"); return(ret); } -#endif /* LIBXML_ZLIB_ENABLED */ +#endif /* LIBXML_ZLIB_ENABLED */ -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED /************************************************************************ * * * I/O for compressed file accesses * * * ************************************************************************/ -#error #include "xzlib.h" +#error #include "xzlib.h" /** * xmlXzfileMatch: * @filename: the URI for matching @@ -1360,7 +1360,7 @@ xmlXzfileClose (void * context) { if (ret < 0) xmlIOErr(0, "xzclose()"); return(ret); } -#endif /* LIBXML_LZMA_ENABLED */ +#endif /* LIBXML_LZMA_ENABLED */ #ifdef LIBXML_HTTP_ENABLED /************************************************************************ @@ -1380,7 +1380,7 @@ typedef struct xmlIOHTTPWriteCtxt_ } xmlIOHTTPWriteCtxt, *xmlIOHTTPWriteCtxtPtr; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED #define DFLT_WBITS ( -15 ) #define DFLT_MEM_LVL ( 8 ) @@ -1513,7 +1513,7 @@ xmlCreateZMemBuff( int compression ) { xmlFreeZMemBuff( buff ); buff = NULL; xmlStrPrintf(msg, 500, - "xmlCreateZMemBuff: %s %d\n", + "xmlCreateZMemBuff: %s %d\n", "Error initializing compression context. ZLIB error:", z_err ); xmlIOErr(XML_IO_WRITE, (const char *) msg); @@ -1581,9 +1581,9 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) { else { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlZMemBuffExtend: %s %lu bytes.\n", + "xmlZMemBuffExtend: %s %lu bytes.\n", "Allocation failure extending output buffer to", - (unsigned long) new_size ); + (unsigned long) new_size ); xmlIOErr(XML_IO_WRITE, (const char *) msg); } @@ -1627,7 +1627,7 @@ xmlZMemBuffAppend( xmlZMemBuffPtr buff, const char * src, int len ) { if ( z_err != Z_OK ) { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlZMemBuffAppend: %s %d %s - %d", + "xmlZMemBuffAppend: %s %d %s - %d", "Compression error while appending", len, "bytes to buffer. ZLIB error", z_err ); xmlIOErr(XML_IO_WRITE, (const char *) msg); @@ -1700,7 +1700,7 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) { else { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlZMemBuffGetContent: %s - %d\n", + "xmlZMemBuffGetContent: %s - %d\n", "Error flushing zlib buffers. Error code", z_err ); xmlIOErr(XML_IO_WRITE, (const char *) msg); } @@ -1708,7 +1708,7 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) { return ( zlgth ); } #endif /* LIBXML_OUTPUT_ENABLED */ -#endif /* LIBXML_ZLIB_ENABLED */ +#endif /* LIBXML_ZLIB_ENABLED */ #ifdef LIBXML_OUTPUT_ENABLED /** @@ -1727,7 +1727,7 @@ xmlFreeHTTPWriteCtxt( xmlIOHTTPWriteCtxtPtr ctxt ) if ( ctxt->doc_buff != NULL ) { -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ( ctxt->compression > 0 ) { xmlFreeZMemBuff( ctxt->doc_buff ); } @@ -1785,7 +1785,7 @@ xmlIOHTTPOpen (const char *filename) { */ void * -xmlIOHTTPOpenW(const char *post_uri, int compression ATTRIBUTE_UNUSED) +xmlIOHTTPOpenW(const char *post_uri, int compression ATTRIBUTE_UNUSED) { xmlIOHTTPWriteCtxtPtr ctxt = NULL; @@ -1814,7 +1814,7 @@ xmlIOHTTPOpenW(const char *post_uri, int compression ATTRIBUTE_UNUSED) * ** is being used to avoid pushing the data to disk and back. */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ((compression > 0) && (compression <= 9)) { ctxt->compression = compression; @@ -1894,7 +1894,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) { /* Use gzwrite or fwrite as previously setup in the open call */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ( ctxt->compression > 0 ) len = xmlZMemBuffAppend( ctxt->doc_buff, buffer, len ); @@ -1905,7 +1905,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) { if ( len < 0 ) { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlIOHTTPWrite: %s\n%s '%s'.\n", + "xmlIOHTTPWrite: %s\n%s '%s'.\n", "Error appending to internal buffer.", "Error sending document to URI", ctxt->uri ); @@ -1958,7 +1958,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) { /* Retrieve the content from the appropriate buffer */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ( ctxt->compression > 0 ) { content_lgth = xmlZMemBuffGetContent( ctxt->doc_buff, &http_content ); @@ -1977,7 +1977,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) { if ( http_content == NULL ) { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlIOHTTPCloseWrite: %s '%s' %s '%s'.\n", + "xmlIOHTTPCloseWrite: %s '%s' %s '%s'.\n", "Error retrieving content.\nUnable to", http_mthd, "data to URI", ctxt->uri ); xmlIOErr(XML_IO_WRITE, (const char *) msg); @@ -2049,7 +2049,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) { else { xmlChar msg[500]; xmlStrPrintf(msg, 500, - "xmlIOHTTPCloseWrite: HTTP '%s' of %d %s\n'%s' %s %d\n", + "xmlIOHTTPCloseWrite: HTTP '%s' of %d %s\n'%s' %s %d\n", http_mthd, content_lgth, "bytes to URI", ctxt->uri, "failed. HTTP return code:", http_rtn ); @@ -2229,14 +2229,14 @@ xmlRegisterDefaultInputCallbacks(void) { xmlRegisterInputCallbacks(xmlFileMatch, xmlFileOpen, xmlFileRead, xmlFileClose); -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED xmlRegisterInputCallbacks(xmlGzfileMatch, xmlGzfileOpen, xmlGzfileRead, xmlGzfileClose); -#endif /* LIBXML_ZLIB_ENABLED */ -#ifdef LIBXML_LZMA_ENABLED +#endif /* LIBXML_ZLIB_ENABLED */ +#ifdef LIBXML_LZMA_ENABLED xmlRegisterInputCallbacks(xmlXzfileMatch, xmlXzfileOpen, xmlXzfileRead, xmlXzfileClose); -#endif /* LIBXML_LZMA_ENABLED */ +#endif /* LIBXML_LZMA_ENABLED */ #ifdef LIBXML_HTTP_ENABLED xmlRegisterInputCallbacks(xmlIOHTTPMatch, xmlIOHTTPOpen, @@ -2274,7 +2274,7 @@ xmlRegisterDefaultOutputCallbacks (void) { uncompressed ones except opening if existing then closing and saving with same compression ratio ... a pain. -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED xmlRegisterOutputCallbacks(xmlGzfileMatch, xmlGzfileOpen, xmlGzfileWrite, xmlGzfileClose); #endif @@ -2383,7 +2383,7 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) { if (encoder != NULL) { ret->conv = xmlBufCreateSize(4000); if (ret->conv == NULL) { - xmlBufFree(ret->buffer); + xmlBufFree(ret->buffer); xmlFree(ret); return(NULL); } @@ -2436,7 +2436,7 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder) { if (encoder != NULL) { ret->conv = xmlBufCreateSize(4000); if (ret->conv == NULL) { - xmlBufFree(ret->buffer); + xmlBufFree(ret->buffer); xmlFree(ret); return(NULL); } @@ -2566,7 +2566,7 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) { ret->context = context; ret->readcallback = xmlInputCallbackTable[i].readcallback; ret->closecallback = xmlInputCallbackTable[i].closecallback; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) && (strcmp(URI, "-") != 0)) { #if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1230 @@ -2586,7 +2586,7 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) { #endif } #endif -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED if ((xmlInputCallbackTable[i].opencallback == xmlXzfileOpen) && (strcmp(URI, "-") != 0)) { ret->compressed = __libxml2_xzcompressed(context); @@ -2630,7 +2630,7 @@ __xmlOutputBufferCreateFilename(const char *URI, int i = 0; void *context = NULL; char *unescaped = NULL; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED int is_file_uri = 1; #endif @@ -2641,7 +2641,7 @@ __xmlOutputBufferCreateFilename(const char *URI, puri = xmlParseURI(URI); if (puri != NULL) { -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ((puri->scheme != NULL) && (!xmlStrEqual(BAD_CAST puri->scheme, BAD_CAST "file"))) is_file_uri = 0; @@ -2661,7 +2661,7 @@ __xmlOutputBufferCreateFilename(const char *URI, * try with an unescaped version of the URI */ if (unescaped != NULL) { -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ((compression > 0) && (compression <= 9) && (is_file_uri == 1)) { context = xmlGzfileOpenW(unescaped, compression); if (context != NULL) { @@ -2679,7 +2679,7 @@ __xmlOutputBufferCreateFilename(const char *URI, for (i = xmlOutputCallbackNr - 1;i >= 0;i--) { if ((xmlOutputCallbackTable[i].matchcallback != NULL) && (xmlOutputCallbackTable[i].matchcallback(unescaped) != 0)) { -#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_ZLIB_ENABLED) +#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_ZLIB_ENABLED) /* Need to pass compression parameter into HTTP open calls */ if (xmlOutputCallbackTable[i].matchcallback == xmlIOHTTPMatch) context = xmlIOHTTPOpenW(unescaped, compression); @@ -2698,7 +2698,7 @@ __xmlOutputBufferCreateFilename(const char *URI, * filename */ if (context == NULL) { -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if ((compression > 0) && (compression <= 9) && (is_file_uri == 1)) { context = xmlGzfileOpenW(URI, compression); if (context != NULL) { @@ -2715,7 +2715,7 @@ __xmlOutputBufferCreateFilename(const char *URI, for (i = xmlOutputCallbackNr - 1;i >= 0;i--) { if ((xmlOutputCallbackTable[i].matchcallback != NULL) && (xmlOutputCallbackTable[i].matchcallback(URI) != 0)) { -#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_ZLIB_ENABLED) +#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_ZLIB_ENABLED) /* Need to pass compression parameter into HTTP open calls */ if (xmlOutputCallbackTable[i].matchcallback == xmlIOHTTPMatch) context = xmlIOHTTPOpenW(URI, compression); @@ -2845,8 +2845,8 @@ xmlOutputBufferCreateBuffer(xmlBufferPtr buffer, if (buffer == NULL) return(NULL); - ret = xmlOutputBufferCreateIO(xmlBufferWrite, NULL, (void *) buffer, - encoder); + ret = xmlOutputBufferCreateIO(xmlBufferWrite, NULL, (void *) buffer, + encoder); return(ret); } @@ -2904,7 +2904,7 @@ xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc) { ret = xmlAllocParserInputBuffer(enc); if (ret != NULL) { - ret->context = (void *) (ptrdiff_t) fd; + ret->context = (void *) (ptrdiff_t) fd; ret->readcallback = xmlFdRead; ret->closecallback = xmlFdClose; } @@ -2928,13 +2928,13 @@ xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; int errcode; - if (size < 0) return(NULL); + if (size < 0) return(NULL); if (mem == NULL) return(NULL); ret = xmlAllocParserInputBuffer(enc); if (ret != NULL) { ret->context = (void *) mem; - ret->readcallback = xmlInputReadCallbackNop; + ret->readcallback = xmlInputReadCallbackNop; ret->closecallback = NULL; errcode = xmlBufAdd(ret->buffer, (const xmlChar *) mem, size); if (errcode != 0) { @@ -2964,7 +2964,7 @@ xmlParserInputBufferCreateStatic(const char *mem, int size, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; - if (size < 0) return(NULL); + if (size < 0) return(NULL); if (mem == NULL) return(NULL); ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer)); @@ -3010,7 +3010,7 @@ xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandlerPtr encoder) { ret = xmlAllocOutputBufferInternal(encoder); if (ret != NULL) { - ret->context = (void *) (ptrdiff_t) fd; + ret->context = (void *) (ptrdiff_t) fd; ret->writecallback = xmlFdWrite; ret->closecallback = NULL; } @@ -3251,7 +3251,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) { * try to establish compressed status of input if not done already */ if (in->compressed == -1) { -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED if (in->readcallback == xmlXzfileRead) in->compressed = __libxml2_xzcompressed(in->context); #endif @@ -3337,7 +3337,7 @@ xmlOutputBufferWrite(xmlOutputBufferPtr out, int len, const char *buf) { int nbchars = 0; /* number of chars to output to I/O */ int ret; /* return from function call */ int written = 0; /* number of char written to I/O so far */ - int chunk; /* number of byte current processed from buf */ + int chunk; /* number of byte current processed from buf */ if ((out == NULL) || (out->error)) return(-1); if (len < 0) return(0); @@ -3374,25 +3374,25 @@ xmlOutputBufferWrite(xmlOutputBufferPtr out, int len, const char *buf) { out->error = XML_IO_ENCODER; return(-1); } - if (out->writecallback) - nbchars = xmlBufUse(out->conv); - else - nbchars = ret; + if (out->writecallback) + nbchars = xmlBufUse(out->conv); + else + nbchars = ret; } else { ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk); if (ret != 0) return(-1); - if (out->writecallback) - nbchars = xmlBufUse(out->buffer); - else - nbchars = chunk; + if (out->writecallback) + nbchars = xmlBufUse(out->buffer); + else + nbchars = chunk; } buf += chunk; len -= chunk; - if (out->writecallback) { - if ((nbchars < MINLEN) && (len <= 0)) - goto done; + if (out->writecallback) { + if ((nbchars < MINLEN) && (len <= 0)) + goto done; /* * second write the stuff to the I/O channel @@ -3413,10 +3413,10 @@ xmlOutputBufferWrite(xmlOutputBufferPtr out, int len, const char *buf) { out->error = XML_IO_WRITE; return(ret); } - if (out->written > INT_MAX - ret) - out->written = INT_MAX; - else - out->written += ret; + if (out->written > INT_MAX - ret) + out->written = INT_MAX; + else + out->written += ret; } written += nbchars; } while (len > 0); @@ -3496,7 +3496,7 @@ xmlEscapeContent(unsigned char* out, int *outlen, * @escaping: an optional escaping function (or NULL) * * Write the content of the string in the output I/O buffer - * This routine escapes the characters and then handle the I18N + * This routine escapes the characters and then handle the I18N * transcoding from internal UTF-8 * The buffer is lossless, i.e. will store in case of partial * or delayed writes. @@ -3572,26 +3572,26 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str, out->error = XML_IO_ENCODER; return(-1); } - if (out->writecallback) - nbchars = xmlBufUse(out->conv); - else - nbchars = ret; + if (out->writecallback) + nbchars = xmlBufUse(out->conv); + else + nbchars = ret; } else { ret = escaping(xmlBufEnd(out->buffer), &chunk, str, &cons); if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */ return(-1); xmlBufAddLen(out->buffer, chunk); - if (out->writecallback) - nbchars = xmlBufUse(out->buffer); - else - nbchars = chunk; + if (out->writecallback) + nbchars = xmlBufUse(out->buffer); + else + nbchars = chunk; } str += cons; len -= cons; - if (out->writecallback) { - if ((nbchars < MINLEN) && (len <= 0)) - goto done; + if (out->writecallback) { + if ((nbchars < MINLEN) && (len <= 0)) + goto done; /* * second write the stuff to the I/O channel @@ -3612,10 +3612,10 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str, out->error = XML_IO_WRITE; return(ret); } - if (out->written > INT_MAX - ret) - out->written = INT_MAX; - else - out->written += ret; + if (out->written > INT_MAX - ret) + out->written = INT_MAX; + else + out->written += ret; } else if (xmlBufAvail(out->buffer) < MINLEN) { xmlBufGrow(out->buffer, MINLEN); } @@ -3709,10 +3709,10 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) { out->error = XML_IO_FLUSH; return(ret); } - if (out->written > INT_MAX - ret) - out->written = INT_MAX; - else - out->written += ret; + if (out->written > INT_MAX - ret) + out->written = INT_MAX; + else + out->written += ret; #ifdef DEBUG_INPUT xmlGenericError(xmlGenericErrorContext, @@ -3745,7 +3745,7 @@ xmlParserGetDirectory(const char *filename) { if (filename == NULL) return(NULL); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) # define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\')) #else # define IS_XMLPGD_SEP(ch) (ch=='/') @@ -3960,7 +3960,7 @@ xmlResolveResourceFromCatalog(const char *URL, const char *ID, * @ID: the System ID for the entity to load * @ctxt: the context in which the entity is called or NULL * - * By default we don't load external entities, yet. + * By default we don't load external entities, yet. * * Returns a new allocated xmlParserInputPtr, or NULL. */ diff --git a/contrib/libs/libxml/xmlmemory.c b/contrib/libs/libxml/xmlmemory.c index a620d42a8b..6f16c4b3ca 100644 --- a/contrib/libs/libxml/xmlmemory.c +++ b/contrib/libs/libxml/xmlmemory.c @@ -109,9 +109,9 @@ typedef struct memnod { #define RESERVE_SIZE (((HDR_SIZE + (ALIGN_SIZE-1)) \ / ALIGN_SIZE ) * ALIGN_SIZE) -#define MAX_SIZE_T ((size_t)-1) +#define MAX_SIZE_T ((size_t)-1) -#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE)) +#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE)) #define HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE)) @@ -172,13 +172,13 @@ xmlMallocLoc(size_t size, const char * file, int line) TEST_POINT - if (size > (MAX_SIZE_T - RESERVE_SIZE)) { - xmlGenericError(xmlGenericErrorContext, - "xmlMallocLoc : Unsigned overflow\n"); - xmlMemoryDump(); - return(NULL); - } - + if (size > (MAX_SIZE_T - RESERVE_SIZE)) { + xmlGenericError(xmlGenericErrorContext, + "xmlMallocLoc : Unsigned overflow\n"); + xmlMemoryDump(); + return(NULL); + } + p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { @@ -225,7 +225,7 @@ xmlMallocLoc(size_t size, const char * file, int line) /** * xmlMallocAtomicLoc: - * @size: an unsigned int specifying the size in byte to allocate. + * @size: an unsigned int specifying the size in byte to allocate. * @file: the file name or NULL * @line: the line number * @@ -248,18 +248,18 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line) TEST_POINT - if (size > (MAX_SIZE_T - RESERVE_SIZE)) { - xmlGenericError(xmlGenericErrorContext, - "xmlMallocAtomicLoc : Unsigned overflow\n"); - xmlMemoryDump(); - return(NULL); - } - + if (size > (MAX_SIZE_T - RESERVE_SIZE)) { + xmlGenericError(xmlGenericErrorContext, + "xmlMallocAtomicLoc : Unsigned overflow\n"); + xmlMemoryDump(); + return(NULL); + } + p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { xmlGenericError(xmlGenericErrorContext, - "xmlMallocAtomicLoc : Out of free space\n"); + "xmlMallocAtomicLoc : Out of free space\n"); xmlMemoryDump(); return(NULL); } @@ -359,13 +359,13 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line) #endif xmlMutexUnlock(xmlMemMutex); - if (size > (MAX_SIZE_T - RESERVE_SIZE)) { - xmlGenericError(xmlGenericErrorContext, - "xmlReallocLoc : Unsigned overflow\n"); - xmlMemoryDump(); - return(NULL); - } - + if (size > (MAX_SIZE_T - RESERVE_SIZE)) { + xmlGenericError(xmlGenericErrorContext, + "xmlReallocLoc : Unsigned overflow\n"); + xmlMemoryDump(); + return(NULL); + } + tmp = (MEMHDR *) realloc(p,RESERVE_SIZE+size); if (!tmp) { free(p); @@ -487,7 +487,7 @@ xmlMemFree(void *ptr) error: xmlGenericError(xmlGenericErrorContext, - "xmlMemFree(%p) error\n", ptr); + "xmlMemFree(%p) error\n", ptr); xmlMallocBreakpoint(); return; } @@ -513,13 +513,13 @@ xmlMemStrdupLoc(const char *str, const char *file, int line) if (!xmlMemInitialized) xmlInitMemory(); TEST_POINT - if (size > (MAX_SIZE_T - RESERVE_SIZE)) { - xmlGenericError(xmlGenericErrorContext, - "xmlMemStrdupLoc : Unsigned overflow\n"); - xmlMemoryDump(); - return(NULL); - } - + if (size > (MAX_SIZE_T - RESERVE_SIZE)) { + xmlGenericError(xmlGenericErrorContext, + "xmlMemStrdupLoc : Unsigned overflow\n"); + xmlMemoryDump(); + return(NULL); + } + p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { goto error; @@ -583,12 +583,12 @@ xmlMemoryStrdup(const char *str) { int xmlMemUsed(void) { - int res; - - xmlMutexLock(xmlMemMutex); - res = debugMemSize; - xmlMutexUnlock(xmlMemMutex); - return(res); + int res; + + xmlMutexLock(xmlMemMutex); + res = debugMemSize; + xmlMutexUnlock(xmlMemMutex); + return(res); } /** @@ -601,12 +601,12 @@ xmlMemUsed(void) { int xmlMemBlocks(void) { - int res; - - xmlMutexLock(xmlMemMutex); - res = debugMemBlocks; - xmlMutexUnlock(xmlMemMutex); - return(res); + int res; + + xmlMutexLock(xmlMemMutex); + res = debugMemBlocks; + xmlMutexUnlock(xmlMemMutex); + return(res); } #ifdef MEM_LIST diff --git a/contrib/libs/libxml/xmlmodule.c b/contrib/libs/libxml/xmlmodule.c index d02d34777e..1867a5e160 100644 --- a/contrib/libs/libxml/xmlmodule.c +++ b/contrib/libs/libxml/xmlmodule.c @@ -8,11 +8,11 @@ * http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html */ -/* In order RTLD_GLOBAL and RTLD_NOW to be defined on zOS */ -#if defined(__MVS__) -#define _UNIX03_SOURCE -#endif - +/* In order RTLD_GLOBAL and RTLD_NOW to be defined on zOS */ +#if defined(__MVS__) +#define _UNIX03_SOURCE +#endif + #define IN_LIBXML #include "libxml.h" @@ -67,7 +67,7 @@ xmlModuleErrMemory(xmlModulePtr module, const char *extra) * * Opens a module/shared library given its name or path * NOTE: that due to portability issues, behaviour can only be - * guaranteed with @name using ASCII. We cannot guarantee that + * guaranteed with @name using ASCII. We cannot guarantee that * an UTF-8 string would work, which is why name is a const char * * and not a const xmlChar * . * TODO: options are not yet implemented. @@ -109,7 +109,7 @@ xmlModuleOpen(const char *name, int options ATTRIBUTE_UNUSED) * * Lookup for a symbol address in the given module * NOTE: that due to portability issues, behaviour can only be - * guaranteed with @name using ASCII. We cannot guarantee that + * guaranteed with @name using ASCII. We cannot guarantee that * an UTF-8 string would work, which is why name is a const char * * and not a const xmlChar * . * @@ -301,9 +301,9 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) #endif /* HAVE_SHLLOAD */ #endif /* ! HAVE_DLOPEN */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #include <windows.h> /* @@ -340,7 +340,7 @@ xmlModulePlatformClose(void *handle) static int xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) { -XML_IGNORE_PEDANTIC_WARNINGS +XML_IGNORE_PEDANTIC_WARNINGS #ifdef _WIN32_WCE /* * GetProcAddressA seems only available on WinCE @@ -350,7 +350,7 @@ XML_IGNORE_PEDANTIC_WARNINGS *symbol = GetProcAddress(handle, name); #endif return (NULL == *symbol) ? -1 : 0; -XML_POP_WARNINGS +XML_POP_WARNINGS } #endif /* _WIN32 */ diff --git a/contrib/libs/libxml/xmlreader.c b/contrib/libs/libxml/xmlreader.c index 12d748c857..f3891e43af 100644 --- a/contrib/libs/libxml/xmlreader.c +++ b/contrib/libs/libxml/xmlreader.c @@ -142,7 +142,7 @@ struct _xmlTextReader { xmlNodePtr faketext;/* fake xmlNs chld */ int preserve;/* preserve the resulting document */ xmlBufPtr buffer; /* used to return const xmlChar * */ - xmlDictPtr dict; /* the context dictionary */ + xmlDictPtr dict; /* the context dictionary */ /* entity stack when traversing entities content */ xmlNodePtr ent; /* Current Entity Ref Node */ @@ -210,7 +210,7 @@ static int xmlTextReaderNextTree(xmlTextReaderPtr reader); * DICT_FREE: * @str: a string * - * Free a string if it is not owned by the "dict" dictionary in the + * Free a string if it is not owned by the "dict" dictionary in the * current scope */ #define DICT_FREE(str) \ @@ -238,8 +238,8 @@ xmlFreeID(xmlIDPtr id) { if (id->value != NULL) DICT_FREE(id->value) - if (id->name != NULL) - DICT_FREE(id->name) + if (id->name != NULL) + DICT_FREE(id->name) xmlFree(id); } @@ -273,7 +273,7 @@ xmlTextReaderRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { return(-1); } id->name = attr->name; - attr->name = NULL; + attr->name = NULL; id->attr = NULL; return(0); } @@ -348,9 +348,9 @@ xmlTextReaderFreePropList(xmlTextReaderPtr reader, xmlAttrPtr cur) { static void xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) { xmlNodePtr next; - xmlNodePtr parent; + xmlNodePtr parent; xmlDictPtr dict; - size_t depth = 0; + size_t depth = 0; if ((reader != NULL) && (reader->ctxt != NULL)) dict = reader->ctxt->dict; @@ -366,18 +366,18 @@ xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) { xmlFreeDoc((xmlDocPtr) cur); return; } - while (1) { - while ((cur->type != XML_DTD_NODE) && - (cur->type != XML_ENTITY_REF_NODE) && - (cur->children != NULL) && - (cur->children->parent == cur)) { - cur = cur->children; - depth += 1; - } - + while (1) { + while ((cur->type != XML_DTD_NODE) && + (cur->type != XML_ENTITY_REF_NODE) && + (cur->children != NULL) && + (cur->children->parent == cur)) { + cur = cur->children; + depth += 1; + } + next = cur->next; - parent = cur->parent; - + parent = cur->parent; + /* unroll to speed up freeing the document */ if (cur->type != XML_DTD_NODE) { @@ -419,16 +419,16 @@ xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) { xmlFree(cur); } } - - if (next != NULL) { - cur = next; - } else { - if ((depth == 0) || (parent == NULL)) - break; - depth -= 1; - cur = parent; - cur->children = NULL; - } + + if (next != NULL) { + cur = next; + } else { + if ((depth == 0) || (parent == NULL)) + break; + depth -= 1; + cur = parent; + cur->children = NULL; + } } } @@ -508,11 +508,11 @@ xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) { } } -static void -xmlTextReaderFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeID((xmlIDPtr) id); -} - +static void +xmlTextReaderFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlFreeID((xmlIDPtr) id); +} + /** * xmlTextReaderFreeIDTable: * @table: An id table @@ -521,7 +521,7 @@ xmlTextReaderFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { */ static void xmlTextReaderFreeIDTable(xmlIDTablePtr table) { - xmlHashFree(table, xmlTextReaderFreeIDTableEntry); + xmlHashFree(table, xmlTextReaderFreeIDTableEntry); } /** @@ -1111,7 +1111,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) { do { if (node->type == XML_ENTITY_REF_NODE) { /* - * Case where the underlying tree is not available, lookup the entity + * Case where the underlying tree is not available, lookup the entity * and walk it. */ if ((node->children == NULL) && (ctxt->sax != NULL) && @@ -1128,11 +1128,11 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) { continue; } else { /* - * The error has probably been raised already. + * The error has probably been raised already. */ if (node == oldnode) break; - goto skip_children; + goto skip_children; } #ifdef LIBXML_REGEXP_ENABLED } else if (node->type == XML_ELEMENT_NODE) { @@ -1154,7 +1154,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) { } else if (node->type == XML_ELEMENT_NODE) { xmlTextReaderValidatePop(reader); } -skip_children: +skip_children: if (node->next != NULL) { node = node->next; continue; @@ -1374,7 +1374,7 @@ get_next_node: /* * If we are not backtracking on ancestors or examined nodes, - * that the parser didn't finished or that we aren't at the end + * that the parser didn't finished or that we aren't at the end * of stream, continue processing. */ while ((reader->node != NULL) && (reader->node->next == NULL) && @@ -1565,7 +1565,7 @@ node_found: (reader->node->type == XML_ENTITY_REF_NODE) && (reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) { /* - * Case where the underlying tree is not available, lookup the entity + * Case where the underlying tree is not available, lookup the entity * and walk it. */ if ((reader->node->children == NULL) && (reader->ctxt->sax != NULL) && @@ -1728,13 +1728,13 @@ xmlTextReaderReadInnerXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) if (xmlTextReaderExpand(reader) == NULL) { return NULL; } - doc = reader->node->doc; + doc = reader->node->doc; buff = xmlBufferCreate(); - if (buff == NULL) - return NULL; + if (buff == NULL) + return NULL; for (cur_node = reader->node->children; cur_node != NULL; cur_node = cur_node->next) { - /* XXX: Why is the node copied? */ + /* XXX: Why is the node copied? */ node = xmlDocCopyNode(cur_node, doc, 1); buff2 = xmlBufferCreate(); if (xmlNodeDump(buff2, doc, node, 0, 0) == -1) { @@ -1777,9 +1777,9 @@ xmlTextReaderReadOuterXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) if (xmlTextReaderExpand(reader) == NULL) { return NULL; } - node = reader->node; - doc = node->doc; - /* XXX: Why is the node copied? */ + node = reader->node; + doc = node->doc; + /* XXX: Why is the node copied? */ if (node->type == XML_DTD_NODE) { node = (xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node); } else { @@ -1938,9 +1938,9 @@ xmlTextReaderNextTree(xmlTextReaderPtr reader) /* if reader->node->next is NULL mean no subtree for current node, so need to move to sibling of parent node if present */ - reader->state = XML_TEXTREADER_BACKTRACK; - /* This will move to parent if present */ - xmlTextReaderRead(reader); + reader->state = XML_TEXTREADER_BACKTRACK; + /* This will move to parent if present */ + xmlTextReaderRead(reader); } if (reader->node->next != 0) { @@ -2114,9 +2114,9 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) { "xmlNewTextReader : malloc failed\n"); return(NULL); } - /* no operation on a reader should require a huge buffer */ - xmlBufSetAllocationScheme(ret->buffer, - XML_BUFFER_ALLOC_BOUNDED); + /* no operation on a reader should require a huge buffer */ + xmlBufSetAllocationScheme(ret->buffer, + XML_BUFFER_ALLOC_BOUNDED); ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler)); if (ret->sax == NULL) { xmlBufFree(ret->buffer); @@ -2181,7 +2181,7 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) { ret->ctxt->dictNames = 1; ret->allocs = XML_TEXTREADER_CTXT; /* - * use the parser dictionary to allocate all elements and attributes names + * use the parser dictionary to allocate all elements and attributes names */ ret->ctxt->docdict = 1; ret->dict = ret->ctxt->dict; @@ -2283,17 +2283,17 @@ xmlFreeTextReader(xmlTextReaderPtr reader) { reader->dict = NULL; if ((reader->ctxt->vctxt.vstateTab != NULL) && (reader->ctxt->vctxt.vstateMax > 0)){ - while (reader->ctxt->vctxt.vstateNr > 0) - xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL); + while (reader->ctxt->vctxt.vstateNr > 0) + xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL); xmlFree(reader->ctxt->vctxt.vstateTab); reader->ctxt->vctxt.vstateTab = NULL; reader->ctxt->vctxt.vstateMax = 0; } - if (reader->ctxt->myDoc != NULL) { - if (reader->preserve == 0) - xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc); - reader->ctxt->myDoc = NULL; - } + if (reader->ctxt->myDoc != NULL) { + if (reader->preserve == 0) + xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc); + reader->ctxt->myDoc = NULL; + } if (reader->allocs & XML_TEXTREADER_CTXT) xmlFreeParserCtxt(reader->ctxt); } @@ -2521,7 +2521,7 @@ xmlTextReaderGetAttributeNs(xmlTextReaderPtr reader, const xmlChar *localName, * parser, set its state to End Of File and return the input stream with * what is left that the parser did not use. * - * The implementation is not good, the parser certainly progressed past + * The implementation is not good, the parser certainly progressed past * what's left in reader->input, and there is an allocation problem. Best * would be to rewrite it differently. * @@ -2903,8 +2903,8 @@ xmlTextReaderMoveToElement(xmlTextReaderPtr reader) { * * Parses an attribute value into one or more Text and EntityReference nodes. * - * Returns 1 in case of success, 0 if the reader was not positioned on an - * attribute node or all the attribute values have been read, or -1 + * Returns 1 in case of success, 0 if the reader was not positioned on an + * attribute node or all the attribute values have been read, or -1 * in case of error. */ int @@ -3026,7 +3026,7 @@ xmlTextReaderAttributeCount(xmlTextReaderPtr reader) { * Reference: * http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html * - * Returns the xmlReaderTypes of the current node or -1 in case of error + * Returns the xmlReaderTypes of the current node or -1 in case of error */ int xmlTextReaderNodeType(xmlTextReaderPtr reader) { @@ -3644,7 +3644,7 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) { return(((xmlNsPtr) node)->href); case XML_ATTRIBUTE_NODE:{ xmlAttrPtr attr = (xmlAttrPtr) node; - const xmlChar *ret; + const xmlChar *ret; if ((attr->children != NULL) && (attr->children->type == XML_TEXT_NODE) && @@ -3658,21 +3658,21 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) { "xmlTextReaderSetup : malloc failed\n"); return (NULL); } - xmlBufSetAllocationScheme(reader->buffer, - XML_BUFFER_ALLOC_BOUNDED); + xmlBufSetAllocationScheme(reader->buffer, + XML_BUFFER_ALLOC_BOUNDED); } else xmlBufEmpty(reader->buffer); xmlBufGetNodeContent(reader->buffer, node); - ret = xmlBufContent(reader->buffer); - if (ret == NULL) { - /* error on the buffer best to reallocate */ - xmlBufFree(reader->buffer); - reader->buffer = xmlBufCreateSize(100); - xmlBufSetAllocationScheme(reader->buffer, - XML_BUFFER_ALLOC_BOUNDED); - ret = BAD_CAST ""; - } - return(ret); + ret = xmlBufContent(reader->buffer); + if (ret == NULL) { + /* error on the buffer best to reallocate */ + xmlBufFree(reader->buffer); + reader->buffer = xmlBufCreateSize(100); + xmlBufSetAllocationScheme(reader->buffer, + XML_BUFFER_ALLOC_BOUNDED); + ret = BAD_CAST ""; + } + return(ret); } break; } @@ -3941,7 +3941,7 @@ xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader) * xmlTextReaderCurrentNode: * @reader: the xmlTextReaderPtr used * - * Hacking interface allowing to get the xmlNodePtr corresponding to the + * Hacking interface allowing to get the xmlNodePtr corresponding to the * current node being accessed by the xmlTextReader. This is dangerous * because the underlying node may be destroyed on the next Reads. * @@ -4007,7 +4007,7 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) { * pattern. The caller must also use xmlTextReaderCurrentDoc() to * keep an handle on the resulting document once parsing has finished * - * Returns a non-negative number in case of success and -1 in case of error + * Returns a non-negative number in case of success and -1 in case of error */ int xmlTextReaderPreservePattern(xmlTextReaderPtr reader, const xmlChar *pattern, @@ -4053,7 +4053,7 @@ xmlTextReaderPreservePattern(xmlTextReaderPtr reader, const xmlChar *pattern, * xmlTextReaderCurrentDoc: * @reader: the xmlTextReaderPtr used * - * Hacking interface allowing to get the xmlDocPtr corresponding to the + * Hacking interface allowing to get the xmlDocPtr corresponding to the * current document being accessed by the xmlTextReader. * NOTE: as a result of this call, the reader will not destroy the * associated XML document and calling xmlFreeDoc() on the result @@ -4075,21 +4075,21 @@ xmlTextReaderCurrentDoc(xmlTextReaderPtr reader) { } #ifdef LIBXML_SCHEMAS_ENABLED -static char *xmlTextReaderBuildMessage(const char *msg, va_list ap) LIBXML_ATTR_FORMAT(1,0); +static char *xmlTextReaderBuildMessage(const char *msg, va_list ap) LIBXML_ATTR_FORMAT(1,0); + +static void XMLCDECL +xmlTextReaderValidityError(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); static void XMLCDECL -xmlTextReaderValidityError(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); static void XMLCDECL -xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); + +static void XMLCDECL +xmlTextReaderValidityWarningRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); static void XMLCDECL -xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -static void XMLCDECL -xmlTextReaderValidityWarningRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -static void XMLCDECL xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...) { xmlTextReaderPtr reader = (xmlTextReaderPtr) ctx; @@ -4156,11 +4156,11 @@ xmlTextReaderValidityStructuredRelay(void *userData, xmlErrorPtr error) * * Use RelaxNG to validate the document as it is processed. * Activation is only possible before the first Read(). - * if @schema is NULL, then RelaxNG validation is deactivated. + * if @schema is NULL, then RelaxNG validation is deactivated. @ The @schema should not be freed until the reader is deallocated * or its use has been deactivated. * - * Returns 0 in case the RelaxNG validation could be (de)activated and + * Returns 0 in case the RelaxNG validation could be (de)activated and * -1 in case of error. */ int @@ -4220,7 +4220,7 @@ xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, xmlRelaxNGPtr schema) { * * Internal locator function for the readers * - * Returns 0 in case the Schema validation could be (de)activated and + * Returns 0 in case the Schema validation could be (de)activated and * -1 in case of error. */ static int @@ -4273,11 +4273,11 @@ xmlTextReaderLocator(void *ctx, const char **file, unsigned long *line) { * * Use XSD Schema to validate the document as it is processed. * Activation is only possible before the first Read(). - * if @schema is NULL, then Schema validation is deactivated. - * The @schema should not be freed until the reader is deallocated + * if @schema is NULL, then Schema validation is deactivated. + * The @schema should not be freed until the reader is deallocated * or its use has been deactivated. * - * Returns 0 in case the Schema validation could be (de)activated and + * Returns 0 in case the Schema validation could be (de)activated and * -1 in case of error. */ int @@ -4881,7 +4881,7 @@ xmlTextReaderStructuredError(void *ctxt, xmlErrorPtr error) } } -static void XMLCDECL LIBXML_ATTR_FORMAT(2,3) +static void XMLCDECL LIBXML_ATTR_FORMAT(2,3) xmlTextReaderError(void *ctxt, const char *msg, ...) { va_list ap; @@ -4894,7 +4894,7 @@ xmlTextReaderError(void *ctxt, const char *msg, ...) } -static void XMLCDECL LIBXML_ATTR_FORMAT(2,3) +static void XMLCDECL LIBXML_ATTR_FORMAT(2,3) xmlTextReaderWarning(void *ctxt, const char *msg, ...) { va_list ap; @@ -5177,9 +5177,9 @@ xmlTextReaderSetup(xmlTextReaderPtr reader, "xmlTextReaderSetup : malloc failed\n"); return (-1); } - /* no operation on a reader should require a huge buffer */ - xmlBufSetAllocationScheme(reader->buffer, - XML_BUFFER_ALLOC_BOUNDED); + /* no operation on a reader should require a huge buffer */ + xmlBufSetAllocationScheme(reader->buffer, + XML_BUFFER_ALLOC_BOUNDED); if (reader->sax == NULL) reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler)); if (reader->sax == NULL) { @@ -5280,7 +5280,7 @@ xmlTextReaderSetup(xmlTextReaderPtr reader, reader->ctxt->linenumbers = 1; reader->ctxt->dictNames = 1; /* - * use the parser dictionary to allocate all elements and attributes names + * use the parser dictionary to allocate all elements and attributes names */ reader->ctxt->docdict = 1; reader->ctxt->parseMode = XML_PARSE_READER; diff --git a/contrib/libs/libxml/xmlregexp.c b/contrib/libs/libxml/xmlregexp.c index d1999b15cf..c119ff1fb7 100644 --- a/contrib/libs/libxml/xmlregexp.c +++ b/contrib/libs/libxml/xmlregexp.c @@ -2,7 +2,7 @@ * regexp.c: generic and extensible Regular Expression engine * * Basically designed with the purpose of compiling regexps for - * the variety of validation/schemas mechanisms now available in + * the variety of validation/schemas mechanisms now available in * XML related specifications these include: * - XML-1.0 DTD validation * - XML Schemas structure part 1 @@ -228,7 +228,7 @@ struct _xmlAutomataState { int maxTrans; int nbTrans; xmlRegTrans *trans; - /* knowing states pointing to us can speed things up */ + /* knowing states pointing to us can speed things up */ int maxTransTo; int nbTransTo; int *transTo; @@ -545,8 +545,8 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) { if (transitions == NULL) { xmlFree(stateRemap); xmlFree(stringRemap); - for (i = 0;i < nbatoms;i++) - xmlFree(stringMap[i]); + for (i = 0;i < nbatoms;i++) + xmlFree(stringMap[i]); xmlFree(stringMap); xmlFree(ret); return(NULL); @@ -590,7 +590,7 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) { targetno = stateRemap[trans->to]; /* * if the same atom can generate transitions to 2 different - * states then it means the automata is not deterministic and + * states then it means the automata is not deterministic and * the compact form can't be used ! */ prev = transitions[stateno * (nbatoms + 1) + atomno + 1]; @@ -831,7 +831,7 @@ xmlRegFreeAtom(xmlRegAtomPtr atom) { /** * xmlRegCopyAtom: * @ctxt: the regexp parser context - * @atom: the original atom + * @atom: the original atom * * Allocate a new regexp range * @@ -1546,10 +1546,10 @@ static int xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, xmlRegStatePtr to, xmlRegAtomPtr atom) { xmlRegStatePtr end; - int nullable = 0; + int nullable = 0; if (atom == NULL) { - ERROR("generate transition: atom == NULL"); + ERROR("generate transition: atom == NULL"); return(-1); } if (atom->type == XML_REGEXP_SUBREG) { @@ -1624,7 +1624,7 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, xmlRegAtomPtr copy; /* * duplicate a transition based on atom to count next - * occurrences after 1. We cannot loop to atom->start + * occurrences after 1. We cannot loop to atom->start * directly because we need an epsilon transition to * newstate. */ @@ -1657,7 +1657,7 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, } else { /* * either we need the atom at least once or there - * is an atom->start0 allowing to easily plug the + * is an atom->start0 allowing to easily plug the * epsilon transition. */ counter = xmlRegGetCounter(ctxt); @@ -1733,13 +1733,13 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, if (xmlRegAtomPush(ctxt, atom) < 0) { return(-1); } - if ((atom->quant == XML_REGEXP_QUANT_RANGE) && - (atom->min == 0) && (atom->max > 0)) { - nullable = 1; - atom->min = 1; - if (atom->max == 1) - atom->quant = XML_REGEXP_QUANT_OPT; - } + if ((atom->quant == XML_REGEXP_QUANT_RANGE) && + (atom->min == 0) && (atom->max > 0)) { + nullable = 1; + atom->min = 1; + if (atom->max == 1) + atom->quant = XML_REGEXP_QUANT_OPT; + } xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1); ctxt->state = end; switch (atom->quant) { @@ -1757,7 +1757,7 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1); break; case XML_REGEXP_QUANT_RANGE: - if (nullable) + if (nullable) xmlFAGenerateEpsilonTransition(ctxt, from, to); break; default: @@ -1957,7 +1957,7 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) { * Build the completed transitions bypassing the epsilons * Use a marking algorithm to avoid loops * Mark sink states too. - * Process from the latest states backward to the start when + * Process from the latest states backward to the start when * there is long cascading epsilon chains this minimize the * recursions and transition compares when adding the new ones */ @@ -2145,7 +2145,7 @@ xmlFACompareRanges(xmlRegRangePtr range1, xmlRegRangePtr range2) { } else { /* * comparing a block range with anything else is way - * too costly, and maintaining the table is like too much + * too costly, and maintaining the table is like too much * memory too, so let's force the automata to save state * here. */ @@ -2279,7 +2279,7 @@ xmlFACompareAtomTypes(xmlRegAtomType type1, xmlRegAtomType type2) { } switch (type1) { case XML_REGEXP_ANYSPACE: /* \s */ - /* can't be a letter, number, mark, punctuation, symbol */ + /* can't be a letter, number, mark, punctuation, symbol */ if ((type2 == XML_REGEXP_NOTSPACE) || ((type2 >= XML_REGEXP_LETTER) && (type2 <= XML_REGEXP_LETTER_OTHERS)) || @@ -2296,7 +2296,7 @@ xmlFACompareAtomTypes(xmlRegAtomType type1, xmlRegAtomType type2) { case XML_REGEXP_NOTSPACE: /* \S */ break; case XML_REGEXP_INITNAME: /* \l */ - /* can't be a number, mark, separator, punctuation, symbol or other */ + /* can't be a number, mark, separator, punctuation, symbol or other */ if ((type2 == XML_REGEXP_NOTINITNAME) || ((type2 >= XML_REGEXP_NUMBER) && (type2 <= XML_REGEXP_NUMBER_OTHERS)) || @@ -2315,7 +2315,7 @@ xmlFACompareAtomTypes(xmlRegAtomType type1, xmlRegAtomType type2) { case XML_REGEXP_NOTINITNAME: /* \L */ break; case XML_REGEXP_NAMECHAR: /* \c */ - /* can't be a mark, separator, punctuation, symbol or other */ + /* can't be a mark, separator, punctuation, symbol or other */ if ((type2 == XML_REGEXP_NOTNAMECHAR) || ((type2 >= XML_REGEXP_MARK) && (type2 <= XML_REGEXP_MARK_ENCLOSING)) || @@ -2332,7 +2332,7 @@ xmlFACompareAtomTypes(xmlRegAtomType type1, xmlRegAtomType type2) { case XML_REGEXP_NOTNAMECHAR: /* \C */ break; case XML_REGEXP_DECIMAL: /* \d */ - /* can't be a letter, mark, separator, punctuation, symbol or other */ + /* can't be a letter, mark, separator, punctuation, symbol or other */ if ((type2 == XML_REGEXP_NOTDECIMAL) || (type2 == XML_REGEXP_REALCHAR) || ((type2 >= XML_REGEXP_LETTER) && @@ -2352,7 +2352,7 @@ xmlFACompareAtomTypes(xmlRegAtomType type1, xmlRegAtomType type2) { case XML_REGEXP_NOTDECIMAL: /* \D */ break; case XML_REGEXP_REALCHAR: /* \w */ - /* can't be a mark, separator, punctuation, symbol or other */ + /* can't be a mark, separator, punctuation, symbol or other */ if ((type2 == XML_REGEXP_NOTDECIMAL) || ((type2 >= XML_REGEXP_MARK) && (type2 <= XML_REGEXP_MARK_ENCLOSING)) || @@ -2528,18 +2528,18 @@ xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) { case XML_REGEXP_STRING: if (!deep) ret = (atom1->valuep != atom2->valuep); - else { - xmlChar *val1 = (xmlChar *)atom1->valuep; - xmlChar *val2 = (xmlChar *)atom2->valuep; - int compound1 = (xmlStrchr(val1, '|') != NULL); - int compound2 = (xmlStrchr(val2, '|') != NULL); - - /* Ignore negative match flag for ##other namespaces */ - if (compound1 != compound2) - return(0); - - ret = xmlRegStrEqualWildcard(val1, val2); - } + else { + xmlChar *val1 = (xmlChar *)atom1->valuep; + xmlChar *val2 = (xmlChar *)atom2->valuep; + int compound1 = (xmlStrchr(val1, '|') != NULL); + int compound2 = (xmlStrchr(val2, '|') != NULL); + + /* Ignore negative match flag for ##other namespaces */ + if (compound1 != compound2) + return(0); + + ret = xmlRegStrEqualWildcard(val1, val2); + } break; case XML_REGEXP_EPSILON: goto not_determinist; @@ -2821,21 +2821,21 @@ xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, int neg, break; case XML_REGEXP_NOTSPACE: neg = !neg; - /* Falls through. */ + /* Falls through. */ case XML_REGEXP_ANYSPACE: ret = ((codepoint == '\n') || (codepoint == '\r') || (codepoint == '\t') || (codepoint == ' ')); break; case XML_REGEXP_NOTINITNAME: neg = !neg; - /* Falls through. */ + /* Falls through. */ case XML_REGEXP_INITNAME: ret = (IS_LETTER(codepoint) || (codepoint == '_') || (codepoint == ':')); break; case XML_REGEXP_NOTNAMECHAR: neg = !neg; - /* Falls through. */ + /* Falls through. */ case XML_REGEXP_NAMECHAR: ret = (IS_LETTER(codepoint) || IS_DIGIT(codepoint) || (codepoint == '.') || (codepoint == '-') || @@ -2844,13 +2844,13 @@ xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, int neg, break; case XML_REGEXP_NOTDECIMAL: neg = !neg; - /* Falls through. */ + /* Falls through. */ case XML_REGEXP_DECIMAL: ret = xmlUCSIsCatNd(codepoint); break; case XML_REGEXP_REALCHAR: neg = !neg; - /* Falls through. */ + /* Falls through. */ case XML_REGEXP_NOTREALCHAR: ret = xmlUCSIsCatP(codepoint); if (ret == 0) @@ -3575,9 +3575,9 @@ xmlRegNewExecCtxt(xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data) { /** * xmlRegFreeExecCtxt: - * @exec: a regular expression evaluation context + * @exec: a regular expression evaluation context * - * Free the structures associated to a regular expression evaluation context. + * Free the structures associated to a regular expression evaluation context. */ void xmlRegFreeExecCtxt(xmlRegExecCtxtPtr exec) { @@ -3651,7 +3651,7 @@ xmlFARegExecSaveInputString(xmlRegExecCtxtPtr exec, const xmlChar *value, * @valStr: the validation string * * Checks if both strings are equal or have the same content. "*" - * can be used as a wildcard in @valStr; "|" is used as a separator of + * can be used as a wildcard in @valStr; "|" is used as a separator of * substrings in both @expStr and @valStr. * * Returns 1 if the comparison is satisfied and the number of substrings @@ -4105,9 +4105,9 @@ rollback: xmlFree(exec->errString); exec->errString = xmlStrdup(value); exec->errState = exec->state; - if (exec->comp->nbCounters) - memcpy(exec->errCounts, exec->counts, - exec->comp->nbCounters * sizeof(int)); + if (exec->comp->nbCounters) + memcpy(exec->errCounts, exec->counts, + exec->comp->nbCounters * sizeof(int)); } /* @@ -4897,8 +4897,8 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) { } NEXT; xmlFAParseCharProp(ctxt); - if (ctxt->atom != NULL) - ctxt->atom->neg = 1; + if (ctxt->atom != NULL) + ctxt->atom->neg = 1; if (CUR != '}') { ERROR("Expecting '}'"); return; @@ -5069,18 +5069,18 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { return; } len = 1; - } else if ((cur != '\0') && (cur != 0x5B) && (cur != 0x5D)) { + } else if ((cur != '\0') && (cur != 0x5B) && (cur != 0x5D)) { end = CUR_SCHAR(ctxt->cur, len); } else { ERROR("Expecting the end of a char range"); return; } - + /* TODO check that the values are acceptable character ranges for XML */ if (end < start) { ERROR("End of range is before start of range"); } else { - NEXTL(len); + NEXTL(len); xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg, XML_REGEXP_CHARVAL, start, end, NULL); } @@ -5358,12 +5358,12 @@ xmlFAParseBranch(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr to) { previous = ctxt->state; ret = xmlFAParsePiece(ctxt); - if (ret == 0) { - /* Empty branch */ - xmlFAGenerateEpsilonTransition(ctxt, previous, to); - } else { + if (ret == 0) { + /* Empty branch */ + xmlFAGenerateEpsilonTransition(ctxt, previous, to); + } else { if (xmlFAGenerateTransitions(ctxt, previous, - (CUR=='|' || CUR==')' || CUR==0) ? to : NULL, ctxt->atom) < 0) + (CUR=='|' || CUR==')' || CUR==0) ? to : NULL, ctxt->atom) < 0) return(-1); previous = ctxt->state; ctxt->atom = NULL; @@ -5372,8 +5372,8 @@ xmlFAParseBranch(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr to) { ret = xmlFAParsePiece(ctxt); if (ret != 0) { if (xmlFAGenerateTransitions(ctxt, previous, - (CUR=='|' || CUR==')' || CUR==0) ? to : NULL, - ctxt->atom) < 0) + (CUR=='|' || CUR==')' || CUR==0) ? to : NULL, + ctxt->atom) < 0) return(-1); previous = ctxt->state; ctxt->atom = NULL; @@ -5548,8 +5548,8 @@ xmlRegexpIsDeterminist(xmlRegexpPtr comp) { return(comp->determinist); am = xmlNewAutomata(); - if (am == NULL) - return(-1); + if (am == NULL) + return(-1); if (am->states != NULL) { int i; @@ -5877,8 +5877,8 @@ xmlAutomataNewNegTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, * @to: the target point of the transition or NULL * @token: the input string associated to that transition * @token2: the second input string associated to that transition - * @min: the minimum successive occurrences of token - * @max: the maximum successive occurrences of token + * @min: the minimum successive occurrences of token + * @max: the maximum successive occurrences of token * @data: data associated to the transition * * If @to is NULL, this creates first a new target state in the automata @@ -5964,8 +5964,8 @@ xmlAutomataNewCountTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, * @from: the starting point of the transition * @to: the target point of the transition or NULL * @token: the input string associated to that transition - * @min: the minimum successive occurrences of token - * @max: the maximum successive occurrences of token + * @min: the minimum successive occurrences of token + * @max: the maximum successive occurrences of token * @data: data associated to the transition * * If @to is NULL, this creates first a new target state in the automata @@ -6031,8 +6031,8 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, * @to: the target point of the transition or NULL * @token: the input string associated to that transition * @token2: the second input string associated to that transition - * @min: the minimum successive occurrences of token - * @max: the maximum successive occurrences of token + * @min: the minimum successive occurrences of token + * @max: the maximum successive occurrences of token * @data: data associated to the transition * * If @to is NULL, this creates first a new target state in the automata @@ -6111,8 +6111,8 @@ xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, * @from: the starting point of the transition * @to: the target point of the transition or NULL * @token: the input string associated to that transition - * @min: the minimum successive occurrences of token - * @max: the maximum successive occurrences of token + * @min: the minimum successive occurrences of token + * @max: the maximum successive occurrences of token * @data: data associated to the transition * * If @to is NULL, this creates first a new target state in the automata @@ -6371,7 +6371,7 @@ struct _xmlExpCtxt { /** * xmlExpNewCtxt: * @maxNodes: the maximum number of nodes - * @dict: optional dictionary to use internally + * @dict: optional dictionary to use internally * * Creates a new context for manipulating expressions * @@ -6629,7 +6629,7 @@ xmlExpHashGetEntry(xmlExpCtxtPtr ctxt, xmlExpNodeType type, /* OR reduction rule 1 */ /* a | a reduced to a */ if (left == right) { - xmlExpFree(ctxt, right); + xmlExpFree(ctxt, right); return(left); } /* OR canonicalization rule 1 */ @@ -7088,7 +7088,7 @@ xmlExpGetStart(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, * xmlExpIsNillable: * @exp: the expression * - * Finds if the expression is nillable, i.e. if it accepts the empty sequence + * Finds if the expression is nillable, i.e. if it accepts the empty sequence * * Returns 1 if nillable, 0 if not and -1 in case of error */ @@ -7230,7 +7230,7 @@ xmlExpStringDerive(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, return(NULL); } /* - * check the string is in the dictionary, if yes use an interned + * check the string is in the dictionary, if yes use an interned * copy, otherwise we know it's not an acceptable input */ input = xmlDictExists(ctxt->dict, str, len); @@ -7271,7 +7271,7 @@ static xmlExpNodePtr xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, * so that sub{n} subsume exp * * Returns the multiple value if successful, 0 if it is not a multiple - * and -1 in case of internal error. + * and -1 in case of internal error. */ static int @@ -7439,7 +7439,7 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { return(forbiddenExp); } #ifdef DEBUG_DERIV - printf("Complex exp vs Atom -> Forbid\n"); + printf("Complex exp vs Atom -> Forbid\n"); #endif return(forbiddenExp); case XML_EXP_SEQ: @@ -7783,7 +7783,7 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { * * Evaluates the expression resulting from @exp consuming a sub expression @sub * Based on algebraic derivation and sometimes direct Brzozowski derivation - * it usually takes less than linear time and can handle expressions generating + * it usually takes less than linear time and can handle expressions generating * infinite languages. * * Returns the resulting expression or NULL in case of internal error, the @@ -7805,7 +7805,7 @@ xmlExpExpDerive(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { } if (xmlExpCheckCard(exp, sub) == 0) { #ifdef DEBUG_DERIV - printf("sub generate longer sequences than exp : can't subsume\n"); + printf("sub generate longer sequences than exp : can't subsume\n"); #endif return(forbiddenExp); } @@ -7818,7 +7818,7 @@ xmlExpExpDerive(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { * @exp: the englobing expression * @sub: the subexpression * - * Check whether @exp accepts all the languages accepted by @sub + * Check whether @exp accepts all the languages accepted by @sub * the input being a subexpression. * * Returns 1 if true 0 if false and -1 in case of failure. @@ -7845,7 +7845,7 @@ xmlExpSubsume(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { } if (xmlExpCheckCard(exp, sub) == 0) { #ifdef DEBUG_DERIV - printf("sub generate longer sequences than exp : can't subsume\n"); + printf("sub generate longer sequences than exp : can't subsume\n"); #endif return(0); } diff --git a/contrib/libs/libxml/xmlsave.c b/contrib/libs/libxml/xmlsave.c index 888412075a..fa00915371 100644 --- a/contrib/libs/libxml/xmlsave.c +++ b/contrib/libs/libxml/xmlsave.c @@ -1,5 +1,5 @@ /* - * xmlsave.c: Implementation of the document serializer + * xmlsave.c: Implementation of the document serializer * * See Copyright for the status of this software. * @@ -355,7 +355,7 @@ xmlSaveCtxtInit(xmlSaveCtxtPtr ctxt) /** * xmlFreeSaveCtxt: * - * Free a saving context, destroying the output in any remaining buffer + * Free a saving context, destroying the output in any remaining buffer */ static void xmlFreeSaveCtxt(xmlSaveCtxtPtr ctxt) @@ -1587,31 +1587,31 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { if (cur->properties != NULL) xhtmlAttrListDumpOutput(ctxt, cur->properties); - if ((cur->type == XML_ELEMENT_NODE) && - (cur->parent != NULL) && - (cur->parent->parent == (xmlNodePtr) cur->doc) && - xmlStrEqual(cur->name, BAD_CAST"head") && - xmlStrEqual(cur->parent->name, BAD_CAST"html")) { - - tmp = cur->children; - while (tmp != NULL) { - if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { - xmlChar *httpequiv; - - httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); - if (httpequiv != NULL) { - if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { - xmlFree(httpequiv); - break; - } - xmlFree(httpequiv); - } - } - tmp = tmp->next; - } - if (tmp == NULL) - addmeta = 1; - } + if ((cur->type == XML_ELEMENT_NODE) && + (cur->parent != NULL) && + (cur->parent->parent == (xmlNodePtr) cur->doc) && + xmlStrEqual(cur->name, BAD_CAST"head") && + xmlStrEqual(cur->parent->name, BAD_CAST"html")) { + + tmp = cur->children; + while (tmp != NULL) { + if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { + xmlChar *httpequiv; + + httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); + if (httpequiv != NULL) { + if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + xmlFree(httpequiv); + break; + } + xmlFree(httpequiv); + } + } + tmp = tmp->next; + } + if (tmp == NULL) + addmeta = 1; + } if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) { if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) && @@ -2089,8 +2089,8 @@ xmlBufAttrSerializeTxtContent(xmlBufPtr buf, xmlDocPtr doc, xmlBufAdd(buf, BAD_CAST "&", 5); cur++; base = cur; - } else if ((*cur >= 0x80) && (cur[1] != 0) && - ((doc == NULL) || (doc->encoding == NULL))) { + } else if ((*cur >= 0x80) && (cur[1] != 0) && + ((doc == NULL) || (doc->encoding == NULL))) { /* * We assume we have UTF-8 content. */ @@ -2111,14 +2111,14 @@ xmlBufAttrSerializeTxtContent(xmlBufPtr buf, xmlDocPtr doc, val <<= 6; val |= (cur[1]) & 0x3F; l = 2; - } else if ((*cur < 0xF0) && (cur [2] != 0)) { + } else if ((*cur < 0xF0) && (cur [2] != 0)) { val = (cur[0]) & 0x0F; val <<= 6; val |= (cur[1]) & 0x3F; val <<= 6; val |= (cur[2]) & 0x3F; l = 3; - } else if ((*cur < 0xF8) && (cur [2] != 0) && (cur[3] != 0)) { + } else if ((*cur < 0xF8) && (cur [2] != 0) && (cur[3] != 0)) { val = (cur[0]) & 0x07; val <<= 6; val |= (cur[1]) & 0x3F; @@ -2186,9 +2186,9 @@ xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, * * Dump an XML node, recursive behaviour,children are printed too. * Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 - * or xmlKeepBlanksDefault(0) was called. + * or xmlKeepBlanksDefault(0) was called. * Since this is using xmlBuffer structures it is limited to 2GB and somehow - * deprecated, use xmlNodeDumpOutput() instead. + * deprecated, use xmlNodeDumpOutput() instead. * * Returns the number of bytes written to the buffer or -1 in case of error */ @@ -2588,7 +2588,7 @@ xmlDocDump(FILE *f, xmlDocPtr cur) { * xmlSaveFileTo: * @buf: an output I/O buffer * @cur: the document - * @encoding: the encoding if any assuming the I/O layer handles the transcoding + * @encoding: the encoding if any assuming the I/O layer handles the transcoding * * Dump an XML document to an I/O buffer. * Warning ! This call xmlOutputBufferClose() on buf which is not available @@ -2622,7 +2622,7 @@ xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) { * xmlSaveFormatFileTo: * @buf: an output I/O buffer * @cur: the document - * @encoding: the encoding if any assuming the I/O layer handles the transcoding + * @encoding: the encoding if any assuming the I/O layer handles the transcoding * @format: should formatting spaces been added * * Dump an XML document to an I/O buffer. @@ -2691,7 +2691,7 @@ xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur, return(-1); } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (cur->compression < 0) cur->compression = xmlGetCompressMode(); #endif /* diff --git a/contrib/libs/libxml/xmlschemas.c b/contrib/libs/libxml/xmlschemas.c index 8227cdd681..b83982eb5a 100644 --- a/contrib/libs/libxml/xmlschemas.c +++ b/contrib/libs/libxml/xmlschemas.c @@ -22,7 +22,7 @@ * acquisition episode (xmlSchemaAugmentIDC). * * NOTES: - * - Eliminated item creation for: <restriction>, <extension>, + * - Eliminated item creation for: <restriction>, <extension>, * <simpleContent>, <complexContent>, <list>, <union> * * PROBLEMS: @@ -44,12 +44,12 @@ * but is done here due to performance. Move it to an other layer * is schema construction via an API is implemented. */ - -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - + +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" @@ -172,7 +172,7 @@ static const xmlChar *xmlNamespaceNs = (const xmlChar *) /* * Macros for attribute uses. */ -#define WXS_ATTRUSE_DECL(au) (WXS_ATTR_USE_CAST (au))->attrDecl +#define WXS_ATTRUSE_DECL(au) (WXS_ATTR_USE_CAST (au))->attrDecl #define WXS_ATTRUSE_TYPEDEF(au) WXS_ATTR_TYPEDEF(WXS_ATTRUSE_DECL( WXS_ATTR_USE_CAST au)) @@ -369,7 +369,7 @@ typedef struct _xmlSchemaAbstractCtxt xmlSchemaAbstractCtxt; typedef xmlSchemaAbstractCtxt *xmlSchemaAbstractCtxtPtr; struct _xmlSchemaAbstractCtxt { int type; /* E.g. XML_SCHEMA_CTXT_VALIDATOR */ - void *dummy; /* Fix alignment issues */ + void *dummy; /* Fix alignment issues */ }; typedef struct _xmlSchemaBucket xmlSchemaBucket; @@ -480,7 +480,7 @@ typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem; typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr; struct _xmlSchemaBasicItem { xmlSchemaTypeType type; - void *dummy; /* Fix alignment issues */ + void *dummy; /* Fix alignment issues */ }; /** @@ -625,7 +625,7 @@ struct _xmlSchemaParserCtxt { xmlAutomataStatePtr end; xmlAutomataStatePtr state; - xmlDictPtr dict; /* dictionary for interned string names */ + xmlDictPtr dict; /* dictionary for interned string names */ xmlSchemaTypePtr ctxtType; /* The current context simple/complex type */ int options; xmlSchemaValidCtxtPtr vctxt; @@ -1093,7 +1093,7 @@ xmlSchemaGetUnionSimpleTypeMemberTypes(xmlSchemaTypePtr type); static void xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt, const char *funcName, - const char *message) LIBXML_ATTR_FORMAT(3,0); + const char *message) LIBXML_ATTR_FORMAT(3,0); static int xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt, xmlSchemaTypePtr type, @@ -1742,7 +1742,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, BAD_CAST "'"); FREE_AND_NULL(str); } - /* Falls through. */ + /* Falls through. */ default: named = 0; } @@ -1778,7 +1778,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, } FREE_AND_NULL(str) - return (xmlEscapeFormatString(buf)); + return (xmlEscapeFormatString(buf)); } /** @@ -1898,7 +1898,7 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt, * * Handle a parser error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, const char *msg, const xmlChar * str1, const xmlChar * str2) { @@ -1931,7 +1931,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, * * Handle a parser error */ -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, xmlNodePtr child, int error, const char *msg, const xmlChar * str1, const xmlChar * str2) @@ -1960,7 +1960,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, * * Handle a parser error */ -static void LIBXML_ATTR_FORMAT(7,0) +static void LIBXML_ATTR_FORMAT(7,0) xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, const xmlChar * strData1, const xmlChar * strData2, const xmlChar * strData3, const char *msg, const xmlChar * str1, @@ -2011,7 +2011,7 @@ xmlSchemaVErrMemory(xmlSchemaValidCtxtPtr ctxt, extra); } -static void LIBXML_ATTR_FORMAT(2,0) +static void LIBXML_ATTR_FORMAT(2,0) xmlSchemaPSimpleInternalErr(xmlNodePtr node, const char *msg, const xmlChar *str) { @@ -2022,21 +2022,21 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node, #define WXS_ERROR_TYPE_ERROR 1 #define WXS_ERROR_TYPE_WARNING 2 /** - * xmlSchemaErr4Line: + * xmlSchemaErr4Line: * @ctxt: the validation context - * @errorLevel: the error level - * @error: the error code + * @errorLevel: the error level + * @error: the error code * @node: the context node - * @line: the line number + * @line: the line number * @msg: the error message * @str1: extra data * @str2: extra data * @str3: extra data - * @str4: extra data + * @str4: extra data * * Handle a validation error */ -static void LIBXML_ATTR_FORMAT(6,0) +static void LIBXML_ATTR_FORMAT(6,0) xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, xmlErrorLevel errorLevel, int error, xmlNodePtr node, int line, const char *msg, @@ -2151,7 +2151,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, * * Handle a validation error */ -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2, const xmlChar *str3) @@ -2160,7 +2160,7 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt, msg, str1, str2, str3, NULL); } -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2, @@ -2170,7 +2170,7 @@ xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt, msg, str1, str2, str3, str4); } -static void LIBXML_ATTR_FORMAT(4,0) +static void LIBXML_ATTR_FORMAT(4,0) xmlSchemaErr(xmlSchemaAbstractCtxtPtr actxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2) @@ -2193,7 +2193,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, /* * Don't try to format other nodes than element and * attribute nodes. - * Play safe and return an empty string. + * Play safe and return an empty string. */ *msg = xmlStrdup(BAD_CAST ""); return(*msg); @@ -2258,14 +2258,14 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, TODO return (NULL); } - + + /* + * xmlSchemaFormatItemForReport() also returns an escaped format + * string, so do this before calling it below (in the future). + */ + xmlEscapeFormatString(msg); + /* - * xmlSchemaFormatItemForReport() also returns an escaped format - * string, so do this before calling it below (in the future). - */ - xmlEscapeFormatString(msg); - - /* * VAL TODO: The output of the given schema component is currently * disabled. */ @@ -2281,7 +2281,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, return (*msg); } -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt, const char *funcName, const char *message, @@ -2292,21 +2292,21 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt, if (actxt == NULL) return; - msg = xmlStrdup(BAD_CAST "Internal error: %s, "); + msg = xmlStrdup(BAD_CAST "Internal error: %s, "); msg = xmlStrcat(msg, BAD_CAST message); msg = xmlStrcat(msg, BAD_CAST ".\n"); if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) - xmlSchemaErr3(actxt, XML_SCHEMAV_INTERNAL, NULL, - (const char *) msg, (const xmlChar *) funcName, str1, str2); + xmlSchemaErr3(actxt, XML_SCHEMAV_INTERNAL, NULL, + (const char *) msg, (const xmlChar *) funcName, str1, str2); else if (actxt->type == XML_SCHEMA_CTXT_PARSER) - xmlSchemaErr3(actxt, XML_SCHEMAP_INTERNAL, NULL, - (const char *) msg, (const xmlChar *) funcName, str1, str2); + xmlSchemaErr3(actxt, XML_SCHEMAP_INTERNAL, NULL, + (const char *) msg, (const xmlChar *) funcName, str1, str2); FREE_AND_NULL(msg) } -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt, const char *funcName, const char *message) @@ -2315,7 +2315,7 @@ xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt, } #if 0 -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt, const char *funcName, const char *message, @@ -2327,7 +2327,7 @@ xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt, } #endif -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, @@ -2352,7 +2352,7 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt, FREE_AND_NULL(msg) } -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, @@ -2367,7 +2367,7 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, @@ -2392,7 +2392,7 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt, -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt, xmlParserErrors error, xmlSchemaPSVIIDCNodePtr idcNode, @@ -2492,13 +2492,13 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt, msg = xmlStrcat(msg, BAD_CAST " '"); if (type->builtInType != 0) { msg = xmlStrcat(msg, BAD_CAST "xs:"); - str = xmlStrdup(type->name); - } else { - const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name); - if (!str) - str = xmlStrdup(qName); - } - msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); + str = xmlStrdup(type->name); + } else { + const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name); + if (!str) + str = xmlStrdup(qName); + } + msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); msg = xmlStrcat(msg, BAD_CAST "'"); FREE_AND_NULL(str); } @@ -2543,7 +2543,7 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt, FREE_AND_NULL(msg) } -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, @@ -2635,7 +2635,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, str = xmlStrcat(str, BAD_CAST ", "); } str = xmlStrcat(str, BAD_CAST " ).\n"); - msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); + msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); FREE_AND_NULL(str) } else msg = xmlStrcat(msg, BAD_CAST "\n"); @@ -2643,7 +2643,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, xmlFree(msg); } -static void LIBXML_ATTR_FORMAT(8,0) +static void LIBXML_ATTR_FORMAT(8,0) xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, @@ -2839,7 +2839,7 @@ xmlSchemaPResCompAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlSchemaFormatItemForReport(&des, NULL, ownerItem, ownerElem); if (refTypeStr == NULL) refTypeStr = (const char *) xmlSchemaItemTypeToStr(refType); - xmlSchemaPErrExt(ctxt, ownerElem, error, + xmlSchemaPErrExt(ctxt, ownerElem, error, NULL, NULL, NULL, "%s, attribute '%s': The QName value '%s' does not resolve to a(n) " "%s.\n", BAD_CAST des, BAD_CAST name, @@ -2930,7 +2930,7 @@ xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt, * * Reports an error during parsing. */ -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlSchemaBasicItemPtr item, @@ -2966,7 +2966,7 @@ xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt, * * Reports an error during parsing. */ -static void LIBXML_ATTR_FORMAT(5,0) +static void LIBXML_ATTR_FORMAT(5,0) xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlSchemaBasicItemPtr item, @@ -2991,7 +2991,7 @@ xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt, * * Reports an attribute use error during parsing. */ -static void LIBXML_ATTR_FORMAT(6,0) +static void LIBXML_ATTR_FORMAT(6,0) xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlNodePtr node, @@ -3112,7 +3112,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, * Reports a simple type validation error. * TODO: Should this report the value of an element as well? */ -static void LIBXML_ATTR_FORMAT(8,0) +static void LIBXML_ATTR_FORMAT(8,0) xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED, @@ -3154,13 +3154,13 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, msg = xmlStrcat(msg, BAD_CAST " '"); if (type->builtInType != 0) { msg = xmlStrcat(msg, BAD_CAST "xs:"); - str = xmlStrdup(type->name); - } else { - const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name); - if (!str) - str = xmlStrdup(qName); - } - msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); + str = xmlStrdup(type->name); + } else { + const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name); + if (!str) + str = xmlStrdup(qName); + } + msg = xmlStrcat(msg, xmlEscapeFormatString(&str)); msg = xmlStrcat(msg, BAD_CAST "'."); FREE_AND_NULL(str); } @@ -3172,10 +3172,10 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, "valid."); } if (expected) { - xmlChar *expectedEscaped = xmlCharStrdup(expected); + xmlChar *expectedEscaped = xmlCharStrdup(expected); msg = xmlStrcat(msg, BAD_CAST " Expected is '"); - msg = xmlStrcat(msg, xmlEscapeFormatString(&expectedEscaped)); - FREE_AND_NULL(expectedEscaped); + msg = xmlStrcat(msg, xmlEscapeFormatString(&expectedEscaped)); + FREE_AND_NULL(expectedEscaped); msg = xmlStrcat(msg, BAD_CAST "'.\n"); } else msg = xmlStrcat(msg, BAD_CAST "\n"); @@ -3559,12 +3559,12 @@ xmlSchemaBucketFree(xmlSchemaBucketPtr bucket) xmlFree(bucket); } -static void -xmlSchemaBucketFreeEntry(void *bucket, const xmlChar *name ATTRIBUTE_UNUSED) -{ - xmlSchemaBucketFree((xmlSchemaBucketPtr) bucket); -} - +static void +xmlSchemaBucketFreeEntry(void *bucket, const xmlChar *name ATTRIBUTE_UNUSED) +{ + xmlSchemaBucketFree((xmlSchemaBucketPtr) bucket); +} + static xmlSchemaBucketPtr xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, int type, const xmlChar *targetNamespace) @@ -4159,7 +4159,7 @@ xmlSchemaFree(xmlSchemaPtr schema) xmlHashFree(schema->idcDef, NULL); if (schema->schemasImports != NULL) - xmlHashFree(schema->schemasImports, xmlSchemaBucketFreeEntry); + xmlHashFree(schema->schemasImports, xmlSchemaBucketFreeEntry); if (schema->includes != NULL) { xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes; int i; @@ -4195,13 +4195,13 @@ xmlSchemaTypeDump(xmlSchemaTypePtr type, FILE * output); /* forward */ * Dump the element */ static void -xmlSchemaElementDump(void *payload, void *data, +xmlSchemaElementDump(void *payload, void *data, const xmlChar * name ATTRIBUTE_UNUSED, const xmlChar * namespace ATTRIBUTE_UNUSED, const xmlChar * context ATTRIBUTE_UNUSED) { - xmlSchemaElementPtr elem = (xmlSchemaElementPtr) payload; - FILE *output = (FILE *) data; + xmlSchemaElementPtr elem = (xmlSchemaElementPtr) payload; + FILE *output = (FILE *) data; if (elem == NULL) return; @@ -4301,7 +4301,7 @@ xmlSchemaAnnotDump(FILE * output, xmlSchemaAnnotPtr annot) * xmlSchemaContentModelDump: * @particle: the schema particle * @output: the file output - * @depth: the depth used for indentation + * @depth: the depth used for indentation * * Dump a SchemaType structure */ @@ -4516,13 +4516,13 @@ xmlSchemaTypeDump(xmlSchemaTypePtr type, FILE * output) #endif } -static void -xmlSchemaTypeDumpEntry(void *type, void *output, - const xmlChar *name ATTRIBUTE_UNUSED) -{ - xmlSchemaTypeDump((xmlSchemaTypePtr) type, (FILE *) output); -} - +static void +xmlSchemaTypeDumpEntry(void *type, void *output, + const xmlChar *name ATTRIBUTE_UNUSED) +{ + xmlSchemaTypeDump((xmlSchemaTypePtr) type, (FILE *) output); +} + /** * xmlSchemaDump: * @output: the file output @@ -4551,8 +4551,8 @@ xmlSchemaDump(FILE * output, xmlSchemaPtr schema) fprintf(output, "\n"); if (schema->annot != NULL) xmlSchemaAnnotDump(output, schema->annot); - xmlHashScan(schema->typeDecl, xmlSchemaTypeDumpEntry, output); - xmlHashScanFull(schema->elemDecl, xmlSchemaElementDump, output); + xmlHashScan(schema->typeDecl, xmlSchemaTypeDumpEntry, output); + xmlHashScanFull(schema->elemDecl, xmlSchemaElementDump, output); } #ifdef DEBUG_IDC_NODE_TABLE @@ -5149,7 +5149,7 @@ subschemas: * Add an XML schema annotation declaration * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaNotationPtr xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, @@ -5183,10 +5183,10 @@ xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * @name: the item name * @namespace: the namespace * - * Add an XML schema Attribute declaration + * Add an XML schema Attribute declaration * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaAttributePtr xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, @@ -5224,10 +5224,10 @@ xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * @name: the item name * @namespace: the namespace * - * Add an XML schema Attribute declaration + * Add an XML schema Attribute declaration * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaAttributeUsePtr xmlSchemaAddAttributeUse(xmlSchemaParserCtxtPtr pctxt, @@ -5295,9 +5295,9 @@ xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt, * @nsName: the target namespace * @node: the corresponding node * - * Add an XML schema Attribute Group definition. + * Add an XML schema Attribute Group definition. * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaAttributeGroupPtr xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, @@ -5349,7 +5349,7 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, * Add an XML schema Element declaration * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaElementPtr xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, @@ -5390,7 +5390,7 @@ xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, * Add an XML schema item * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaTypePtr xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, @@ -5487,7 +5487,7 @@ xmlSchemaAddAttributeUseProhib(xmlSchemaParserCtxtPtr pctxt) * Adds a schema model group * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaModelGroupPtr xmlSchemaAddModelGroup(xmlSchemaParserCtxtPtr ctxt, @@ -5529,7 +5529,7 @@ xmlSchemaAddModelGroup(xmlSchemaParserCtxtPtr ctxt, * Adds an XML schema particle component. * *WARNING* this interface is highly subject to change * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaParticlePtr xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt, @@ -5575,7 +5575,7 @@ xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt, * * Add an XML schema Group definition * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaModelGroupDefPtr xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, @@ -5621,7 +5621,7 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, * * Creates a new wildcard namespace constraint. * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaWildcardNsPtr xmlSchemaNewWildcardNsConstraint(xmlSchemaParserCtxtPtr ctxt) @@ -5679,7 +5679,7 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Adds a wildcard. * It corresponds to a xsd:anyAttribute and xsd:any. * - * Returns the new structure or NULL in case of error + * Returns the new structure or NULL in case of error */ static xmlSchemaWildcardPtr xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, @@ -5712,12 +5712,12 @@ xmlSchemaSubstGroupFree(xmlSchemaSubstGroupPtr group) xmlFree(group); } -static void -xmlSchemaSubstGroupFreeEntry(void *group, const xmlChar *name ATTRIBUTE_UNUSED) -{ - xmlSchemaSubstGroupFree((xmlSchemaSubstGroupPtr) group); -} - +static void +xmlSchemaSubstGroupFreeEntry(void *group, const xmlChar *name ATTRIBUTE_UNUSED) +{ + xmlSchemaSubstGroupFree((xmlSchemaSubstGroupPtr) group); +} + static xmlSchemaSubstGroupPtr xmlSchemaSubstGroupAdd(xmlSchemaParserCtxtPtr pctxt, xmlSchemaElementPtr head) @@ -5809,7 +5809,7 @@ xmlSchemaAddElementSubstitutionMember(xmlSchemaParserCtxtPtr pctxt, * @schema: the schema context * @ownerItem: the parent as a schema object * @value: the QName value - * @uri: the resulting namespace URI if found + * @uri: the resulting namespace URI if found * @local: the resulting local part if found, the attribute value otherwise * * Extracts the local name and the URI of a QName value and validates it. @@ -5889,7 +5889,7 @@ xmlSchemaPValAttrNodeQNameValue(xmlSchemaParserCtxtPtr ctxt, * @schema: the schema context * @ownerItem: the owner as a schema object * @attr: the attribute node - * @uri: the resulting namespace URI if found + * @uri: the resulting namespace URI if found * @local: the resulting local part if found, the attribute value otherwise * * Extracts and validates the QName of an attribute value. @@ -5921,7 +5921,7 @@ xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt, * @ownerItem: the owner as a schema object * @ownerElem: the parent node of the attribute * @name: the name of the attribute - * @uri: the resulting namespace URI if found + * @uri: the resulting namespace URI if found * @local: the resulting local part if found, the attribute value otherwise * * Extracts and validates the QName of an attribute value. @@ -6238,7 +6238,7 @@ xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt, /************************************************************************ * * - * Schema extraction from an Infoset * + * Schema extraction from an Infoset * * * ************************************************************************/ static xmlSchemaTypePtr xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr @@ -6271,7 +6271,7 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, /** * xmlSchemaPValAttrNodeValue: * - * @pctxt: a schema parser context + * @pctxt: a schema parser context * @ownerItem: the schema object owner if existent * @attr: the schema attribute node being validated * @value: the value @@ -6525,7 +6525,7 @@ xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * @schema: the schema being built * @node: a subtree containing XML Schema informations * - * parse a XML schema Attribute declaration + * parse a XML schema Attribute declaration * *WARNING* this interface is highly subject to change * * Returns -1 in case of error, 0 if the declaration is improper and @@ -6822,7 +6822,7 @@ xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt, dictnsItem = xmlDictLookup(ctxt->dict, nsItem, -1); } /* - * Avoid duplicate namespaces. + * Avoid duplicate namespaces. */ tmp = wildc->nsSet; while (tmp != NULL) { @@ -7045,7 +7045,7 @@ xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * @schema: the schema being built * @node: a subtree containing XML Schema informations * - * parse a XML schema AnyAttribute declaration + * parse a XML schema AnyAttribute declaration * *WARNING* this interface is highly subject to change * * Returns a wildcard or NULL. @@ -7115,7 +7115,7 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, * @schema: the schema being built * @node: a subtree containing XML Schema informations * - * parse a XML schema Attribute declaration + * parse a XML schema Attribute declaration * *WARNING* this interface is highly subject to change * * Returns the attribute declaration. @@ -7373,8 +7373,8 @@ attr_next: */ if (defValue != NULL) use->defValue = defValue; - if (defValueType == WXS_ATTR_DEF_VAL_FIXED) - use->flags |= XML_SCHEMA_ATTR_USE_FIXED; + if (defValueType == WXS_ATTR_DEF_VAL_FIXED) + use->flags |= XML_SCHEMA_ATTR_USE_FIXED; } check_children: @@ -7935,7 +7935,7 @@ xmlSchemaPValAttrBlockFinal(const xmlChar *value, int ret = 0; /* - * TODO: This does not check for duplicate entries. + * TODO: This does not check for duplicate entries. */ if ((flags == NULL) || (value == NULL)) return (-1); @@ -8127,7 +8127,7 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt, * * Adds the annotation to the given schema component. * - * Returns the given annotation. + * Returns the given annotation. */ static xmlSchemaAnnotPtr xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem, @@ -8222,7 +8222,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem, * @schema: the schema being built * @node: a subtree containing XML Schema informations * - * Parses a XML Schema identity-constraint definition's + * Parses a XML Schema identity-constraint definition's * <selector> and <field> elements. * * Returns the parsed identity-constraint definition. @@ -8320,7 +8320,7 @@ xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, * @schema: the schema being built * @node: a subtree containing XML Schema informations * - * Parses a XML Schema identity-constraint definition. + * Parses a XML Schema identity-constraint definition. * * Returns the parsed identity-constraint definition. */ @@ -9459,7 +9459,7 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, * * Parses a XML schema model group definition. * - * Note that the constraint src-redefine (6.2) can't be applied until + * Note that the constraint src-redefine (6.2) can't be applied until * references have been resolved. So we will do this at the * component fixup level. * @@ -9918,7 +9918,7 @@ xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con) if (con->pending != NULL) xmlSchemaItemListFree(con->pending); if (con->substGroups != NULL) - xmlHashFree(con->substGroups, xmlSchemaSubstGroupFreeEntry); + xmlHashFree(con->substGroups, xmlSchemaSubstGroupFreeEntry); if (con->redefs != NULL) xmlSchemaRedefListFree(con->redefs); if (con->dict != NULL) @@ -10167,7 +10167,7 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt, goto exit; /* * TODO: Not nice, but I'm not 100% sure we will get always an error - * as a result of the above functions; so better rely on pctxt->err + * as a result of the above functions; so better rely on pctxt->err * as well. */ if ((ret == 0) && (oldErrs != pctxt->nberrors)) { @@ -10261,7 +10261,7 @@ xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location, xmlNodePtr ctxtNode) { /* - * Build an absolute location URI. + * Build an absolute location URI. */ if (location != NULL) { if (ctxtNode == NULL) @@ -10343,7 +10343,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, if ((type == XML_SCHEMA_SCHEMA_MAIN) || (! WXS_HAS_BUCKETS(pctxt))) goto doc_load; - /* Note that we expect the location to be an absolute URI. */ + /* Note that we expect the location to be an absolute URI. */ if (schemaLocation != NULL) { bkt = xmlSchemaGetSchemaBucket(pctxt, schemaLocation); if ((bkt != NULL) && @@ -10490,7 +10490,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, /* * Chameleon include/redefine: skip loading only if it was - * already build for the targetNamespace of the including + * already build for the targetNamespace of the including * schema. */ /* @@ -10498,7 +10498,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, * the components into the including schema and modify the * targetNamespace of those components, do nothing otherwise. * NOTE: This is currently worked-around by compiling the - * chameleon for every distinct including targetNamespace; thus + * chameleon for every distinct including targetNamespace; thus * not performant at the moment. * TODO: Check when the namespace in wildcards for chameleons * needs to be converted: before we built wildcard intersections @@ -10689,7 +10689,7 @@ doc_load: exit: /* - * Return the bucket explicitly; this is needed for the + * Return the bucket explicitly; this is needed for the * main schema. */ if (bucket != NULL) @@ -12870,7 +12870,7 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, ret = 1; /* - * If max and min occurrences are default (1) then + * If max and min occurrences are default (1) then * simply iterate over the particles of the <sequence>. */ if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) { @@ -13029,7 +13029,7 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, particle->minOccurs < 1 ? 0 : particle->minOccurs - 1; /* - * use a counter to keep track of the number of transitions + * use a counter to keep track of the number of transitions * which went through the choice. */ counter = @@ -13494,7 +13494,7 @@ xmlSchemaGetBuiltInTypeAncestor(xmlSchemaTypePtr type) * @source: the source wildcard * * Clones the namespace constraints of source - * and assigns them to dest. + * and assigns them to dest. * Returns -1 on internal error, 0 otherwise. */ static int @@ -13717,7 +13717,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPErr(ctxt, completeWild->node, XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, - "The union of the wildcard is not expressible.\n", + "The union of the wildcard is not expressible.\n", NULL, NULL); return(XML_SCHEMAP_UNION_NOT_EXPRESSIBLE); } else if ((!nsFound) && (!absentFound)) { @@ -13954,7 +13954,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt, (curWild->negNsSet->value != NULL)) { xmlSchemaPErr(ctxt, completeWild->node, XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, - "The intersection of the wildcard is not expressible.\n", + "The intersection of the wildcard is not expressible.\n", NULL, NULL); return(XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE); } @@ -14425,7 +14425,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, * Builds the wildcard and the attribute uses on the given complex type. * Returns -1 if an internal error occurs, 0 otherwise. * - * ATTENTION TODO: Experimentally this uses pointer comparisons for + * ATTENTION TODO: Experimentally this uses pointer comparisons for * strings, so recheck this if we start to hardcode some schemata, since * they might not be in the same dict. * NOTE: It is allowed to "extend" the xs:anyType type. @@ -14625,7 +14625,7 @@ exit_failure: * Evaluates if a type definition contains the given "final". * This does take "finalDefault" into account as well. * - * Returns 1 if the type does contain the given "final", + * Returns 1 if the type does contain the given "final", * 0 otherwise. */ static int @@ -14665,7 +14665,7 @@ xmlSchemaGetUnionSimpleTypeMemberTypes(xmlSchemaTypePtr type) * Schema Component Constraint: Effective Total Range * (all and sequence) + (choice) * - * Returns the minimum Effective Total Range. + * Returns the minimum Effective Total Range. */ static int xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle) @@ -14809,12 +14809,12 @@ xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle) * @actxt: a context * @type: the derived simple type definition * @baseType: the base type definition - * @subset: the subset of ('restriction', etc.) + * @subset: the subset of ('restriction', etc.) * * Schema Component Constraint: * Type Derivation OK (Simple) (cos-st-derived-OK) * - * Checks whether @type can be validly + * Checks whether @type can be validly * derived from @baseType. * * Returns 0 on success, an positive error code otherwise. @@ -14827,7 +14827,7 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt, { /* * 1 They are the same type definition. - * TODO: The identity check might have to be more complex than this. + * TODO: The identity check might have to be more complex than this. */ if (type == baseType) return (0); @@ -15037,7 +15037,7 @@ xmlSchemaCheckUnionTypeDefCircular(xmlSchemaParserCtxtPtr pctxt, * @ctxt: the parser context * @name: the name * - * Resolves type definition references + * Resolves type definition references */ static void xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef, @@ -15898,7 +15898,7 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt, * STATUS: (seems) complete * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, @@ -16114,7 +16114,7 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt, * Calls: * Type Derivation OK (Simple) AND Type Derivation OK (Complex) * - * Checks whether @type can be validly derived from @baseType. + * Checks whether @type can be validly derived from @baseType. * * Returns 0 on success, an positive error code otherwise. */ @@ -16145,7 +16145,7 @@ xmlSchemaCheckCOSDerivedOK(xmlSchemaAbstractCtxtPtr actxt, * (1.4.3.2.2.2) "Particle Valid (Extension)" * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, @@ -16247,7 +16247,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * if created the type via a schema construction API. */ if (base->attributeWildcard != NULL) { - if (type->attributeWildcard == NULL) { + if (type->attributeWildcard == NULL) { xmlChar *str = NULL; xmlSchemaCustomErr(ACTXT_CAST pctxt, @@ -16402,7 +16402,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * Validation Rule: Checking complex type subsumption * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, @@ -16476,7 +16476,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, * the {content type} is validly derived given the empty * set as defined in Type Derivation OK (Simple) ($3.14.6)." * - * ATTENTION TODO: This seems not needed if the type implicitly + * ATTENTION TODO: This seems not needed if the type implicitly * derived from the base type. * */ @@ -16592,7 +16592,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, * (3.4.6) Constraints on Complex Type Definition Schema Components * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckCTComponent(xmlSchemaParserCtxtPtr ctxt, @@ -16622,7 +16622,7 @@ xmlSchemaCheckCTComponent(xmlSchemaParserCtxtPtr ctxt, * Complex Type Definition Representation OK (src-ct) * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, @@ -16791,7 +16791,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, * STATUS: complete * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckParticleRangeOK(int rmin, int rmax, @@ -16821,7 +16821,7 @@ xmlSchemaCheckParticleRangeOK(int rmin, int rmax, * CLARIFY: (3.2.2) * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt, @@ -16926,7 +16926,7 @@ xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt, * STATUS: complete * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt, @@ -16970,7 +16970,7 @@ xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt, * STATUS: TODO * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseRecurseAsIfGroup(xmlSchemaParserCtxtPtr ctxt, @@ -16996,7 +16996,7 @@ xmlSchemaCheckRCaseRecurseAsIfGroup(xmlSchemaParserCtxtPtr ctxt, * STATUS: complete * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt, @@ -17046,7 +17046,7 @@ xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt, * STATUS: TODO * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt, @@ -17087,7 +17087,7 @@ xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt, * STATUS: TODO: subst-groups * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt, @@ -17142,7 +17142,7 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt, * TODO: subst-groups * * Returns 0 if the constraints are satisfied, a positive - * error code if not and -1 if an internal error occurred. + * error code if not and -1 if an internal error occurred. */ static int xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt, @@ -17701,7 +17701,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, * * *Patterns*: won't be add here, since they are ORed at * type level and ANDed at ancestor level. This will - * happen during validation by walking the base axis + * happen during validation by walking the base axis * of the type. */ for (cur = base->facetSet; cur != NULL; cur = cur->next) { @@ -17772,7 +17772,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, return (0); internal_error: PERROR_INT("xmlSchemaDeriveAndValidateFacets", - "an error occurred"); + "an error occurred"); return (-1); } @@ -18301,7 +18301,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, WXS_BASIC_CAST type, NULL, "Internal error: xmlSchemaTypeFixup, " "complex type '%s': the <simpleContent><restriction> " - "is missing a <simpleType> child, but was not caught " + "is missing a <simpleType> child, but was not caught " "by xmlSchemaCheckSRCCT()", type->name); goto exit_failure; } @@ -18314,7 +18314,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, if (baseType->contentTypeDef == NULL) { /* * TODO: Check if this ever happens. xmlSchemaCheckSRCCT - * should have caught this already. + * should have caught this already. */ xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_INTERNAL, @@ -18557,7 +18557,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, * NOTE that, although we miss to add an intermediate * <sequence>, this should produce no difference to * neither the regex compilation of the content model, - * nor to the complex type constraints. + * nor to the complex type constraints. */ particle->children->children = (xmlSchemaTreeItemPtr) baseType->subtypes; @@ -18982,7 +18982,7 @@ xmlSchemaCheckGroupDefCircular(xmlSchemaModelGroupDefPtr item, * is defined for model groups but not definitions, but since * there cannot be any circular model groups without a model group * definition (if not using a construction API), we check those - * definitions only. + * definitions only. */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_MG_PROPS_CORRECT_2, @@ -19055,7 +19055,7 @@ xmlSchemaModelGroupToModelGroupDefFixup( * This one is intended to be used by * xmlSchemaCheckAttrGroupCircular only. * - * Returns the circular attribute group reference, otherwise NULL. + * Returns the circular attribute group reference, otherwise NULL. */ static xmlSchemaQNameRefPtr xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr, @@ -19169,7 +19169,7 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, * @list: the attribute uses * * Substitutes contained attribute group references - * for their attribute uses. Wildcards are intersected. + * for their attribute uses. Wildcards are intersected. * Attribute use prohibitions are removed from the list * and returned via the @prohibs list. * Pointlessness of attr. prohibs, if a matching attr. decl @@ -19343,7 +19343,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, * {attribute wildcard} property * * Substitutes contained attribute group references - * for their attribute uses. Wildcards are intersected. + * for their attribute uses. Wildcards are intersected. */ static int xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, @@ -19366,7 +19366,7 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, * @attrGr: the attribute group definition * * Substitutes contained attribute group references - * for their attribute uses. Wildcards are intersected. + * for their attribute uses. Wildcards are intersected. * * Schema Component Constraint: * Attribute Group Definition Properties Correct (ag-props-correct) @@ -19502,8 +19502,8 @@ xmlSchemaResolveAttrGroupReferences(xmlSchemaQNameRefPtr ref, * Attribute Declaration Properties Correct (a-props-correct) * * Validates the value constraints of an attribute declaration/use. - * NOTE that this needs the simple type definitions to be already - * built and checked. + * NOTE that this needs the simple type definitions to be already + * built and checked. */ static int xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt, @@ -20490,7 +20490,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) * it's not clear if the referenced component needs to originate * from the <redefine>d schema _document_ or the schema; the latter * would include all imported and included sub-schemas of the - * <redefine>d schema. Currently the latter approach is used. + * <redefine>d schema. Currently the latter approach is used. * SUPPLEMENT: It seems that the WG moves towards the latter * approach, so we are doing it right. * @@ -20605,8 +20605,8 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) * This is the complicated case: we need * to apply src-redefine (7.2.2) at a later * stage, i.e. when attribute group references - * have been expanded and simple types have - * been fixed. + * have been expanded and simple types have + * been fixed. */ redef->target = prev; } @@ -20981,7 +20981,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * 1. the base axis of type definitions * 2. nested model group definitions * 3. nested attribute group definitions - * TODO: check for circular substitution groups. + * TODO: check for circular substitution groups. */ for (i = 0; i < nbItems; i++) { item = items[i]; @@ -21062,7 +21062,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, goto exit_error; /* * First compute the variety of simple types. This is needed as - * a separate step, since otherwise we won't be able to detect + * a separate step, since otherwise we won't be able to detect * circular union types in all cases. */ for (i = 0; i < nbItems; i++) { @@ -21124,7 +21124,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * At this point we need build and check all simple types. */ /* - * Apply constraints for attribute declarations. + * Apply constraints for attribute declarations. */ for (i = 0; i < nbItems; i++) { item = items[i]; @@ -21189,7 +21189,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, goto exit_error; /* - * Complex types are built and checked. + * Complex types are built and checked. */ for (i = 0; i < nbItems; i++) { item = con->pending->items[i]; @@ -21292,7 +21292,7 @@ exit: con->bucket = oldbucket; con->pending->nbItems = 0; if (con->substGroups != NULL) { - xmlHashFree(con->substGroups, xmlSchemaSubstGroupFreeEntry); + xmlHashFree(con->substGroups, xmlSchemaSubstGroupFreeEntry); con->substGroups = NULL; } if (con->redefs != NULL) { @@ -21306,7 +21306,7 @@ exit: * @ctxt: a schema validation context * * parse a schema definition resource and build an internal - * XML Schema structure which can be used to validate instances. + * XML Schema structure which can be used to validate instances. * * Returns the internal XML Schema structure built from the resource or * NULL in case of error @@ -21408,7 +21408,7 @@ exit: exit_failure: /* * Quite verbose, but should catch internal errors, which were - * not communicated. + * not communicated. */ if (mainSchema) { xmlSchemaFree(mainSchema); @@ -21420,7 +21420,7 @@ exit_failure: ctxt->ownsConstructor = 0; } PERROR_INT2("xmlSchemaParse", - "An internal error occurred"); + "An internal error occurred"); ctxt->schema = NULL; return(NULL); } @@ -21875,7 +21875,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, if ((vctxt->inode->node == NULL) || (vctxt->inode->node->doc == NULL)) { VERROR_INT("xmlSchemaLookupNamespace", - "no node or node's doc available"); + "no node or node's doc available"); return (NULL); } ns = xmlSearchNs(vctxt->inode->node->doc, @@ -22000,11 +22000,11 @@ xmlSchemaVAddNodeQName(xmlSchemaValidCtxtPtr vctxt, * Returns the item, or NULL on internal errors. */ static void -xmlSchemaAugmentIDC(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) +xmlSchemaAugmentIDC(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { - xmlSchemaIDCPtr idcDef = (xmlSchemaIDCPtr) payload; - xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) data; + xmlSchemaIDCPtr idcDef = (xmlSchemaIDCPtr) payload; + xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) data; xmlSchemaIDCAugPtr aidc; aidc = (xmlSchemaIDCAugPtr) xmlMalloc(sizeof(xmlSchemaIDCAug)); @@ -22038,12 +22038,12 @@ xmlSchemaAugmentIDC(void *payload, void *data, * Creates an augmented IDC definition for the imported schema. */ static void -xmlSchemaAugmentImportedIDC(void *payload, void *data, - const xmlChar *name ATTRIBUTE_UNUSED) { - xmlSchemaImportPtr imported = (xmlSchemaImportPtr) payload; - xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) data; +xmlSchemaAugmentImportedIDC(void *payload, void *data, + const xmlChar *name ATTRIBUTE_UNUSED) { + xmlSchemaImportPtr imported = (xmlSchemaImportPtr) payload; + xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) data; if (imported->schema->idcDef != NULL) { - xmlHashScan(imported->schema->idcDef, xmlSchemaAugmentIDC, vctxt); + xmlHashScan(imported->schema->idcDef, xmlSchemaAugmentIDC, vctxt); } } @@ -22088,7 +22088,7 @@ xmlSchemaIDCStoreNodeTableItem(xmlSchemaValidCtxtPtr vctxt, xmlSchemaPSVIIDCNodePtr item) { /* - * Add to global list. + * Add to global list. */ if (vctxt->idcNodes == NULL) { vctxt->idcNodes = (xmlSchemaPSVIIDCNodePtr *) @@ -22129,7 +22129,7 @@ xmlSchemaIDCStoreKey(xmlSchemaValidCtxtPtr vctxt, xmlSchemaPSVIIDCKeyPtr key) { /* - * Add to global list. + * Add to global list. */ if (vctxt->idcKeys == NULL) { vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *) @@ -22786,7 +22786,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, VERROR(XML_SCHEMAV_CVC_IDC, WXS_BASIC_CAST sto->matcher->aidc->def, "Warning: No precomputed value available, the value " - "was either invalid or something strange happened"); + "was either invalid or something strange happened"); sto->nbHistory--; goto deregister_check; } else { @@ -22807,7 +22807,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * <bar> * </scope> * - * The size of the list is only dependent on the depth of + * The size of the list is only dependent on the depth of * the tree. * An entry will be NULLed in selector_leave, i.e. when * we hit the target's @@ -23298,7 +23298,7 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, matcher->aidc = aidc; matcher->idcType = aidc->def->type; #ifdef DEBUG_IDC - xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n"); + xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n"); #endif /* * Init the automaton state object. @@ -23348,8 +23348,8 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, * Get/create the IDC binding on this element for the IDC definition. */ bind = xmlSchemaIDCAcquireBinding(vctxt, matcher); - if (bind == NULL) - goto internal_error; + if (bind == NULL) + goto internal_error; if (! WXS_ILIST_IS_EMPTY(bind->dupls)) { dupls = (xmlSchemaPSVIIDCNodePtr *) bind->dupls->items; @@ -24102,7 +24102,7 @@ xmlSchemaClearElemInfo(xmlSchemaValidCtxtPtr vctxt, * @vctxt: the schema validation context * * Creates/reuses and initializes the element info item for - * the current tree depth. + * the current tree depth. * * Returns the element info item or NULL on API or internal errors. */ @@ -24212,7 +24212,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, else goto pattern_and_enum; } - + /* * Whitespace handling is only of importance for string-based * types. @@ -24223,13 +24223,13 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, ws = xmlSchemaGetWhiteSpaceFacetValue(type); } else ws = XML_SCHEMA_WHITESPACE_COLLAPSE; - + /* * If the value was not computed (for string or * anySimpleType based types), then use the provided * type. */ - if (val != NULL) + if (val != NULL) valType = xmlSchemaGetValType(val); ret = 0; @@ -24375,7 +24375,7 @@ pattern_and_enum: found = 1; /* * NOTE that for patterns, @value needs to be the - * normalized value. + * normalized value. */ ret = xmlRegexpExec(facetLink->facet->regexp, value); if (ret == 1) @@ -24649,7 +24649,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; } } - else if (fireErrors && (ret > 0)) + else if (fireErrors && (ret > 0)) xmlSchemaSimpleTypeErr(actxt, ret, node, value, type, 1); } else if (WXS_IS_LIST(type)) { @@ -24912,7 +24912,7 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt, else { const xmlChar *nsName = NULL, *local = NULL; /* - * TODO: We should report a *warning* that the type was overridden + * TODO: We should report a *warning* that the type was overridden * by the instance. */ ACTIVATE_ATTRIBUTE(iattr); @@ -25572,7 +25572,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) if (xmlNewProp(defAttrOwnerElem, iattr->localName, value) == NULL) { VERROR_INT("xmlSchemaVAttributesComplex", - "calling xmlNewProp()"); + "calling xmlNewProp()"); if (normValue != NULL) xmlFree(normValue); goto internal_error; @@ -25970,12 +25970,12 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, } static void -xmlSchemaVContentModelCallback(xmlRegExecCtxtPtr exec ATTRIBUTE_UNUSED, +xmlSchemaVContentModelCallback(xmlRegExecCtxtPtr exec ATTRIBUTE_UNUSED, const xmlChar * name ATTRIBUTE_UNUSED, - void *transdata, void *inputdata) + void *transdata, void *inputdata) { - xmlSchemaElementPtr item = (xmlSchemaElementPtr) transdata; - xmlSchemaNodeInfoPtr inode = (xmlSchemaNodeInfoPtr) inputdata; + xmlSchemaElementPtr item = (xmlSchemaElementPtr) transdata; + xmlSchemaNodeInfoPtr inode = (xmlSchemaNodeInfoPtr) inputdata; inode->decl = item; #ifdef DEBUG_CONTENT { @@ -26080,7 +26080,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) */ inode->regexCtxt = xmlRegNewExecCtxt(inode->typeDef->contModel, - xmlSchemaVContentModelCallback, vctxt); + xmlSchemaVContentModelCallback, vctxt); if (inode->regexCtxt == NULL) { VERROR_INT("xmlSchemaValidatorPopElem", "failed to create a regex context"); @@ -26107,7 +26107,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) /* * Get hold of the still expected content, since a further - * call to xmlRegExecPushString() will lose this information. + * call to xmlRegExecPushString() will lose this information. */ xmlRegExecNextValues(inode->regexCtxt, &nbval, &nbneg, &values[0], &terminal); @@ -26331,7 +26331,7 @@ default_psvi: XML_SCHEMA_ELEM_INFO_HAS_ELEM_CONTENT) { ret = XML_SCHEMAV_CVC_ELT_5_2_2_1; VERROR(ret, NULL, - "The content must not contain element nodes since " + "The content must not contain element nodes since " "there is a fixed value constraint"); goto end_elem; } else { @@ -26538,7 +26538,7 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt) if (ptype->builtInType == XML_SCHEMAS_ANYTYPE) { /* * Workaround for "anyType": we have currently no content model - * assigned for "anyType", so handle it explicitly. + * assigned for "anyType", so handle it explicitly. * "anyType" has an unbounded, lax "any" wildcard. */ vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema, @@ -26613,7 +26613,7 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt) return (-1); } /* - * Safety belt for evaluation if the cont. model was already + * Safety belt for evaluation if the cont. model was already * examined to be invalid. */ if (pielem->flags & XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT) { @@ -26628,7 +26628,7 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt) * Create the regex context. */ regexCtxt = xmlRegNewExecCtxt(ptype->contModel, - xmlSchemaVContentModelCallback, vctxt); + xmlSchemaVContentModelCallback, vctxt); if (regexCtxt == NULL) { VERROR_INT("xmlSchemaValidateChildElem", "failed to create a regex context"); @@ -26888,8 +26888,8 @@ xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt) * Augment the IDC definitions for the main schema and all imported ones * NOTE: main schema is the first in the imported list */ - xmlHashScan(vctxt->schema->schemasImports, xmlSchemaAugmentImportedIDC, - vctxt); + xmlHashScan(vctxt->schema->schemasImports, xmlSchemaAugmentImportedIDC, + vctxt); } if (vctxt->depth > 0) { /* @@ -27163,7 +27163,7 @@ root_found: } if (ret < 0) { /* - * VAL TODO: A reader error occurred; what to do here? + * VAL TODO: A reader error occurred; what to do here? */ ret = 1; goto exit; @@ -27404,41 +27404,41 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, * attributes yet. */ if (nb_attributes != 0) { - int valueLen, k, l; + int valueLen, k, l; xmlChar *value; for (j = 0, i = 0; i < nb_attributes; i++, j += 5) { /* - * Duplicate the value, changing any & to a literal ampersand. - * - * libxml2 differs from normal SAX here in that it escapes all ampersands - * as & instead of delivering the raw converted string. Changing the - * behavior at this point would break applications that use this API, so - * we are forced to work around it. + * Duplicate the value, changing any & to a literal ampersand. + * + * libxml2 differs from normal SAX here in that it escapes all ampersands + * as & instead of delivering the raw converted string. Changing the + * behavior at this point would break applications that use this API, so + * we are forced to work around it. */ - valueLen = attributes[j+4] - attributes[j+3]; - value = xmlMallocAtomic(valueLen + 1); - if (value == NULL) { - xmlSchemaVErrMemory(vctxt, - "allocating string for decoded attribute", - NULL); - goto internal_error; - } - for (k = 0, l = 0; k < valueLen; l++) { - if (k < valueLen - 4 && - attributes[j+3][k+0] == '&' && - attributes[j+3][k+1] == '#' && - attributes[j+3][k+2] == '3' && - attributes[j+3][k+3] == '8' && - attributes[j+3][k+4] == ';') { - value[l] = '&'; - k += 5; - } else { - value[l] = attributes[j+3][k]; - k++; - } - } - value[l] = '\0'; + valueLen = attributes[j+4] - attributes[j+3]; + value = xmlMallocAtomic(valueLen + 1); + if (value == NULL) { + xmlSchemaVErrMemory(vctxt, + "allocating string for decoded attribute", + NULL); + goto internal_error; + } + for (k = 0, l = 0; k < valueLen; l++) { + if (k < valueLen - 4 && + attributes[j+3][k+0] == '&' && + attributes[j+3][k+1] == '#' && + attributes[j+3][k+2] == '3' && + attributes[j+3][k+3] == '8' && + attributes[j+3][k+4] == ';') { + value[l] = '&'; + k += 5; + } else { + value[l] = attributes[j+3][k]; + k++; + } + } + value[l] = '\0'; /* * TODO: Set the node line. */ @@ -27637,17 +27637,17 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) vctxt->nbIdcNodes = 0; vctxt->sizeIdcNodes = 0; } - - if (vctxt->idcKeys != NULL) { - int i; - for (i = 0; i < vctxt->nbIdcKeys; i++) - xmlSchemaIDCFreeKey(vctxt->idcKeys[i]); - xmlFree(vctxt->idcKeys); - vctxt->idcKeys = NULL; - vctxt->nbIdcKeys = 0; - vctxt->sizeIdcKeys = 0; - } - + + if (vctxt->idcKeys != NULL) { + int i; + for (i = 0; i < vctxt->nbIdcKeys; i++) + xmlSchemaIDCFreeKey(vctxt->idcKeys[i]); + xmlFree(vctxt->idcKeys); + vctxt->idcKeys = NULL; + vctxt->nbIdcKeys = 0; + vctxt->sizeIdcKeys = 0; + } + /* * Note that we won't delete the XPath state pool here. */ @@ -27832,7 +27832,7 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, { if (ctxt == NULL) return; - ctxt->serror = serror; + ctxt->serror = serror; ctxt->error = NULL; ctxt->warning = NULL; ctxt->errCtxt = ctx; @@ -28141,8 +28141,8 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { * Augment the IDC definitions for the main schema and all imported ones * NOTE: main schema if the first in the imported list */ - xmlHashScan(vctxt->schema->schemasImports, xmlSchemaAugmentImportedIDC, - vctxt); + xmlHashScan(vctxt->schema->schemasImports, xmlSchemaAugmentImportedIDC, + vctxt); return(0); } @@ -28801,7 +28801,7 @@ xmlSchemaValidateSetLocator(xmlSchemaValidCtxtPtr vctxt, * * Internal locator function for the readers * - * Returns 0 in case the Schema validation could be (de)activated and + * Returns 0 in case the Schema validation could be (de)activated and * -1 in case of error. */ static int diff --git a/contrib/libs/libxml/xmlschemastypes.c b/contrib/libs/libxml/xmlschemastypes.c index 2a13a5defa..e7764d9058 100644 --- a/contrib/libs/libxml/xmlschemastypes.c +++ b/contrib/libs/libxml/xmlschemastypes.c @@ -7,11 +7,11 @@ * Daniel Veillard <veillard@redhat.com> */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" @@ -67,10 +67,10 @@ struct _xmlSchemaValDate { long year; unsigned int mon :4; /* 1 <= mon <= 12 */ unsigned int day :5; /* 1 <= day <= 31 */ - unsigned int hour :5; /* 0 <= hour <= 24 */ + unsigned int hour :5; /* 0 <= hour <= 24 */ unsigned int min :6; /* 0 <= min <= 59 */ double sec; - unsigned int tz_flag :1; /* is tzo explicitly set? */ + unsigned int tz_flag :1; /* is tzo explicitly set? */ signed int tzo :12; /* -1440 <= tzo <= 1440; currently only -840 to +840 are needed */ }; @@ -619,11 +619,11 @@ xmlSchemaInitTypes(void) xmlSchemaTypesInitialized = 1; } -static void -xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlSchemaFreeType((xmlSchemaTypePtr) type); -} - +static void +xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlSchemaFreeType((xmlSchemaTypePtr) type); +} + /** * xmlSchemaCleanupTypes: * @@ -651,7 +651,7 @@ xmlSchemaCleanupTypes(void) { xmlFree((xmlSchemaParticlePtr) particle); xmlSchemaTypeAnyTypeDef->subtypes = NULL; } - xmlHashFree(xmlSchemaTypesBank, xmlSchemaFreeTypeEntry); + xmlHashFree(xmlSchemaTypesBank, xmlSchemaFreeTypeEntry); xmlSchemaTypesInitialized = 0; } @@ -1129,7 +1129,7 @@ xmlSchemaGetBuiltInListSimpleTypeItemType(xmlSchemaTypePtr type) #define VALID_HOUR(hr) ((hr >= 0) && (hr <= 23)) #define VALID_MIN(min) ((min >= 0) && (min <= 59)) #define VALID_SEC(sec) ((sec >= 0) && (sec < 60)) -#define VALID_TZO(tzo) ((tzo >= -840) && (tzo <= 840)) +#define VALID_TZO(tzo) ((tzo >= -840) && (tzo <= 840)) #define IS_LEAP(y) \ (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) @@ -1149,13 +1149,13 @@ static const unsigned int daysInMonthLeap[12] = #define VALID_DATE(dt) \ (VALID_YEAR(dt->year) && VALID_MONTH(dt->mon) && VALID_MDAY(dt)) -#define VALID_END_OF_DAY(dt) \ - ((dt)->hour == 24 && (dt)->min == 0 && (dt)->sec == 0) - +#define VALID_END_OF_DAY(dt) \ + ((dt)->hour == 24 && (dt)->min == 0 && (dt)->sec == 0) + #define VALID_TIME(dt) \ - (((VALID_HOUR(dt->hour) && VALID_MIN(dt->min) && \ - VALID_SEC(dt->sec)) || VALID_END_OF_DAY(dt)) && \ - VALID_TZO(dt->tzo)) + (((VALID_HOUR(dt->hour) && VALID_MIN(dt->min) && \ + VALID_SEC(dt->sec)) || VALID_END_OF_DAY(dt)) && \ + VALID_TZO(dt->tzo)) #define VALID_DATETIME(dt) \ (VALID_DATE(dt) && VALID_TIME(dt)) @@ -1369,7 +1369,7 @@ _xmlSchemaParseTime (xmlSchemaValDatePtr dt, const xmlChar **str) { return ret; if (*cur != ':') return 1; - if (!VALID_HOUR(value) && value != 24 /* Allow end-of-day hour */) + if (!VALID_HOUR(value) && value != 24 /* Allow end-of-day hour */) return 2; cur++; @@ -1391,7 +1391,7 @@ _xmlSchemaParseTime (xmlSchemaValDatePtr dt, const xmlChar **str) { if (ret != 0) return ret; - if (!VALID_TIME(dt)) + if (!VALID_TIME(dt)) return 2; *str = cur; @@ -2130,7 +2130,7 @@ xmlSchemaParseUInt(const xmlChar **str, unsigned long *llo, * @value: the value to check * @val: the return computed value * @node: the node containing the value - * flags: flags to control the validation + * flags: flags to control the validation * * Check that a value conforms to the lexical space of the atomic type. * if true a value is computed and returned in @val. @@ -2155,7 +2155,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, return (-1); /* - * validating a non existent text node is similar to validating + * validating a non existent text node is similar to validating * an empty one. */ if (value == NULL) @@ -2925,7 +2925,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, if (*value != 0) { xmlURIPtr uri; xmlChar *tmpval, *cur; - if ((norm == NULL) && (normOnTheFly)) { + if ((norm == NULL) && (normOnTheFly)) { norm = xmlSchemaCollapseString(value); if (norm != NULL) value = norm; @@ -3067,7 +3067,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, * following cases can arise: (1) the final quantum of * encoding input is an integral multiple of 24 bits; here, * the final unit of encoded output will be an integral - * multiple of indent: Standard input:701: Warning:old style + * multiple of indent: Standard input:701: Warning:old style * assignment ambiguity in "=*". Assuming "= *" 4 characters * with no "=" padding, (2) the final * quantum of encoding input is exactly 8 bits; here, the @@ -3628,10 +3628,10 @@ xmlSchemaCompareDurations(xmlSchemaValPtr x, xmlSchemaValPtr y) minday = 0; maxday = 0; } else { - /* FIXME: This doesn't take leap year exceptions every 100/400 years - into account. */ - maxday = 365 * myear + (myear + 3) / 4; - /* FIXME: Needs to be calculated separately */ + /* FIXME: This doesn't take leap year exceptions every 100/400 years + into account. */ + maxday = 365 * myear + (myear + 3) / 4; + /* FIXME: Needs to be calculated separately */ minday = maxday - 1; } @@ -3879,7 +3879,7 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) temp = r->mon + carry; r->mon = (unsigned int) MODULO_RANGE(temp, 1, 13); - r->year = r->year + (long) FQUOTIENT_RANGE(temp, 1, 13); + r->year = r->year + (long) FQUOTIENT_RANGE(temp, 1, 13); if (r->year == 0) { if (temp < 1) r->year--; @@ -5319,7 +5319,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType ws) { int ret; - int stringType; + int stringType; if (facet == NULL) return(-1); @@ -5332,15 +5332,15 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, */ if (value == NULL) return(-1); - /* - * If string-derived type, regexp must be tested on the value space of - * the datatype. - * See https://www.w3.org/TR/xmlschema-2/#rf-pattern - */ - stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <= XML_SCHEMAS_NORMSTRING) - || (val->type >= XML_SCHEMAS_TOKEN && val->type <= XML_SCHEMAS_NCNAME)); - ret = xmlRegexpExec(facet->regexp, - (stringType && val->value.str) ? val->value.str : value); + /* + * If string-derived type, regexp must be tested on the value space of + * the datatype. + * See https://www.w3.org/TR/xmlschema-2/#rf-pattern + */ + stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <= XML_SCHEMAS_NORMSTRING) + || (val->type >= XML_SCHEMAS_TOKEN && val->type <= XML_SCHEMAS_NCNAME)); + ret = xmlRegexpExec(facet->regexp, + (stringType && val->value.str) ? val->value.str : value); if (ret == 1) return(0); if (ret == 0) @@ -5410,7 +5410,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, if ((valType == XML_SCHEMAS_QNAME) || (valType == XML_SCHEMAS_NOTATION)) return (0); - /* Falls through. */ + /* Falls through. */ case XML_SCHEMA_FACET_MAXLENGTH: case XML_SCHEMA_FACET_MINLENGTH: { unsigned int len = 0; diff --git a/contrib/libs/libxml/xmlstring.c b/contrib/libs/libxml/xmlstring.c index 45ff75a0b0..8d2e06f66c 100644 --- a/contrib/libs/libxml/xmlstring.c +++ b/contrib/libs/libxml/xmlstring.c @@ -130,7 +130,7 @@ xmlCharStrdup(const char *cur) { int xmlStrcmp(const xmlChar *str1, const xmlChar *str2) { - register int tmp; + register int tmp; if (str1 == str2) return(0); if (str1 == NULL) return(-1); @@ -204,7 +204,7 @@ xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) { int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) { - register int tmp; + register int tmp; if (len <= 0) return(0); if (str1 == str2) return(0); @@ -269,7 +269,7 @@ static const xmlChar casemap[256] = { int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) { - register int tmp; + register int tmp; if (str1 == str2) return(0); if (str1 == NULL) return(-1); @@ -294,7 +294,7 @@ xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) { int xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) { - register int tmp; + register int tmp; if (len <= 0) return(0); if (str1 == str2) return(0); @@ -440,8 +440,8 @@ xmlStrlen(const xmlChar *str) { * first bytes of @add. Note that if @len < 0 then this is an API error * and NULL will be returned. * - * Returns a new xmlChar *, the original @cur is reallocated and should - * not be freed. + * Returns a new xmlChar *, the original @cur is reallocated and should + * not be freed. */ xmlChar * @@ -457,8 +457,8 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) { return(xmlStrndup(add, len)); size = xmlStrlen(cur); - if (size < 0) - return(NULL); + if (size < 0) + return(NULL); ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar)); if (ret == NULL) { xmlErrMemory(NULL, NULL); @@ -486,19 +486,19 @@ xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) { int size; xmlChar *ret; - if (len < 0) { + if (len < 0) { len = xmlStrlen(str2); - if (len < 0) - return(NULL); - } + if (len < 0) + return(NULL); + } if ((str2 == NULL) || (len == 0)) return(xmlStrdup(str1)); if (str1 == NULL) return(xmlStrndup(str2, len)); size = xmlStrlen(str1); - if (size < 0) - return(NULL); + if (size < 0) + return(NULL); ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar)); if (ret == NULL) { xmlErrMemory(NULL, NULL); @@ -519,8 +519,8 @@ xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) { * encoded in UTF-8 or an encoding with 8bit based chars, we assume * a termination mark of '0'. * - * Returns a new xmlChar * containing the concatenated string. The original - * @cur is reallocated and should not be freed. + * Returns a new xmlChar * containing the concatenated string. The original + * @cur is reallocated and should not be freed. */ xmlChar * xmlStrcat(xmlChar *cur, const xmlChar *add) { @@ -546,7 +546,7 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) { * Returns the number of characters written to @buf or -1 if an error occurs. */ int XMLCDECL -xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) { +xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) { va_list args; int ret; @@ -574,7 +574,7 @@ xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) { * Returns the number of characters written to @buf or -1 if an error occurs. */ int -xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) { +xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) { int ret; if((buf == NULL) || (msg == NULL)) { @@ -823,7 +823,7 @@ xmlCheckUTF8(const unsigned char *utf) * @len: the number of characters in the array * * storage size of an UTF8 string - * the behaviour is not guaranteed if the input string is not UTF-8 + * the behaviour is not guaranteed if the input string is not UTF-8 * * Returns the storage size of * the first 'len' characters of ARRAY @@ -845,7 +845,7 @@ xmlUTF8Strsize(const xmlChar *utf, int len) { break; if ( (ch = *ptr++) & 0x80) while ((ch<<=1) & 0x80 ) { - if (*ptr == 0) break; + if (*ptr == 0) break; ptr++; } } @@ -988,60 +988,60 @@ xmlUTF8Strsub(const xmlChar *utf, int start, int len) { return(xmlUTF8Strndup(utf, len)); } -/** - * xmlEscapeFormatString: - * @msg: a pointer to the string in which to escape '%' characters. - * Must be a heap-allocated buffer created by libxml2 that may be - * returned, or that may be freed and replaced. - * - * Replaces the string pointed to by 'msg' with an escaped string. - * Returns the same string with all '%' characters escaped. - */ -xmlChar * -xmlEscapeFormatString(xmlChar **msg) -{ - xmlChar *msgPtr = NULL; - xmlChar *result = NULL; - xmlChar *resultPtr = NULL; - size_t count = 0; - size_t msgLen = 0; - size_t resultLen = 0; - - if (!msg || !*msg) - return(NULL); - - for (msgPtr = *msg; *msgPtr != '\0'; ++msgPtr) { - ++msgLen; - if (*msgPtr == '%') - ++count; - } - - if (count == 0) - return(*msg); - - resultLen = msgLen + count + 1; - result = (xmlChar *) xmlMallocAtomic(resultLen * sizeof(xmlChar)); - if (result == NULL) { - /* Clear *msg to prevent format string vulnerabilities in - out-of-memory situations. */ - xmlFree(*msg); - *msg = NULL; - xmlErrMemory(NULL, NULL); - return(NULL); - } - - for (msgPtr = *msg, resultPtr = result; *msgPtr != '\0'; ++msgPtr, ++resultPtr) { - *resultPtr = *msgPtr; - if (*msgPtr == '%') - *(++resultPtr) = '%'; - } - result[resultLen - 1] = '\0'; - - xmlFree(*msg); - *msg = result; - - return *msg; -} - +/** + * xmlEscapeFormatString: + * @msg: a pointer to the string in which to escape '%' characters. + * Must be a heap-allocated buffer created by libxml2 that may be + * returned, or that may be freed and replaced. + * + * Replaces the string pointed to by 'msg' with an escaped string. + * Returns the same string with all '%' characters escaped. + */ +xmlChar * +xmlEscapeFormatString(xmlChar **msg) +{ + xmlChar *msgPtr = NULL; + xmlChar *result = NULL; + xmlChar *resultPtr = NULL; + size_t count = 0; + size_t msgLen = 0; + size_t resultLen = 0; + + if (!msg || !*msg) + return(NULL); + + for (msgPtr = *msg; *msgPtr != '\0'; ++msgPtr) { + ++msgLen; + if (*msgPtr == '%') + ++count; + } + + if (count == 0) + return(*msg); + + resultLen = msgLen + count + 1; + result = (xmlChar *) xmlMallocAtomic(resultLen * sizeof(xmlChar)); + if (result == NULL) { + /* Clear *msg to prevent format string vulnerabilities in + out-of-memory situations. */ + xmlFree(*msg); + *msg = NULL; + xmlErrMemory(NULL, NULL); + return(NULL); + } + + for (msgPtr = *msg, resultPtr = result; *msgPtr != '\0'; ++msgPtr, ++resultPtr) { + *resultPtr = *msgPtr; + if (*msgPtr == '%') + *(++resultPtr) = '%'; + } + result[resultLen - 1] = '\0'; + + xmlFree(*msg); + *msg = result; + + return *msg; +} + #define bottom_xmlstring #include "elfgcchack.h" diff --git a/contrib/libs/libxml/xmlunicode.c b/contrib/libs/libxml/xmlunicode.c index 6e5d00e2a6..6d0a96a0e2 100644 --- a/contrib/libs/libxml/xmlunicode.c +++ b/contrib/libs/libxml/xmlunicode.c @@ -29,14 +29,14 @@ typedef struct { } xmlUnicodeRange; typedef struct { - const xmlUnicodeRange *table; + const xmlUnicodeRange *table; int numentries; } xmlUnicodeNameTable; static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname); -static const xmlUnicodeRange xmlUnicodeBlocks[] = { +static const xmlUnicodeRange xmlUnicodeBlocks[] = { {"AegeanNumbers", xmlUCSIsAegeanNumbers}, {"AlphabeticPresentationForms", xmlUCSIsAlphabeticPresentationForms}, {"Arabic", xmlUCSIsArabic}, @@ -945,7 +945,7 @@ static xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36}; static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname) { int low, high, mid, cmp; - const xmlUnicodeRange *sptr; + const xmlUnicodeRange *sptr; if ((tptr == NULL) || (tname == NULL)) return(NULL); diff --git a/contrib/libs/libxml/xmlwriter.c b/contrib/libs/libxml/xmlwriter.c index 6a8e8622b5..cb4ad69d37 100644 --- a/contrib/libs/libxml/xmlwriter.c +++ b/contrib/libs/libxml/xmlwriter.c @@ -104,10 +104,10 @@ static void xmlFreeTextWriterNsStackEntry(xmlLinkPtr lk); static int xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1); static int xmlTextWriterWriteDocCallback(void *context, - const char *str, int len); + const char *str, int len); static int xmlTextWriterCloseDocCallback(void *context); -static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr) LIBXML_ATTR_FORMAT(1,0); +static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr) LIBXML_ATTR_FORMAT(1,0); static int xmlOutputBufferWriteBase64(xmlOutputBufferPtr out, int len, const unsigned char *data); static void xmlTextWriterStartDocumentCallback(void *ctx); @@ -147,7 +147,7 @@ xmlWriterErrMsg(xmlTextWriterPtr ctxt, xmlParserErrors error, * * Handle a writer error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlWriterErrMsgInt(xmlTextWriterPtr ctxt, xmlParserErrors error, const char *msg, int val) { @@ -184,7 +184,7 @@ xmlNewTextWriter(xmlOutputBufferPtr out) } memset(ret, 0, (size_t) sizeof(xmlTextWriter)); - ret->nodes = xmlListCreate(xmlFreeTextWriterStackEntry, + ret->nodes = xmlListCreate(xmlFreeTextWriterStackEntry, xmlCmpTextWriterStackEntry); if (ret->nodes == NULL) { xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY, @@ -193,7 +193,7 @@ xmlNewTextWriter(xmlOutputBufferPtr out) return NULL; } - ret->nsstack = xmlListCreate(xmlFreeTextWriterNsStackEntry, + ret->nsstack = xmlListCreate(xmlFreeTextWriterNsStackEntry, xmlCmpTextWriterNsStackEntry); if (ret->nsstack == NULL) { xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY, @@ -319,7 +319,7 @@ xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, return NULL; } - out = xmlOutputBufferCreateIO(xmlTextWriterWriteDocCallback, + out = xmlOutputBufferCreateIO(xmlTextWriterWriteDocCallback, xmlTextWriterCloseDocCallback, (void *) ctxt, NULL); if (out == NULL) { @@ -535,8 +535,8 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version, if (encoding != NULL) { encoder = xmlFindCharEncodingHandler(encoding); if (encoder == NULL) { - xmlWriterErrMsg(writer, XML_ERR_UNSUPPORTED_ENCODING, - "xmlTextWriterStartDocument : unsupported encoding\n"); + xmlWriterErrMsg(writer, XML_ERR_UNSUPPORTED_ENCODING, + "xmlTextWriterStartDocument : unsupported encoding\n"); return -1; } } @@ -795,7 +795,7 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer) * xmlTextWriterEndComment: * @writer: the xmlTextWriterPtr * - * End the current xml comment. + * End the current xml comment. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */ @@ -3742,7 +3742,7 @@ xmlTextWriterEndDTDEntity(xmlTextWriterPtr writer) if (count < 0) return -1; sum += count; - /* Falls through. */ + /* Falls through. */ case XML_TEXTWRITER_DTD_ENTY: case XML_TEXTWRITER_DTD_PENT: count = xmlOutputBufferWriteString(writer->out, ">"); @@ -4410,12 +4410,12 @@ xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1) * Returns -1, 0, 1 */ static int -xmlTextWriterWriteDocCallback(void *context, const char *str, int len) +xmlTextWriterWriteDocCallback(void *context, const char *str, int len) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) context; int rc; - if ((rc = xmlParseChunk(ctxt, str, len, 0)) != 0) { + if ((rc = xmlParseChunk(ctxt, str, len, 0)) != 0) { xmlWriterErrMsgInt(NULL, XML_ERR_INTERNAL_ERROR, "xmlTextWriterWriteDocCallback : XML error %d !\n", rc); @@ -4441,7 +4441,7 @@ xmlTextWriterCloseDocCallback(void *context) if ((rc = xmlParseChunk(ctxt, NULL, 0, 1)) != 0) { xmlWriterErrMsgInt(NULL, XML_ERR_INTERNAL_ERROR, - "xmlTextWriterCloseDocCallback : XML error %d !\n", + "xmlTextWriterCloseDocCallback : XML error %d !\n", rc); return -1; } diff --git a/contrib/libs/libxml/xpath.c b/contrib/libs/libxml/xpath.c index bf797b9c2a..e1f2bd5522 100644 --- a/contrib/libs/libxml/xpath.c +++ b/contrib/libs/libxml/xpath.c @@ -2,7 +2,7 @@ * xpath.c: XML Path Language implementation * XPath is a language for addressing parts of an XML document, * designed to be used by both XSLT and XPointer - * + * * Reference: W3C Recommendation 16 November 1999 * http://www.w3.org/TR/1999/REC-xpath-19991116 * Public reference: @@ -14,17 +14,17 @@ * */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" -#include <limits.h> +#include <limits.h> #include <string.h> -#include <stddef.h> +#include <stddef.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -160,7 +160,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { int misc = 0, precedence1 = 0, precedence2 = 0; xmlNodePtr miscNode1 = NULL, miscNode2 = NULL; xmlNodePtr cur, root; - ptrdiff_t l1, l2; + ptrdiff_t l1, l2; if ((node1 == NULL) || (node2 == NULL)) return(-2); @@ -174,12 +174,12 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { switch (node1->type) { case XML_ELEMENT_NODE: if (node2->type == XML_ELEMENT_NODE) { - if ((0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + if ((0 > (ptrdiff_t) node1->content) && + (0 > (ptrdiff_t) node2->content) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -((ptrdiff_t) node1->content); + l2 = -((ptrdiff_t) node2->content); if (l1 < l2) return(1); if (l1 > l2) @@ -224,7 +224,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { node1 = node1->parent; } if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) || - (0 <= (ptrdiff_t) node1->content)) { + (0 <= (ptrdiff_t) node1->content)) { /* * Fallback for whatever case. */ @@ -274,7 +274,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { node2 = node2->parent; } if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) || - (0 <= (ptrdiff_t) node2->content)) + (0 <= (ptrdiff_t) node2->content)) { node2 = miscNode2; precedence2 = 0; @@ -343,16 +343,16 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { } /* - * Speedup using document order if available. + * Speedup using document order if available. */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > (ptrdiff_t) node1->content) && + (0 > (ptrdiff_t) node2->content) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -((ptrdiff_t) node1->content); + l2 = -((ptrdiff_t) node2->content); if (l1 < l2) return(1); if (l1 > l2) @@ -368,14 +368,14 @@ turtle_comparison: /* * compute depth to root */ - for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) { - if (cur->parent == node1) + for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) { + if (cur->parent == node1) return(1); depth2++; } root = cur; - for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) { - if (cur->parent == node2) + for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) { + if (cur->parent == node2) return(-1); depth1++; } @@ -411,16 +411,16 @@ turtle_comparison: if (node1 == node2->next) return(-1); /* - * Speedup using document order if available. + * Speedup using document order if available. */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > (ptrdiff_t) node1->content) && + (0 > (ptrdiff_t) node2->content) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -((ptrdiff_t) node1->content); + l2 = -((ptrdiff_t) node2->content); if (l1 < l2) return(1); if (l1 > l2) @@ -435,7 +435,7 @@ turtle_comparison: #endif /* XP_OPTIMIZED_NON_ELEM_COMPARISON */ /* - * Wrapper for the Timsort algorithm from timsort.h + * Wrapper for the Timsort algorithm from timsort.h */ #ifdef WITH_TIM_SORT #define SORT_NAME libxml_domnode @@ -477,24 +477,24 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y ); * * ************************************************************************/ -#ifndef NAN -#define NAN (0.0 / 0.0) +#ifndef NAN +#define NAN (0.0 / 0.0) #endif -#ifndef INFINITY -#define INFINITY HUGE_VAL -#endif +#ifndef INFINITY +#define INFINITY HUGE_VAL +#endif + +double xmlXPathNAN = NAN; +double xmlXPathPINF = INFINITY; +double xmlXPathNINF = -INFINITY; -double xmlXPathNAN = NAN; -double xmlXPathPINF = INFINITY; -double xmlXPathNINF = -INFINITY; - /** * xmlXPathInit: * * Initialize the XPath environment - * - * Does nothing but must be kept as public function. + * + * Does nothing but must be kept as public function. */ void xmlXPathInit(void) { @@ -508,34 +508,34 @@ xmlXPathInit(void) { */ int xmlXPathIsNaN(double val) { -#ifdef isnan - return isnan(val); -#else - return !(val == val); -#endif +#ifdef isnan + return isnan(val); +#else + return !(val == val); +#endif } /** * xmlXPathIsInf: * @val: a double value * - * Returns 1 if the value is +Infinite, -1 if -Infinite, 0 otherwise + * Returns 1 if the value is +Infinite, -1 if -Infinite, 0 otherwise */ int xmlXPathIsInf(double val) { -#ifdef isinf - return isinf(val) ? (val > 0 ? 1 : -1) : 0; -#else - if (val >= INFINITY) - return 1; - if (val <= -INFINITY) - return -1; - return 0; -#endif +#ifdef isinf + return isinf(val) ? (val > 0 ? 1 : -1) : 0; +#else + if (val >= INFINITY) + return 1; + if (val <= -INFINITY) + return -1; + return 0; +#endif } #endif /* SCHEMAS or XPATH */ - + #ifdef LIBXML_XPATH_ENABLED /* @@ -609,8 +609,8 @@ static const char *xmlXPathErrorMessages[] = { "Invalid or incomplete context\n", "Stack usage error\n", "Forbidden variable\n", - "Operation limit exceeded\n", - "Recursion limit exceeded\n", + "Operation limit exceeded\n", + "Recursion limit exceeded\n", "?? Unknown error ??\n" /* Must be last in the list! */ }; #define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) / \ @@ -626,12 +626,12 @@ static void xmlXPathErrMemory(xmlXPathContextPtr ctxt, const char *extra) { if (ctxt != NULL) { - xmlResetError(&ctxt->lastError); + xmlResetError(&ctxt->lastError); if (extra) { xmlChar buf[200]; xmlStrPrintf(buf, 200, - "Memory allocation failed : %s\n", + "Memory allocation failed : %s\n", extra); ctxt->lastError.message = (char *) xmlStrdup(buf); } else { @@ -749,32 +749,32 @@ xmlXPatherror(xmlXPathParserContextPtr ctxt, const char *file ATTRIBUTE_UNUSED, xmlXPathErr(ctxt, no); } -/** - * xmlXPathCheckOpLimit: - * @ctxt: the XPath Parser context - * @opCount: the number of operations to be added - * - * Adds opCount to the running total of operations and returns -1 if the - * operation limit is exceeded. Returns 0 otherwise. - */ -static int -xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) { - xmlXPathContextPtr xpctxt = ctxt->context; - - if ((opCount > xpctxt->opLimit) || - (xpctxt->opCount > xpctxt->opLimit - opCount)) { - xpctxt->opCount = xpctxt->opLimit; - xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED); - return(-1); - } - - xpctxt->opCount += opCount; - return(0); -} - -#define OP_LIMIT_EXCEEDED(ctxt, n) \ - ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0)) - +/** + * xmlXPathCheckOpLimit: + * @ctxt: the XPath Parser context + * @opCount: the number of operations to be added + * + * Adds opCount to the running total of operations and returns -1 if the + * operation limit is exceeded. Returns 0 otherwise. + */ +static int +xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) { + xmlXPathContextPtr xpctxt = ctxt->context; + + if ((opCount > xpctxt->opLimit) || + (xpctxt->opCount > xpctxt->opLimit - opCount)) { + xpctxt->opCount = xpctxt->opLimit; + xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED); + return(-1); + } + + xpctxt->opCount += opCount; + return(0); +} + +#define OP_LIMIT_EXCEEDED(ctxt, n) \ + ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0)) + /************************************************************************ * * * Utilities * @@ -897,13 +897,13 @@ typedef enum { XPATH_OP_ROOT, XPATH_OP_NODE, XPATH_OP_COLLECT, - XPATH_OP_VALUE, /* 11 */ + XPATH_OP_VALUE, /* 11 */ XPATH_OP_VARIABLE, XPATH_OP_FUNCTION, XPATH_OP_ARG, XPATH_OP_PREDICATE, - XPATH_OP_FILTER, /* 16 */ - XPATH_OP_SORT /* 17 */ + XPATH_OP_FILTER, /* 16 */ + XPATH_OP_SORT /* 17 */ #ifdef LIBXML_XPTR_ENABLED ,XPATH_OP_RANGETO #endif @@ -952,7 +952,7 @@ struct _xmlXPathStepOp { int value3; void *value4; void *value5; - xmlXPathFunction cache; + xmlXPathFunction cache; void *cacheURI; }; @@ -962,7 +962,7 @@ struct _xmlXPathCompExpr { xmlXPathStepOp *steps; /* ops for computation of this expression */ int last; /* index of last step in expression */ xmlChar *expr; /* the expression being computed */ - xmlDictPtr dict; /* the dictionary to use if any */ + xmlDictPtr dict; /* the dictionary to use if any */ #ifdef DEBUG_EVAL_COUNTS int nb; xmlChar *string; @@ -988,8 +988,8 @@ static int xmlXPathCompOpEvalToBoolean(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, int isPredicate); -static void -xmlXPathFreeObjectEntry(void *obj, const xmlChar *name); +static void +xmlXPathFreeObjectEntry(void *obj, const xmlChar *name); /************************************************************************ * * @@ -1104,15 +1104,15 @@ xmlXPathFreeCompExpr(xmlXPathCompExprPtr comp) * Returns -1 in case of failure, the index otherwise */ static int -xmlXPathCompExprAdd(xmlXPathParserContextPtr ctxt, int ch1, int ch2, +xmlXPathCompExprAdd(xmlXPathParserContextPtr ctxt, int ch1, int ch2, xmlXPathOp op, int value, int value2, int value3, void *value4, void *value5) { - xmlXPathCompExprPtr comp = ctxt->comp; + xmlXPathCompExprPtr comp = ctxt->comp; if (comp->nbStep >= comp->maxStep) { xmlXPathStepOp *real; if (comp->maxStep >= XPATH_MAX_STEPS) { - xmlXPathPErrMemory(ctxt, "adding step\n"); + xmlXPathPErrMemory(ctxt, "adding step\n"); return(-1); } comp->maxStep *= 2; @@ -1120,7 +1120,7 @@ xmlXPathCompExprAdd(xmlXPathParserContextPtr ctxt, int ch1, int ch2, comp->maxStep * sizeof(xmlXPathStepOp)); if (real == NULL) { comp->maxStep /= 2; - xmlXPathPErrMemory(ctxt, "adding step\n"); + xmlXPathPErrMemory(ctxt, "adding step\n"); return(-1); } comp->steps = real; @@ -1182,20 +1182,20 @@ xmlXPathCompSwap(xmlXPathStepOpPtr op) { } #define PUSH_FULL_EXPR(op, op1, op2, val, val2, val3, val4, val5) \ - xmlXPathCompExprAdd(ctxt, (op1), (op2), \ + xmlXPathCompExprAdd(ctxt, (op1), (op2), \ (op), (val), (val2), (val3), (val4), (val5)) #define PUSH_LONG_EXPR(op, val, val2, val3, val4, val5) \ - xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1, \ + xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1, \ (op), (val), (val2), (val3), (val4), (val5)) #define PUSH_LEAVE_EXPR(op, val, val2) \ -xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL) +xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL) #define PUSH_UNARY_EXPR(op, ch, val, val2) \ -xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL) +xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL) #define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2) \ -xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op), \ +xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op), \ (val), (val2), 0 ,NULL ,NULL) /************************************************************************ @@ -1434,8 +1434,8 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) { default: if (xmlXPathIsNaN(cur->floatval)) { fprintf(output, "Object is a number : NaN\n"); - } else if (cur->floatval == 0) { - /* Omit sign for negative zero. */ + } else if (cur->floatval == 0) { + /* Omit sign for negative zero. */ fprintf(output, "Object is a number : 0\n"); } else { fprintf(output, "Object is a number : %0g\n", cur->floatval); @@ -1691,17 +1691,17 @@ xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp, fprintf(output, "%s", shift); -#ifdef XPATH_STREAMING - if (comp->stream) { - fprintf(output, "Streaming Expression\n"); - } else -#endif - { - fprintf(output, "Compiled Expression : %d elements\n", - comp->nbStep); - i = comp->last; - xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); - } +#ifdef XPATH_STREAMING + if (comp->stream) { + fprintf(output, "Streaming Expression\n"); + } else +#endif + { + fprintf(output, "Compiled Expression : %d elements\n", + comp->nbStep); + i = comp->last; + xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); + } } #ifdef XP_DEBUG_OBJ_USAGE @@ -2255,7 +2255,7 @@ xmlXPathFreeCache(xmlXPathContextCachePtr cache) * * @ctxt: the XPath context * @active: enables/disables (creates/frees) the cache - * @value: a value with semantics dependent on @options + * @value: a value with semantics dependent on @options * @options: options (currently only the value 0 is used) * * Creates/frees an object cache on the XPath context. @@ -2415,7 +2415,7 @@ xmlXPathCacheNewNodeSet(xmlXPathContextPtr ctxt, xmlNodePtr val) { xmlXPathObjectPtr ret; /* - * Use the nodeset-cache. + * Use the nodeset-cache. */ ret = (xmlXPathObjectPtr) cache->nodesetObjs->items[--cache->nodesetObjs->number]; @@ -2425,7 +2425,7 @@ xmlXPathCacheNewNodeSet(xmlXPathContextPtr ctxt, xmlNodePtr val) if ((ret->nodesetval->nodeMax == 0) || (val->type == XML_NAMESPACE_DECL)) { - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ xmlXPathNodeSetAddUnique(ret->nodesetval, val); } else { ret->nodesetval->nodeTab[0] = val; @@ -2872,36 +2872,36 @@ valuePop(xmlXPathParserContextPtr ctxt) * @ctxt: an XPath evaluation context * @value: the XPath object * - * Pushes a new XPath object on top of the value stack. If value is NULL, - * a memory error is recorded in the parser context. + * Pushes a new XPath object on top of the value stack. If value is NULL, + * a memory error is recorded in the parser context. * - * Returns the number of items on the value stack, or -1 in case of error. + * Returns the number of items on the value stack, or -1 in case of error. */ int valuePush(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value) { - if (ctxt == NULL) return(-1); - if (value == NULL) { - /* - * A NULL value typically indicates that a memory allocation failed, - * so we set ctxt->error here to propagate the error. - */ - ctxt->error = XPATH_MEMORY_ERROR; - return(-1); - } + if (ctxt == NULL) return(-1); + if (value == NULL) { + /* + * A NULL value typically indicates that a memory allocation failed, + * so we set ctxt->error here to propagate the error. + */ + ctxt->error = XPATH_MEMORY_ERROR; + return(-1); + } if (ctxt->valueNr >= ctxt->valueMax) { xmlXPathObjectPtr *tmp; if (ctxt->valueMax >= XPATH_MAX_STACK_DEPTH) { - xmlXPathPErrMemory(ctxt, "XPath stack depth limit reached\n"); - return (-1); + xmlXPathPErrMemory(ctxt, "XPath stack depth limit reached\n"); + return (-1); } tmp = (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab, 2 * ctxt->valueMax * sizeof(ctxt->valueTab[0])); if (tmp == NULL) { - xmlXPathPErrMemory(ctxt, "pushing value\n"); - return (-1); + xmlXPathPErrMemory(ctxt, "pushing value\n"); + return (-1); } ctxt->valueMax *= 2; ctxt->valueTab = tmp; @@ -3137,11 +3137,11 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize) if (xmlXPathIsNaN(number)) { if (buffersize > (int)sizeof("NaN")) snprintf(buffer, buffersize, "NaN"); - } else if (number == 0) { - /* Omit sign for negative zero. */ + } else if (number == 0) { + /* Omit sign for negative zero. */ snprintf(buffer, buffersize, "0"); - } else if ((number > INT_MIN) && (number < INT_MAX) && - (number == (int) number)) { + } else if ((number > INT_MIN) && (number < INT_MAX) && + (number == (int) number)) { char work[30]; char *ptr, *cur; int value = (int) number; @@ -3261,7 +3261,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize) */ long xmlXPathOrderDocElems(xmlDocPtr doc) { - ptrdiff_t count = 0; + ptrdiff_t count = 0; xmlNodePtr cur; if (doc == NULL) @@ -3293,7 +3293,7 @@ xmlXPathOrderDocElems(xmlDocPtr doc) { } } while (cur != NULL); } - return((long) count); + return((long) count); } /** @@ -3357,17 +3357,17 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) { return(-1); /* - * Speedup using document order if available. + * Speedup using document order if available. */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > (ptrdiff_t) node1->content) && + (0 > (ptrdiff_t) node2->content) && (node1->doc == node2->doc)) { - ptrdiff_t l1, l2; + ptrdiff_t l1, l2; - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -((ptrdiff_t) node1->content); + l2 = -((ptrdiff_t) node2->content); if (l1 < l2) return(1); if (l1 > l2) @@ -3378,13 +3378,13 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) { * compute depth to root */ for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) { - if (cur->parent == node1) + if (cur->parent == node1) return(1); depth2++; } root = cur; for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) { - if (cur->parent == node2) + if (cur->parent == node2) return(-1); depth1++; } @@ -3420,17 +3420,17 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) { if (node1 == node2->next) return(-1); /* - * Speedup using document order if available. + * Speedup using document order if available. */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > (ptrdiff_t) node1->content) && + (0 > (ptrdiff_t) node2->content) && (node1->doc == node2->doc)) { - ptrdiff_t l1, l2; + ptrdiff_t l1, l2; - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -((ptrdiff_t) node1->content); + l2 = -((ptrdiff_t) node2->content); if (l1 < l2) return(1); if (l1 > l2) @@ -3584,7 +3584,7 @@ xmlXPathNodeSetCreate(xmlNodePtr val) { if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret->nodeTab[ret->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else @@ -3691,7 +3691,7 @@ xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) { cur->nodeMax *= 2; cur->nodeTab = temp; } - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns); return(0); } @@ -3713,7 +3713,7 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { /* @@ with_ns to check whether namespace nodes should be looked at @@ */ /* - * prevent duplicates + * prevent duplicates */ for (i = 0;i < cur->nodeNr;i++) if (cur->nodeTab[i] == val) return(0); @@ -3750,7 +3750,7 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else @@ -3805,7 +3805,7 @@ xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) { if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else @@ -3840,7 +3840,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { * xmlXPathNodeSetDupNs() to the set; thus a pure * memcpy is not possible. * If there was a flag on the nodesetval, indicating that - * some temporary nodes are in, that would be helpful. + * some temporary nodes are in, that would be helpful. */ /* * Optimization: Create an equally sized node-set @@ -3922,7 +3922,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { if (n2->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) n2; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ val1->nodeTab[val1->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else @@ -3938,15 +3938,15 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { * @set1: the first NodeSet or NULL * @set2: the second NodeSet * - * Merges two nodesets, all nodes from @set2 are added to @set1. + * Merges two nodesets, all nodes from @set2 are added to @set1. * Checks for duplicate nodes. Clears set2. * * Returns @set1 once extended or NULL in case of error. */ static xmlNodeSetPtr -xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2) +xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2) { - { + { int i, j, initNbSet1; xmlNodePtr n1, n2; @@ -4005,7 +4005,7 @@ xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2) set1->nodeTab = temp; set1->nodeMax *= 2; } - set1->nodeTab[set1->nodeNr++] = n2; + set1->nodeTab[set1->nodeNr++] = n2; skip_node: {} } @@ -4019,15 +4019,15 @@ skip_node: * @set1: the first NodeSet or NULL * @set2: the second NodeSet * - * Merges two nodesets, all nodes from @set2 are added to @set1. - * Doesn't check for duplicate nodes. Clears set2. + * Merges two nodesets, all nodes from @set2 are added to @set1. + * Doesn't check for duplicate nodes. Clears set2. * * Returns @set1 once extended or NULL in case of error. */ static xmlNodeSetPtr -xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2) +xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2) { - { + { int i; xmlNodePtr n2; @@ -4157,7 +4157,7 @@ xmlXPathFreeNodeSet(xmlNodeSetPtr obj) { static void xmlXPathNodeSetClearFromPos(xmlNodeSetPtr set, int pos, int hasNsNodes) { - if ((set == NULL) || (pos >= set->nodeNr)) + if ((set == NULL) || (pos >= set->nodeNr)) return; else if ((hasNsNodes)) { int i; @@ -4174,46 +4174,46 @@ xmlXPathNodeSetClearFromPos(xmlNodeSetPtr set, int pos, int hasNsNodes) } /** - * xmlXPathNodeSetClear: - * @set: the node set to clear - * - * Clears the list from all temporary XPath objects (e.g. namespace nodes - * are feed), but does *not* free the list itself. Sets the length of the - * list to 0. - */ -static void -xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes) -{ - xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes); -} - -/** - * xmlXPathNodeSetKeepLast: - * @set: the node set to be cleared - * - * Move the last node to the first position and clear temporary XPath objects - * (e.g. namespace nodes) from all other nodes. Sets the length of the list - * to 1. - */ -static void -xmlXPathNodeSetKeepLast(xmlNodeSetPtr set) -{ - int i; - xmlNodePtr node; - - if ((set == NULL) || (set->nodeNr <= 1)) - return; - for (i = 0; i < set->nodeNr - 1; i++) { - node = set->nodeTab[i]; - if ((node != NULL) && - (node->type == XML_NAMESPACE_DECL)) - xmlXPathNodeSetFreeNs((xmlNsPtr) node); - } - set->nodeTab[0] = set->nodeTab[set->nodeNr-1]; - set->nodeNr = 1; -} - -/** + * xmlXPathNodeSetClear: + * @set: the node set to clear + * + * Clears the list from all temporary XPath objects (e.g. namespace nodes + * are feed), but does *not* free the list itself. Sets the length of the + * list to 0. + */ +static void +xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes) +{ + xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes); +} + +/** + * xmlXPathNodeSetKeepLast: + * @set: the node set to be cleared + * + * Move the last node to the first position and clear temporary XPath objects + * (e.g. namespace nodes) from all other nodes. Sets the length of the list + * to 1. + */ +static void +xmlXPathNodeSetKeepLast(xmlNodeSetPtr set) +{ + int i; + xmlNodePtr node; + + if ((set == NULL) || (set->nodeNr <= 1)) + return; + for (i = 0; i < set->nodeNr - 1; i++) { + node = set->nodeTab[i]; + if ((node != NULL) && + (node->type == XML_NAMESPACE_DECL)) + xmlXPathNodeSetFreeNs((xmlNsPtr) node); + } + set->nodeTab[0] = set->nodeTab[set->nodeNr-1]; + set->nodeNr = 1; +} + +/** * xmlXPathFreeValueTree: * @obj: the xmlNodeSetPtr to free * @@ -4303,7 +4303,7 @@ xmlXPathNewNodeSet(xmlNodePtr val) { memset(ret, 0 , (size_t) sizeof(xmlXPathObject)); ret->type = XPATH_NODESET; ret->boolval = 0; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret->nodesetval = xmlXPathNodeSetCreate(val); /* @@ with_ns to check whether namespace nodes should be looked at @@ */ #ifdef XP_DEBUG_OBJ_USAGE @@ -4364,7 +4364,7 @@ xmlXPathNewNodeSetList(xmlNodeSetPtr val) ret = xmlXPathNewNodeSet(val->nodeTab[0]); if (ret) { for (i = 1; i < val->nodeNr; ++i) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret->nodesetval, val->nodeTab[i]) < 0) break; } @@ -4436,7 +4436,7 @@ xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) { if (xmlXPathNodeSetIsEmpty(nodes2)) return(nodes1); - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret = xmlXPathNodeSetCreate(NULL); if (xmlXPathNodeSetIsEmpty(nodes1)) return(ret); @@ -4446,7 +4446,7 @@ xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) { for (i = 0; i < l1; i++) { cur = xmlXPathNodeSetItem(nodes1, i); if (!xmlXPathNodeSetContains(nodes2, cur)) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret, cur) < 0) break; } @@ -4483,7 +4483,7 @@ xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) { for (i = 0; i < l1; i++) { cur = xmlXPathNodeSetItem(nodes1, i); if (xmlXPathNodeSetContains(nodes2, cur)) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret, cur) < 0) break; } @@ -4522,14 +4522,14 @@ xmlXPathDistinctSorted (xmlNodeSetPtr nodes) { strval = xmlXPathCastNodeToString(cur); if (xmlHashLookup(hash, strval) == NULL) { xmlHashAddEntry(hash, strval, strval); - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret, cur) < 0) break; } else { xmlFree(strval); } } - xmlHashFree(hash, xmlHashDefaultDeallocator); + xmlHashFree(hash, xmlHashDefaultDeallocator); return(ret); } @@ -4616,7 +4616,7 @@ xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) { cur = xmlXPathNodeSetItem(nodes, i); if (cur == node) break; - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret, cur) < 0) break; } @@ -4722,7 +4722,7 @@ xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) { cur = xmlXPathNodeSetItem(nodes, i); if (cur == node) break; - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ if (xmlXPathNodeSetAddUnique(ret, cur) < 0) break; } @@ -4843,9 +4843,9 @@ xmlXPathRegisterFuncNS(xmlXPathContextPtr ctxt, const xmlChar *name, return(-1); if (f == NULL) return(xmlHashRemoveEntry2(ctxt->funcHash, name, ns_uri, NULL)); -XML_IGNORE_PEDANTIC_WARNINGS - return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, (void *) f)); -XML_POP_WARNINGS +XML_IGNORE_PEDANTIC_WARNINGS + return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, (void *) f)); +XML_POP_WARNINGS } /** @@ -4926,9 +4926,9 @@ xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, if (ctxt->funcHash == NULL) return(NULL); -XML_IGNORE_PEDANTIC_WARNINGS - ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri); -XML_POP_WARNINGS +XML_IGNORE_PEDANTIC_WARNINGS + ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri); +XML_POP_WARNINGS return(ret); } @@ -4997,9 +4997,9 @@ xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name, return(-1); if (value == NULL) return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri, - xmlXPathFreeObjectEntry)); + xmlXPathFreeObjectEntry)); return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri, - (void *) value, xmlXPathFreeObjectEntry)); + (void *) value, xmlXPathFreeObjectEntry)); } /** @@ -5089,7 +5089,7 @@ xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt) { if (ctxt == NULL) return; - xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry); + xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry); ctxt->varHash = NULL; } @@ -5120,9 +5120,9 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix, return(-1); if (ns_uri == NULL) return(xmlHashRemoveEntry(ctxt->nsHash, prefix, - xmlHashDefaultDeallocator)); + xmlHashDefaultDeallocator)); return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) xmlStrdup(ns_uri), - xmlHashDefaultDeallocator)); + xmlHashDefaultDeallocator)); } /** @@ -5171,7 +5171,7 @@ xmlXPathRegisteredNsCleanup(xmlXPathContextPtr ctxt) { if (ctxt == NULL) return; - xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator); + xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator); ctxt->nsHash = NULL; } @@ -5422,7 +5422,7 @@ xmlXPathObjectCopy(xmlXPathObjectPtr val) { break; #endif case XPATH_NODESET: - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret->nodesetval = xmlXPathNodeSetMerge(NULL, val->nodesetval); /* Do not deallocate the copied tree value */ ret->boolval = 0; @@ -5486,11 +5486,11 @@ xmlXPathFreeObject(xmlXPathObjectPtr obj) { xmlFree(obj); } -static void -xmlXPathFreeObjectEntry(void *obj, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlXPathFreeObject((xmlXPathObjectPtr) obj); -} - +static void +xmlXPathFreeObjectEntry(void *obj, const xmlChar *name ATTRIBUTE_UNUSED) { + xmlXPathFreeObject((xmlXPathObjectPtr) obj); +} + /** * xmlXPathReleaseObject: * @obj: the xmlXPathObjectPtr to free or to cache @@ -5680,8 +5680,8 @@ xmlXPathCastNumberToString (double val) { default: if (xmlXPathIsNaN(val)) { ret = xmlStrdup((const xmlChar *) "NaN"); - } else if (val == 0) { - /* Omit sign for negative zero. */ + } else if (val == 0) { + /* Omit sign for negative zero. */ ret = xmlStrdup((const xmlChar *) "0"); } else { /* could be improved */ @@ -5863,10 +5863,10 @@ xmlXPathCastNodeToNumber (xmlNodePtr node) { double ret; if (node == NULL) - return(NAN); + return(NAN); strval = xmlXPathCastNodeToString(node); if (strval == NULL) - return(NAN); + return(NAN); ret = xmlXPathCastStringToNumber(strval); xmlFree(strval); @@ -5887,7 +5887,7 @@ xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns) { double ret; if (ns == NULL) - return(NAN); + return(NAN); str = xmlXPathCastNodeSetToString(ns); ret = xmlXPathCastStringToNumber(str); xmlFree(str); @@ -5907,13 +5907,13 @@ xmlXPathCastToNumber(xmlXPathObjectPtr val) { double ret = 0.0; if (val == NULL) - return(NAN); + return(NAN); switch (val->type) { case XPATH_UNDEFINED: -#ifdef DEBUG_EXPR +#ifdef DEBUG_EXPR xmlGenericError(xmlGenericErrorContext, "NUMBER: undefined\n"); #endif - ret = NAN; + ret = NAN; break; case XPATH_NODESET: case XPATH_XSLT_TREE: @@ -5933,7 +5933,7 @@ xmlXPathCastToNumber(xmlXPathObjectPtr val) { case XPATH_RANGE: case XPATH_LOCATIONSET: TODO; - ret = NAN; + ret = NAN; break; } return(ret); @@ -6119,9 +6119,9 @@ xmlXPathNewContext(xmlDocPtr doc) { ret->contextSize = -1; ret->proximityPosition = -1; - ret->maxDepth = INT_MAX; - ret->maxParserDepth = INT_MAX; - + ret->maxDepth = INT_MAX; + ret->maxParserDepth = INT_MAX; + #ifdef XP_DEFAULT_CACHE_ON if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) { xmlXPathFreeContext(ret); @@ -6273,15 +6273,15 @@ xmlXPathCompParserContext(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt) { */ void xmlXPathFreeParserContext(xmlXPathParserContextPtr ctxt) { - int i; - + int i; + if (ctxt->valueTab != NULL) { - for (i = 0; i < ctxt->valueNr; i++) { - if (ctxt->context) - xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]); - else - xmlXPathFreeObject(ctxt->valueTab[i]); - } + for (i = 0; i < ctxt->valueNr; i++) { + if (ctxt->context) + xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]); + else + xmlXPathFreeObject(ctxt->valueTab[i]); + } xmlFree(ctxt->valueTab); } if (ctxt->comp != NULL) { @@ -6368,7 +6368,7 @@ xmlXPathNodeValHash(xmlNodePtr node) { string = tmp->content; break; default: - string = NULL; + string = NULL; break; } if ((string != NULL) && (string[0] != 0)) { @@ -6612,7 +6612,7 @@ xmlXPathCompareNodeSets(int inf, int strict, values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double)); if (values2 == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ xmlXPathErrMemory(NULL, "comparing nodesets\n"); xmlXPathFreeObject(arg1); xmlXPathFreeObject(arg2); @@ -6691,13 +6691,13 @@ xmlXPathCompareNodeSetValue(xmlXPathParserContextPtr ctxt, int inf, int strict, valuePush(ctxt, val); return(xmlXPathCompareValues(ctxt, inf, strict)); default: - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompareNodeSetValue: Can't compare node set " - "and object of type %d\n", - val->type); - xmlXPathReleaseObject(ctxt->context, arg); - xmlXPathReleaseObject(ctxt->context, val); - XP_ERROR0(XPATH_INVALID_TYPE); + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompareNodeSetValue: Can't compare node set " + "and object of type %d\n", + val->type); + xmlXPathReleaseObject(ctxt->context, arg); + xmlXPathReleaseObject(ctxt->context, val); + XP_ERROR0(XPATH_INVALID_TYPE); } return(0); } @@ -6873,13 +6873,13 @@ xmlXPathEqualNodeSets(xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2, int neq) { values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *)); if (values1 == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ xmlXPathErrMemory(NULL, "comparing nodesets\n"); return(0); } hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int)); if (hashs1 == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ xmlXPathErrMemory(NULL, "comparing nodesets\n"); xmlFree(values1); return(0); @@ -6887,7 +6887,7 @@ xmlXPathEqualNodeSets(xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2, int neq) { memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *)); values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *)); if (values2 == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ xmlXPathErrMemory(NULL, "comparing nodesets\n"); xmlFree(hashs1); xmlFree(values1); @@ -6895,7 +6895,7 @@ xmlXPathEqualNodeSets(xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2, int neq) { } hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int)); if (hashs2 == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ xmlXPathErrMemory(NULL, "comparing nodesets\n"); xmlFree(hashs1); xmlFree(values1); @@ -7009,7 +7009,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt, valuePush(ctxt, arg2); xmlXPathNumberFunction(ctxt, 1); arg2 = valuePop(ctxt); - /* Falls through. */ + /* Falls through. */ case XPATH_NUMBER: /* Hand check NaN and Infinity equalities */ if (xmlXPathIsNaN(arg1->floatval) || @@ -7445,7 +7445,7 @@ xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt) { if ((ctxt == NULL) || (ctxt->context == NULL)) return; CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - ctxt->value->floatval = -ctxt->value->floatval; + ctxt->value->floatval = -ctxt->value->floatval; } /** @@ -7525,7 +7525,7 @@ xmlXPathMultValues(xmlXPathParserContextPtr ctxt) { * The numeric operators convert their operands to numbers as if * by calling the number function. */ -ATTRIBUTE_NO_SANITIZE("float-divide-by-zero") +ATTRIBUTE_NO_SANITIZE("float-divide-by-zero") void xmlXPathDivValues(xmlXPathParserContextPtr ctxt) { xmlXPathObjectPtr arg; @@ -7538,7 +7538,7 @@ xmlXPathDivValues(xmlXPathParserContextPtr ctxt) { xmlXPathReleaseObject(ctxt->context, arg); CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - ctxt->value->floatval /= val; + ctxt->value->floatval /= val; } /** @@ -7563,7 +7563,7 @@ xmlXPathModValues(xmlXPathParserContextPtr ctxt) { CHECK_TYPE(XPATH_NUMBER); arg1 = ctxt->value->floatval; if (arg2 == 0) - ctxt->value->floatval = NAN; + ctxt->value->floatval = NAN; else { ctxt->value->floatval = fmod(arg1, arg2); } @@ -7598,7 +7598,7 @@ typedef xmlNodePtr (*xmlXPathTraversalFunctionExt) * Used for merging node sets in xmlXPathCollectAndTest(). */ typedef xmlNodeSetPtr (*xmlXPathNodeSetMergeFunction) - (xmlNodeSetPtr, xmlNodeSetPtr); + (xmlNodeSetPtr, xmlNodeSetPtr); /** @@ -7902,15 +7902,15 @@ xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); - if (cur == NULL) + if (cur == NULL) return(ctxt->context->node); - if (ctxt->context->node == NULL) - return(NULL); - if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) || - (ctxt->context->node->type == XML_NAMESPACE_DECL)) - return(NULL); - + if (ctxt->context->node == NULL) + return(NULL); + if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) || + (ctxt->context->node->type == XML_NAMESPACE_DECL)) + return(NULL); + return(xmlXPathNextDescendant(ctxt, cur)); } @@ -8083,12 +8083,12 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { return(NULL); return(cur->parent); case XML_ATTRIBUTE_NODE: { - xmlAttrPtr att = (xmlAttrPtr) cur; + xmlAttrPtr att = (xmlAttrPtr) cur; return(att->parent); } case XML_NAMESPACE_DECL: { - xmlNsPtr ns = (xmlNsPtr) cur; + xmlNsPtr ns = (xmlNsPtr) cur; if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) @@ -8205,16 +8205,16 @@ xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if (cur == NULL) { cur = ctxt->context->node; - if (cur->type == XML_ATTRIBUTE_NODE) { + if (cur->type == XML_ATTRIBUTE_NODE) { cur = cur->parent; - } else if (cur->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr) cur; - - if ((ns->next == NULL) || - (ns->next->type == XML_NAMESPACE_DECL)) - return (NULL); - cur = (xmlNodePtr) ns->next; - } + } else if (cur->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) cur; + + if ((ns->next == NULL) || + (ns->next->type == XML_NAMESPACE_DECL)) + return (NULL); + cur = (xmlNodePtr) ns->next; + } } if (cur == NULL) return(NULL) ; /* ERROR */ if (cur->next != NULL) return(cur->next) ; @@ -8275,16 +8275,16 @@ xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); if (cur == NULL) { cur = ctxt->context->node; - if (cur->type == XML_ATTRIBUTE_NODE) { - cur = cur->parent; - } else if (cur->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr) cur; - - if ((ns->next == NULL) || - (ns->next->type == XML_NAMESPACE_DECL)) - return (NULL); - cur = (xmlNodePtr) ns->next; - } + if (cur->type == XML_ATTRIBUTE_NODE) { + cur = cur->parent; + } else if (cur->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) cur; + + if ((ns->next == NULL) || + (ns->next->type == XML_NAMESPACE_DECL)) + return (NULL); + cur = (xmlNodePtr) ns->next; + } } if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return (NULL); @@ -8329,16 +8329,16 @@ xmlXPathNextPrecedingInternal(xmlXPathParserContextPtr ctxt, cur = ctxt->context->node; if (cur == NULL) return (NULL); - if (cur->type == XML_ATTRIBUTE_NODE) { - cur = cur->parent; - } else if (cur->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr) cur; - - if ((ns->next == NULL) || - (ns->next->type == XML_NAMESPACE_DECL)) - return (NULL); - cur = (xmlNodePtr) ns->next; - } + if (cur->type == XML_ATTRIBUTE_NODE) { + cur = cur->parent; + } else if (cur->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) cur; + + if ((ns->next == NULL) || + (ns->next->type == XML_NAMESPACE_DECL)) + return (NULL); + cur = (xmlNodePtr) ns->next; + } ctxt->ancestor = cur->parent; } if (cur->type == XML_NAMESPACE_DECL) @@ -8379,7 +8379,7 @@ xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL); - if (cur == NULL) { + if (cur == NULL) { if (ctxt->context->tmpNsList != NULL) xmlFree(ctxt->context->tmpNsList); ctxt->context->tmpNsList = @@ -8453,7 +8453,7 @@ xmlXPathRoot(xmlXPathParserContextPtr ctxt) { if ((ctxt == NULL) || (ctxt->context == NULL)) return; valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context, - (xmlNodePtr) ctxt->context->doc)); + (xmlNodePtr) ctxt->context->doc)); } /************************************************************************ @@ -8537,7 +8537,7 @@ xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs) { if ((cur == NULL) || (cur->nodesetval == NULL)) valuePush(ctxt, xmlXPathCacheNewFloat(ctxt->context, (double) 0)); - else + else valuePush(ctxt, xmlXPathCacheNewFloat(ctxt->context, (double) cur->nodesetval->nodeNr)); xmlXPathReleaseObject(ctxt->context, cur); @@ -8577,7 +8577,7 @@ xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) { * We used to check the fact that the value passed * was an NCName, but this generated much troubles for * me and Aleksey Sanin, people blatantly violated that - * constraint, like Visa3D spec. + * constraint, like Visa3D spec. * if (xmlValidateNCName(ID, 1) == 0) */ attr = xmlGetID(doc, ID); @@ -8588,7 +8588,7 @@ xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) { elem = (xmlNodePtr) attr; else elem = NULL; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ if (elem != NULL) xmlXPathNodeSetAdd(ret, elem); } @@ -8632,7 +8632,7 @@ xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlNodeSetPtr ns; int i; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret = xmlXPathNodeSetCreate(NULL); if (obj->nodesetval != NULL) { @@ -8640,7 +8640,7 @@ xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs) { tokens = xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]); ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens); - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ ret = xmlXPathNodeSetMerge(ret, ns); xmlXPathFreeNodeSet(ns); if (tokens != NULL) @@ -8652,7 +8652,7 @@ xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs) { return; } obj = xmlXPathCacheConvertString(ctxt->context, obj); - if (obj == NULL) return; + if (obj == NULL) return; ret = xmlXPathGetElementsByIds(ctxt->context->doc, obj->stringval); valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, ret)); xmlXPathReleaseObject(ctxt->context, obj); @@ -9090,7 +9090,7 @@ void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr str, start, len; double le=0, in; - int i = 1, j = INT_MAX; + int i = 1, j = INT_MAX; if (nargs < 2) { CHECK_ARITY(2); @@ -9118,41 +9118,41 @@ xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) { CHECK_TYPE(XPATH_STRING); str = valuePop(ctxt); - if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */ - i = INT_MAX; - } else if (in >= 1.0) { - i = (int)in; - if (in - floor(in) >= 0.5) - i += 1; + if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */ + i = INT_MAX; + } else if (in >= 1.0) { + i = (int)in; + if (in - floor(in) >= 0.5) + i += 1; } - if (nargs == 3) { - double rin, rle, end; + if (nargs == 3) { + double rin, rle, end; - rin = floor(in); - if (in - rin >= 0.5) - rin += 1.0; + rin = floor(in); + if (in - rin >= 0.5) + rin += 1.0; - rle = floor(le); - if (le - rle >= 0.5) - rle += 1.0; + rle = floor(le); + if (le - rle >= 0.5) + rle += 1.0; - end = rin + rle; - if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */ - j = 1; - } else if (end < INT_MAX) { - j = (int)end; - } - } + end = rin + rle; + if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */ + j = 1; + } else if (end < INT_MAX) { + j = (int)end; + } + } - if (i < j) { - xmlChar *ret = xmlUTF8Strsub(str->stringval, i - 1, j - i); + if (i < j) { + xmlChar *ret = xmlUTF8Strsub(str->stringval, i - 1, j - i); valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, ret)); xmlFree(ret); - } else { - valuePush(ctxt, xmlXPathCacheNewCString(ctxt->context, "")); + } else { + valuePush(ctxt, xmlXPathCacheNewCString(ctxt->context, "")); } - + xmlXPathReleaseObject(ctxt->context, str); } @@ -9592,7 +9592,7 @@ xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs) { CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - ctxt->value->floatval = floor(ctxt->value->floatval); + ctxt->value->floatval = floor(ctxt->value->floatval); } /** @@ -9611,10 +9611,10 @@ xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs) { CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); -#ifdef _AIX - /* Work around buggy ceil() function on AIX */ - ctxt->value->floatval = copysign(ceil(ctxt->value->floatval), ctxt->value->floatval); -#else +#ifdef _AIX + /* Work around buggy ceil() function on AIX */ + ctxt->value->floatval = copysign(ceil(ctxt->value->floatval), ctxt->value->floatval); +#else ctxt->value->floatval = ceil(ctxt->value->floatval); #endif } @@ -9628,7 +9628,7 @@ xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs) { * number round(number) * The round function returns the number that is closest to the * argument and that is an integer. If there are two such numbers, - * then the one that is closest to positive infinity is returned. + * then the one that is closest to positive infinity is returned. */ void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs) { @@ -9638,18 +9638,18 @@ xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs) { CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - f = ctxt->value->floatval; + f = ctxt->value->floatval; - if ((f >= -0.5) && (f < 0.5)) { - /* Handles negative zero. */ - ctxt->value->floatval *= 0.0; + if ((f >= -0.5) && (f < 0.5)) { + /* Handles negative zero. */ + ctxt->value->floatval *= 0.0; + } + else { + double rounded = floor(f); + if (f - rounded >= 0.5) + rounded += 1.0; + ctxt->value->floatval = rounded; } - else { - double rounded = floor(f); - if (f - rounded >= 0.5) - rounded += 1.0; - ctxt->value->floatval = rounded; - } } /************************************************************************ @@ -9898,7 +9898,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) { (c == '[') || (c == ']') || (c == '@') || /* accelerators */ (c == '*') || /* accelerators */ (!IS_LETTER(c) && (c != '_') && - ((!qualified) || (c != ':')))) { + ((!qualified) || (c != ':')))) { return(NULL); } @@ -9933,19 +9933,19 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) { (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (len + 10 > max) { - xmlChar *tmp; + xmlChar *tmp; if (max > XML_MAX_NAME_LENGTH) { - xmlFree(buffer); + xmlFree(buffer); XP_ERRORNULL(XPATH_EXPR_ERROR); } max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, - max * sizeof(xmlChar)); - if (tmp == NULL) { - xmlFree(buffer); + tmp = (xmlChar *) xmlRealloc(buffer, + max * sizeof(xmlChar)); + if (tmp == NULL) { + xmlFree(buffer); XP_ERRORNULL(XPATH_MEMORY_ERROR); } - buffer = tmp; + buffer = tmp; } COPY_BUF(l,buffer,len,c); NEXTL(l); @@ -9993,7 +9993,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) { if (cur == NULL) return(0); while (IS_BLANK_CH(*cur)) cur++; if ((*cur != '.') && ((*cur < '0') || (*cur > '9')) && (*cur != '-')) { - return(NAN); + return(NAN); } if (*cur == '-') { isneg = 1; @@ -10024,25 +10024,25 @@ xmlXPathStringEvalNumber(const xmlChar *str) { #endif if (*cur == '.') { - int v, frac = 0, max; + int v, frac = 0, max; double fraction = 0; cur++; if (((*cur < '0') || (*cur > '9')) && (!ok)) { - return(NAN); - } - while (*cur == '0') { - frac = frac + 1; - cur++; - } - max = frac + MAX_FRAC; - while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) { + return(NAN); + } + while (*cur == '0') { + frac = frac + 1; + cur++; + } + max = frac + MAX_FRAC; + while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) { v = (*cur - '0'); fraction = fraction * 10 + v; frac = frac + 1; cur++; } - fraction /= pow(10.0, frac); + fraction /= pow(10.0, frac); ret = ret + fraction; while ((*cur >= '0') && (*cur <= '9')) cur++; @@ -10056,13 +10056,13 @@ xmlXPathStringEvalNumber(const xmlChar *str) { cur++; } while ((*cur >= '0') && (*cur <= '9')) { - if (exponent < 1000000) - exponent = exponent * 10 + (*cur - '0'); + if (exponent < 1000000) + exponent = exponent * 10 + (*cur - '0'); cur++; } } while (IS_BLANK_CH(*cur)) cur++; - if (*cur != 0) return(NAN); + if (*cur != 0) return(NAN); if (isneg) ret = -ret; if (is_exponent_negative) exponent = -exponent; ret *= pow(10.0, (double)exponent); @@ -10119,25 +10119,25 @@ xmlXPathCompNumber(xmlXPathParserContextPtr ctxt) } #endif if (CUR == '.') { - int v, frac = 0, max; + int v, frac = 0, max; double fraction = 0; NEXT; if (((CUR < '0') || (CUR > '9')) && (!ok)) { XP_ERROR(XPATH_NUMBER_ERROR); } - while (CUR == '0') { - frac = frac + 1; - NEXT; - } - max = frac + MAX_FRAC; - while ((CUR >= '0') && (CUR <= '9') && (frac < max)) { + while (CUR == '0') { + frac = frac + 1; + NEXT; + } + max = frac + MAX_FRAC; + while ((CUR >= '0') && (CUR <= '9') && (frac < max)) { v = (CUR - '0'); fraction = fraction * 10 + v; frac = frac + 1; NEXT; } - fraction /= pow(10.0, frac); + fraction /= pow(10.0, frac); ret = ret + fraction; while ((CUR >= '0') && (CUR <= '9')) NEXT; @@ -10151,8 +10151,8 @@ xmlXPathCompNumber(xmlXPathParserContextPtr ctxt) NEXT; } while ((CUR >= '0') && (CUR <= '9')) { - if (exponent < 1000000) - exponent = exponent * 10 + (CUR - '0'); + if (exponent < 1000000) + exponent = exponent * 10 + (CUR - '0'); NEXT; } if (is_exponent_negative) @@ -10283,7 +10283,7 @@ xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) { NEXT; name = xmlXPathParseQName(ctxt, &prefix); if (name == NULL) { - xmlFree(prefix); + xmlFree(prefix); XP_ERROR(XPATH_VARIABLE_REF_ERROR); } ctxt->comp->last = -1; @@ -10600,18 +10600,18 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) { lc = 1; break; } else if ((NXT(len) == '(')) { - /* Node Type or Function */ + /* Node Type or Function */ if (xmlXPathIsNodeType(name)) { #ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "PathExpr: Type search\n"); #endif lc = 1; -#ifdef LIBXML_XPTR_ENABLED - } else if (ctxt->xptr && - xmlStrEqual(name, BAD_CAST "range-to")) { - lc = 1; -#endif +#ifdef LIBXML_XPTR_ENABLED + } else if (ctxt->xptr && + xmlStrEqual(name, BAD_CAST "range-to")) { + lc = 1; +#endif } else { #ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, @@ -10837,7 +10837,7 @@ xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) { xmlXPathCompAdditiveExpr(ctxt); CHECK_ERROR; SKIP_BLANKS; - while ((CUR == '<') || (CUR == '>')) { + while ((CUR == '<') || (CUR == '>')) { int inf, strict; int op1 = ctxt->comp->last; @@ -10930,14 +10930,14 @@ xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) { */ static void xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) { - xmlXPathContextPtr xpctxt = ctxt->context; - - if (xpctxt != NULL) { - if (xpctxt->depth >= xpctxt->maxParserDepth) - XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED); - xpctxt->depth += 1; - } - + xmlXPathContextPtr xpctxt = ctxt->context; + + if (xpctxt != NULL) { + if (xpctxt->depth >= xpctxt->maxParserDepth) + XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED); + xpctxt->depth += 1; + } + xmlXPathCompAndExpr(ctxt); CHECK_ERROR; SKIP_BLANKS; @@ -10959,9 +10959,9 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) { */ PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0); } - - if (xpctxt != NULL) - xpctxt->depth -= 1; + + if (xpctxt != NULL) + xpctxt->depth -= 1; } /** @@ -11580,300 +11580,300 @@ xmlXPathDebugDumpStepAxis(xmlXPathStepOpPtr op, } #endif /* DEBUG_STEP */ -/** - * xmlXPathNodeSetFilter: - * @ctxt: the XPath Parser context - * @set: the node set to filter - * @filterOpIndex: the index of the predicate/filter op - * @minPos: minimum position in the filtered set (1-based) - * @maxPos: maximum position in the filtered set (1-based) - * @hasNsNodes: true if the node set may contain namespace nodes - * - * Filter a node set, keeping only nodes for which the predicate expression - * matches. Afterwards, keep only nodes between minPos and maxPos in the - * filtered result. - */ -static void -xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt, - xmlNodeSetPtr set, - int filterOpIndex, - int minPos, int maxPos, - int hasNsNodes) +/** + * xmlXPathNodeSetFilter: + * @ctxt: the XPath Parser context + * @set: the node set to filter + * @filterOpIndex: the index of the predicate/filter op + * @minPos: minimum position in the filtered set (1-based) + * @maxPos: maximum position in the filtered set (1-based) + * @hasNsNodes: true if the node set may contain namespace nodes + * + * Filter a node set, keeping only nodes for which the predicate expression + * matches. Afterwards, keep only nodes between minPos and maxPos in the + * filtered result. + */ +static void +xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt, + xmlNodeSetPtr set, + int filterOpIndex, + int minPos, int maxPos, + int hasNsNodes) { - xmlXPathContextPtr xpctxt; - xmlNodePtr oldnode; - xmlDocPtr olddoc; - xmlXPathStepOpPtr filterOp; - int oldcs, oldpp; - int i, j, pos; - - if ((set == NULL) || (set->nodeNr == 0)) - return; - - /* - * Check if the node set contains a sufficient number of nodes for - * the requested range. - */ - if (set->nodeNr < minPos) { - xmlXPathNodeSetClear(set, hasNsNodes); - return; - } - - xpctxt = ctxt->context; - oldnode = xpctxt->node; - olddoc = xpctxt->doc; - oldcs = xpctxt->contextSize; - oldpp = xpctxt->proximityPosition; - filterOp = &ctxt->comp->steps[filterOpIndex]; - - xpctxt->contextSize = set->nodeNr; - - for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) { - xmlNodePtr node = set->nodeTab[i]; - int res; - - xpctxt->node = node; - xpctxt->proximityPosition = i + 1; - - /* - * Also set the xpath document in case things like - * key() are evaluated in the predicate. - * - * TODO: Get real doc for namespace nodes. - */ - if ((node->type != XML_NAMESPACE_DECL) && - (node->doc != NULL)) - xpctxt->doc = node->doc; - - res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1); - - if (ctxt->error != XPATH_EXPRESSION_OK) - goto exit; - if (res < 0) { - /* Shouldn't happen */ - xmlXPathErr(ctxt, XPATH_EXPR_ERROR); - goto exit; - } - - if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) { - if (i != j) { - set->nodeTab[j] = node; - set->nodeTab[i] = NULL; - } - - j += 1; - } else { - /* Remove the entry from the initial node set. */ - set->nodeTab[i] = NULL; - if (node->type == XML_NAMESPACE_DECL) - xmlXPathNodeSetFreeNs((xmlNsPtr) node); - } - - if (res != 0) { - if (pos == maxPos) { - /* Clear remaining nodes and exit loop. */ - if (hasNsNodes) { - for (i++; i < set->nodeNr; i++) { - node = set->nodeTab[i]; - if ((node != NULL) && - (node->type == XML_NAMESPACE_DECL)) - xmlXPathNodeSetFreeNs((xmlNsPtr) node); - } - } - break; - } - - pos += 1; - } - } - - set->nodeNr = j; - - /* If too many elements were removed, shrink table to preserve memory. */ - if ((set->nodeMax > XML_NODESET_DEFAULT) && - (set->nodeNr < set->nodeMax / 2)) { - xmlNodePtr *tmp; - int nodeMax = set->nodeNr; - - if (nodeMax < XML_NODESET_DEFAULT) - nodeMax = XML_NODESET_DEFAULT; - tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab, - nodeMax * sizeof(xmlNodePtr)); - if (tmp == NULL) { - xmlXPathPErrMemory(ctxt, "shrinking nodeset\n"); - } else { - set->nodeTab = tmp; - set->nodeMax = nodeMax; - } - } - -exit: - xpctxt->node = oldnode; - xpctxt->doc = olddoc; - xpctxt->contextSize = oldcs; - xpctxt->proximityPosition = oldpp; -} - + xmlXPathContextPtr xpctxt; + xmlNodePtr oldnode; + xmlDocPtr olddoc; + xmlXPathStepOpPtr filterOp; + int oldcs, oldpp; + int i, j, pos; + + if ((set == NULL) || (set->nodeNr == 0)) + return; + + /* + * Check if the node set contains a sufficient number of nodes for + * the requested range. + */ + if (set->nodeNr < minPos) { + xmlXPathNodeSetClear(set, hasNsNodes); + return; + } + + xpctxt = ctxt->context; + oldnode = xpctxt->node; + olddoc = xpctxt->doc; + oldcs = xpctxt->contextSize; + oldpp = xpctxt->proximityPosition; + filterOp = &ctxt->comp->steps[filterOpIndex]; + + xpctxt->contextSize = set->nodeNr; + + for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) { + xmlNodePtr node = set->nodeTab[i]; + int res; + + xpctxt->node = node; + xpctxt->proximityPosition = i + 1; + + /* + * Also set the xpath document in case things like + * key() are evaluated in the predicate. + * + * TODO: Get real doc for namespace nodes. + */ + if ((node->type != XML_NAMESPACE_DECL) && + (node->doc != NULL)) + xpctxt->doc = node->doc; + + res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1); + + if (ctxt->error != XPATH_EXPRESSION_OK) + goto exit; + if (res < 0) { + /* Shouldn't happen */ + xmlXPathErr(ctxt, XPATH_EXPR_ERROR); + goto exit; + } + + if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) { + if (i != j) { + set->nodeTab[j] = node; + set->nodeTab[i] = NULL; + } + + j += 1; + } else { + /* Remove the entry from the initial node set. */ + set->nodeTab[i] = NULL; + if (node->type == XML_NAMESPACE_DECL) + xmlXPathNodeSetFreeNs((xmlNsPtr) node); + } + + if (res != 0) { + if (pos == maxPos) { + /* Clear remaining nodes and exit loop. */ + if (hasNsNodes) { + for (i++; i < set->nodeNr; i++) { + node = set->nodeTab[i]; + if ((node != NULL) && + (node->type == XML_NAMESPACE_DECL)) + xmlXPathNodeSetFreeNs((xmlNsPtr) node); + } + } + break; + } + + pos += 1; + } + } + + set->nodeNr = j; + + /* If too many elements were removed, shrink table to preserve memory. */ + if ((set->nodeMax > XML_NODESET_DEFAULT) && + (set->nodeNr < set->nodeMax / 2)) { + xmlNodePtr *tmp; + int nodeMax = set->nodeNr; + + if (nodeMax < XML_NODESET_DEFAULT) + nodeMax = XML_NODESET_DEFAULT; + tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab, + nodeMax * sizeof(xmlNodePtr)); + if (tmp == NULL) { + xmlXPathPErrMemory(ctxt, "shrinking nodeset\n"); + } else { + set->nodeTab = tmp; + set->nodeMax = nodeMax; + } + } + +exit: + xpctxt->node = oldnode; + xpctxt->doc = olddoc; + xpctxt->contextSize = oldcs; + xpctxt->proximityPosition = oldpp; +} + #ifdef LIBXML_XPTR_ENABLED -/** - * xmlXPathLocationSetFilter: - * @ctxt: the XPath Parser context - * @locset: the location set to filter - * @filterOpIndex: the index of the predicate/filter op - * @minPos: minimum position in the filtered set (1-based) - * @maxPos: maximum position in the filtered set (1-based) - * - * Filter a location set, keeping only nodes for which the predicate - * expression matches. Afterwards, keep only nodes between minPos and maxPos - * in the filtered result. - */ -static void -xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt, - xmlLocationSetPtr locset, - int filterOpIndex, - int minPos, int maxPos) -{ - xmlXPathContextPtr xpctxt; - xmlNodePtr oldnode; - xmlDocPtr olddoc; - xmlXPathStepOpPtr filterOp; - int oldcs, oldpp; - int i, j, pos; - - if ((locset == NULL) || (locset->locNr == 0) || (filterOpIndex == -1)) - return; - - xpctxt = ctxt->context; - oldnode = xpctxt->node; - olddoc = xpctxt->doc; - oldcs = xpctxt->contextSize; - oldpp = xpctxt->proximityPosition; - filterOp = &ctxt->comp->steps[filterOpIndex]; - - xpctxt->contextSize = locset->locNr; - - for (i = 0, j = 0, pos = 1; i < locset->locNr; i++) { - xmlNodePtr contextNode = locset->locTab[i]->user; - int res; - - xpctxt->node = contextNode; - xpctxt->proximityPosition = i + 1; - - /* - * Also set the xpath document in case things like - * key() are evaluated in the predicate. - * - * TODO: Get real doc for namespace nodes. - */ - if ((contextNode->type != XML_NAMESPACE_DECL) && - (contextNode->doc != NULL)) - xpctxt->doc = contextNode->doc; - - res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1); - - if (ctxt->error != XPATH_EXPRESSION_OK) - goto exit; - if (res < 0) { - /* Shouldn't happen */ - xmlXPathErr(ctxt, XPATH_EXPR_ERROR); - goto exit; - } - - if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) { - if (i != j) { - locset->locTab[j] = locset->locTab[i]; - locset->locTab[i] = NULL; - } - - j += 1; - } else { - /* Remove the entry from the initial location set. */ - xmlXPathFreeObject(locset->locTab[i]); - locset->locTab[i] = NULL; - } - - if (res != 0) { - if (pos == maxPos) { - /* Clear remaining nodes and exit loop. */ - for (i++; i < locset->locNr; i++) { - xmlXPathFreeObject(locset->locTab[i]); +/** + * xmlXPathLocationSetFilter: + * @ctxt: the XPath Parser context + * @locset: the location set to filter + * @filterOpIndex: the index of the predicate/filter op + * @minPos: minimum position in the filtered set (1-based) + * @maxPos: maximum position in the filtered set (1-based) + * + * Filter a location set, keeping only nodes for which the predicate + * expression matches. Afterwards, keep only nodes between minPos and maxPos + * in the filtered result. + */ +static void +xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt, + xmlLocationSetPtr locset, + int filterOpIndex, + int minPos, int maxPos) +{ + xmlXPathContextPtr xpctxt; + xmlNodePtr oldnode; + xmlDocPtr olddoc; + xmlXPathStepOpPtr filterOp; + int oldcs, oldpp; + int i, j, pos; + + if ((locset == NULL) || (locset->locNr == 0) || (filterOpIndex == -1)) + return; + + xpctxt = ctxt->context; + oldnode = xpctxt->node; + olddoc = xpctxt->doc; + oldcs = xpctxt->contextSize; + oldpp = xpctxt->proximityPosition; + filterOp = &ctxt->comp->steps[filterOpIndex]; + + xpctxt->contextSize = locset->locNr; + + for (i = 0, j = 0, pos = 1; i < locset->locNr; i++) { + xmlNodePtr contextNode = locset->locTab[i]->user; + int res; + + xpctxt->node = contextNode; + xpctxt->proximityPosition = i + 1; + + /* + * Also set the xpath document in case things like + * key() are evaluated in the predicate. + * + * TODO: Get real doc for namespace nodes. + */ + if ((contextNode->type != XML_NAMESPACE_DECL) && + (contextNode->doc != NULL)) + xpctxt->doc = contextNode->doc; + + res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1); + + if (ctxt->error != XPATH_EXPRESSION_OK) + goto exit; + if (res < 0) { + /* Shouldn't happen */ + xmlXPathErr(ctxt, XPATH_EXPR_ERROR); + goto exit; + } + + if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) { + if (i != j) { + locset->locTab[j] = locset->locTab[i]; + locset->locTab[i] = NULL; + } + + j += 1; + } else { + /* Remove the entry from the initial location set. */ + xmlXPathFreeObject(locset->locTab[i]); + locset->locTab[i] = NULL; + } + + if (res != 0) { + if (pos == maxPos) { + /* Clear remaining nodes and exit loop. */ + for (i++; i < locset->locNr; i++) { + xmlXPathFreeObject(locset->locTab[i]); } - break; - } - - pos += 1; - } - } - - locset->locNr = j; - - /* If too many elements were removed, shrink table to preserve memory. */ - if ((locset->locMax > XML_NODESET_DEFAULT) && - (locset->locNr < locset->locMax / 2)) { - xmlXPathObjectPtr *tmp; - int locMax = locset->locNr; - - if (locMax < XML_NODESET_DEFAULT) - locMax = XML_NODESET_DEFAULT; - tmp = (xmlXPathObjectPtr *) xmlRealloc(locset->locTab, - locMax * sizeof(xmlXPathObjectPtr)); - if (tmp == NULL) { - xmlXPathPErrMemory(ctxt, "shrinking locset\n"); - } else { - locset->locTab = tmp; - locset->locMax = locMax; - } - } - -exit: - xpctxt->node = oldnode; - xpctxt->doc = olddoc; - xpctxt->contextSize = oldcs; - xpctxt->proximityPosition = oldpp; -} -#endif /* LIBXML_XPTR_ENABLED */ - -/** - * xmlXPathCompOpEvalPredicate: - * @ctxt: the XPath Parser context - * @op: the predicate op - * @set: the node set to filter - * @minPos: minimum position in the filtered set (1-based) - * @maxPos: maximum position in the filtered set (1-based) - * @hasNsNodes: true if the node set may contain namespace nodes - * - * Filter a node set, keeping only nodes for which the sequence of predicate - * expressions matches. Afterwards, keep only nodes between minPos and maxPos - * in the filtered result. - */ -static void -xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt, - xmlXPathStepOpPtr op, - xmlNodeSetPtr set, - int minPos, int maxPos, - int hasNsNodes) -{ - if (op->ch1 != -1) { - xmlXPathCompExprPtr comp = ctxt->comp; + break; + } + + pos += 1; + } + } + + locset->locNr = j; + + /* If too many elements were removed, shrink table to preserve memory. */ + if ((locset->locMax > XML_NODESET_DEFAULT) && + (locset->locNr < locset->locMax / 2)) { + xmlXPathObjectPtr *tmp; + int locMax = locset->locNr; + + if (locMax < XML_NODESET_DEFAULT) + locMax = XML_NODESET_DEFAULT; + tmp = (xmlXPathObjectPtr *) xmlRealloc(locset->locTab, + locMax * sizeof(xmlXPathObjectPtr)); + if (tmp == NULL) { + xmlXPathPErrMemory(ctxt, "shrinking locset\n"); + } else { + locset->locTab = tmp; + locset->locMax = locMax; + } + } + +exit: + xpctxt->node = oldnode; + xpctxt->doc = olddoc; + xpctxt->contextSize = oldcs; + xpctxt->proximityPosition = oldpp; +} +#endif /* LIBXML_XPTR_ENABLED */ + +/** + * xmlXPathCompOpEvalPredicate: + * @ctxt: the XPath Parser context + * @op: the predicate op + * @set: the node set to filter + * @minPos: minimum position in the filtered set (1-based) + * @maxPos: maximum position in the filtered set (1-based) + * @hasNsNodes: true if the node set may contain namespace nodes + * + * Filter a node set, keeping only nodes for which the sequence of predicate + * expressions matches. Afterwards, keep only nodes between minPos and maxPos + * in the filtered result. + */ +static void +xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + xmlNodeSetPtr set, + int minPos, int maxPos, + int hasNsNodes) +{ + if (op->ch1 != -1) { + xmlXPathCompExprPtr comp = ctxt->comp; /* - * Process inner predicates first. + * Process inner predicates first. */ - if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompOpEvalPredicate: Expected a predicate\n"); - XP_ERROR(XPATH_INVALID_OPERAND); - } - if (ctxt->context->depth >= ctxt->context->maxDepth) - XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED); - ctxt->context->depth += 1; - xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set, - 1, set->nodeNr, hasNsNodes); - ctxt->context->depth -= 1; - CHECK_ERROR; - } - - if (op->ch2 != -1) - xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes); + if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEvalPredicate: Expected a predicate\n"); + XP_ERROR(XPATH_INVALID_OPERAND); + } + if (ctxt->context->depth >= ctxt->context->maxDepth) + XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED); + ctxt->context->depth += 1; + xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set, + 1, set->nodeNr, hasNsNodes); + ctxt->context->depth -= 1; + CHECK_ERROR; + } + + if (op->ch2 != -1) + xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes); } static int @@ -11893,7 +11893,7 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt, * 1) For predicates (XPATH_OP_PREDICATE): * - an inner predicate operator * 2) For filters (XPATH_OP_FILTER): - * - an inner filter operator OR + * - an inner filter operator OR * - an expression selecting the node set. * E.g. "key('a', 'b')" or "(//foo | //bar)". */ @@ -11910,8 +11910,8 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt, (exprOp->value4 != NULL) && (((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER)) { - double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval; - + double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval; + /* * We have a "[n]" predicate here. * TODO: Unfortunately this simplistic test here is not @@ -11923,11 +11923,11 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt, * Maybe we could rewrite the AST to ease the optimization. */ - if ((floatval > INT_MIN) && (floatval < INT_MAX)) { - *maxPos = (int) floatval; - if (floatval == (double) *maxPos) - return(1); - } + if ((floatval > INT_MIN) && (floatval < INT_MAX)) { + *maxPos = (int) floatval; + if (floatval == (double) *maxPos) + return(1); + } } return(0); } @@ -11991,7 +11991,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, /* First predicate operator */ xmlXPathStepOpPtr predOp; int maxPos; /* The requested position() (when a "[n]" predicate) */ - int hasPredicateRange, hasAxisRange, pos; + int hasPredicateRange, hasAxisRange, pos; int breakOnFirstHit; xmlXPathTraversalFunction next = NULL; @@ -12184,7 +12184,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, if (seq == NULL) { seq = xmlXPathNodeSetCreate(NULL); if (seq == NULL) { - /* TODO: Propagate memory error. */ + /* TODO: Propagate memory error. */ total = 0; goto error; } @@ -12196,9 +12196,9 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, cur = NULL; hasNsNodes = 0; do { - if (OP_LIMIT_EXCEEDED(ctxt, 1)) - goto error; - + if (OP_LIMIT_EXCEEDED(ctxt, 1)) + goto error; + cur = next(ctxt, cur); if (cur == NULL) break; @@ -12260,19 +12260,19 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, case XML_TEXT_NODE: XP_TEST_HIT break; - case XML_NAMESPACE_DECL: { - if (axis == AXIS_NAMESPACE) { - XP_TEST_HIT_NS - } else { - hasNsNodes = 1; - XP_TEST_HIT - } - break; - } + case XML_NAMESPACE_DECL: { + if (axis == AXIS_NAMESPACE) { + XP_TEST_HIT_NS + } else { + hasNsNodes = 1; + XP_TEST_HIT + } + break; + } default: break; } - } else if (cur->type == (xmlElementType) type) { + } else if (cur->type == (xmlElementType) type) { if (cur->type == XML_NAMESPACE_DECL) XP_TEST_HIT_NS else @@ -12406,8 +12406,8 @@ axis_range_end: /* ----------------------------------------------------- */ outSeq = seq; seq = NULL; } else - /* TODO: Check memory error. */ - outSeq = mergeAndClear(outSeq, seq); + /* TODO: Check memory error. */ + outSeq = mergeAndClear(outSeq, seq); /* * Break if only a true/false result was requested. */ @@ -12424,8 +12424,8 @@ first_hit: /* ---------------------------------------------------------- */ outSeq = seq; seq = NULL; } else - /* TODO: Check memory error. */ - outSeq = mergeAndClear(outSeq, seq); + /* TODO: Check memory error. */ + outSeq = mergeAndClear(outSeq, seq); break; #ifdef DEBUG_STEP @@ -12470,19 +12470,19 @@ apply_predicates: /* --------------------------------------------------- */ * function: xmlXPathCompOpEvalPredicate(). */ if (hasPredicateRange != 0) - xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos, - hasNsNodes); + xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos, + hasNsNodes); else - xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr, - hasNsNodes); + xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr, + hasNsNodes); if (ctxt->error != XPATH_EXPRESSION_OK) { total = 0; goto error; } - } - - if (seq->nodeNr > 0) { + } + + if (seq->nodeNr > 0) { /* * Add to result set. */ @@ -12490,12 +12490,12 @@ apply_predicates: /* --------------------------------------------------- */ outSeq = seq; seq = NULL; } else { - /* TODO: Check memory error. */ - outSeq = mergeAndClear(outSeq, seq); + /* TODO: Check memory error. */ + outSeq = mergeAndClear(outSeq, seq); } - - if (toBool) - break; + + if (toBool) + break; } } @@ -12514,13 +12514,13 @@ error: xmlXPathReleaseObject(xpctxt, obj); /* - * Ensure we return at least an empty set. + * Ensure we return at least an empty set. */ if (outSeq == NULL) { if ((seq != NULL) && (seq->nodeNr == 0)) outSeq = seq; else - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ outSeq = xmlXPathNodeSetCreate(NULL); } if ((seq != NULL) && (seq != outSeq)) { @@ -12535,14 +12535,14 @@ error: * Reset the context node. */ xpctxt->node = oldContextNode; - /* - * When traversing the namespace axis in "toBool" mode, it's - * possible that tmpNsList wasn't freed. - */ - if (xpctxt->tmpNsList != NULL) { - xmlFree(xpctxt->tmpNsList); - xpctxt->tmpNsList = NULL; - } + /* + * When traversing the namespace axis in "toBool" mode, it's + * possible that tmpNsList wasn't freed. + */ + if (xpctxt->tmpNsList != NULL) { + xmlFree(xpctxt->tmpNsList); + xpctxt->tmpNsList = NULL; + } #ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, @@ -12577,15 +12577,15 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr arg1, arg2; CHECK_ERROR0; - if (OP_LIMIT_EXCEEDED(ctxt, 1)) - return(0); - if (ctxt->context->depth >= ctxt->context->maxDepth) - XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); - ctxt->context->depth += 1; + if (OP_LIMIT_EXCEEDED(ctxt, 1)) + return(0); + if (ctxt->context->depth >= ctxt->context->maxDepth) + XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); + ctxt->context->depth += 1; comp = ctxt->comp; switch (op->op) { case XPATH_OP_END: - break; + break; case XPATH_OP_UNION: total = xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1], @@ -12599,11 +12599,11 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, * limit tree traversing to first node in the result */ /* - * OPTIMIZE TODO: This implicitly sorts + * OPTIMIZE TODO: This implicitly sorts * the result, even if not needed. E.g. if the argument * of the count() function, no sorting is needed. * OPTIMIZE TODO: How do we know if the node-list wasn't - * already sorted? + * already sorted? */ if (ctxt->value->nodesetval->nodeNr > 1) xmlXPathNodeSetSort(ctxt->value->nodesetval); @@ -12613,28 +12613,28 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2], first); CHECK_ERROR0; - + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); - if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || - (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - XP_ERROR0(XPATH_INVALID_TYPE); - } - if ((ctxt->context->opLimit != 0) && - (((arg1->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg1->nodesetval->nodeNr) < 0)) || - ((arg2->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg2->nodesetval->nodeNr) < 0)))) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - break; - } - - /* TODO: Check memory error. */ + if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || + (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + XP_ERROR0(XPATH_INVALID_TYPE); + } + if ((ctxt->context->opLimit != 0) && + (((arg1->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg1->nodesetval->nodeNr) < 0)) || + ((arg2->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg2->nodesetval->nodeNr) < 0)))) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + break; + } + + /* TODO: Check memory error. */ arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval, arg2->nodesetval); valuePush(ctxt, arg1); @@ -12642,11 +12642,11 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, /* optimizer */ if (total > cur) xmlXPathCompSwap(op); - total += cur; - break; + total += cur; + break; case XPATH_OP_ROOT: xmlXPathRoot(ctxt); - break; + break; case XPATH_OP_NODE: if (op->ch1 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -12656,22 +12656,22 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, CHECK_ERROR0; valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node)); - break; + break; case XPATH_OP_COLLECT:{ if (op->ch1 == -1) - break; + break; total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0); - break; + break; } case XPATH_OP_VALUE: valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt->context, (xmlXPathObjectPtr) op->value4)); - break; + break; case XPATH_OP_SORT: if (op->ch1 != -1) total += @@ -12683,19 +12683,19 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, && (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeNr > 1)) xmlXPathNodeSetSort(ctxt->value->nodesetval); - break; + break; #ifdef XP_OPTIMIZED_FILTER_FIRST case XPATH_OP_FILTER: total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first); - break; + break; #endif default: - total += xmlXPathCompOpEval(ctxt, op); - break; + total += xmlXPathCompOpEval(ctxt, op); + break; } - - ctxt->context->depth -= 1; - return(total); + + ctxt->context->depth -= 1; + return(total); } /** @@ -12718,15 +12718,15 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, xmlXPathObjectPtr arg1, arg2; CHECK_ERROR0; - if (OP_LIMIT_EXCEEDED(ctxt, 1)) - return(0); - if (ctxt->context->depth >= ctxt->context->maxDepth) - XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); - ctxt->context->depth += 1; + if (OP_LIMIT_EXCEEDED(ctxt, 1)) + return(0); + if (ctxt->context->depth >= ctxt->context->maxDepth) + XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); + ctxt->context->depth += 1; comp = ctxt->comp; switch (op->op) { case XPATH_OP_END: - break; + break; case XPATH_OP_UNION: total = xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last); @@ -12753,28 +12753,28 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, && (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */ } - + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); - if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || - (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - XP_ERROR0(XPATH_INVALID_TYPE); - } - if ((ctxt->context->opLimit != 0) && - (((arg1->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg1->nodesetval->nodeNr) < 0)) || - ((arg2->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg2->nodesetval->nodeNr) < 0)))) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - break; - } - - /* TODO: Check memory error. */ + if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || + (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + XP_ERROR0(XPATH_INVALID_TYPE); + } + if ((ctxt->context->opLimit != 0) && + (((arg1->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg1->nodesetval->nodeNr) < 0)) || + ((arg2->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg2->nodesetval->nodeNr) < 0)))) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + break; + } + + /* TODO: Check memory error. */ arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval, arg2->nodesetval); valuePush(ctxt, arg1); @@ -12782,11 +12782,11 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, /* optimizer */ if (total > cur) xmlXPathCompSwap(op); - total += cur; - break; + total += cur; + break; case XPATH_OP_ROOT: xmlXPathRoot(ctxt); - break; + break; case XPATH_OP_NODE: if (op->ch1 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -12796,22 +12796,22 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, CHECK_ERROR0; valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node)); - break; + break; case XPATH_OP_COLLECT:{ if (op->ch1 == -1) - break; + break; total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0); - break; + break; } case XPATH_OP_VALUE: valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt->context, (xmlXPathObjectPtr) op->value4)); - break; + break; case XPATH_OP_SORT: if (op->ch1 != -1) total += @@ -12823,14 +12823,14 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, && (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeNr > 1)) xmlXPathNodeSetSort(ctxt->value->nodesetval); - break; + break; default: - total += xmlXPathCompOpEval(ctxt, op); - break; + total += xmlXPathCompOpEval(ctxt, op); + break; } - - ctxt->context->depth -= 1; - return (total); + + ctxt->context->depth -= 1; + return (total); } #ifdef XP_OPTIMIZED_FILTER_FIRST @@ -12840,7 +12840,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt, { int total = 0; xmlXPathCompExprPtr comp; - xmlNodeSetPtr set; + xmlNodeSetPtr set; CHECK_ERROR0; comp = ctxt->comp; @@ -12875,7 +12875,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt, (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeTab != NULL) && (ctxt->value->nodesetval->nodeNr > 1)) { - xmlXPathNodeSetKeepLast(ctxt->value->nodesetval); + xmlXPathNodeSetKeepLast(ctxt->value->nodesetval); *first = *(ctxt->value->nodesetval->nodeTab); } return (total); @@ -12895,27 +12895,27 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt, * Hum are we filtering the result of an XPointer expression */ if (ctxt->value->type == XPATH_LOCATIONSET) { - xmlLocationSetPtr locset = ctxt->value->user; + xmlLocationSetPtr locset = ctxt->value->user; - if (locset != NULL) { - xmlXPathLocationSetFilter(ctxt, locset, op->ch2, 1, 1); - if (locset->locNr > 0) - *first = (xmlNodePtr) locset->locTab[0]->user; - } + if (locset != NULL) { + xmlXPathLocationSetFilter(ctxt, locset, op->ch2, 1, 1); + if (locset->locNr > 0) + *first = (xmlNodePtr) locset->locTab[0]->user; + } return (total); } #endif /* LIBXML_XPTR_ENABLED */ CHECK_TYPE0(XPATH_NODESET); - set = ctxt->value->nodesetval; - if (set != NULL) { - xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1); - if (set->nodeNr > 0) - *first = set->nodeTab[0]; - } + set = ctxt->value->nodesetval; + if (set != NULL) { + xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1); + if (set->nodeNr > 0) + *first = set->nodeTab[0]; + } - return (total); + return (total); } #endif /* XP_OPTIMIZED_FILTER_FIRST */ @@ -12936,49 +12936,49 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathObjectPtr arg1, arg2; CHECK_ERROR0; - if (OP_LIMIT_EXCEEDED(ctxt, 1)) - return(0); - if (ctxt->context->depth >= ctxt->context->maxDepth) - XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); - ctxt->context->depth += 1; + if (OP_LIMIT_EXCEEDED(ctxt, 1)) + return(0); + if (ctxt->context->depth >= ctxt->context->maxDepth) + XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED); + ctxt->context->depth += 1; comp = ctxt->comp; switch (op->op) { case XPATH_OP_END: - break; + break; case XPATH_OP_AND: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; xmlXPathBooleanFunction(ctxt, 1); if ((ctxt->value == NULL) || (ctxt->value->boolval == 0)) - break; + break; arg2 = valuePop(ctxt); total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error) { xmlXPathFreeObject(arg2); - break; + break; } xmlXPathBooleanFunction(ctxt, 1); - if (ctxt->value != NULL) - ctxt->value->boolval &= arg2->boolval; + if (ctxt->value != NULL) + ctxt->value->boolval &= arg2->boolval; xmlXPathReleaseObject(ctxt->context, arg2); - break; + break; case XPATH_OP_OR: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; xmlXPathBooleanFunction(ctxt, 1); if ((ctxt->value == NULL) || (ctxt->value->boolval == 1)) - break; + break; arg2 = valuePop(ctxt); total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error) { xmlXPathFreeObject(arg2); - break; + break; } xmlXPathBooleanFunction(ctxt, 1); - if (ctxt->value != NULL) - ctxt->value->boolval |= arg2->boolval; + if (ctxt->value != NULL) + ctxt->value->boolval |= arg2->boolval; xmlXPathReleaseObject(ctxt->context, arg2); - break; + break; case XPATH_OP_EQUAL: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; @@ -12989,7 +12989,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) else equal = xmlXPathNotEqualValues(ctxt); valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt->context, equal)); - break; + break; case XPATH_OP_CMP: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; @@ -12997,7 +12997,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) CHECK_ERROR0; ret = xmlXPathCompareValues(ctxt, op->value, op->value2); valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt->context, ret)); - break; + break; case XPATH_OP_PLUS: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; @@ -13015,7 +13015,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) CAST_TO_NUMBER; CHECK_TYPE0(XPATH_NUMBER); } - break; + break; case XPATH_OP_MULT: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; @@ -13027,48 +13027,48 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathDivValues(ctxt); else if (op->value == 2) xmlXPathModValues(ctxt); - break; + break; case XPATH_OP_UNION: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; - + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); - if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || - (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - XP_ERROR0(XPATH_INVALID_TYPE); - } - if ((ctxt->context->opLimit != 0) && - (((arg1->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg1->nodesetval->nodeNr) < 0)) || - ((arg2->nodesetval != NULL) && - (xmlXPathCheckOpLimit(ctxt, - arg2->nodesetval->nodeNr) < 0)))) { - xmlXPathReleaseObject(ctxt->context, arg1); - xmlXPathReleaseObject(ctxt->context, arg2); - break; - } + if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || + (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + XP_ERROR0(XPATH_INVALID_TYPE); + } + if ((ctxt->context->opLimit != 0) && + (((arg1->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg1->nodesetval->nodeNr) < 0)) || + ((arg2->nodesetval != NULL) && + (xmlXPathCheckOpLimit(ctxt, + arg2->nodesetval->nodeNr) < 0)))) { + xmlXPathReleaseObject(ctxt->context, arg1); + xmlXPathReleaseObject(ctxt->context, arg2); + break; + } if ((arg1->nodesetval == NULL) || ((arg2->nodesetval != NULL) && (arg2->nodesetval->nodeNr != 0))) { - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval, arg2->nodesetval); } valuePush(ctxt, arg1); xmlXPathReleaseObject(ctxt->context, arg2); - break; + break; case XPATH_OP_ROOT: xmlXPathRoot(ctxt); - break; + break; case XPATH_OP_NODE: if (op->ch1 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -13078,22 +13078,22 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) CHECK_ERROR0; valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node)); - break; + break; case XPATH_OP_COLLECT:{ if (op->ch1 == -1) - break; + break; total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0); - break; + break; } case XPATH_OP_VALUE: valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt->context, (xmlXPathObjectPtr) op->value4)); - break; + break; case XPATH_OP_VARIABLE:{ xmlXPathObjectPtr val; @@ -13102,8 +13102,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); if (op->value5 == NULL) { val = xmlXPathVariableLookup(ctxt->context, op->value4); - if (val == NULL) - XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + if (val == NULL) + XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); valuePush(ctxt, val); } else { const xmlChar *URI; @@ -13114,15 +13114,15 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) "xmlXPathCompOpEval: variable %s bound to undefined prefix %s\n", (char *) op->value4, (char *)op->value5); ctxt->error = XPATH_UNDEF_PREFIX_ERROR; - break; + break; } val = xmlXPathVariableLookupNS(ctxt->context, op->value4, URI); - if (val == NULL) - XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + if (val == NULL) + XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); valuePush(ctxt, val); } - break; + break; } case XPATH_OP_FUNCTION:{ xmlXPathFunction func; @@ -13136,7 +13136,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); if (ctxt->error != XPATH_EXPRESSION_OK) { xmlXPathPopFrame(ctxt, frame); - break; + break; } } if (ctxt->valueNr < ctxt->valueFrame + op->value) { @@ -13144,7 +13144,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) "xmlXPathCompOpEval: parameter error\n"); ctxt->error = XPATH_INVALID_OPERAND; xmlXPathPopFrame(ctxt, frame); - break; + break; } for (i = 0; i < op->value; i++) { if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL) { @@ -13152,11 +13152,11 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) "xmlXPathCompOpEval: parameter error\n"); ctxt->error = XPATH_INVALID_OPERAND; xmlXPathPopFrame(ctxt, frame); - break; + break; } } if (op->cache != NULL) - func = op->cache; + func = op->cache; else { const xmlChar *URI = NULL; @@ -13172,7 +13172,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) (char *)op->value4, (char *)op->value5); xmlXPathPopFrame(ctxt, frame); ctxt->error = XPATH_UNDEF_PREFIX_ERROR; - break; + break; } func = xmlXPathFunctionLookupNS(ctxt->context, op->value4, URI); @@ -13183,7 +13183,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) (char *)op->value4); XP_ERROR0(XPATH_UNKNOWN_FUNC_ERROR); } - op->cache = func; + op->cache = func; op->cacheURI = (void *) URI; } oldFunc = ctxt->context->function; @@ -13193,11 +13193,11 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) func(ctxt, op->value); ctxt->context->function = oldFunc; ctxt->context->functionURI = oldFuncURI; - if ((ctxt->error == XPATH_EXPRESSION_OK) && - (ctxt->valueNr != ctxt->valueFrame + 1)) - XP_ERROR0(XPATH_STACK_ERROR); + if ((ctxt->error == XPATH_EXPRESSION_OK) && + (ctxt->valueNr != ctxt->valueFrame + 1)) + XP_ERROR0(XPATH_STACK_ERROR); xmlXPathPopFrame(ctxt, frame); - break; + break; } case XPATH_OP_ARG: if (op->ch1 != -1) { @@ -13208,10 +13208,10 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; } - break; + break; case XPATH_OP_PREDICATE: case XPATH_OP_FILTER:{ - xmlNodeSetPtr set; + xmlNodeSetPtr set; /* * Optimization for ()[1] selection i.e. the first elem @@ -13223,7 +13223,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) * will result in an ordered list if we have an * XPATH_OP_FILTER? * What about an additional field or flag on - * xmlXPathObject like @sorted ? This way we wouldn't need + * xmlXPathObject like @sorted ? This way we wouldn't need * to assume anything, so it would be more robust and * easier to optimize. */ @@ -13253,9 +13253,9 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) (ctxt->value->type == XPATH_NODESET) && (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeNr > 1)) - xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval, - 1, 1); - break; + xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval, + 1, 1); + break; } } /* @@ -13288,9 +13288,9 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) (ctxt->value->type == XPATH_NODESET) && (ctxt->value->nodesetval != NULL) && (ctxt->value->nodesetval->nodeTab != NULL) && - (ctxt->value->nodesetval->nodeNr > 1)) - xmlXPathNodeSetKeepLast(ctxt->value->nodesetval); - break; + (ctxt->value->nodesetval->nodeNr > 1)) + xmlXPathNodeSetKeepLast(ctxt->value->nodesetval); + break; } } /* @@ -13309,28 +13309,28 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; if (op->ch2 == -1) - break; + break; if (ctxt->value == NULL) - break; + break; #ifdef LIBXML_XPTR_ENABLED /* * Hum are we filtering the result of an XPointer expression */ if (ctxt->value->type == XPATH_LOCATIONSET) { - xmlLocationSetPtr locset = ctxt->value->user; - xmlXPathLocationSetFilter(ctxt, locset, op->ch2, - 1, locset->locNr); - break; + xmlLocationSetPtr locset = ctxt->value->user; + xmlXPathLocationSetFilter(ctxt, locset, op->ch2, + 1, locset->locNr); + break; } #endif /* LIBXML_XPTR_ENABLED */ CHECK_TYPE0(XPATH_NODESET); - set = ctxt->value->nodesetval; - if (set != NULL) - xmlXPathNodeSetFilter(ctxt, set, op->ch2, - 1, set->nodeNr, 1); - break; + set = ctxt->value->nodesetval; + if (set != NULL) + xmlXPathNodeSetFilter(ctxt, set, op->ch2, + 1, set->nodeNr, 1); + break; } case XPATH_OP_SORT: if (op->ch1 != -1) @@ -13343,7 +13343,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) { xmlXPathNodeSetSort(ctxt->value->nodesetval); } - break; + break; #ifdef LIBXML_XPTR_ENABLED case XPATH_OP_RANGETO:{ xmlXPathObjectPtr range; @@ -13352,21 +13352,21 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlLocationSetPtr newlocset = NULL; xmlLocationSetPtr oldlocset; xmlNodeSetPtr oldset; - xmlNodePtr oldnode = ctxt->context->node; - int oldcs = ctxt->context->contextSize; - int oldpp = ctxt->context->proximityPosition; + xmlNodePtr oldnode = ctxt->context->node; + int oldcs = ctxt->context->contextSize; + int oldpp = ctxt->context->proximityPosition; int i, j; - if (op->ch1 != -1) { + if (op->ch1 != -1) { total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); - CHECK_ERROR0; - } - if (ctxt->value == NULL) { - XP_ERROR0(XPATH_INVALID_OPERAND); - } + CHECK_ERROR0; + } + if (ctxt->value == NULL) { + XP_ERROR0(XPATH_INVALID_OPERAND); + } if (op->ch2 == -1) - break; + break; if (ctxt->value->type == XPATH_LOCATIONSET) { /* @@ -13375,11 +13375,11 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) * up a new locset. */ CHECK_TYPE0(XPATH_LOCATIONSET); - - if ((ctxt->value->user == NULL) || - (((xmlLocationSetPtr) ctxt->value->user)->locNr == 0)) - break; - + + if ((ctxt->value->user == NULL) || + (((xmlLocationSetPtr) ctxt->value->user)->locNr == 0)) + break; + obj = valuePop(ctxt); oldlocset = obj->user; @@ -13402,8 +13402,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error != XPATH_EXPRESSION_OK) { - xmlXPtrFreeLocationSet(newlocset); - goto rangeto_error; + xmlXPtrFreeLocationSet(newlocset); + goto rangeto_error; } res = valuePop(ctxt); @@ -13465,8 +13465,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error != XPATH_EXPRESSION_OK) { - xmlXPtrFreeLocationSet(newlocset); - goto rangeto_error; + xmlXPtrFreeLocationSet(newlocset); + goto rangeto_error; } res = valuePop(ctxt); @@ -13494,23 +13494,23 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) /* * The result is used as the new evaluation set. */ - valuePush(ctxt, xmlXPtrWrapLocationSet(newlocset)); -rangeto_error: + valuePush(ctxt, xmlXPtrWrapLocationSet(newlocset)); +rangeto_error: xmlXPathReleaseObject(ctxt->context, obj); - ctxt->context->node = oldnode; - ctxt->context->contextSize = oldcs; - ctxt->context->proximityPosition = oldpp; - break; + ctxt->context->node = oldnode; + ctxt->context->contextSize = oldcs; + ctxt->context->proximityPosition = oldpp; + break; } #endif /* LIBXML_XPTR_ENABLED */ - default: - xmlGenericError(xmlGenericErrorContext, - "XPath: unknown precompiled operation %d\n", op->op); - ctxt->error = XPATH_INVALID_OPERAND; - break; - } - - ctxt->context->depth -= 1; + default: + xmlGenericError(xmlGenericErrorContext, + "XPath: unknown precompiled operation %d\n", op->op); + ctxt->error = XPATH_INVALID_OPERAND; + break; + } + + ctxt->context->depth -= 1; return (total); } @@ -13530,8 +13530,8 @@ xmlXPathCompOpEvalToBoolean(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr resObj = NULL; start: - if (OP_LIMIT_EXCEEDED(ctxt, 1)) - return(0); + if (OP_LIMIT_EXCEEDED(ctxt, 1)) + return(0); /* comp = ctxt->comp; */ switch (op->op) { case XPATH_OP_END: @@ -13658,14 +13658,14 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp, /* Select "/" */ if (toBool) return(1); - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, (xmlNodePtr) ctxt->doc); } else { /* Select "self::node()" */ if (toBool) return(1); - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, ctxt->node); } } @@ -13726,7 +13726,7 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp, } else if (ret == 1) { if (toBool) goto return_1; - /* TODO: Check memory error. */ + /* TODO: Check memory error. */ xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur); } } @@ -13734,16 +13734,16 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp, goto scan_children; next_node: do { - if (ctxt->opLimit != 0) { - if (ctxt->opCount >= ctxt->opLimit) { - xmlGenericError(xmlGenericErrorContext, - "XPath operation limit exceeded\n"); - xmlFreeStreamCtxt(patstream); - return(-1); - } - ctxt->opCount++; - } - + if (ctxt->opLimit != 0) { + if (ctxt->opCount >= ctxt->opLimit) { + xmlGenericError(xmlGenericErrorContext, + "XPath operation limit exceeded\n"); + xmlFreeStreamCtxt(patstream); + return(-1); + } + ctxt->opCount++; + } + nb_nodes++; switch (cur->type) { @@ -13867,8 +13867,8 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool) if ((ctxt == NULL) || (ctxt->comp == NULL)) return(-1); - ctxt->context->depth = 0; - + ctxt->context->depth = 0; + if (ctxt->valueTab == NULL) { /* Allocate the value stack */ ctxt->valueTab = (xmlXPathObjectPtr *) @@ -14055,7 +14055,7 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { /* * We don't try to handle expressions using the verbose axis - * specifiers ("::"), just the simplified form at this point. + * specifiers ("::"), just the simplified form at this point. * Additionally, if there is no list of namespaces available and * there's a ":" in the expression, indicating a prefixed QName, * then we won't try to compile either. xmlPatterncompile() needs @@ -14109,12 +14109,12 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { #endif /* XPATH_STREAMING */ static void -xmlXPathOptimizeExpression(xmlXPathParserContextPtr pctxt, - xmlXPathStepOpPtr op) +xmlXPathOptimizeExpression(xmlXPathParserContextPtr pctxt, + xmlXPathStepOpPtr op) { - xmlXPathCompExprPtr comp = pctxt->comp; - xmlXPathContextPtr ctxt; - + xmlXPathCompExprPtr comp = pctxt->comp; + xmlXPathContextPtr ctxt; + /* * Try to rewrite "descendant-or-self::node()/foo" to an optimized * internal representation. @@ -14165,23 +14165,23 @@ xmlXPathOptimizeExpression(xmlXPathParserContextPtr pctxt, } } - /* OP_VALUE has invalid ch1. */ - if (op->op == XPATH_OP_VALUE) - return; - + /* OP_VALUE has invalid ch1. */ + if (op->op == XPATH_OP_VALUE) + return; + /* Recurse */ - ctxt = pctxt->context; - if (ctxt != NULL) { - if (ctxt->depth >= ctxt->maxDepth) - return; - ctxt->depth += 1; - } + ctxt = pctxt->context; + if (ctxt != NULL) { + if (ctxt->depth >= ctxt->maxDepth) + return; + ctxt->depth += 1; + } if (op->ch1 != -1) - xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]); + xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]); if (op->ch2 != -1) - xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]); - if (ctxt != NULL) - ctxt->depth -= 1; + xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]); + if (ctxt != NULL) + ctxt->depth -= 1; } /** @@ -14210,8 +14210,8 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { pctxt = xmlXPathNewParserContext(str, ctxt); if (pctxt == NULL) return NULL; - if (ctxt != NULL) - ctxt->depth = 0; + if (ctxt != NULL) + ctxt->depth = 0; xmlXPathCompileExpr(pctxt, 1); if( pctxt->error != XPATH_EXPRESSION_OK ) @@ -14231,11 +14231,11 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { comp = NULL; } else { comp = pctxt->comp; - if ((comp->nbStep > 1) && (comp->last >= 0)) { - if (ctxt != NULL) - ctxt->depth = 0; - xmlXPathOptimizeExpression(pctxt, &comp->steps[comp->last]); - } + if ((comp->nbStep > 1) && (comp->last >= 0)) { + if (ctxt != NULL) + ctxt->depth = 0; + xmlXPathOptimizeExpression(pctxt, &comp->steps[comp->last]); + } pctxt->comp = NULL; } xmlXPathFreeParserContext(pctxt); @@ -14280,11 +14280,11 @@ xmlXPathCompile(const xmlChar *str) { static int xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt, - xmlXPathObjectPtr *resObjPtr, + xmlXPathObjectPtr *resObjPtr, int toBool) { xmlXPathParserContextPtr pctxt; - xmlXPathObjectPtr resObj; + xmlXPathObjectPtr resObj; #ifndef LIBXML_THREAD_ENABLED static int reentance = 0; #endif @@ -14312,25 +14312,25 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp, pctxt = xmlXPathCompParserContext(comp, ctxt); res = xmlXPathRunEval(pctxt, toBool); - if (pctxt->error != XPATH_EXPRESSION_OK) { - resObj = NULL; - } else { - resObj = valuePop(pctxt); - if (resObj == NULL) { - if (!toBool) - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompiledEval: No result on the stack.\n"); - } else if (pctxt->valueNr > 0) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompiledEval: %d object(s) left on the stack.\n", - pctxt->valueNr); - } - } - - if (resObjPtr) - *resObjPtr = resObj; - else - xmlXPathReleaseObject(ctxt, resObj); + if (pctxt->error != XPATH_EXPRESSION_OK) { + resObj = NULL; + } else { + resObj = valuePop(pctxt); + if (resObj == NULL) { + if (!toBool) + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompiledEval: No result on the stack.\n"); + } else if (pctxt->valueNr > 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompiledEval: %d object(s) left on the stack.\n", + pctxt->valueNr); + } + } + + if (resObjPtr) + *resObjPtr = resObj; + else + xmlXPathReleaseObject(ctxt, resObj); pctxt->comp = NULL; xmlXPathFreeParserContext(pctxt); @@ -14402,23 +14402,23 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) { } else #endif { - if (ctxt->context != NULL) - ctxt->context->depth = 0; + if (ctxt->context != NULL) + ctxt->context->depth = 0; xmlXPathCompileExpr(ctxt, 1); - CHECK_ERROR; - - /* Check for trailing characters. */ - if (*ctxt->cur != 0) - XP_ERROR(XPATH_EXPR_ERROR); - - if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) { - if (ctxt->context != NULL) - ctxt->context->depth = 0; - xmlXPathOptimizeExpression(ctxt, + CHECK_ERROR; + + /* Check for trailing characters. */ + if (*ctxt->cur != 0) + XP_ERROR(XPATH_EXPR_ERROR); + + if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) { + if (ctxt->context != NULL) + ctxt->context->depth = 0; + xmlXPathOptimizeExpression(ctxt, &ctxt->comp->steps[ctxt->comp->last]); - } + } } - + xmlXPathRunEval(ctxt, 0); } @@ -14435,7 +14435,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) { xmlXPathObjectPtr xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) { xmlXPathParserContextPtr ctxt; - xmlXPathObjectPtr res; + xmlXPathObjectPtr res; CHECK_CTXT(ctx) @@ -14446,17 +14446,17 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) { return NULL; xmlXPathEvalExpr(ctxt); - if (ctxt->error != XPATH_EXPRESSION_OK) { + if (ctxt->error != XPATH_EXPRESSION_OK) { res = NULL; } else { res = valuePop(ctxt); - if (res == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompiledEval: No result on the stack.\n"); - } else if (ctxt->valueNr > 0) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompiledEval: %d object(s) left on the stack.\n", - ctxt->valueNr); + if (res == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompiledEval: No result on the stack.\n"); + } else if (ctxt->valueNr > 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompiledEval: %d object(s) left on the stack.\n", + ctxt->valueNr); } } @@ -14512,14 +14512,14 @@ xmlXPathNodeEval(xmlNodePtr node, const xmlChar *str, xmlXPathContextPtr ctx) { * @str: the XPath expression * @ctxt: the XPath context * - * Alias for xmlXPathEval(). + * Alias for xmlXPathEval(). * * Returns the xmlXPathObjectPtr resulting from the evaluation or NULL. * the caller has to free the object. */ xmlXPathObjectPtr xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt) { - return(xmlXPathEval(str, ctxt)); + return(xmlXPathEval(str, ctxt)); } /************************************************************************ diff --git a/contrib/libs/libxml/xpointer.c b/contrib/libs/libxml/xpointer.c index 587a2071ac..c1732a584a 100644 --- a/contrib/libs/libxml/xpointer.c +++ b/contrib/libs/libxml/xpointer.c @@ -14,11 +14,11 @@ * daniel@veillard.com */ -/* To avoid EBCDIC trouble when parsing on zOS */ -#if defined(__MVS__) -#pragma convert("ISO8859-1") -#endif - +/* To avoid EBCDIC trouble when parsing on zOS */ +#if defined(__MVS__) +#pragma convert("ISO8859-1") +#endif + #define IN_LIBXML #include "libxml.h" @@ -27,7 +27,7 @@ * be parsed beforehand instead of a progressive evaluation * TODO: Access into entities references are not supported now ... * need a start to be able to pop out of entities refs since - * parent is the entity declaration, not the ref. + * parent is the entity declaration, not the ref. */ #include <string.h> @@ -90,7 +90,7 @@ xmlXPtrErrMemory(const char *extra) * * Handle a redefinition of attribute error */ -static void LIBXML_ATTR_FORMAT(3,0) +static void LIBXML_ATTR_FORMAT(3,0) xmlXPtrErr(xmlXPathParserContextPtr ctxt, int error, const char * msg, const xmlChar *extra) { @@ -104,10 +104,10 @@ xmlXPtrErr(xmlXPathParserContextPtr ctxt, int error, msg, extra); return; } - - /* cleanup current last error */ - xmlResetError(&ctxt->context->lastError); - + + /* cleanup current last error */ + xmlResetError(&ctxt->context->lastError); + ctxt->context->lastError.domain = XML_FROM_XPOINTER; ctxt->context->lastError.code = error; ctxt->context->lastError.level = XML_ERR_ERROR; @@ -329,45 +329,45 @@ xmlXPtrRangesEqual(xmlXPathObjectPtr range1, xmlXPathObjectPtr range2) { } /** - * xmlXPtrNewRangeInternal: - * @start: the starting node - * @startindex: the start index - * @end: the ending point - * @endindex: the ending index - * - * Internal function to create a new xmlXPathObjectPtr of type range - * - * Returns the newly created object. - */ -static xmlXPathObjectPtr -xmlXPtrNewRangeInternal(xmlNodePtr start, int startindex, - xmlNodePtr end, int endindex) { - xmlXPathObjectPtr ret; - - /* - * Namespace nodes must be copied (see xmlXPathNodeSetDupNs). - * Disallow them for now. - */ - if ((start != NULL) && (start->type == XML_NAMESPACE_DECL)) - return(NULL); - if ((end != NULL) && (end->type == XML_NAMESPACE_DECL)) - return(NULL); - - ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject)); - if (ret == NULL) { - xmlXPtrErrMemory("allocating range"); - return(NULL); - } - memset(ret, 0, sizeof(xmlXPathObject)); - ret->type = XPATH_RANGE; - ret->user = start; - ret->index = startindex; - ret->user2 = end; - ret->index2 = endindex; - return(ret); -} - -/** + * xmlXPtrNewRangeInternal: + * @start: the starting node + * @startindex: the start index + * @end: the ending point + * @endindex: the ending index + * + * Internal function to create a new xmlXPathObjectPtr of type range + * + * Returns the newly created object. + */ +static xmlXPathObjectPtr +xmlXPtrNewRangeInternal(xmlNodePtr start, int startindex, + xmlNodePtr end, int endindex) { + xmlXPathObjectPtr ret; + + /* + * Namespace nodes must be copied (see xmlXPathNodeSetDupNs). + * Disallow them for now. + */ + if ((start != NULL) && (start->type == XML_NAMESPACE_DECL)) + return(NULL); + if ((end != NULL) && (end->type == XML_NAMESPACE_DECL)) + return(NULL); + + ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject)); + if (ret == NULL) { + xmlXPtrErrMemory("allocating range"); + return(NULL); + } + memset(ret, 0, sizeof(xmlXPathObject)); + ret->type = XPATH_RANGE; + ret->user = start; + ret->index = startindex; + ret->user2 = end; + ret->index2 = endindex; + return(ret); +} + +/** * xmlXPtrNewRange: * @start: the starting node * @startindex: the start index @@ -392,7 +392,7 @@ xmlXPtrNewRange(xmlNodePtr start, int startindex, if (endindex < 0) return(NULL); - ret = xmlXPtrNewRangeInternal(start, startindex, end, endindex); + ret = xmlXPtrNewRangeInternal(start, startindex, end, endindex); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -419,8 +419,8 @@ xmlXPtrNewRangePoints(xmlXPathObjectPtr start, xmlXPathObjectPtr end) { if (end->type != XPATH_POINT) return(NULL); - ret = xmlXPtrNewRangeInternal(start->user, start->index, end->user, - end->index); + ret = xmlXPtrNewRangeInternal(start->user, start->index, end->user, + end->index); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -445,7 +445,7 @@ xmlXPtrNewRangePointNode(xmlXPathObjectPtr start, xmlNodePtr end) { if (start->type != XPATH_POINT) return(NULL); - ret = xmlXPtrNewRangeInternal(start->user, start->index, end, -1); + ret = xmlXPtrNewRangeInternal(start->user, start->index, end, -1); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -470,7 +470,7 @@ xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end) { if (end->type != XPATH_POINT) return(NULL); - ret = xmlXPtrNewRangeInternal(start, -1, end->user, end->index); + ret = xmlXPtrNewRangeInternal(start, -1, end->user, end->index); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -493,7 +493,7 @@ xmlXPtrNewRangeNodes(xmlNodePtr start, xmlNodePtr end) { if (end == NULL) return(NULL); - ret = xmlXPtrNewRangeInternal(start, -1, end, -1); + ret = xmlXPtrNewRangeInternal(start, -1, end, -1); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -513,7 +513,7 @@ xmlXPtrNewCollapsedRange(xmlNodePtr start) { if (start == NULL) return(NULL); - ret = xmlXPtrNewRangeInternal(start, -1, NULL, -1); + ret = xmlXPtrNewRangeInternal(start, -1, NULL, -1); return(ret); } @@ -528,8 +528,8 @@ xmlXPtrNewCollapsedRange(xmlNodePtr start) { */ xmlXPathObjectPtr xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) { - xmlNodePtr endNode; - int endIndex; + xmlNodePtr endNode; + int endIndex; xmlXPathObjectPtr ret; if (start == NULL) @@ -538,28 +538,28 @@ xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) { return(NULL); switch (end->type) { case XPATH_POINT: - endNode = end->user; - endIndex = end->index; - break; + endNode = end->user; + endIndex = end->index; + break; case XPATH_RANGE: - endNode = end->user2; - endIndex = end->index2; + endNode = end->user2; + endIndex = end->index2; break; case XPATH_NODESET: /* * Empty set ... */ - if ((end->nodesetval == NULL) || (end->nodesetval->nodeNr <= 0)) + if ((end->nodesetval == NULL) || (end->nodesetval->nodeNr <= 0)) return(NULL); - endNode = end->nodesetval->nodeTab[end->nodesetval->nodeNr - 1]; - endIndex = -1; + endNode = end->nodesetval->nodeTab[end->nodesetval->nodeNr - 1]; + endIndex = -1; break; default: /* TODO */ return(NULL); } - ret = xmlXPtrNewRangeInternal(start, -1, endNode, endIndex); + ret = xmlXPtrNewRangeInternal(start, -1, endNode, endIndex); xmlXPtrRangeCheckOrder(ret); return(ret); } @@ -956,10 +956,10 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { if (name == NULL) XP_ERROR(XPATH_EXPR_ERROR); - if (CUR != '(') { - xmlFree(name); + if (CUR != '(') { + xmlFree(name); XP_ERROR(XPATH_EXPR_ERROR); - } + } NEXT; level = 1; @@ -968,7 +968,7 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { buffer = (xmlChar *) xmlMallocAtomic(len * sizeof (xmlChar)); if (buffer == NULL) { xmlXPtrErrMemory("allocating buffer"); - xmlFree(name); + xmlFree(name); return; } @@ -993,7 +993,7 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { *cur = 0; if ((level != 0) && (CUR == 0)) { - xmlFree(name); + xmlFree(name); xmlFree(buffer); XP_ERROR(XPTR_SYNTAX_ERROR); } @@ -1026,7 +1026,7 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { if (name2 == NULL) { CUR_PTR = left; xmlFree(buffer); - xmlFree(name); + xmlFree(name); XP_ERROR(XPATH_EXPR_ERROR); } xmlXPtrEvalChildSeq(ctxt, name2); @@ -1186,7 +1186,7 @@ xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) { static void xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) { /* - * XPointer don't allow by syntax to address in multirooted trees + * XPointer don't allow by syntax to address in multirooted trees * this might prove useful in some cases, warn about it. */ if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) { @@ -1202,23 +1202,23 @@ xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) { } while (CUR == '/') { - int child = 0, overflow = 0; + int child = 0, overflow = 0; NEXT; while ((CUR >= '0') && (CUR <= '9')) { - int d = CUR - '0'; - if (child > INT_MAX / 10) - overflow = 1; - else - child *= 10; - if (child > INT_MAX - d) - overflow = 1; - else - child += d; + int d = CUR - '0'; + if (child > INT_MAX / 10) + overflow = 1; + else + child *= 10; + if (child > INT_MAX - d) + overflow = 1; + else + child += d; NEXT; } - if (overflow) - child = 0; + if (overflow) + child = 0; xmlXPtrGetChildNo(ctxt, child); } } @@ -1383,7 +1383,7 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) { */ xmlNodeSetPtr set; set = tmp->nodesetval; - if ((set == NULL) || (set->nodeNr != 1) || + if ((set == NULL) || (set->nodeNr != 1) || (set->nodeTab[0] != (xmlNodePtr) ctx->doc)) stack++; } else @@ -1818,8 +1818,8 @@ xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) { case XPATH_RANGE: { xmlNodePtr node = tmp->user; if (node != NULL) { - if ((node->type == XML_ATTRIBUTE_NODE) || - (node->type == XML_NAMESPACE_DECL)) { + if ((node->type == XML_ATTRIBUTE_NODE) || + (node->type == XML_NAMESPACE_DECL)) { xmlXPathFreeObject(obj); xmlXPtrFreeLocationSet(newset); XP_ERROR(XPTR_SYNTAX_ERROR); @@ -1914,8 +1914,8 @@ xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs) { case XPATH_RANGE: { xmlNodePtr node = tmp->user2; if (node != NULL) { - if ((node->type == XML_ATTRIBUTE_NODE) || - (node->type == XML_NAMESPACE_DECL)) { + if ((node->type == XML_ATTRIBUTE_NODE) || + (node->type == XML_NAMESPACE_DECL)) { xmlXPathFreeObject(obj); xmlXPtrFreeLocationSet(newset); XP_ERROR(XPTR_SYNTAX_ERROR); @@ -2056,11 +2056,11 @@ xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathFreeObject(set); XP_ERROR(XPATH_MEMORY_ERROR); } - if (oldset != NULL) { - for (i = 0;i < oldset->locNr;i++) { - xmlXPtrLocationSetAdd(newset, - xmlXPtrCoveringRange(ctxt, oldset->locTab[i])); - } + if (oldset != NULL) { + for (i = 0;i < oldset->locNr;i++) { + xmlXPtrLocationSetAdd(newset, + xmlXPtrCoveringRange(ctxt, oldset->locTab[i])); + } } /* @@ -2228,14 +2228,14 @@ xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) { * @nargs: the number of args * * Implement the range-to() XPointer function - * - * Obsolete. range-to is not a real function but a special type of location - * step which is handled in xpath.c. + * + * Obsolete. range-to is not a real function but a special type of location + * step which is handled in xpath.c. */ void -xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, - int nargs ATTRIBUTE_UNUSED) { - XP_ERROR(XPATH_EXPR_ERROR); +xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, + int nargs ATTRIBUTE_UNUSED) { + XP_ERROR(XPATH_EXPR_ERROR); } /** diff --git a/contrib/libs/libxml/xzlib.c b/contrib/libs/libxml/xzlib.c index 1c07ff16a7..1068963869 100644 --- a/contrib/libs/libxml/xzlib.c +++ b/contrib/libs/libxml/xzlib.c @@ -1,5 +1,5 @@ /** - * xzlib.c: front end for the transparent support of lzma compression + * xzlib.c: front end for the transparent support of lzma compression * at the I/O layer, based on an example file from lzma project * * See Copyright for the status of this software. @@ -8,7 +8,7 @@ */ #define IN_LIBXML #include "libxml.h" -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED #include <string.h> #ifdef HAVE_ERRNO_H @@ -31,14 +31,14 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#ifdef LIBXML_ZLIB_ENABLED -#include <zlib.h> +#ifdef LIBXML_ZLIB_ENABLED +#include <zlib.h> #endif -#ifdef LIBXML_LZMA_ENABLED +#ifdef LIBXML_LZMA_ENABLED #error #include <lzma.h> -#endif +#endif -#error #include "xzlib.h" +#error #include "xzlib.h" #include <libxml/xmlmemory.h> /* values for xz_state how */ @@ -71,12 +71,12 @@ typedef struct { int err; /* error code */ char *msg; /* error message */ /* lzma stream */ - int init; /* is the inflate stream initialized */ + int init; /* is the inflate stream initialized */ lzma_stream strm; /* stream structure in-place (not a pointer) */ char padding1[32]; /* padding allowing to cope with possible extensions of above structure without too much side effect */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /* zlib inflate or deflate stream */ z_stream zstrm; /* stream structure in-place (not a pointer) */ #endif @@ -130,7 +130,7 @@ xz_reset(xz_statep state) xz_error(state, LZMA_OK, NULL); /* clear error */ state->pos = 0; /* no uncompressed data yet */ state->strm.avail_in = 0; /* no input data yet */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED state->zstrm.avail_in = 0; /* no input data yet */ #endif } @@ -272,7 +272,7 @@ xz_avail(xz_statep state) return 0; } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED static int xz_avail_zstrm(xz_statep state) { @@ -349,7 +349,7 @@ is_format_lzma(xz_statep state) return 1; } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /* Get next byte from input, or -1 if end or error. */ #define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \ @@ -408,14 +408,14 @@ xz_head(xz_statep state) state->strm = init; state->strm.avail_in = 0; state->strm.next_in = NULL; - if (lzma_auto_decoder(&state->strm, 100000000, 0) != LZMA_OK) { + if (lzma_auto_decoder(&state->strm, 100000000, 0) != LZMA_OK) { xmlFree(state->out); xmlFree(state->in); state->size = 0; xz_error(state, LZMA_MEM_ERROR, "out of memory"); return -1; } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /* allocate inflate memory */ state->zstrm.zalloc = Z_NULL; state->zstrm.zfree = Z_NULL; @@ -449,7 +449,7 @@ xz_head(xz_statep state) state->direct = 0; return 0; } -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED /* look for the gzip magic header bytes 31 and 139 */ if (strm->next_in[0] == 31) { strm->avail_in--; @@ -550,7 +550,7 @@ xz_decomp(xz_statep state) action = LZMA_FINISH; /* decompress and handle errors */ -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (state->how == GZIP) { state->zstrm.avail_in = (uInt) state->strm.avail_in; state->zstrm.next_in = (Bytef *) state->strm.next_in; @@ -562,10 +562,10 @@ xz_decomp(xz_statep state) "internal error: inflate stream corrupt"); return -1; } - /* - * FIXME: Remapping a couple of error codes and falling through - * to the LZMA error handling looks fragile. - */ + /* + * FIXME: Remapping a couple of error codes and falling through + * to the LZMA error handling looks fragile. + */ if (ret == Z_MEM_ERROR) ret = LZMA_MEM_ERROR; if (ret == Z_DATA_ERROR) @@ -587,27 +587,27 @@ xz_decomp(xz_statep state) xz_error(state, LZMA_DATA_ERROR, "compressed data error"); return -1; } - if (ret == LZMA_PROG_ERROR) { - xz_error(state, LZMA_PROG_ERROR, "compression error"); - return -1; - } - if ((state->how != GZIP) && - (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) { - xz_error(state, ret, "lzma error"); - return -1; - } + if (ret == LZMA_PROG_ERROR) { + xz_error(state, LZMA_PROG_ERROR, "compression error"); + return -1; + } + if ((state->how != GZIP) && + (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) { + xz_error(state, ret, "lzma error"); + return -1; + } } while (strm->avail_out && ret != LZMA_STREAM_END); /* update available output and crc check value */ state->have = had - strm->avail_out; state->next = strm->next_out - state->have; -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED state->zstrm.adler = crc32(state->zstrm.adler, state->next, state->have); #endif if (ret == LZMA_STREAM_END) { -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (state->how == GZIP) { if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) { xz_error(state, LZMA_DATA_ERROR, "unexpected end of file"); @@ -797,7 +797,7 @@ __libxml2_xzclose(xzFile file) /* free memory and close file */ if (state->size) { lzma_end(&(state->strm)); -#ifdef LIBXML_ZLIB_ENABLED +#ifdef LIBXML_ZLIB_ENABLED if (state->init == 1) inflateEnd(&(state->zstrm)); state->init = 0; @@ -806,10 +806,10 @@ __libxml2_xzclose(xzFile file) xmlFree(state->in); } xmlFree(state->path); - if ((state->msg != NULL) && (state->err != LZMA_MEM_ERROR)) - xmlFree(state->msg); + if ((state->msg != NULL) && (state->err != LZMA_MEM_ERROR)) + xmlFree(state->msg); ret = close(state->fd); xmlFree(state); return ret ? ret : LZMA_OK; } -#endif /* LIBXML_LZMA_ENABLED */ +#endif /* LIBXML_LZMA_ENABLED */ diff --git a/contrib/libs/libxml/ya.make b/contrib/libs/libxml/ya.make index 6ab3c3c1e1..b7ee2eb058 100644 --- a/contrib/libs/libxml/ya.make +++ b/contrib/libs/libxml/ya.make @@ -1,5 +1,5 @@ -# Generated by devtools/yamaker from nixpkgs 5852a21819542e6809f68ba5a798600e69874e76. - +# Generated by devtools/yamaker from nixpkgs 5852a21819542e6809f68ba5a798600e69874e76. + LIBRARY() OWNER( @@ -7,10 +7,10 @@ OWNER( g:yandex_io ) -VERSION(2.9.10) - -ORIGINAL_SOURCE(http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz) - +VERSION(2.9.10) + +ORIGINAL_SOURCE(http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz) + LICENSE( MIT AND Mit-Veillard-Variant @@ -18,22 +18,22 @@ LICENSE( LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -PEERDIR( - contrib/libs/libiconv - contrib/libs/zlib -) +PEERDIR( + contrib/libs/libiconv + contrib/libs/zlib +) -ADDINCL( - GLOBAL contrib/libs/libxml/include - contrib/libs/libiconv/include - contrib/libs/libxml +ADDINCL( + GLOBAL contrib/libs/libxml/include + contrib/libs/libiconv/include + contrib/libs/libxml ) NO_COMPILER_WARNINGS() -CFLAGS( - -DHAVE_CONFIG_H - GLOBAL -DLIBXML_STATIC +CFLAGS( + -DHAVE_CONFIG_H + GLOBAL -DLIBXML_STATIC ) SRCS( @@ -59,7 +59,7 @@ SRCS( parser.c parserInternals.c pattern.c - rand.cpp + rand.cpp relaxng.c schematron.c threads.c |