Index: include/reactos/libs/libxml/c14n.h =================================================================== --- include/reactos/libs/libxml/c14n.h (revision 58293) +++ include/reactos/libs/libxml/c14n.h (working copy) @@ -54,7 +54,7 @@ /* * xmlC14NMode: - * + * * Predefined values for C14N modes * */ Index: include/reactos/libs/libxml/catalog.h =================================================================== --- include/reactos/libs/libxml/catalog.h (revision 58293) +++ include/reactos/libs/libxml/catalog.h (working copy) @@ -68,111 +68,111 @@ */ XMLPUBFUN xmlCatalogPtr XMLCALL xmlNewCatalog (int sgml); -XMLPUBFUN xmlCatalogPtr XMLCALL +XMLPUBFUN xmlCatalogPtr XMLCALL xmlLoadACatalog (const char *filename); -XMLPUBFUN xmlCatalogPtr XMLCALL +XMLPUBFUN xmlCatalogPtr XMLCALL xmlLoadSGMLSuperCatalog (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlConvertSGMLCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlACatalogAdd (xmlCatalogPtr catal, const xmlChar *type, const xmlChar *orig, const xmlChar *replace); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlACatalogRemove (xmlCatalogPtr catal, const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolve (xmlCatalogPtr catal, const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolveSystem(xmlCatalogPtr catal, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolvePublic(xmlCatalogPtr catal, const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolveURI (xmlCatalogPtr catal, const xmlChar *URI); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlACatalogDump (xmlCatalogPtr catal, FILE *out); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogIsEmpty (xmlCatalogPtr catal); /* * Global operations. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitializeCatalog (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLoadCatalog (const char *filename); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlLoadCatalogs (const char *paths); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogCleanup (void); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogDump (FILE *out); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolve (const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolveSystem (const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolvePublic (const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolveURI (const xmlChar *URI); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogAdd (const xmlChar *type, const xmlChar *orig, const xmlChar *replace); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogRemove (const xmlChar *value); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseCatalogFile (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogConvert (void); /* * Strictly minimal interfaces for per-document catalogs used * by the parser. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogFreeLocal (void *catalogs); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlCatalogAddLocal (void *catalogs, const xmlChar *URL); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogLocalResolve (void *catalogs, const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogLocalResolveURI(void *catalogs, const xmlChar *URI); /* * Preference settings. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogSetDebug (int level); -XMLPUBFUN xmlCatalogPrefer XMLCALL +XMLPUBFUN xmlCatalogPrefer XMLCALL xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogSetDefaults (xmlCatalogAllow allow); -XMLPUBFUN xmlCatalogAllow XMLCALL +XMLPUBFUN xmlCatalogAllow XMLCALL xmlCatalogGetDefaults (void); /* DEPRECATED interfaces */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlCatalogGetSystem (const xmlChar *sysID); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlCatalogGetPublic (const xmlChar *pubID); #ifdef __cplusplus Index: include/reactos/libs/libxml/debugXML.h =================================================================== --- include/reactos/libs/libxml/debugXML.h (revision 58293) +++ include/reactos/libs/libxml/debugXML.h (working copy) @@ -25,18 +25,18 @@ /* * The standard Dump routines. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpString (FILE *output, const xmlChar *str); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpAttr (FILE *output, xmlAttrPtr attr, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpAttrList (FILE *output, xmlAttrPtr attr, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpOneNode (FILE *output, xmlNodePtr node, int depth); @@ -54,16 +54,16 @@ XMLPUBFUN void XMLCALL xmlDebugDumpDocument (FILE *output, xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpDTD (FILE *output, xmlDtdPtr dtd); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpEntities (FILE *output, xmlDocPtr doc); /**************************************************************** * * - * Checking routines * + * Checking routines * * * ****************************************************************/ @@ -73,16 +73,16 @@ /**************************************************************** * * - * XML shell helpers * + * XML shell helpers * * * ****************************************************************/ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlLsOneNode (FILE *output, xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLsCountNode (xmlNodePtr node); -XMLPUBFUN const char * XMLCALL +XMLPUBFUN const char * XMLCALL xmlBoolToText (int boolval); /**************************************************************** @@ -136,63 +136,63 @@ xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintXPathError (int errorType, const char *arg); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintXPathResult(xmlXPathObjectPtr list); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellList (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellBase (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellDir (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellLoad (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintNode (xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellCat (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellWrite (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellSave (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellValidate (xmlShellCtxtPtr ctxt, char *dtd, xmlNodePtr node, xmlNodePtr node2); #endif /* LIBXML_VALID_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellDu (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr tree, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellPwd (xmlShellCtxtPtr ctxt, char *buffer, xmlNodePtr node, @@ -201,12 +201,12 @@ /* * The Shell interface. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShell (xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, FILE *output); - + #endif /* LIBXML_XPATH_ENABLED */ #ifdef __cplusplus Index: include/reactos/libs/libxml/dict.h =================================================================== --- include/reactos/libs/libxml/dict.h (revision 58293) +++ include/reactos/libs/libxml/dict.h (working copy) @@ -11,6 +11,7 @@ #ifndef __XML_DICT_H__ #define __XML_DICT_H__ +#include #include #include @@ -25,36 +26,46 @@ typedef xmlDict *xmlDictPtr; /* + * Initializer + */ +XMLPUBFUN int XMLCALL xmlInitializeDict(void); + +/* * Constructor and destructor. */ XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreate (void); +XMLPUBFUN size_t XMLCALL + xmlDictSetLimit (xmlDictPtr dict, + size_t limit); +XMLPUBFUN size_t XMLCALL + xmlDictGetUsage (xmlDictPtr dict); XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreateSub(xmlDictPtr sub); XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDictFree (xmlDictPtr dict); /* * Lookup of entry in the dictionnary. */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictLookup (xmlDictPtr dict, const xmlChar *name, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictExists (xmlDictPtr dict, const xmlChar *name, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictQLookup (xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name); XMLPUBFUN int XMLCALL xmlDictOwns (xmlDictPtr dict, const xmlChar *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDictSize (xmlDictPtr dict); /* Index: include/reactos/libs/libxml/DOCBparser.h =================================================================== --- include/reactos/libs/libxml/DOCBparser.h (revision 58293) +++ include/reactos/libs/libxml/DOCBparser.h (working copy) @@ -47,44 +47,44 @@ const unsigned char *in, int *inlen, int quoteChar); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbSAXParseDoc (xmlChar *cur, const char *encoding, docbSAXHandlerPtr sax, void *userData); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbParseDoc (xmlChar *cur, const char *encoding); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbSAXParseFile (const char *filename, const char *encoding, docbSAXHandlerPtr sax, void *userData); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbParseFile (const char *filename, const char *encoding); /** * Interfaces for the Push mode. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL docbFreeParserCtxt (docbParserCtxtPtr ctxt); -XMLPUBFUN docbParserCtxtPtr XMLCALL +XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreatePushParserCtxt(docbSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL docbParseChunk (docbParserCtxtPtr ctxt, const char *chunk, int size, int terminate); -XMLPUBFUN docbParserCtxtPtr XMLCALL +XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreateFileParserCtxt(const char *filename, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL docbParseDocument (docbParserCtxtPtr ctxt); #ifdef __cplusplus Index: include/reactos/libs/libxml/encoding.h =================================================================== --- include/reactos/libs/libxml/encoding.h (revision 58293) +++ include/reactos/libs/libxml/encoding.h (working copy) @@ -163,32 +163,32 @@ /* * Interfaces for encoding handlers. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlGetCharEncodingHandler (xmlCharEncoding enc); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler (const char *name); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL - xmlNewCharEncodingHandler (const char *name, - xmlCharEncodingInputFunc input, - xmlCharEncodingOutputFunc output); + xmlNewCharEncodingHandler (const char *name, + xmlCharEncodingInputFunc input, + xmlCharEncodingOutputFunc output); /* * Interfaces for encoding names and aliases. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAddEncodingAlias (const char *name, const char *alias); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDelEncodingAlias (const char *alias); XMLPUBFUN const char * XMLCALL xmlGetEncodingAlias (const char *alias); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases (void); XMLPUBFUN xmlCharEncoding XMLCALL xmlParseCharEncoding (const char *name); @@ -202,12 +202,12 @@ xmlDetectCharEncoding (const unsigned char *in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncOutFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncInFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); @@ -215,20 +215,20 @@ xmlCharEncFirstLine (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); /* * Export a few useful functions */ #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL UTF8Toisolat1 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL isolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, Index: include/reactos/libs/libxml/hash.h =================================================================== --- include/reactos/libs/libxml/hash.h (revision 58293) +++ include/reactos/libs/libxml/hash.h (working copy) @@ -1,7 +1,7 @@ /* * Summary: Chained hash tables - * Description: This module implements the hash table support used in - * various places in the library. + * Description: This module implements the hash table support used in + * various places in the library. * * Copy: See Copyright for the status of this software. * @@ -108,40 +108,40 @@ XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreateDict(int size, xmlDictPtr dict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashFree (xmlHashTablePtr table, xmlHashDeallocator f); /* * Add a new entry to the hash table. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry (xmlHashTablePtr table, const xmlChar *name, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, @@ -152,13 +152,13 @@ /* * Remove an entry from the hash table. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f); @@ -166,29 +166,29 @@ /* * Retrieve the userdata. */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup (xmlHashTablePtr table, const xmlChar *name); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, @@ -200,27 +200,27 @@ /* * Helpers. */ -XMLPUBFUN xmlHashTablePtr XMLCALL +XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCopy (xmlHashTablePtr table, xmlHashCopier f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashSize (xmlHashTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScan (xmlHashTablePtr table, xmlHashScanner f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScan3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScanFull (xmlHashTablePtr table, xmlHashScannerFull f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, Index: include/reactos/libs/libxml/HTMLparser.h =================================================================== --- include/reactos/libs/libxml/HTMLparser.h (revision 58293) +++ include/reactos/libs/libxml/HTMLparser.h (working copy) @@ -83,87 +83,87 @@ /* * There is only few public functions. */ -XMLPUBFUN const htmlElemDesc * XMLCALL +XMLPUBFUN const htmlElemDesc * XMLCALL htmlTagLookup (const xmlChar *tag); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlEntityLookup(const xmlChar *name); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlEntityValueLookup(unsigned int value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsAutoClosed(htmlDocPtr doc, htmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlAutoCloseTag(htmlDocPtr doc, const xmlChar *name, htmlNodePtr elem); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseCharRef(htmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlParseElement(htmlParserCtxtPtr ctxt); -XMLPUBFUN htmlParserCtxtPtr XMLCALL +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlNewParserCtxt(void); -XMLPUBFUN htmlParserCtxtPtr XMLCALL +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateMemoryParserCtxt(const char *buffer, int size); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseDocument(htmlParserCtxtPtr ctxt); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseDoc (xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlParseDoc (xmlChar *cur, const char *encoding); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax, void *userData); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlParseFile (const char *filename, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL UTF8ToHtml (unsigned char *out, int *outlen, const unsigned char *in, int *inlen); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlEncodeEntities(unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int quoteChar); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsScriptAttribute(const xmlChar *name); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlHandleOmittedElem(int val); #ifdef LIBXML_PUSH_ENABLED /** * Interfaces for the Push mode. */ -XMLPUBFUN htmlParserCtxtPtr XMLCALL +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseChunk (htmlParserCtxtPtr ctxt, const char *chunk, int size, int terminate); #endif /* LIBXML_PUSH_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); /* @@ -184,7 +184,8 @@ HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ HTML_PARSE_NONET = 1<<11,/* Forbid network access */ HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */ - HTML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ + HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */ + HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */ } htmlParserOption; XMLPUBFUN void XMLCALL Index: include/reactos/libs/libxml/HTMLtree.h =================================================================== --- include/reactos/libs/libxml/HTMLtree.h (revision 58293) +++ include/reactos/libs/libxml/HTMLtree.h (working copy) @@ -62,78 +62,78 @@ XMLPUBFUN htmlDocPtr XMLCALL htmlNewDoc (const xmlChar *URI, const xmlChar *ExternalID); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlNewDocNoDtD (const xmlChar *URI, const xmlChar *ExternalID); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL htmlGetMetaEncoding (htmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSetMetaEncoding (htmlDocPtr doc, const xmlChar *encoding); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocDumpMemoryFormat (xmlDocPtr cur, xmlChar **mem, int *size, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlDocDump (FILE *f, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFile (const char *filename, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlNodeDump (xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlNodeDumpFile (FILE *out, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlNodeDumpFileFormat (FILE *out, xmlDocPtr doc, xmlNodePtr cur, const char *encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFileEnc (const char *filename, xmlDocPtr cur, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFileFormat (const char *filename, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL - htmlNodeDumpOutput (xmlOutputBufferPtr buf, +XMLPUBFUN void XMLCALL + htmlNodeDumpOutput (xmlOutputBufferPtr buf, xmlDocPtr doc, - xmlNodePtr cur, + xmlNodePtr cur, const char *encoding); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsBooleanAttr (const xmlChar *name); Index: include/reactos/libs/libxml/list.h =================================================================== --- include/reactos/libs/libxml/list.h (revision 58293) +++ include/reactos/libs/libxml/list.h (working copy) @@ -1,6 +1,6 @@ /* * Summary: lists interfaces - * Description: this module implement the list support used in + * Description: this module implement the list support used in * various place in the library. * * Copy: See Copyright for the status of this software. @@ -55,76 +55,76 @@ XMLPUBFUN xmlListPtr XMLCALL xmlListCreate (xmlListDeallocator deallocator, xmlListDataCompare compare); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListDelete (xmlListPtr l); /* Basic Operators */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlListSearch (xmlListPtr l, void *data); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlListReverseSearch (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListInsert (xmlListPtr l, void *data) ; -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListAppend (xmlListPtr l, void *data) ; -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveFirst (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveLast (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveAll (xmlListPtr l, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListClear (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListEmpty (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL +XMLPUBFUN xmlLinkPtr XMLCALL xmlListFront (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL +XMLPUBFUN xmlLinkPtr XMLCALL xmlListEnd (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListSize (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListPopFront (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListPopBack (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListPushFront (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListPushBack (xmlListPtr l, void *data); /* Advanced Operators */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListReverse (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListSort (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListWalk (xmlListPtr l, xmlListWalker walker, const void *user); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListReverseWalk (xmlListPtr l, xmlListWalker walker, const void *user); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListMerge (xmlListPtr l1, xmlListPtr l2); -XMLPUBFUN xmlListPtr XMLCALL +XMLPUBFUN xmlListPtr XMLCALL xmlListDup (const xmlListPtr old); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListCopy (xmlListPtr cur, const xmlListPtr old); /* Link operators */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlLinkGetData (xmlLinkPtr lk); /* xmlListUnique() */ Index: include/reactos/libs/libxml/Makefile.in =================================================================== --- include/reactos/libs/libxml/Makefile.in (revision 58293) +++ include/reactos/libs/libxml/Makefile.in (working copy) @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -33,8 +34,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = include -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +subdir = include/libxml +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -44,55 +46,52 @@ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = xmlversion.h CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(xmlincdir)" +HEADERS = $(xmlinc_HEADERS) ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -129,6 +128,7 @@ HTML_OBJ = @HTML_OBJ@ HTTP_OBJ = @HTTP_OBJ@ ICONV_LIBS = @ICONV_LIBS@ +ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -149,7 +149,10 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULE_EXTENSION = @MODULE_EXTENSION@ MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ @@ -206,10 +209,8 @@ TEST_XINCLUDE = @TEST_XINCLUDE@ TEST_XPATH = @TEST_XPATH@ TEST_XPTR = @TEST_XPTR@ -THREADS_W32 = @THREADS_W32@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ -U = @U@ VERSION = @VERSION@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ WGET = @WGET@ @@ -227,6 +228,7 @@ WITH_ICU = @WITH_ICU@ WITH_ISO8859X = @WITH_ISO8859X@ WITH_LEGACY = @WITH_LEGACY@ +WITH_LZMA = @WITH_LZMA@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ WITH_MODULES = @WITH_MODULES@ WITH_OUTPUT = @WITH_OUTPUT@ @@ -263,6 +265,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -311,10 +314,59 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = libxml -EXTRA_DIST = win32config.h wsockcompat.h -all: all-recursive +xmlincdir = $(includedir)/libxml2/libxml +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h \ + schematron.h +EXTRA_DIST = xmlversion.h.in +all: all-am + .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -325,9 +377,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile + $(AUTOMAKE) --gnu include/libxml/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -346,83 +398,33 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs +install-xmlincHEADERS: $(xmlinc_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xmlincdir)" || $(MKDIR_P) "$(DESTDIR)$(xmlincdir)" + @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmlincdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(xmlincdir)" || exit $$?; \ + done -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" +uninstall-xmlincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(xmlincdir)'; $(am__uninstall_files_from_dir) -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -433,23 +435,10 @@ mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -468,7 +457,7 @@ fi; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -518,53 +507,32 @@ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(xmlincdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -576,88 +544,86 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive +clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: +install-data-am: install-xmlincHEADERS -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: install-exec-am: -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-xmlincHEADERS -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ + install-ps install-ps-am install-strip install-xmlincHEADERS \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-xmlincHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. Index: include/reactos/libs/libxml/nanoftp.h =================================================================== --- include/reactos/libs/libxml/nanoftp.h (revision 58293) +++ include/reactos/libs/libxml/nanoftp.h (working copy) @@ -31,6 +31,7 @@ * macro used to provide portability of code to windows sockets * the value to be used when the socket is not valid */ +#undef INVALID_SOCKET #define INVALID_SOCKET (-1) #endif Index: include/reactos/libs/libxml/nanohttp.h =================================================================== --- include/reactos/libs/libxml/nanohttp.h (revision 58293) +++ include/reactos/libs/libxml/nanohttp.h (working copy) @@ -7,7 +7,7 @@ * * Author: Daniel Veillard */ - + #ifndef __NANO_HTTP_H__ #define __NANO_HTTP_H__ @@ -20,22 +20,22 @@ #endif XMLPUBFUN void XMLCALL xmlNanoHTTPInit (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPCleanup (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPScanProxy (const char *URL); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPFetch (const char *URL, const char *filename, char **contentType); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPMethod (const char *URL, const char *method, const char *input, char **contentType, const char *headers, int ilen); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPMethodRedir (const char *URL, const char *method, const char *input, @@ -43,16 +43,16 @@ char **redir, const char *headers, int ilen); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPOpen (const char *URL, char **contentType); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPOpenRedir (const char *URL, char **contentType, char **redir); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPReturnCode (void *ctx); -XMLPUBFUN const char * XMLCALL +XMLPUBFUN const char * XMLCALL xmlNanoHTTPAuthHeader (void *ctx); XMLPUBFUN const char * XMLCALL xmlNanoHTTPRedir (void *ctx); @@ -62,16 +62,16 @@ xmlNanoHTTPEncoding (void *ctx); XMLPUBFUN const char * XMLCALL xmlNanoHTTPMimeType (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPRead (void *ctx, void *dest, int len); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPSave (void *ctxt, const char *filename); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPClose (void *ctx); #ifdef __cplusplus } Index: include/reactos/libs/libxml/parser.h =================================================================== --- include/reactos/libs/libxml/parser.h (revision 58293) +++ include/reactos/libs/libxml/parser.h (working copy) @@ -80,7 +80,7 @@ * xmlParserNodeInfo: * * The parser can be asked to collect Node informations, i.e. at what - * place in the file they were detected. + * place in the file they were detected. * NOTE: This is off by default and not very well tested. */ typedef struct _xmlParserNodeInfo xmlParserNodeInfo; @@ -125,9 +125,9 @@ XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ - XML_PARSER_EPILOG, /* the Misc* after the last end tag */ + XML_PARSER_EPILOG, /* the Misc* after the last end tag */ XML_PARSER_IGNORE, /* within an IGNORED section */ - XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ + XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ } xmlParserInputState; /** @@ -221,7 +221,7 @@ xmlValidCtxt vctxt; /* The validity context */ xmlParserInputState instate; /* current type of input */ - int token; /* next char look-ahead */ + int token; /* next char look-ahead */ char *directory; /* the data directory */ @@ -308,6 +308,8 @@ int nodeInfoNr; /* Depth of the parsing stack */ int nodeInfoMax; /* Max depth of the parsing stack */ xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ + + int input_id; /* we need to label inputs */ }; /** @@ -398,8 +400,8 @@ /** * entityDeclSAXFunc: * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -429,8 +431,8 @@ * attributeDeclSAXFunc: * @ctx: the user data (XML parser context) * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type + * @fullname: the attribute name + * @type: the attribute type * @def: the type of default value * @defaultValue: the attribute default value * @tree: the tree of enumerated value set @@ -447,8 +449,8 @@ /** * elementDeclSAXFunc: * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value tree * * An element definition has been parsed. @@ -535,7 +537,7 @@ * @ctx: the user data (XML parser context) * @name: The entity name * - * Called when an entity reference is detected. + * Called when an entity reference is detected. */ typedef void (*referenceSAXFunc) (void *ctx, const xmlChar *name); @@ -599,7 +601,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a warning messages, callback. */ typedef void (XMLCDECL *warningSAXFunc) (void *ctx, @@ -609,7 +611,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an error messages, callback. */ typedef void (XMLCDECL *errorSAXFunc) (void *ctx, @@ -619,7 +621,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format fatal error messages, callback. * Note: so far fatalError() SAX callbacks are not used, error() * get all the callbacks for errors. @@ -695,7 +697,7 @@ int nb_attributes, int nb_defaulted, const xmlChar **attributes); - + /** * endElementNsSAX2Func: * @ctx: the user data (XML parser context) @@ -790,7 +792,7 @@ * xmlExternalEntityLoader: * @URL: The System ID of the resource requested * @ID: The Public ID of the resource requested - * @context: the XML parser context + * @context: the XML parser context * * External entity loaders types. * @@ -816,18 +818,18 @@ /* * Init/Cleanup */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitParser (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupParser (void); /* * Input functions */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputRead (xmlParserInputPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputGrow (xmlParserInputPtr in, int len); @@ -835,101 +837,101 @@ * Basic parsing Interfaces */ #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseFile (const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseMemory (const char *buffer, int size); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSubstituteEntitiesDefault(int val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlKeepBlanksDefault (int val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlStopParser (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlPedanticParserDefault(int val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLineNumbersDefault (int val); #ifdef LIBXML_SAX1_ENABLED /* - * Recovery mode + * Recovery mode */ -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverMemory (const char *buffer, int size); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverFile (const char *filename); #endif /* LIBXML_SAX1_ENABLED */ /* * Less common routines and SAX interfaces */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseDocument (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAXUserParseFile (xmlSAXHandlerPtr sax, void *user_data, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, void *user_data, const char *buffer, int size); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseDoc (xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseMemory (xmlSAXHandlerPtr sax, const char *buffer, - int size, + int size, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, const char *buffer, - int size, + int size, int recovery, void *data); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseFile (xmlSAXHandlerPtr sax, const char *filename, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, const char *filename, int recovery, void *data); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseEntity (xmlSAXHandlerPtr sax, const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseEntity (const char *filename); #endif /* LIBXML_SAX1_ENABLED */ #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlSAXParseDTD (xmlSAXHandlerPtr sax, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlParseDTD (const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlIOParseDTD (xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, xmlCharEncoding enc); #endif /* LIBXML_VALID_ENABLE */ #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseBalancedChunkMemory(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -944,7 +946,7 @@ int options, xmlNodePtr *lst); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -952,7 +954,7 @@ const xmlChar *string, xmlNodePtr *lst, int recover); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseExternalEntity (xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -961,7 +963,7 @@ const xmlChar *ID, xmlNodePtr *lst); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, @@ -970,35 +972,35 @@ /* * Parser contexts handling. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlNewParserCtxt (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlInitParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlClearParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, const xmlChar* buffer, const char *filename); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateDocParserCtxt (const xmlChar *cur); #ifdef LIBXML_LEGACY_ENABLED /* * Reading/setting optional parsing features. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetFeaturesList (int *len, const char **result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetFeature (xmlParserCtxtPtr ctxt, const char *name, void *result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name, void *value); @@ -1008,13 +1010,13 @@ /* * Interfaces for the Push mode. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseChunk (xmlParserCtxtPtr ctxt, const char *chunk, int size, @@ -1025,7 +1027,7 @@ * Special I/O mode. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, @@ -1033,7 +1035,7 @@ void *ioctx, xmlCharEncoding enc); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewIOInputStream (xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc); @@ -1044,14 +1046,14 @@ XMLPUBFUN const xmlParserNodeInfo* XMLCALL xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, const xmlNodePtr node); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN unsigned long XMLCALL +XMLPUBFUN unsigned long XMLCALL xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr node); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info); @@ -1059,7 +1061,7 @@ * External entities handling actually implemented in xmlIO. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetExternalEntityLoader(xmlExternalEntityLoader f); XMLPUBFUN xmlExternalEntityLoader XMLCALL xmlGetExternalEntityLoader(void); @@ -1105,8 +1107,10 @@ crash if you try to modify the tree) */ XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ - XML_PARSE_HUGE = 1<<19, /* relax any hardcoded limit from the parser */ - XML_PARSE_OLDSAX = 1<<20 /* parse using SAX2 interface from before 2.7.0 */ + XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */ + XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */ + XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */ + XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */ } xmlParserOption; XMLPUBFUN void XMLCALL @@ -1223,6 +1227,7 @@ XML_WITH_DEBUG_RUN = 30, XML_WITH_ZLIB = 31, XML_WITH_ICU = 32, + XML_WITH_LZMA = 33, XML_WITH_NONE = 99999 /* just to be sure of allocation size */ } xmlFeature; Index: include/reactos/libs/libxml/parserInternals.h =================================================================== --- include/reactos/libs/libxml/parserInternals.h (revision 58293) +++ include/reactos/libs/libxml/parserInternals.h (working copy) @@ -1,5 +1,5 @@ /* - * Summary: internals routines exported by the parser. + * Summary: internals routines and limits exported by the parser. * Description: this module exports a number of internal parsing routines * they are not really all intended for applications but * can prove useful doing low level processing. @@ -36,10 +36,43 @@ * Maximum size allowed for a single text node when building a tree. * This is not a limitation of the parser but a safety boundary feature, * use XML_PARSE_HUGE option to override it. + * Introduced in 2.9.0 */ #define XML_MAX_TEXT_LENGTH 10000000 /** + * XML_MAX_NAME_LENGTH: + * + * Maximum size allowed for a markup identitier + * 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 + * may result in more runtime memory usage in face of "unfriendly' content + * Introduced in 2.9.0 + */ +#define XML_MAX_NAME_LENGTH 50000 + +/** + * XML_MAX_DICTIONARY_LIMIT: + * + * Maximum size allowed by the parser for a dictionary by default + * This is not a limitation of the parser but a safety boundary feature, + * use XML_PARSE_HUGE option to override it. + * Introduced in 2.9.0 + */ +#define XML_MAX_DICTIONARY_LIMIT 10000000 + +/** + * XML_MAX_LOOKUP_LIMIT: + * + * Maximum size allowed by the parser for ahead lookup + * This is an upper boundary enforced by the parser to avoid bad + * behaviour on "unfriendly' content + * Introduced in 2.9.0 + */ +#define XML_MAX_LOOKUP_LIMIT 10000000 + +/** * XML_MAX_NAMELEN: * * Identifiers can be longer, but this will be more costly @@ -57,7 +90,7 @@ /************************************************************************ * * - * UNICODE version of the macros. * + * UNICODE version of the macros. * * * ************************************************************************/ /** @@ -153,7 +186,7 @@ * * Always false (all combining chars > 0xff) */ -#define IS_COMBINING_CH(c) 0 +#define IS_COMBINING_CH(c) 0 /** * IS_EXTENDER: @@ -194,7 +227,7 @@ * Macro to check the following production in the XML spec: * * - * [84] Letter ::= BaseChar | Ideographic + * [84] Letter ::= BaseChar | Ideographic */ #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) @@ -251,7 +284,7 @@ * * Skips the end of line chars. */ -#define SKIP_EOL(p) \ +#define SKIP_EOL(p) \ if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } @@ -288,25 +321,25 @@ /** * Parser context. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt (const char *filename); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt (const char *filename, int options); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, const xmlChar *base); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchEncoding (xmlParserCtxtPtr ctxt, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler); @@ -324,29 +357,29 @@ /** * Input Streams. */ -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewStringInputStream (xmlParserCtxtPtr ctxt, const xmlChar *buffer); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlPushInput (xmlParserCtxtPtr ctxt, xmlParserInputPtr input); -XMLPUBFUN xmlChar XMLCALL +XMLPUBFUN xmlChar XMLCALL xmlPopInput (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeInputStream (xmlParserInputPtr input); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputFromFile (xmlParserCtxtPtr ctxt, const char *filename); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream (xmlParserCtxtPtr ctxt); /** * Namespaces. */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlSplitQName (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix); @@ -354,112 +387,112 @@ /** * Generic production rules. */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseNmtoken (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseEntityValue (xmlParserCtxtPtr ctxt, xmlChar **orig); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseAttValue (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseCharData (xmlParserCtxtPtr ctxt, int cdata); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseExternalID (xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseComment (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParsePITarget (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParsePI (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseNotationDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseEntityDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, xmlChar **value); -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseAttributeType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl (xmlParserCtxtPtr ctxt, int inputchk); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseElementDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseCharRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParsePEReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseAttribute (xmlParserCtxtPtr ctxt, xmlChar **value); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseStartTag (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseEndTag (xmlParserCtxtPtr ctxt); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseCDSect (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseContent (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseElement (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseVersionNum (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseVersionInfo (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseEncName (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseSDDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseXMLDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseTextDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseMisc (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseExternalSubset (xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, - const xmlChar *SystemID); + const xmlChar *SystemID); /** * XML_SUBSTITUTE_NONE: * @@ -483,7 +516,7 @@ * * Both general and parameter entities need to be substituted. */ -#define XML_SUBSTITUTE_BOTH 3 +#define XML_SUBSTITUTE_BOTH 3 XMLPUBFUN xmlChar * XMLCALL xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, @@ -563,21 +596,21 @@ typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, xmlNodePtr firstNode, xmlNodePtr lastNode); - + XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseQuotedString (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParseNamespace (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlScanName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, xmlChar **prefix); /** @@ -590,7 +623,7 @@ xmlChar end, xmlChar end2, xmlChar end3); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHandleEntity (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); Index: include/reactos/libs/libxml/SAX.h =================================================================== --- include/reactos/libs/libxml/SAX.h (revision 58293) +++ include/reactos/libs/libxml/SAX.h (working copy) @@ -25,53 +25,53 @@ #endif XMLPUBFUN const xmlChar * XMLCALL getPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL getSystemId (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL setDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL + +XMLPUBFUN int XMLCALL getLineNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL getColumnNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL isStandalone (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL hasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL hasExternalSubset (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL internalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL externalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL getEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL getParameterEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL resolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL entityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL attributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, @@ -79,87 +79,87 @@ int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL elementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL notationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL unparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL startDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL endDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL attribute (void *ctx, const xmlChar *fullname, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL startElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL endElement (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL reference (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL characters (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL ignorableWhitespace (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL processingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL globalNamespace (void *ctx, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL setNamespace (void *ctx, const xmlChar *name); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL getNamespace (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL checkNamespace (void *ctx, xmlChar *nameSpace); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL namespaceDecl (void *ctx, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL comment (void *ctx, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL cdataBlock (void *ctx, const xmlChar *value, int len); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif #ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif #endif /* LIBXML_SAX1_ENABLED */ Index: include/reactos/libs/libxml/SAX2.h =================================================================== --- include/reactos/libs/libxml/SAX2.h (revision 58293) +++ include/reactos/libs/libxml/SAX2.h (working copy) @@ -23,53 +23,53 @@ #endif XMLPUBFUN const xmlChar * XMLCALL xmlSAX2GetPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlSAX2GetSystemId (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2SetDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL + +XMLPUBFUN int XMLCALL xmlSAX2GetLineNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2GetColumnNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2IsStandalone (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2HasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2HasExternalSubset (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ExternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetParameterEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlSAX2ResolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EntityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2AttributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, @@ -77,33 +77,33 @@ int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ElementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2NotationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2UnparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2StartDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx); #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2StartElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EndElement (void *ctx, const xmlChar *name); #endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ @@ -122,25 +122,25 @@ const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Reference (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Characters (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2IgnorableWhitespace (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ProcessingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Comment (void *ctx, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2CDataBlock (void *ctx, const xmlChar *value, int len); @@ -153,22 +153,22 @@ XMLPUBFUN int XMLCALL xmlSAXVersion (xmlSAXHandler *hdlr, int version); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDefaultSAXHandlerInit (void); #endif #ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL docbDefaultSAXHandlerInit (void); #endif -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDefaultSAXHandlerInit (void); #ifdef __cplusplus } Index: include/reactos/libs/libxml/schemasInternals.h =================================================================== --- include/reactos/libs/libxml/schemasInternals.h (revision 58293) +++ include/reactos/libs/libxml/schemasInternals.h (working copy) @@ -104,8 +104,8 @@ XML_SCHEMA_TYPE_IDC_UNIQUE, XML_SCHEMA_TYPE_IDC_KEY, XML_SCHEMA_TYPE_IDC_KEYREF, - XML_SCHEMA_TYPE_PARTICLE = 25, - XML_SCHEMA_TYPE_ATTRIBUTE_USE, + XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_TYPE_ATTRIBUTE_USE, XML_SCHEMA_FACET_MININCLUSIVE = 1000, XML_SCHEMA_FACET_MINEXCLUSIVE, XML_SCHEMA_FACET_MAXINCLUSIVE, Index: include/reactos/libs/libxml/schematron.h =================================================================== --- include/reactos/libs/libxml/schematron.h (revision 58293) +++ include/reactos/libs/libxml/schematron.h (working copy) @@ -69,17 +69,17 @@ /* * Interfaces for parsing. */ -XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL xmlSchematronNewParserCtxt (const char *URL); -XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL xmlSchematronNewMemParserCtxt(const char *buffer, int size); XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL xmlSchematronNewDocParserCtxt(xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); /***** -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt, xmlSchematronValidityErrorFunc err, xmlSchematronValidityWarningFunc warn, @@ -92,9 +92,9 @@ XMLPUBFUN int XMLCALL xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt); *****/ -XMLPUBFUN xmlSchematronPtr XMLCALL +XMLPUBFUN xmlSchematronPtr XMLCALL xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchematronFree (xmlSchematronPtr schema); /* * Interfaces for validating @@ -105,7 +105,7 @@ xmlStructuredErrorFunc serror, void *ctx); /****** -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt, xmlSchematronValidityErrorFunc err, xmlSchematronValidityWarningFunc warn, @@ -125,12 +125,12 @@ xmlNodePtr elem); *******/ -XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL +XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL xmlSchematronNewValidCtxt (xmlSchematronPtr schema, - int options); -XMLPUBFUN void XMLCALL + int options); +XMLPUBFUN void XMLCALL xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt, xmlDocPtr instance); Index: include/reactos/libs/libxml/tree.h =================================================================== --- include/reactos/libs/libxml/tree.h (revision 58293) +++ include/reactos/libs/libxml/tree.h (working copy) @@ -13,6 +13,7 @@ #define __XML_TREE_H__ #include +#include #include #include @@ -74,13 +75,15 @@ XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ 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_IO, /* special allocation scheme used for I/O */ + XML_BUFFER_ALLOC_HYBRID /* exact up to a threshold, and doubleit thereafter */ } xmlBufferAllocationScheme; /** * xmlBuffer: * - * A buffer structure. + * A buffer structure, this old construct is limited to 2GB and + * is being deprecated, use API with xmlBuf instead */ typedef struct _xmlBuffer xmlBuffer; typedef xmlBuffer *xmlBufferPtr; @@ -93,6 +96,41 @@ }; /** + * xmlBuf: + * + * A buffer structure, new one, the actual structure internals are not public + */ + +typedef struct _xmlBuf xmlBuf; + +/** + * xmlBufPtr: + * + * A pointer to a buffer structure, the actual structure internals are not + * public + */ + +typedef xmlBuf *xmlBufPtr; + +/* + * A few public routines for xmlBuf. As those are expected to be used + * mostly internally the bulk of the routines are internal in buf.h + */ +XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBufPtr buf); +XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (const xmlBufPtr buf); +XMLPUBFUN size_t XMLCALL xmlBufUse (xmlBufPtr buf); +XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len); + +/* + * LIBXML2_NEW_BUFFER: + * + * Macro used to express that the API use the new buffers for + * xmlParserInputBuffer and xmlOutputBuffer. The change was + * introduced in 2.9.0. + */ +#define LIBXML2_NEW_BUFFER + +/** * XML_XML_NAMESPACE: * * This is the namespace for the special xml: prefix predefined in the @@ -479,7 +517,7 @@ /** * XML_GET_LINE: * - * Macro to extract the line number of an element node. + * Macro to extract the line number of an element node. */ #define XML_GET_LINE(n) \ (xmlGetLineNo(n)) @@ -522,7 +560,7 @@ /* End of common part */ int compression;/* level of zlib compression */ - int standalone; /* standalone document (no external refs) + int standalone; /* standalone document (no external refs) 1 if standalone="yes" 0 if standalone="no" -1 if there is no XML declaration @@ -553,9 +591,9 @@ /** * xmlDOMWrapAcquireNsFunction: * @ctxt: a DOM wrapper context - * @node: the context node (element or attribute) + * @node: the context node (element or attribute) * @nsName: the requested namespace name - * @nsPrefix: the requested namespace prefix + * @nsPrefix: the requested namespace prefix * * A function called to acquire namespaces (xmlNs) from the wrapper. * @@ -602,7 +640,7 @@ /** * xmlRootNode: * - * Macro for compatibility naming layer with libxml1. Maps + * Macro for compatibility naming layer with libxml1. Maps * to "children". */ #ifndef xmlRootNode @@ -623,429 +661,436 @@ #endif #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateQName (const xmlChar *value, int space); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateName (const xmlChar *value, int space); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNMToken (const xmlChar *value, int space); #endif -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlBuildQName (const xmlChar *ncname, const xmlChar *prefix, xmlChar *memory, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlSplitQName2 (const xmlChar *name, xmlChar **prefix); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlSplitQName3 (const xmlChar *name, int *len); /* - * Handling Buffers. + * Handling Buffers, the old ones see @xmlBuf for the new ones. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); -XMLPUBFUN xmlBufferAllocationScheme XMLCALL +XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlGetBufferAllocationScheme(void); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreate (void); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreateSize (size_t size); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreateStatic (void *mem, size_t size); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferResize (xmlBufferPtr buf, unsigned int size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferFree (xmlBufferPtr buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferDump (FILE *file, xmlBufferPtr buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferAdd (xmlBufferPtr buf, const xmlChar *str, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferAddHead (xmlBufferPtr buf, const xmlChar *str, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferCat (xmlBufferPtr buf, const xmlChar *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferCCat (xmlBufferPtr buf, const char *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferShrink (xmlBufferPtr buf, unsigned int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferGrow (xmlBufferPtr buf, unsigned int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferEmpty (xmlBufferPtr buf); -XMLPUBFUN const xmlChar* XMLCALL +XMLPUBFUN const xmlChar* XMLCALL xmlBufferContent (const xmlBufferPtr buf); -XMLPUBFUN void XMLCALL +XMLPUBFUN xmlChar* XMLCALL + xmlBufferDetach (xmlBufferPtr buf); +XMLPUBFUN void XMLCALL xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferAllocationScheme scheme); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferLength (const xmlBufferPtr buf); /* * Creating/freeing new structures. */ -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlCreateIntSubset (xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlNewDtd (xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDtd (xmlDtdPtr cur); #ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlNewGlobalNs (xmlDocPtr doc, const xmlChar *href, const xmlChar *prefix); #endif /* LIBXML_LEGACY_ENABLED */ -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs (xmlNodePtr node, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNs (xmlNsPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNsList (xmlNsPtr cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc (const xmlChar *version); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDoc (xmlDocPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewDocProp (xmlDocPtr doc, const xmlChar *name, const xmlChar *value); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewProp (xmlNodePtr node, const xmlChar *name, const xmlChar *value); #endif -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsPropEatName (xmlNodePtr node, xmlNsPtr ns, xmlChar *name, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreePropList (xmlAttrPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeProp (xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlCopyProp (xmlNodePtr target, xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlCopyPropList (xmlNodePtr target, xmlAttrPtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlCopyDtd (xmlDtdPtr dtd); #endif /* LIBXML_TREE_ENABLED */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlCopyDoc (xmlDocPtr doc, int recursive); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ /* * Creating new nodes. */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNode (xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNodeEatName (xmlDocPtr doc, xmlNsPtr ns, xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewNode (xmlNsPtr ns, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewNodeEatName (xmlNsPtr ns, xmlChar *name); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewChild (xmlNodePtr parent, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); #endif -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocText (xmlDocPtr doc, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewText (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocPI (xmlDocPtr doc, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewPI (const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocTextLen (xmlDocPtr doc, const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewTextLen (const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocComment (xmlDocPtr doc, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewComment (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewCDataBlock (xmlDocPtr doc, const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewCharRef (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewReference (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlCopyNode (const xmlNodePtr node, int recursive); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocCopyNode (const xmlNodePtr node, xmlDocPtr doc, int recursive); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocCopyNodeList (xmlDocPtr doc, const xmlNodePtr node); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlCopyNodeList (const xmlNodePtr node); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewTextChild (xmlNodePtr parent, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocRawNode (xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocFragment (xmlDocPtr doc); #endif /* LIBXML_TREE_ENABLED */ /* * Navigating. */ -XMLPUBFUN long XMLCALL +XMLPUBFUN long XMLCALL xmlGetLineNo (xmlNodePtr node); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNodePath (xmlNodePtr node); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocGetRootElement (xmlDocPtr doc); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlGetLastChild (xmlNodePtr parent); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNodeIsText (xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsBlankNode (xmlNodePtr node); /* * Changing the structure. */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocSetRootElement (xmlDocPtr doc, xmlNodePtr root); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetName (xmlNodePtr cur, const xmlChar *name); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild (xmlNodePtr parent, xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddChildList (xmlNodePtr parent, xmlNodePtr cur); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlReplaceNode (xmlNodePtr old, xmlNodePtr cur); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddPrevSibling (xmlNodePtr cur, xmlNodePtr elem); #endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling (xmlNodePtr cur, xmlNodePtr elem); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddNextSibling (xmlNodePtr cur, xmlNodePtr elem); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlUnlinkNode (xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlTextMerge (xmlNodePtr first, xmlNodePtr second); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextConcat (xmlNodePtr node, const xmlChar *content, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNodeList (xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNode (xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetTreeDoc (xmlNodePtr tree, xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetListDoc (xmlNodePtr list, xmlDocPtr doc); /* * Namespaces. */ -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs (xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNsByHref (xmlDocPtr doc, xmlNodePtr node, const xmlChar *href); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNsPtr * XMLCALL +XMLPUBFUN xmlNsPtr * XMLCALL xmlGetNsList (xmlDocPtr doc, xmlNodePtr node); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetNs (xmlNodePtr node, xmlNsPtr ns); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespace (xmlNsPtr cur); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespaceList (xmlNsPtr cur); /* * Changing the content. */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlSetProp (xmlNodePtr node, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlSetNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNoNsProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlHasProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlHasNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlStringGetNodeList (xmlDocPtr doc, const xmlChar *value); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlStringLenGetNodeList (xmlDocPtr doc, const xmlChar *value, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetString (xmlDocPtr doc, xmlNodePtr list, int inLine); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetRawString (xmlDocPtr doc, xmlNodePtr list, int inLine); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetContent (xmlNodePtr cur, const xmlChar *content); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetContentLen (xmlNodePtr cur, const xmlChar *content, int len); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeAddContent (xmlNodePtr cur, const xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeAddContentLen (xmlNodePtr cur, const xmlChar *content, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetContent (xmlNodePtr cur); + XMLPUBFUN int XMLCALL xmlNodeBufGetContent (xmlBufferPtr buffer, xmlNodePtr cur); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN int XMLCALL + xmlBufGetNodeContent (xmlBufPtr buf, + xmlNodePtr cur); + +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetLang (xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNodeGetSpacePreserve (xmlNodePtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetLang (xmlNodePtr cur, const xmlChar *lang); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetSpacePreserve (xmlNodePtr cur, int val); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetBase (xmlDocPtr doc, xmlNodePtr cur); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetBase (xmlNodePtr cur, const xmlChar *uri); #endif @@ -1053,14 +1098,14 @@ /* * Removing content. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRemoveProp (xmlAttrPtr cur); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlUnsetNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlUnsetProp (xmlNodePtr node, const xmlChar *name); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ @@ -1068,13 +1113,13 @@ /* * Internal, don't use. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteCHAR (xmlBufferPtr buf, const xmlChar *string); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteChar (xmlBufferPtr buf, const char *string); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string); @@ -1089,7 +1134,7 @@ /* * Namespace handling. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlReconciliateNs (xmlDocPtr doc, xmlNodePtr tree); #endif @@ -1098,61 +1143,67 @@ /* * Saving. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpFormatMemory (xmlDocPtr cur, xmlChar **mem, int *size, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpMemoryEnc (xmlDocPtr out_doc, xmlChar **doc_txt_ptr, int * doc_txt_len, const char *txt_encoding); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr, int * doc_txt_len, const char *txt_encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDocFormatDump (FILE *f, xmlDocPtr cur, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDocDump (FILE *f, xmlDocPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlElemDump (FILE *f, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFile (const char *filename, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFile (const char *filename, xmlDocPtr cur, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN size_t XMLCALL + xmlBufNodeDump (xmlBufPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format); +XMLPUBFUN int XMLCALL xmlNodeDump (xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeDumpOutput (xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, @@ -1160,13 +1211,13 @@ int format, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFileEnc (const char *filename, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFileEnc (const char *filename, xmlDocPtr cur, const char *encoding); @@ -1175,21 +1226,21 @@ /* * XHTML */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsXHTML (const xmlChar *systemID, const xmlChar *publicID); /* * Compression. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetDocCompressMode (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetDocCompressMode (xmlDocPtr doc, int mode); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetCompressMode (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetCompressMode (int mode); /* @@ -1207,7 +1258,7 @@ xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, xmlDocPtr sourceDoc, xmlNodePtr node, - xmlDocPtr destDoc, + xmlDocPtr destDoc, xmlNodePtr destParent, int options); XMLPUBFUN int XMLCALL Index: include/reactos/libs/libxml/valid.h =================================================================== --- include/reactos/libs/libxml/valid.h (revision 58293) +++ include/reactos/libs/libxml/valid.h (working copy) @@ -150,55 +150,55 @@ typedef xmlRefTable *xmlRefTablePtr; /* Notation */ -XMLPUBFUN xmlNotationPtr XMLCALL +XMLPUBFUN xmlNotationPtr XMLCALL xmlAddNotationDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, const xmlChar *PublicID, const xmlChar *SystemID); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNotationTablePtr XMLCALL +XMLPUBFUN xmlNotationTablePtr XMLCALL xmlCopyNotationTable (xmlNotationTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNotationTable (xmlNotationTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpNotationDecl (xmlBufferPtr buf, xmlNotationPtr nota); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpNotationTable (xmlBufferPtr buf, xmlNotationTablePtr table); #endif /* LIBXML_OUTPUT_ENABLED */ /* Element Content */ /* the non Doc version are being deprecated */ -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlNewElementContent (const xmlChar *name, xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlCopyElementContent (xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeElementContent (xmlElementContentPtr cur); /* the new versions with doc argument */ -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlNewDocElementContent (xmlDocPtr doc, const xmlChar *name, xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int englob); #ifdef LIBXML_OUTPUT_ENABLED /* DEPRECATED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSprintfElementContent(char *buf, xmlElementContentPtr content, int englob); @@ -206,39 +206,39 @@ /* DEPRECATED */ /* Element */ -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlAddElementDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContentPtr content); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlElementTablePtr XMLCALL +XMLPUBFUN xmlElementTablePtr XMLCALL xmlCopyElementTable (xmlElementTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeElementTable (xmlElementTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpElementTable (xmlBufferPtr buf, xmlElementTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpElementDecl (xmlBufferPtr buf, xmlElementPtr elem); #endif /* LIBXML_OUTPUT_ENABLED */ /* Enumeration */ -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlCreateEnumeration (const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeEnumeration (xmlEnumerationPtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlCopyEnumeration (xmlEnumerationPtr cur); #endif /* LIBXML_TREE_ENABLED */ /* Attribute */ -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem, @@ -249,55 +249,55 @@ const xmlChar *defaultValue, xmlEnumerationPtr tree); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlAttributeTablePtr XMLCALL +XMLPUBFUN xmlAttributeTablePtr XMLCALL xmlCopyAttributeTable (xmlAttributeTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeAttributeTable (xmlAttributeTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpAttributeTable (xmlBufferPtr buf, xmlAttributeTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpAttributeDecl (xmlBufferPtr buf, xmlAttributePtr attr); #endif /* LIBXML_OUTPUT_ENABLED */ /* IDs */ -XMLPUBFUN xmlIDPtr XMLCALL +XMLPUBFUN xmlIDPtr XMLCALL xmlAddID (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeIDTable (xmlIDTablePtr table); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlGetID (xmlDocPtr doc, const xmlChar *ID); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsID (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveID (xmlDocPtr doc, +XMLPUBFUN int XMLCALL + xmlRemoveID (xmlDocPtr doc, xmlAttrPtr attr); /* IDREFs */ -XMLPUBFUN xmlRefPtr XMLCALL +XMLPUBFUN xmlRefPtr XMLCALL xmlAddRef (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeRefTable (xmlRefTablePtr table); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsRef (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveRef (xmlDocPtr doc, +XMLPUBFUN int XMLCALL + xmlRemoveRef (xmlDocPtr doc, xmlAttrPtr attr); -XMLPUBFUN xmlListPtr XMLCALL +XMLPUBFUN xmlListPtr XMLCALL xmlGetRefs (xmlDocPtr doc, const xmlChar *ID); @@ -306,146 +306,146 @@ */ #ifdef LIBXML_VALID_ENABLED /* Allocate/Release Validation Contexts */ -XMLPUBFUN xmlValidCtxtPtr XMLCALL +XMLPUBFUN xmlValidCtxtPtr XMLCALL xmlNewValidCtxt(void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeValidCtxt(xmlValidCtxtPtr); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateRoot (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateElementDecl (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlElementPtr elem); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlAttributePtr attr); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateAttributeValue(xmlAttributeType type, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNotationPtr nota); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDtd (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDocument (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc); #endif /* LIBXML_VALID_ENABLED */ #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNotationUse (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *notationName); #endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsMixedElement (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlGetDtdAttrDesc (xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlGetDtdQAttrDesc (xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN xmlNotationPtr XMLCALL +XMLPUBFUN xmlNotationPtr XMLCALL xmlGetDtdNotationDesc (xmlDtdPtr dtd, const xmlChar *name); -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlGetDtdQElementDesc (xmlDtdPtr dtd, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlGetDtdElementDesc (xmlDtdPtr dtd, const xmlChar *name); #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **names, int *len, int max); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, int max); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNameValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNamesValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNmtokenValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNmtokensValue(const xmlChar *value); #ifdef LIBXML_REGEXP_ENABLED /* * Validation based on the regexp support */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePushElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *qname); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePushCData (xmlValidCtxtPtr ctxt, const xmlChar *data, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePopElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, Index: include/reactos/libs/libxml/xlink.h =================================================================== --- include/reactos/libs/libxml/xlink.h (revision 58293) +++ include/reactos/libs/libxml/xlink.h (working copy) @@ -57,7 +57,7 @@ * xlinkNodeDetectFunc: * @ctx: user data pointer * @node: the node to check - * + * * This is the prototype for the link detection routine. * It calls the default link detection callbacks upon link detection. */ @@ -157,26 +157,26 @@ /* * The default detection routine, can be overridden, they call the default - * detection callbacks. + * detection callbacks. */ -XMLPUBFUN xlinkNodeDetectFunc XMLCALL +XMLPUBFUN xlinkNodeDetectFunc XMLCALL xlinkGetDefaultDetect (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xlinkSetDefaultDetect (xlinkNodeDetectFunc func); /* * Routines to set/get the default handlers. */ -XMLPUBFUN xlinkHandlerPtr XMLCALL +XMLPUBFUN xlinkHandlerPtr XMLCALL xlinkGetDefaultHandler (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xlinkSetDefaultHandler (xlinkHandlerPtr handler); /* * Link detection module itself. */ -XMLPUBFUN xlinkType XMLCALL +XMLPUBFUN xlinkType XMLCALL xlinkIsLink (xmlDocPtr doc, xmlNodePtr node); Index: include/reactos/libs/libxml/xmlautomata.h =================================================================== --- include/reactos/libs/libxml/xmlautomata.h (revision 58293) +++ include/reactos/libs/libxml/xmlautomata.h (working copy) @@ -40,25 +40,25 @@ /* * Building API */ -XMLPUBFUN xmlAutomataPtr XMLCALL +XMLPUBFUN xmlAutomataPtr XMLCALL xmlNewAutomata (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeAutomata (xmlAutomataPtr am); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataGetInitState (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataSetFinalState (xmlAutomataPtr am, xmlAutomataStatePtr state); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewState (xmlAutomataPtr am); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewTransition (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, const xmlChar *token, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewTransition2 (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -73,7 +73,7 @@ const xmlChar *token2, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -81,7 +81,7 @@ int min, int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountTrans2 (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -90,7 +90,7 @@ int min, int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewOnceTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -99,46 +99,46 @@ int max, void *data); XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, + xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, xmlAutomataStatePtr from, - xmlAutomataStatePtr to, + xmlAutomataStatePtr to, const xmlChar *token, const xmlChar *token2, - int min, - int max, + int min, + int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewAllTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int lax); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewEpsilon (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountedTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int counter); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCounterTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int counter); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataNewCounter (xmlAutomataPtr am, int min, int max); -XMLPUBFUN xmlRegexpPtr XMLCALL +XMLPUBFUN xmlRegexpPtr XMLCALL xmlAutomataCompile (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataIsDeterminist (xmlAutomataPtr am); #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_AUTOMATA_ENABLED */ #endif /* LIBXML_REGEXP_ENABLED */ Index: include/reactos/libs/libxml/xmlerror.h =================================================================== --- include/reactos/libs/libxml/xmlerror.h (revision 58293) +++ include/reactos/libs/libxml/xmlerror.h (working copy) @@ -62,7 +62,9 @@ XML_FROM_WRITER, /* The xmlwriter module */ XML_FROM_MODULE, /* The dynamically loaded module module*/ XML_FROM_I18N, /* The module handling character conversion */ - XML_FROM_SCHEMATRONV /* The Schematron validator module */ + XML_FROM_SCHEMATRONV,/* The Schematron validator module */ + XML_FROM_BUFFER, /* The buffers module */ + XML_FROM_URI /* The URI module */ } xmlErrorDomain; /** @@ -205,6 +207,7 @@ XML_WAR_ENTITY_REDEFINED, /* 107 */ XML_ERR_UNKNOWN_VERSION, /* 108 */ XML_ERR_VERSION_MISMATCH, /* 109 */ + XML_ERR_NAME_TOO_LONG, /* 110 */ XML_NS_ERR_XML_NAMESPACE = 200, XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ XML_NS_ERR_QNAME, /* 202 */ @@ -825,11 +828,8 @@ XML_I18N_NO_HANDLER, /* 6001 */ XML_I18N_EXCESS_HANDLER, /* 6002 */ XML_I18N_CONV_FAILED, /* 6003 */ - XML_I18N_NO_OUTPUT /* 6004 */ -#if 0 - XML_CHECK_, /* 5033 */ - XML_CHECK_X /* 503 */ -#endif + XML_I18N_NO_OUTPUT, /* 6004 */ + XML_BUF_OVERFLOW = 7000 } xmlParserErrors; /** Index: include/reactos/libs/libxml/xmlexports.h =================================================================== --- include/reactos/libs/libxml/xmlexports.h (revision 58293) +++ include/reactos/libs/libxml/xmlexports.h (working copy) @@ -43,7 +43,7 @@ /** * XMLCDECL: * - * Macro which declares the calling convention for exported functions that + * Macro which declares the calling convention for exported functions that * use '...'. */ #define XMLCDECL @@ -115,7 +115,7 @@ */ #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) extern #else #define XMLPUBFUN #if !defined(LIBXML_STATIC) Index: include/reactos/libs/libxml/xmlIO.h =================================================================== --- include/reactos/libs/libxml/xmlIO.h (revision 58293) +++ include/reactos/libs/libxml/xmlIO.h (working copy) @@ -26,7 +26,7 @@ * xmlInputMatchCallback: * @filename: the filename or URI * - * Callback used in the I/O Input API to detect if the current handler + * Callback used in the I/O Input API to detect if the current handler * can provide input fonctionnalities for this resource. * * Returns 1 if yes and 0 if another Input module should be used @@ -72,7 +72,7 @@ * xmlOutputMatchCallback: * @filename: the filename or URI * - * Callback used in the I/O Output API to detect if the current handler + * Callback used in the I/O Output API to detect if the current handler * can provide output fonctionnalities for this resource. * * Returns 1 if yes and 0 if another Output module should be used @@ -126,11 +126,11 @@ void* context; xmlInputReadCallback readcallback; xmlInputCloseCallback closecallback; - + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - - xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ - xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */ + + xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */ + xmlBufPtr raw; /* if encoder != NULL buffer for raw input */ int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ int error; unsigned long rawconsumed;/* amount consumed from raw */ @@ -142,11 +142,11 @@ void* context; xmlOutputWriteCallback writecallback; xmlOutputCloseCallback closecallback; - + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - - xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ - xmlBufferPtr conv; /* if encoder != NULL buffer for output */ + + xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ + xmlBufPtr conv; /* if encoder != NULL buffer for output */ int written; /* total number of byte written */ int error; }; @@ -155,13 +155,13 @@ /* * Interfaces for input */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupInputCallbacks (void); XMLPUBFUN int XMLCALL xmlPopInputCallbacks (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterDefaultInputCallbacks (void); XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlAllocParserInputBuffer (xmlCharEncoding enc); @@ -186,22 +186,22 @@ xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferRead (xmlParserInputBufferPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferGrow (xmlParserInputBufferPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferPush (xmlParserInputBufferPtr in, int len, const char *buf); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); -XMLPUBFUN char * XMLCALL +XMLPUBFUN char * XMLCALL xmlParserGetDirectory (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, @@ -215,9 +215,9 @@ /* * Interfaces for output */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupOutputCallbacks (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterDefaultOutputCallbacks(void); XMLPUBFUN xmlOutputBufferPtr XMLCALL xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); @@ -245,24 +245,30 @@ void *ioctx, xmlCharEncodingHandlerPtr encoder); -XMLPUBFUN int XMLCALL +/* Couple of APIs to get the output without digging into the buffers */ +XMLPUBFUN const xmlChar * XMLCALL + xmlOutputBufferGetContent (xmlOutputBufferPtr out); +XMLPUBFUN size_t XMLCALL + xmlOutputBufferGetSize (xmlOutputBufferPtr out); + +XMLPUBFUN int XMLCALL xmlOutputBufferWrite (xmlOutputBufferPtr out, int len, const char *buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferWriteString (xmlOutputBufferPtr out, const char *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, const xmlChar *str, xmlCharEncodingOutputFunc escaping); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferFlush (xmlOutputBufferPtr out); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferClose (xmlOutputBufferPtr out); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, xmlOutputOpenCallback openFunc, xmlOutputWriteCallback writeFunc, @@ -275,10 +281,10 @@ #ifdef LIBXML_HTTP_ENABLED /* This function only exists if HTTP support built into the library */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterHTTPPostCallbacks (void ); #endif /* LIBXML_HTTP_ENABLED */ - + #endif /* LIBXML_OUTPUT_ENABLED */ XMLPUBFUN xmlParserInputPtr XMLCALL @@ -288,69 +294,69 @@ /* * A predefined entity loader disabling network accesses */ -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNoNetExternalEntityLoader (const char *URL, const char *ID, xmlParserCtxtPtr ctxt); -/* - * xmlNormalizeWindowsPath is obsolete, don't use it. +/* + * xmlNormalizeWindowsPath is obsolete, don't use it. * Check xmlCanonicPath in uri.h for a better alternative. */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNormalizeWindowsPath (const xmlChar *path); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCheckFilename (const char *path); /** - * Default 'file://' protocol callbacks + * Default 'file://' protocol callbacks */ -XMLPUBFUN int XMLCALL - xmlFileMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlFileOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlFileRead (void * context, - char * buffer, +XMLPUBFUN int XMLCALL + xmlFileMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlFileOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlFileRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL - xmlFileClose (void * context); +XMLPUBFUN int XMLCALL + xmlFileClose (void * context); /** - * Default 'http://' protocol callbacks + * Default 'http://' protocol callbacks */ #ifdef LIBXML_HTTP_ENABLED -XMLPUBFUN int XMLCALL - xmlIOHTTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlIOHTTPOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlIOHTTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpen (const char *filename); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlIOHTTPOpenW (const char * post_uri, int compression ); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL - xmlIOHTTPRead (void * context, - char * buffer, +XMLPUBFUN int XMLCALL + xmlIOHTTPRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL - xmlIOHTTPClose (void * context); +XMLPUBFUN int XMLCALL + xmlIOHTTPClose (void * context); #endif /* LIBXML_HTTP_ENABLED */ /** - * Default 'ftp://' protocol callbacks + * Default 'ftp://' protocol callbacks */ -#ifdef LIBXML_FTP_ENABLED -XMLPUBFUN int XMLCALL - xmlIOFTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlIOFTPOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlIOFTPRead (void * context, - char * buffer, +#ifdef LIBXML_FTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOFTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOFTPOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlIOFTPRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL - xmlIOFTPClose (void * context); +XMLPUBFUN int XMLCALL + xmlIOFTPClose (void * context); #endif /* LIBXML_FTP_ENABLED */ #ifdef __cplusplus Index: include/reactos/libs/libxml/xmlmodule.h =================================================================== --- include/reactos/libs/libxml/xmlmodule.h (revision 58293) +++ include/reactos/libs/libxml/xmlmodule.h (working copy) @@ -50,7 +50,7 @@ #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_MODULES_ENABLED */ Index: include/reactos/libs/libxml/xmlreader.h =================================================================== --- include/reactos/libs/libxml/xmlreader.h (revision 58293) +++ include/reactos/libs/libxml/xmlreader.h (working copy) @@ -130,16 +130,16 @@ #ifdef LIBXML_WRITER_ENABLED XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); + xmlTextReaderReadInnerXml(xmlTextReaderPtr reader); XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); + xmlTextReaderReadOuterXml(xmlTextReaderPtr reader); #endif XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadString (xmlTextReaderPtr reader); + xmlTextReaderReadString (xmlTextReaderPtr reader); XMLPUBFUN int XMLCALL - xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader); + xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader); /* * Attributes of the node @@ -285,6 +285,11 @@ xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng); XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader, + xmlRelaxNGValidCtxtPtr ctxt, + int options); + +XMLPUBFUN int XMLCALL xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, xmlRelaxNGPtr schema); XMLPUBFUN int XMLCALL @@ -392,27 +397,26 @@ * * Signature of an error callback from a reader parser */ -typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, - const char *msg, - xmlParserSeverities severity, - xmlTextReaderLocatorPtr locator); +typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, + const char *msg, + xmlParserSeverities severity, + xmlTextReaderLocatorPtr locator); XMLPUBFUN int XMLCALL - xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); -/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/ + xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); + xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); XMLPUBFUN void XMLCALL - xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc f, - void *arg); + xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, + void *arg); XMLPUBFUN void XMLCALL - xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, - xmlStructuredErrorFunc f, - void *arg); + xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, + xmlStructuredErrorFunc f, + void *arg); XMLPUBFUN void XMLCALL - xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc *f, - void **arg); + xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, + void **arg); #endif /* LIBXML_READER_ENABLED */ Index: include/reactos/libs/libxml/xmlschemas.h =================================================================== --- include/reactos/libs/libxml/xmlschemas.h (revision 58293) +++ include/reactos/libs/libxml/xmlschemas.h (working copy) @@ -92,7 +92,8 @@ * * Signature of an error callback from an XSD validation */ -typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) + (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); /** * xmlSchemaValidityWarningFunc: @@ -102,7 +103,8 @@ * * Signature of a warning callback from an XSD validation */ -typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) + (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); /** * A schemas validation context @@ -113,6 +115,22 @@ typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; +/** + * xmlSchemaValidityLocatorFunc: + * @ctx: user provided context + * @file: returned file information + * @line: returned line information + * + * A schemas validation locator, a callback called by the validator. + * This is used when file or node informations are not available + * to find out what file and line number are affected + * + * Returns: 0 in case of success and -1 in case of error + */ + +typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx, + const char **file, unsigned long *line); + /* * Interfaces for parsing. */ @@ -171,6 +189,9 @@ XMLPUBFUN int XMLCALL xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, int options); +XMLPUBFUN void XMLCALL + xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt, + const char *filename); XMLPUBFUN int XMLCALL xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); @@ -210,6 +231,13 @@ void **user_data); XMLPUBFUN int XMLCALL xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); + + +XMLPUBFUN void XMLCALL + xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt, + xmlSchemaValidityLocatorFunc f, + void *ctxt); + #ifdef __cplusplus } #endif Index: include/reactos/libs/libxml/xmlschemastypes.h =================================================================== --- include/reactos/libs/libxml/xmlschemastypes.h (revision 58293) +++ include/reactos/libs/libxml/xmlschemastypes.h (working copy) @@ -30,23 +30,23 @@ XML_SCHEMA_WHITESPACE_COLLAPSE = 3 } xmlSchemaWhitespaceValueType; -XMLPUBFUN void XMLCALL - xmlSchemaInitTypes (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL + xmlSchemaInitTypes (void); +XMLPUBFUN void XMLCALL xmlSchemaCleanupTypes (void); -XMLPUBFUN xmlSchemaTypePtr XMLCALL +XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetPredefinedType (const xmlChar *name, const xmlChar *ns); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, const xmlChar *value, xmlSchemaValPtr *val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, const xmlChar *value, xmlSchemaValPtr *val, xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValidateFacet (xmlSchemaTypePtr base, xmlSchemaFacetPtr facet, const xmlChar *value, @@ -54,25 +54,25 @@ XMLPUBFUN int XMLCALL xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeValue (xmlSchemaValPtr val); -XMLPUBFUN xmlSchemaFacetPtr XMLCALL +XMLPUBFUN xmlSchemaFacetPtr XMLCALL xmlSchemaNewFacet (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, xmlSchemaTypePtr typeDecl, xmlSchemaParserCtxtPtr ctxt, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaCompareValues (xmlSchemaValPtr x, xmlSchemaValPtr y); -XMLPUBFUN xmlSchemaTypePtr XMLCALL +XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); XMLPUBFUN int XMLCALL xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, @@ -82,7 +82,7 @@ XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetBuiltInType (xmlSchemaValType type); XMLPUBFUN int XMLCALL - xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, + xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, int facetType); XMLPUBFUN xmlChar * XMLCALL xmlSchemaCollapseString (const xmlChar *value); @@ -91,7 +91,7 @@ XMLPUBFUN unsigned long XMLCALL xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); XMLPUBFUN int XMLCALL - xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, + xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, xmlSchemaFacetPtr facet, const xmlChar *value, xmlSchemaValPtr val, @@ -100,19 +100,19 @@ xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, xmlSchemaValType valType, const xmlChar *value, - xmlSchemaValPtr val, + xmlSchemaValPtr val, unsigned long *length, xmlSchemaWhitespaceValueType ws); XMLPUBFUN int XMLCALL - xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, + xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, const xmlChar *value, - xmlSchemaValPtr *val, + xmlSchemaValPtr *val, xmlNodePtr node); XMLPUBFUN int XMLCALL xmlSchemaGetCanonValue (xmlSchemaValPtr val, const xmlChar **retValue); XMLPUBFUN int XMLCALL - xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, + xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, const xmlChar **retValue, xmlSchemaWhitespaceValueType ws); XMLPUBFUN int XMLCALL Index: include/reactos/libs/libxml/xmlstring.h =================================================================== --- include/reactos/libs/libxml/xmlstring.h (revision 58293) +++ include/reactos/libs/libxml/xmlstring.h (working copy) @@ -113,16 +113,16 @@ XMLPUBFUN int XMLCALL xmlUTF8Strsize (const xmlChar *utf, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlUTF8Strndup (const xmlChar *utf, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlUTF8Strpos (const xmlChar *utf, int pos); XMLPUBFUN int XMLCALL xmlUTF8Strloc (const xmlChar *utf, const xmlChar *utfchar); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlUTF8Strsub (const xmlChar *utf, int start, int len); Index: include/reactos/libs/libxml/xmlversion.h =================================================================== --- include/reactos/libs/libxml/xmlversion.h (revision 58293) +++ include/reactos/libs/libxml/xmlversion.h (working copy) @@ -29,28 +29,28 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.7.8" +#define LIBXML_DOTTED_VERSION "2.9.0" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20708 +#define LIBXML_VERSION 20900 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20708" +#define LIBXML_VERSION_STRING "20900" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-GITv2.7.7-40-g82143f4" +#define LIBXML_VERSION_EXTRA "-GITv2.9.0-rc2-5-g7651606" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ * 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(20708); +#define LIBXML_TEST_VERSION xmlCheckVersion(20900); #ifndef VMS #if 0 @@ -264,7 +264,7 @@ * * Whether iconv support is available */ -#if 0 +#if 1 #define LIBXML_ICONV_ENABLED #endif @@ -300,7 +300,7 @@ * * Whether the memory debugging is configured in */ -#if 1 +#if 0 #define DEBUG_MEMORY_LOCATION #endif @@ -309,7 +309,7 @@ * * Whether the runtime debugging is configured in */ -#if 1 +#if 0 #define LIBXML_DEBUG_RUNTIME #endif @@ -391,6 +391,15 @@ #define LIBXML_ZLIB_ENABLED #endif +/** + * LIBXML_LZMA_ENABLED: + * + * Whether the Lzma support is compiled in + */ +#if 1 +#define LIBXML_LZMA_ENABLED +#endif + #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include @@ -403,7 +412,11 @@ */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__((unused)) +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif #endif /** Index: include/reactos/libs/libxml/xmlversion.h.in =================================================================== --- include/reactos/libs/libxml/xmlversion.h.in (revision 58293) +++ include/reactos/libs/libxml/xmlversion.h.in (working copy) @@ -391,6 +391,15 @@ #define LIBXML_ZLIB_ENABLED #endif +/** + * LIBXML_LZMA_ENABLED: + * + * Whether the Lzma support is compiled in + */ +#if @WITH_LZMA@ +#define LIBXML_LZMA_ENABLED +#endif + #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include @@ -403,7 +412,11 @@ */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__((unused)) +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif #endif /** Index: include/reactos/libs/libxml/xmlwriter.h =================================================================== --- include/reactos/libs/libxml/xmlwriter.h (revision 58293) +++ include/reactos/libs/libxml/xmlwriter.h (working copy) @@ -1,4 +1,3 @@ - /* * Summary: text writing API for XML * Description: text writing API for XML @@ -471,6 +470,10 @@ xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str); + XMLPUBFUN int XMLCALL + xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar); + + /* * misc */ Index: include/reactos/libs/libxml/xpath.h =================================================================== --- include/reactos/libs/libxml/xpath.h (revision 58293) +++ include/reactos/libs/libxml/xpath.h (working copy) @@ -33,7 +33,7 @@ extern "C" { #endif #endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ - + #ifdef LIBXML_XPATH_ENABLED typedef struct _xmlXPathContext xmlXPathContext; @@ -68,7 +68,9 @@ XPATH_UNDEF_PREFIX_ERROR, XPATH_ENCODING_ERROR, XPATH_INVALID_CHAR_ERROR, - XPATH_INVALID_CTXT + XPATH_INVALID_CTXT, + XPATH_STACK_ERROR, + XPATH_FORBID_VARIABLE_ERROR } xmlXPathError; /* @@ -271,11 +273,11 @@ * * Expression evaluation occurs with respect to a context. * he context consists of: - * - a node (the context node) - * - a node list (the context node list) - * - a set of variable bindings - * - a function library - * - the set of namespace declarations in scope for the expression + * - a node (the context node) + * - a node list (the context node list) + * - a set of variable bindings + * - a function library + * - the set of namespace declarations in scope for the expression * Following the switch to hash tables, this need to be trimmed up at * the next binary incompatible release. * The node may be modified when the context is passed to libxml2 @@ -380,6 +382,8 @@ xmlXPathCompExprPtr comp; /* the precompiled expression */ int xptr; /* it this an XPointer expression */ xmlNodePtr ancestor; /* used for walking preceding axis */ + + int valueFrame; /* used to limit Pop on the stack */ }; /************************************************************************ @@ -417,7 +421,7 @@ * @index is out of range (0 to length-1) */ #define xmlXPathNodeSetItem(ns, index) \ - ((((ns) != NULL) && \ + ((((ns) != NULL) && \ ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ (ns)->nodeTab[(index)] \ : NULL) @@ -433,64 +437,64 @@ (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeObject (xmlXPathObjectPtr obj); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeSetCreate (xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeNodeSet (xmlNodeSetPtr obj); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathObjectCopy (xmlXPathObjectPtr val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCmpNodes (xmlNodePtr node1, xmlNodePtr node2); /** * Conversion functions to basic types. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastNumberToBoolean (double val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastStringToBoolean (const xmlChar * val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastToBoolean (xmlXPathObjectPtr val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastBooleanToNumber (int val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastStringToNumber (const xmlChar * val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastNodeToNumber (xmlNodePtr node); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastToNumber (xmlXPathObjectPtr val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastBooleanToString (int val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNumberToString (double val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNodeToString (xmlNodePtr node); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastToString (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertBoolean (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertNumber (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertString (xmlXPathObjectPtr val); /** * Context handling. */ -XMLPUBFUN xmlXPathContextPtr XMLCALL +XMLPUBFUN xmlXPathContextPtr XMLCALL xmlXPathNewContext (xmlDocPtr doc); XMLPUBFUN void XMLCALL xmlXPathFreeContext (xmlXPathContextPtr ctxt); @@ -502,36 +506,36 @@ /** * Evaluation functions. */ -XMLPUBFUN long XMLCALL +XMLPUBFUN long XMLCALL xmlXPathOrderDocElems (xmlDocPtr doc); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathEval (const xmlChar *str, xmlXPathContextPtr ctx); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathEvalExpression (const xmlChar *str, xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, xmlXPathObjectPtr res); /** * Separate compilation/evaluation entry points. */ -XMLPUBFUN xmlXPathCompExprPtr XMLCALL +XMLPUBFUN xmlXPathCompExprPtr XMLCALL xmlXPathCompile (const xmlChar *str); -XMLPUBFUN xmlXPathCompExprPtr XMLCALL +XMLPUBFUN xmlXPathCompExprPtr XMLCALL xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, - const xmlChar *str); -XMLPUBFUN xmlXPathObjectPtr XMLCALL + const xmlChar *str); +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathCompiledEval (xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); #endif /* LIBXML_XPATH_ENABLED */ #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathInit (void); XMLPUBFUN int XMLCALL xmlXPathIsNaN (double val); Index: include/reactos/libs/libxml/xpathInternals.h =================================================================== --- include/reactos/libs/libxml/xpathInternals.h (revision 58293) +++ include/reactos/libs/libxml/xpathInternals.h (working copy) @@ -100,16 +100,16 @@ */ #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); -XMLPUBFUN double XMLCALL - xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathPopString (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void * XMLCALL - xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); +XMLPUBFUN double XMLCALL + xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathPopString (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void * XMLCALL + xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); /** * xmlXPathReturnBoolean: @@ -296,7 +296,9 @@ #define CHECK_ARITY(x) \ if (ctxt == NULL) return; \ if (nargs != (x)) \ - XP_ERROR(XPATH_INVALID_ARITY); + XP_ERROR(XPATH_INVALID_ARITY); \ + if (ctxt->valueNr < ctxt->valueFrame + (x)) \ + XP_ERROR(XPATH_STACK_ERROR); /** * CAST_TO_STRING: @@ -329,7 +331,7 @@ * Variable Lookup forwarding. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, xmlXPathVariableLookupFunc f, void *data); @@ -338,7 +340,7 @@ * Function Lookup forwarding. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, xmlXPathFuncLookupFunc f, void *funcCtxt); @@ -346,7 +348,7 @@ /* * Error reporting. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPatherror (xmlXPathParserContextPtr ctxt, const char *file, int line, @@ -357,11 +359,11 @@ int error); #ifdef LIBXML_DEBUG_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathDebugDumpObject (FILE *output, xmlXPathObjectPtr cur, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp, int depth); @@ -369,48 +371,48 @@ /** * NodeSet handling. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDistinctSorted (xmlNodeSetPtr nodes); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDistinct (xmlNodeSetPtr nodes); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeLeading (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathLeading (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeTrailing (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); @@ -419,51 +421,51 @@ * Extending a context. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterNs (xmlXPathContextPtr ctxt, const xmlChar *prefix, const xmlChar *ns_uri); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlXPathNsLookup (xmlXPathContextPtr ctxt, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathFunction f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathFunction f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathObjectPtr value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathObjectPtr value); -XMLPUBFUN xmlXPathFunction XMLCALL +XMLPUBFUN xmlXPathFunction XMLCALL xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, const xmlChar *name); -XMLPUBFUN xmlXPathFunction XMLCALL +XMLPUBFUN xmlXPathFunction XMLCALL xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathVariableLookup (xmlXPathContextPtr ctxt, const xmlChar *name); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); /** @@ -471,79 +473,79 @@ */ XMLPUBFUN xmlXPathParserContextPtr XMLCALL xmlXPathNewParserContext (const xmlChar *str, - xmlXPathContextPtr ctxt); -XMLPUBFUN void XMLCALL + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); /* TODO: remap to xmlXPathValuePop and Push. */ -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL valuePop (xmlXPathParserContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL valuePush (xmlXPathParserContextPtr ctxt, - xmlXPathObjectPtr value); + xmlXPathObjectPtr value); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewString (const xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewCString (const char *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapString (xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapCString (char * val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewFloat (double val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewBoolean (int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewNodeSet (xmlNodePtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewValueTree (xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN int XMLCALL xmlXPathNodeSetAdd (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN int XMLCALL xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, - xmlNodePtr node, +XMLPUBFUN int XMLCALL + xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, + xmlNodePtr node, xmlNsPtr ns); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathNodeSetSort (xmlNodeSetPtr set); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRoot (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathParseName (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); /* * Existing functions. */ -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathStringEvalNumber (const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, +XMLPUBFUN int XMLCALL + xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr res); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeSetMerge (xmlNodeSetPtr val1, +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetMerge (xmlNodeSetPtr val1, xmlNodeSetPtr val2); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetDel (xmlNodeSetPtr cur, +XMLPUBFUN void XMLCALL + xmlXPathNodeSetDel (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetRemove (xmlNodeSetPtr cur, +XMLPUBFUN void XMLCALL + xmlXPathNodeSetRemove (xmlNodeSetPtr cur, int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewNodeSetList (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapNodeSet (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapExternal (void *val); XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); @@ -621,7 +623,7 @@ * Really internal functions */ XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); - + #ifdef __cplusplus } #endif Index: include/reactos/libs/libxml/xpointer.h =================================================================== --- include/reactos/libs/libxml/xpointer.h (revision 58293) +++ include/reactos/libs/libxml/xpointer.h (working copy) @@ -7,7 +7,7 @@ * * Added support for the element() scheme described in: * W3C Proposed Recommendation 13 November 2002 - * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ * * Copy: See Copyright for the status of this software. * @@ -43,68 +43,68 @@ * Handling of location sets. */ -XMLPUBFUN xmlLocationSetPtr XMLCALL +XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); -XMLPUBFUN xmlLocationSetPtr XMLCALL +XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, xmlLocationSetPtr val2); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRange (xmlNodePtr start, int startindex, xmlNodePtr end, int endindex); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePoints (xmlXPathObjectPtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodePoint (xmlNodePtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodes (xmlNodePtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodes (xmlNodePtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodeObject (xmlNodePtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewCollapsedRange (xmlNodePtr start); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrWrapLocationSet (xmlLocationSetPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetDel (xmlLocationSetPtr cur, xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, int val); /* * Functions. */ -XMLPUBFUN xmlXPathContextPtr XMLCALL +XMLPUBFUN xmlXPathContextPtr XMLCALL xmlXPtrNewContext (xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrEval (const xmlChar *str, xmlXPathContextPtr ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, - int nargs); -XMLPUBFUN xmlNodePtr XMLCALL + int nargs); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); #ifdef __cplusplus } Index: lib/3rdparty/libxml2/acinclude.m4 =================================================================== --- lib/3rdparty/libxml2/acinclude.m4 (revision 58293) +++ lib/3rdparty/libxml2/acinclude.m4 (working copy) @@ -2,8 +2,8 @@ dnl _any_ output. Some compilers might issue warnings which we want dnl to catch. AC_DEFUN([AC_TRY_EVAL2], -[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl -(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) +[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl +(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL AC_DEFUN([AC_TRY_COMPILE2], @@ -19,8 +19,8 @@ ifelse([$3], , :, [rm -rf conftest* $3]) else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD ifelse([$4], , , [ rm -rf conftest* $4 ])dnl Index: lib/3rdparty/libxml2/aclocal.m4 =================================================================== --- lib/3rdparty/libxml2/aclocal.m4 (revision 58293) +++ lib/3rdparty/libxml2/aclocal.m4 (working copy) @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,18 +14,21 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, -[m4_warning([this file was generated for autoconf 2.63. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -406,18 +416,6 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -557,12 +555,15 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -694,12 +695,15 @@ fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -722,13 +726,14 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -736,13 +741,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -753,32 +758,6 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -AC_DEFUN([AM_C_PROTOTYPES], -[AC_REQUIRE([AC_C_PROTOTYPES]) -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. -AC_REQUIRE([AC_HEADER_STDC]) -AC_CHECK_HEADERS([string.h]) -AC_SUBST([U])dnl -AC_SUBST([ANSI2KNR])dnl -_AM_SUBST_NOTMAKE([ANSI2KNR])dnl -]) - -AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) - # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 @@ -844,12 +823,71 @@ fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -872,13 +910,13 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -887,13 +925,13 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -915,10 +953,11 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) Index: lib/3rdparty/libxml2/buf.c =================================================================== --- lib/3rdparty/libxml2/buf.c (revision 0) +++ lib/3rdparty/libxml2/buf.c (working copy) @@ -0,0 +1,1301 @@ +/* + * buf.c: memory buffers for libxml2 + * + * new buffer structures and entry points to simplify the maintainance + * 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 + * xmlBuf...() counterparts to the old xmlBuf...() functions + * + * See Copyright for the status of this software. + * + * daniel@veillard.com + */ + +#define IN_LIBXML +#include "libxml.h" + +#include /* for memset() only ! */ +#include +#ifdef HAVE_CTYPE_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#include +#include +#include +#include "buf.h" + +#define WITH_BUFFER_COMPAT + +/** + * xmlBuf: + * + * A buffer structure. The base of the structure is somehow compatible + * with struct _xmlBuffer to limit risks on application which accessed + * directly the input->buf->buffer structures. + */ + +struct _xmlBuf { + xmlChar *content; /* The buffer content UTF8 */ + unsigned int compat_use; /* for binary compatibility */ + unsigned int compat_size; /* for binary compatibility */ + xmlBufferAllocationScheme alloc; /* The realloc method */ + xmlChar *contentIO; /* in IO mode we may have a different base */ + 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 occured */ +}; + +#ifdef WITH_BUFFER_COMPAT +/* + * Macro for compatibility with xmlBuffer to be used after an xmlBuf + * is updated. This makes sure the compat fields are updated too. + */ +#define UPDATE_COMPAT(buf) \ + if (buf->size < INT_MAX) buf->compat_size = buf->size; \ + else buf->compat_size = INT_MAX; \ + if (buf->use < INT_MAX) buf->compat_use = buf->use; \ + else buf->compat_use = INT_MAX; + +/* + * Macro for compatibility with xmlBuffer to be used in all the xmlBuf + * entry points, it checks that the compat fields have not been modified + * by direct call to xmlBuffer function from code compiled before 2.9.0 . + */ +#define CHECK_COMPAT(buf) \ + if (buf->size != (size_t) buf->compat_size) \ + if (buf->compat_size < INT_MAX) \ + buf->size = buf->compat_size; \ + if (buf->use != (size_t) buf->compat_use) \ + if (buf->compat_use < INT_MAX) \ + buf->use = buf->compat_use; + +#else /* ! WITH_BUFFER_COMPAT */ +#define UPDATE_COMPAT(buf) +#define CHECK_COMPAT(buf) +#endif /* WITH_BUFFER_COMPAT */ + +/** + * xmlBufMemoryError: + * @extra: extra informations + * + * Handle an out of memory condition + * To be improved... + */ +static void +xmlBufMemoryError(xmlBufPtr buf, const char *extra) +{ + __xmlSimpleError(XML_FROM_BUFFER, XML_ERR_NO_MEMORY, NULL, NULL, extra); + if ((buf) && (buf->error == 0)) + buf->error = XML_ERR_NO_MEMORY; +} + +/** + * xmlBufOverflowError: + * @extra: extra informations + * + * Handle a buffer overflow error + * To be improved... + */ +static void +xmlBufOverflowError(xmlBufPtr buf, const char *extra) +{ + __xmlSimpleError(XML_FROM_BUFFER, XML_BUF_OVERFLOW, NULL, NULL, extra); + if ((buf) && (buf->error == 0)) + buf->error = XML_BUF_OVERFLOW; +} + + +/** + * xmlBufCreate: + * + * routine to create an XML buffer. + * returns the new structure. + */ +xmlBufPtr +xmlBufCreate(void) { + xmlBufPtr ret; + + ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); + if (ret == NULL) { + xmlBufMemoryError(NULL, "creating buffer"); + return(NULL); + } + ret->compat_use = 0; + ret->use = 0; + ret->error = 0; + ret->buffer = NULL; + ret->size = xmlDefaultBufferSize; + ret->compat_size = xmlDefaultBufferSize; + ret->alloc = xmlBufferAllocScheme; + ret->content = (xmlChar *) xmlMallocAtomic(ret->size * sizeof(xmlChar)); + if (ret->content == NULL) { + xmlBufMemoryError(ret, "creating buffer"); + xmlFree(ret); + return(NULL); + } + ret->content[0] = 0; + ret->contentIO = NULL; + return(ret); +} + +/** + * xmlBufCreateSize: + * @size: initial size of buffer + * + * routine to create an XML buffer. + * returns the new structure. + */ +xmlBufPtr +xmlBufCreateSize(size_t size) { + xmlBufPtr ret; + + ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); + if (ret == NULL) { + xmlBufMemoryError(NULL, "creating buffer"); + return(NULL); + } + ret->compat_use = 0; + ret->use = 0; + ret->error = 0; + ret->buffer = NULL; + ret->alloc = xmlBufferAllocScheme; + ret->size = (size ? size+2 : 0); /* +1 for ending null */ + ret->compat_size = (int) ret->size; + if (ret->size){ + ret->content = (xmlChar *) xmlMallocAtomic(ret->size * sizeof(xmlChar)); + if (ret->content == NULL) { + xmlBufMemoryError(ret, "creating buffer"); + xmlFree(ret); + return(NULL); + } + ret->content[0] = 0; + } else + ret->content = NULL; + ret->contentIO = NULL; + return(ret); +} + +/** + * xmlBufDetach: + * @buf: the buffer + * + * Remove the string contained in a buffer and give it back to the + * caller. The buffer is reset to an empty content. + * This doesn't work with immutable buffers as they can't be reset. + * + * Returns the previous string contained by the buffer. + */ +xmlChar * +xmlBufDetach(xmlBufPtr buf) { + xmlChar *ret; + + if (buf == NULL) + return(NULL); + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) + return(NULL); + if (buf->buffer != NULL) + return(NULL); + if (buf->error) + return(NULL); + + ret = buf->content; + buf->content = NULL; + buf->size = 0; + buf->use = 0; + buf->compat_use = 0; + buf->compat_size = 0; + + return ret; +} + + +/** + * xmlBufCreateStatic: + * @mem: the memory area + * @size: the size in byte + * + * routine to create an XML buffer from an immutable memory area. + * The area won't be modified nor copied, and is expected to be + * present until the end of the buffer lifetime. + * + * returns the new structure. + */ +xmlBufPtr +xmlBufCreateStatic(void *mem, size_t size) { + xmlBufPtr ret; + + if ((mem == NULL) || (size == 0)) + return(NULL); + + ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); + if (ret == NULL) { + xmlBufMemoryError(NULL, "creating buffer"); + return(NULL); + } + if (size < INT_MAX) { + ret->compat_use = size; + ret->compat_size = size; + } else { + ret->compat_use = INT_MAX; + ret->compat_size = INT_MAX; + } + ret->use = size; + ret->size = size; + ret->alloc = XML_BUFFER_ALLOC_IMMUTABLE; + ret->content = (xmlChar *) mem; + ret->error = 0; + ret->buffer = NULL; + return(ret); +} + +/** + * xmlBufGetAllocationScheme: + * @buf: the buffer + * + * Get the buffer allocation scheme + * + * Returns the scheme or -1 in case of error + */ +int +xmlBufGetAllocationScheme(xmlBufPtr buf) { + if (buf == NULL) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufGetAllocationScheme: buf == NULL\n"); +#endif + return(-1); + } + return(buf->alloc); +} + +/** + * xmlBufSetAllocationScheme: + * @buf: the buffer to tune + * @scheme: allocation scheme to use + * + * Sets the allocation scheme for this buffer + * + * returns 0 in case of success and -1 in case of failure + */ +int +xmlBufSetAllocationScheme(xmlBufPtr buf, + xmlBufferAllocationScheme scheme) { + if ((buf == NULL) || (buf->error != 0)) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufSetAllocationScheme: buf == NULL or in error\n"); +#endif + return(-1); + } + if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) || + (buf->alloc == XML_BUFFER_ALLOC_IO)) + return(-1); + if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) || + (scheme == XML_BUFFER_ALLOC_EXACT) || + (scheme == XML_BUFFER_ALLOC_HYBRID) || + (scheme == XML_BUFFER_ALLOC_IMMUTABLE)) { + buf->alloc = scheme; + if (buf->buffer) + buf->buffer->alloc = scheme; + return(0); + } + /* + * Switching a buffer ALLOC_IO has the side effect of initializing + * the contentIO field with the current content + */ + if (scheme == XML_BUFFER_ALLOC_IO) { + buf->alloc = XML_BUFFER_ALLOC_IO; + buf->contentIO = buf->content; + } + return(-1); +} + +/** + * xmlBufFree: + * @buf: the buffer to free + * + * Frees an XML buffer. It frees both the content and the structure which + * encapsulate it. + */ +void +xmlBufFree(xmlBufPtr buf) { + if (buf == NULL) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufFree: buf == NULL\n"); +#endif + return; + } + + if ((buf->alloc == XML_BUFFER_ALLOC_IO) && + (buf->contentIO != NULL)) { + xmlFree(buf->contentIO); + } else if ((buf->content != NULL) && + (buf->alloc != XML_BUFFER_ALLOC_IMMUTABLE)) { + xmlFree(buf->content); + } + xmlFree(buf); +} + +/** + * xmlBufEmpty: + * @buf: the buffer + * + * empty a buffer. + */ +void +xmlBufEmpty(xmlBufPtr buf) { + if ((buf == NULL) || (buf->error != 0)) return; + if (buf->content == NULL) return; + CHECK_COMPAT(buf) + buf->use = 0; + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) { + buf->content = BAD_CAST ""; + } else if ((buf->alloc == XML_BUFFER_ALLOC_IO) && + (buf->contentIO != NULL)) { + size_t start_buf = buf->content - buf->contentIO; + + buf->size += start_buf; + buf->content = buf->contentIO; + buf->content[0] = 0; + } else { + buf->content[0] = 0; + } + UPDATE_COMPAT(buf) +} + +/** + * xmlBufShrink: + * @buf: the buffer to dump + * @len: the number of xmlChar to remove + * + * Remove the beginning of an XML buffer. + * NOTE that this routine behaviour differs from xmlBufferShrink() + * as it will return 0 on error instead of -1 due to size_t being + * used as the return type. + * + * Returns the number of byte removed or 0 in case of failure + */ +size_t +xmlBufShrink(xmlBufPtr buf, size_t len) { + if ((buf == NULL) || (buf->error != 0)) return(0); + CHECK_COMPAT(buf) + if (len == 0) return(0); + if (len > buf->use) return(0); + + buf->use -= len; + if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) || + ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL))) { + /* + * we just move the content pointer, but also make sure + * the perceived buffer size has shrinked accordingly + */ + buf->content += len; + buf->size -= len; + + /* + * sometimes though it maybe be better to really shrink + * on IO buffers + */ + if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { + size_t start_buf = buf->content - buf->contentIO; + if (start_buf >= buf->size) { + memmove(buf->contentIO, &buf->content[0], buf->use); + buf->content = buf->contentIO; + buf->content[buf->use] = 0; + buf->size += start_buf; + } + } + } else { + memmove(buf->content, &buf->content[len], buf->use); + buf->content[buf->use] = 0; + } + UPDATE_COMPAT(buf) + return(len); +} + +/** + * xmlBufGrowInternal: + * @buf: the buffer + * @len: the minimum free size to allocate + * + * Grow the available space of an XML buffer, @len is the target value + * Error checking should be done on buf->error since using the return + * value doesn't work that well + * + * Returns 0 in case of error or the length made available otherwise + */ +static size_t +xmlBufGrowInternal(xmlBufPtr buf, size_t len) { + size_t size; + xmlChar *newbuf; + + if ((buf == NULL) || (buf->error != 0)) return(0); + CHECK_COMPAT(buf) + + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0); + if (buf->use + len < buf->size) + return(buf->size - buf->use); + + /* + * Windows has a BIG problem on realloc timing, so we try to double + * the buffer size (if that's enough) (bug 146697) + * Apparently BSD too, and it's probably best for linux too + * On an embedded system this may be something to change + */ +#if 1 + if (buf->size > (size_t) len) + size = buf->size * 2; + else + size = buf->use + len + 100; +#else + size = buf->use + len + 100; +#endif + + if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { + size_t start_buf = buf->content - buf->contentIO; + + newbuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + size); + if (newbuf == NULL) { + xmlBufMemoryError(buf, "growing buffer"); + return(0); + } + buf->contentIO = newbuf; + buf->content = newbuf + start_buf; + } else { + newbuf = (xmlChar *) xmlRealloc(buf->content, size); + if (newbuf == NULL) { + xmlBufMemoryError(buf, "growing buffer"); + return(0); + } + buf->content = newbuf; + } + buf->size = size; + UPDATE_COMPAT(buf) + return(buf->size - buf->use); +} + +/** + * xmlBufGrow: + * @buf: the buffer + * @len: the minimum free size to allocate + * + * Grow the available space of an XML buffer, @len is the target value + * This is been kept compatible with xmlBufferGrow() as much as possible + * + * Returns -1 in case of error or the length made available otherwise + */ +int +xmlBufGrow(xmlBufPtr buf, int len) { + size_t ret; + + if ((buf == NULL) || (len < 0)) return(-1); + if (len == 0) + return(0); + ret = xmlBufGrowInternal(buf, len); + if (buf->error != 0) + return(-1); + return((int) ret); +} + +/** + * xmlBufInflate: + * @buf: the buffer + * @len: the minimum extra free size to allocate + * + * Grow the available space of an XML buffer, adding at least @len bytes + * + * Returns 0 if successful or -1 in case of error + */ +int +xmlBufInflate(xmlBufPtr buf, size_t len) { + if (buf == NULL) return(-1); + xmlBufGrowInternal(buf, len + buf->size); + if (buf->error) + return(-1); + return(0); +} + +/** + * xmlBufDump: + * @file: the file output + * @buf: the buffer to dump + * + * Dumps an XML buffer to a FILE *. + * Returns the number of #xmlChar written + */ +size_t +xmlBufDump(FILE *file, xmlBufPtr buf) { + size_t ret; + + if ((buf == NULL) || (buf->error != 0)) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufDump: buf == NULL or in error\n"); +#endif + return(0); + } + if (buf->content == NULL) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufDump: buf->content == NULL\n"); +#endif + return(0); + } + CHECK_COMPAT(buf) + if (file == NULL) + file = stdout; + ret = fwrite(buf->content, sizeof(xmlChar), buf->use, file); + return(ret); +} + +/** + * xmlBufContent: + * @buf: the buffer + * + * Function to extract the content of a buffer + * + * Returns the internal content + */ + +xmlChar * +xmlBufContent(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return NULL; + + return(buf->content); +} + +/** + * xmlBufEnd: + * @buf: the buffer + * + * Function to extract the end of the content of a buffer + * + * Returns the end of the internal content or NULL in case of error + */ + +xmlChar * +xmlBufEnd(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return NULL; + CHECK_COMPAT(buf) + + return(&buf->content[buf->use]); +} + +/** + * xmlBufAddLen: + * @buf: the buffer + * @len: the size which were added at the end + * + * Sometime data may be added at the end of the buffer without + * using the xmlBuf APIs that is used to expand the used space + * and set the zero terminating at the end of the buffer + * + * Returns -1 in case of error and 0 otherwise + */ +int +xmlBufAddLen(xmlBufPtr buf, size_t len) { + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (len > (buf->size - buf->use)) + return(-1); + buf->use += len; + UPDATE_COMPAT(buf) + if (buf->size > buf->use) + buf->content[buf->use] = 0; + else + return(-1); + return(0); +} + +/** + * xmlBufErase: + * @buf: the buffer + * @len: the size to erase at the end + * + * Sometime data need to be erased at the end of the buffer + * + * Returns -1 in case of error and 0 otherwise + */ +int +xmlBufErase(xmlBufPtr buf, size_t len) { + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (len > buf->use) + return(-1); + buf->use -= len; + buf->content[buf->use] = 0; + UPDATE_COMPAT(buf) + return(0); +} + +/** + * xmlBufLength: + * @buf: the buffer + * + * Function to get the length of a buffer + * + * Returns the length of data in the internal content + */ + +size_t +xmlBufLength(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return 0; + CHECK_COMPAT(buf) + + return(buf->use); +} + +/** + * xmlBufUse: + * @buf: the buffer + * + * Function to get the length of a buffer + * + * Returns the length of data in the internal content + */ + +size_t +xmlBufUse(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return 0; + CHECK_COMPAT(buf) + + return(buf->use); +} + +/** + * xmlBufAvail: + * @buf: the buffer + * + * Function to find how much free space is allocated but not + * used in the buffer. It does not account for the terminating zero + * usually needed + * + * Returns the amount or 0 if none or an error occured + */ + +size_t +xmlBufAvail(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return 0; + CHECK_COMPAT(buf) + + return(buf->size - buf->use); +} + +/** + * xmlBufIsEmpty: + * @buf: the buffer + * + * Tell if a buffer is empty + * + * Returns 0 if no, 1 if yes and -1 in case of error + */ +int +xmlBufIsEmpty(const xmlBufPtr buf) +{ + if ((!buf) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + + return(buf->use == 0); +} + +/** + * xmlBufResize: + * @buf: the buffer to resize + * @size: the desired size + * + * Resize a buffer to accommodate minimum size of @size. + * + * Returns 0 in case of problems, 1 otherwise + */ +int +xmlBufResize(xmlBufPtr buf, size_t size) +{ + unsigned int newSize; + xmlChar* rebuf = NULL; + size_t start_buf; + + if ((buf == NULL) || (buf->error)) + return(0); + CHECK_COMPAT(buf) + + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0); + + /* Don't resize if we don't have to */ + if (size < buf->size) + return 1; + + /* figure out new size */ + switch (buf->alloc){ + case XML_BUFFER_ALLOC_IO: + case XML_BUFFER_ALLOC_DOUBLEIT: + /*take care of empty case*/ + newSize = (buf->size ? buf->size*2 : size + 10); + while (size > newSize) { + if (newSize > UINT_MAX / 2) { + xmlBufMemoryError(buf, "growing buffer"); + return 0; + } + newSize *= 2; + } + break; + case XML_BUFFER_ALLOC_EXACT: + newSize = size+10; + break; + case XML_BUFFER_ALLOC_HYBRID: + if (buf->use < BASE_BUFFER_SIZE) + newSize = size; + else { + newSize = buf->size * 2; + while (size > newSize) { + if (newSize > UINT_MAX / 2) { + xmlBufMemoryError(buf, "growing buffer"); + return 0; + } + newSize *= 2; + } + } + break; + + default: + newSize = size+10; + break; + } + + if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { + start_buf = buf->content - buf->contentIO; + + if (start_buf > newSize) { + /* move data back to start */ + memmove(buf->contentIO, buf->content, buf->use); + buf->content = buf->contentIO; + buf->content[buf->use] = 0; + buf->size += start_buf; + } else { + rebuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + newSize); + if (rebuf == NULL) { + xmlBufMemoryError(buf, "growing buffer"); + return 0; + } + buf->contentIO = rebuf; + buf->content = rebuf + start_buf; + } + } else { + if (buf->content == NULL) { + rebuf = (xmlChar *) xmlMallocAtomic(newSize); + } else if (buf->size - buf->use < 100) { + rebuf = (xmlChar *) xmlRealloc(buf->content, newSize); + } else { + /* + * if we are reallocating a buffer far from being full, it's + * better to make a new allocation and copy only the used range + * and free the old one. + */ + rebuf = (xmlChar *) xmlMallocAtomic(newSize); + if (rebuf != NULL) { + memcpy(rebuf, buf->content, buf->use); + xmlFree(buf->content); + rebuf[buf->use] = 0; + } + } + if (rebuf == NULL) { + xmlBufMemoryError(buf, "growing buffer"); + return 0; + } + buf->content = rebuf; + } + buf->size = newSize; + UPDATE_COMPAT(buf) + + return 1; +} + +/** + * xmlBufAdd: + * @buf: the buffer to dump + * @str: the #xmlChar string + * @len: the number of #xmlChar to add + * + * Add a string range to an XML buffer. if len == -1, the length of + * str is recomputed. + * + * Returns 0 successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) { + unsigned int needSize; + + if ((str == NULL) || (buf == NULL) || (buf->error)) + return -1; + CHECK_COMPAT(buf) + + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1; + if (len < -1) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufAdd: len < 0\n"); +#endif + return -1; + } + if (len == 0) return 0; + + if (len < 0) + len = xmlStrlen(str); + + if (len < 0) return -1; + if (len == 0) return 0; + + needSize = buf->use + len + 2; + if (needSize > buf->size){ + if (!xmlBufResize(buf, needSize)){ + xmlBufMemoryError(buf, "growing buffer"); + return XML_ERR_NO_MEMORY; + } + } + + memmove(&buf->content[buf->use], str, len*sizeof(xmlChar)); + buf->use += len; + buf->content[buf->use] = 0; + UPDATE_COMPAT(buf) + return 0; +} + +/** + * xmlBufAddHead: + * @buf: the buffer + * @str: the #xmlChar string + * @len: the number of #xmlChar to add + * + * Add a string range to the beginning of an XML buffer. + * if len == -1, the length of @str is recomputed. + * + * Returns 0 successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) { + unsigned int needSize; + + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1; + if (str == NULL) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufAddHead: str == NULL\n"); +#endif + return -1; + } + if (len < -1) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufAddHead: len < 0\n"); +#endif + return -1; + } + if (len == 0) return 0; + + if (len < 0) + len = xmlStrlen(str); + + if (len <= 0) return -1; + + if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { + size_t start_buf = buf->content - buf->contentIO; + + if (start_buf > (unsigned int) len) { + /* + * We can add it in the space previously shrinked + */ + buf->content -= len; + memmove(&buf->content[0], str, len); + buf->use += len; + buf->size += len; + UPDATE_COMPAT(buf) + return(0); + } + } + needSize = buf->use + len + 2; + if (needSize > buf->size){ + if (!xmlBufResize(buf, needSize)){ + xmlBufMemoryError(buf, "growing buffer"); + return XML_ERR_NO_MEMORY; + } + } + + memmove(&buf->content[len], &buf->content[0], buf->use); + memmove(&buf->content[0], str, len); + buf->use += len; + buf->content[buf->use] = 0; + UPDATE_COMPAT(buf) + return 0; +} + +/** + * xmlBufCat: + * @buf: the buffer to add to + * @str: the #xmlChar string + * + * Append a zero terminated string to an XML buffer. + * + * Returns 0 successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufCat(xmlBufPtr buf, const xmlChar *str) { + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1; + if (str == NULL) return -1; + return xmlBufAdd(buf, str, -1); +} + +/** + * xmlBufCCat: + * @buf: the buffer to dump + * @str: the C char string + * + * Append a zero terminated C string to an XML buffer. + * + * Returns 0 successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufCCat(xmlBufPtr buf, const char *str) { + const char *cur; + + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1; + if (str == NULL) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufCCat: str == NULL\n"); +#endif + return -1; + } + for (cur = str;*cur != 0;cur++) { + if (buf->use + 10 >= buf->size) { + if (!xmlBufResize(buf, buf->use+10)){ + xmlBufMemoryError(buf, "growing buffer"); + return XML_ERR_NO_MEMORY; + } + } + buf->content[buf->use++] = *cur; + } + buf->content[buf->use] = 0; + UPDATE_COMPAT(buf) + return 0; +} + +/** + * xmlBufWriteCHAR: + * @buf: the XML buffer + * @string: the string to add + * + * routine which manages and grows an output buffer. This one adds + * xmlChars at the end of the buffer. + * + * Returns 0 if successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string) { + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) + return(-1); + return(xmlBufCat(buf, string)); +} + +/** + * xmlBufWriteChar: + * @buf: the XML buffer output + * @string: the string to add + * + * routine which manage and grows an output buffer. This one add + * C chars at the end of the array. + * + * Returns 0 if successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufWriteChar(xmlBufPtr buf, const char *string) { + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) + return(-1); + return(xmlBufCCat(buf, string)); +} + + +/** + * xmlBufWriteQuotedString: + * @buf: the XML buffer output + * @string: the string to add + * + * routine which manage and grows an output buffer. This one writes + * a quoted or double quoted #xmlChar string, checking first if it holds + * quote or double-quotes internally + * + * Returns 0 if successful, a positive error code number otherwise + * and -1 in case of internal or API error. + */ +int +xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string) { + const xmlChar *cur, *base; + if ((buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) + return(-1); + if (xmlStrchr(string, '\"')) { + if (xmlStrchr(string, '\'')) { +#ifdef DEBUG_BUFFER + xmlGenericError(xmlGenericErrorContext, + "xmlBufWriteQuotedString: string contains quote and double-quotes !\n"); +#endif + xmlBufCCat(buf, "\""); + base = cur = string; + while(*cur != 0){ + if(*cur == '"'){ + if (base != cur) + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST """, 6); + cur++; + base = cur; + } + else { + cur++; + } + } + if (base != cur) + xmlBufAdd(buf, base, cur - base); + xmlBufCCat(buf, "\""); + } + else{ + xmlBufCCat(buf, "\'"); + xmlBufCat(buf, string); + xmlBufCCat(buf, "\'"); + } + } else { + xmlBufCCat(buf, "\""); + xmlBufCat(buf, string); + xmlBufCCat(buf, "\""); + } + return(0); +} + +/** + * xmlBufFromBuffer: + * @buffer: incoming old buffer to convert to a new one + * + * Helper routine to switch from the old buffer structures in use + * in various APIs. It creates a wrapper xmlBufPtr which will be + * used for internal processing until the xmlBufBackToBuffer() is + * issued. + * + * Returns a new xmlBufPtr unless the call failed and NULL is returned + */ +xmlBufPtr +xmlBufFromBuffer(xmlBufferPtr buffer) { + xmlBufPtr ret; + + if (buffer == NULL) + return(NULL); + + ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); + if (ret == NULL) { + xmlBufMemoryError(NULL, "creating buffer"); + return(NULL); + } + ret->use = buffer->use; + ret->size = buffer->size; + ret->compat_use = buffer->use; + ret->compat_size = buffer->size; + ret->error = 0; + ret->buffer = buffer; + ret->alloc = buffer->alloc; + ret->content = buffer->content; + ret->contentIO = buffer->contentIO; + + return(ret); +} + +/** + * xmlBufBackToBuffer: + * @buf: new buffer wrapping the old one + * + * Function to be called once internal processing had been done to + * update back the buffer provided by the user. This can lead to + * a failure in case the size accumulated in the xmlBuf is larger + * than what an xmlBuffer can support on 64 bits (INT_MAX) + * The xmlBufPtr @buf wrapper is deallocated by this call in any case. + * + * Returns the old xmlBufferPtr unless the call failed and NULL is returned + */ +xmlBufferPtr +xmlBufBackToBuffer(xmlBufPtr buf) { + xmlBufferPtr ret; + + if ((buf == NULL) || (buf->error)) + return(NULL); + CHECK_COMPAT(buf) + if (buf->buffer == NULL) { + xmlBufFree(buf); + return(NULL); + } + + ret = buf->buffer; + /* + * What to do in case of error in the buffer ??? + */ + if (buf->use > INT_MAX) { + /* + * Worse case, we really allocated and used more than the + * maximum allowed memory for an xmlBuffer on this architecture. + * Keep the buffer but provide a truncated size value. + */ + xmlBufOverflowError(buf, "Used size too big for xmlBuffer"); + ret->use = INT_MAX; + ret->size = INT_MAX; + } else if (buf->size > INT_MAX) { + /* + * milder case, we allocated more than the maximum allowed memory + * for an xmlBuffer on this architecture, but used less than the + * limit. + * Keep the buffer but provide a truncated size value. + */ + xmlBufOverflowError(buf, "Allocated size too big for xmlBuffer"); + ret->size = INT_MAX; + } + ret->use = (int) buf->use; + ret->size = (int) buf->size; + ret->alloc = buf->alloc; + ret->content = buf->content; + ret->contentIO = buf->contentIO; + xmlFree(buf); + return(ret); +} + +/** + * xmlBufMergeBuffer: + * @buf: an xmlBufPtr + * @buffer: the buffer to consume into @buf + * + * The content of @buffer is appended to @buf and @buffer is freed + * + * Returns -1 in case of error, 0 otherwise, in any case @buffer is freed + */ +int +xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer) { + int ret = 0; + + if ((buf == NULL) || (buf->error)) { + xmlBufferFree(buffer); + return(-1); + } + CHECK_COMPAT(buf) + if ((buffer != NULL) && (buffer->content != NULL) && + (buffer->use > 0)) { + ret = xmlBufAdd(buf, buffer->content, buffer->use); + } + xmlBufferFree(buffer); + return(ret); +} + +/** + * xmlBufResetInput: + * @buf: an xmlBufPtr + * @input: an xmlParserInputPtr + * + * Update the input to use the current set of pointers from the buffer. + * + * Returns -1 in case of error, 0 otherwise + */ +int +xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input) { + if ((input == NULL) || (buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + input->base = input->cur = buf->content; + input->end = &buf->content[buf->use]; + return(0); +} + +/** + * xmlBufGetInputBase: + * @buf: an xmlBufPtr + * @input: an xmlParserInputPtr + * + * Get the base of the @input relative to the beginning of the buffer + * + * Returns the size_t corresponding to the displacement + */ +size_t +xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) { + size_t base; + + if ((input == NULL) || (buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + base = input->base - buf->content; + /* + * We could do some pointer arythmetic checks but that's probably + * sufficient. + */ + if (base > buf->size) { + xmlBufOverflowError(buf, "Input reference outside of the buffer"); + base = 0; + } + return(base); +} + +/** + * xmlBufSetInputBaseCur: + * @buf: an xmlBufPtr + * @input: an xmlParserInputPtr + * @base: the base value relative to the beginning of the buffer + * @cur: the cur value relative to the beginning of the buffer + * + * Update the input to use the base and cur relative to the buffer + * after a possible reallocation of its content + * + * Returns -1 in case of error, 0 otherwise + */ +int +xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input, + size_t base, size_t cur) { + if ((input == NULL) || (buf == NULL) || (buf->error)) + return(-1); + CHECK_COMPAT(buf) + input->base = &buf->content[base]; + input->cur = input->base + cur; + input->end = &buf->content[buf->use]; + return(0); +} Index: lib/3rdparty/libxml2/buf.h =================================================================== --- lib/3rdparty/libxml2/buf.h (revision 0) +++ lib/3rdparty/libxml2/buf.h (working copy) @@ -0,0 +1,72 @@ +/* + * Summary: Internal Interfaces for memory buffers in libxml2 + * Description: this module describes most of the new xmlBuf buffer + * entry points, those are private routines, with a + * few exceptions exported in tree.h. This was added + * in 2.9.0. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_BUF_H__ +#define __XML_BUF_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +xmlBufPtr xmlBufCreate(void); +xmlBufPtr xmlBufCreateSize(size_t size); +xmlBufPtr xmlBufCreateStatic(void *mem, size_t size); + +int xmlBufSetAllocationScheme(xmlBufPtr buf, + xmlBufferAllocationScheme scheme); +int xmlBufGetAllocationScheme(xmlBufPtr buf); + +void xmlBufFree(xmlBufPtr buf); +void xmlBufEmpty(xmlBufPtr buf); + +/* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */ +int xmlBufGrow(xmlBufPtr buf, int len); +int xmlBufInflate(xmlBufPtr buf, size_t len); +int xmlBufResize(xmlBufPtr buf, size_t len); + +int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len); +int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len); +int xmlBufCat(xmlBufPtr buf, const xmlChar *str); +int xmlBufCCat(xmlBufPtr buf, const char *str); +int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string); +int xmlBufWriteChar(xmlBufPtr buf, const char *string); +int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string); + +size_t xmlBufAvail(const xmlBufPtr buf); +size_t xmlBufLength(const xmlBufPtr buf); +/* size_t xmlBufUse(const xmlBufPtr buf); */ +int xmlBufIsEmpty(const xmlBufPtr buf); +int xmlBufAddLen(xmlBufPtr buf, size_t len); +int xmlBufErase(xmlBufPtr buf, size_t len); + +/* const xmlChar * xmlBufContent(const xmlBufPtr buf); */ +/* const xmlChar * xmlBufEnd(const xmlBufPtr buf); */ + +xmlChar * xmlBufDetach(xmlBufPtr buf); + +size_t xmlBufDump(FILE *file, xmlBufPtr buf); + +xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer); +xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf); +int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer); + +int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input); +size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input); +int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input, + size_t base, size_t cur); +#ifdef __cplusplus +} +#endif +#endif /* __XML_BUF_H__ */ + Index: lib/3rdparty/libxml2/c14n.c =================================================================== --- lib/3rdparty/libxml2/c14n.c (revision 58293) +++ lib/3rdparty/libxml2/c14n.c (working copy) @@ -1,12 +1,12 @@ /* - * "Canonical XML" implementation + * "Canonical XML" implementation * http://www.w3.org/TR/xml-c14n - * + * * "Exclusive XML Canonicalization" implementation * http://www.w3.org/TR/xml-exc-c14n * * See Copyright for the status of this software. - * + * * Author: Aleksey Sanin */ #define IN_LIBXML @@ -27,6 +27,8 @@ #include #include +#include "buf.h" + /************************************************************************ * * * Some declaration better left private ATM * @@ -44,7 +46,7 @@ int nsPrevStart; /* the begginning 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 */ + xmlNsPtr *nsTab; /* array of ns in no particular order */ xmlNodePtr *nodeTab; /* array of nodes in no particular order */ } xmlC14NVisibleNsStack, *xmlC14NVisibleNsStackPtr; @@ -52,7 +54,7 @@ /* input parameters */ xmlDocPtr doc; xmlC14NIsVisibleCallback is_visible_callback; - void* user_data; + void* user_data; int with_comments; xmlOutputBufferPtr buf; @@ -60,7 +62,7 @@ xmlC14NPosition pos; int parent_is_doc; xmlC14NVisibleNsStackPtr ns_rendered; - + /* C14N mode */ xmlC14NMode mode; @@ -73,17 +75,17 @@ static xmlC14NVisibleNsStackPtr xmlC14NVisibleNsStackCreate (void); static void xmlC14NVisibleNsStackDestroy (xmlC14NVisibleNsStackPtr cur); -static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node); -static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state); -static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state); -static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); -static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); +static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns); -static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx); @@ -105,26 +107,26 @@ static xmlChar *xmlC11NNormalizeString(const xmlChar * input, xmlC14NNormalizationMode mode); -#define xmlC11NNormalizeAttr( a ) \ +#define xmlC11NNormalizeAttr( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_ATTR) -#define xmlC11NNormalizeComment( a ) \ +#define xmlC11NNormalizeComment( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_COMMENT) -#define xmlC11NNormalizePI( a ) \ +#define xmlC11NNormalizePI( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_PI) -#define xmlC11NNormalizeText( a ) \ +#define xmlC11NNormalizeText( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_TEXT) -#define xmlC14NIsVisible( ctx, node, parent ) \ +#define xmlC14NIsVisible( ctx, node, parent ) \ (((ctx)->is_visible_callback != NULL) ? \ (ctx)->is_visible_callback((ctx)->user_data, \ (xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1) -#define xmlC14NIsExclusive( ctx ) \ +#define xmlC14NIsExclusive( ctx ) \ ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 ) /************************************************************************ * * - * Some factorized error routines * + * Some factorized error routines * * * ************************************************************************/ @@ -249,25 +251,25 @@ ************************************************************************/ #define XML_NAMESPACES_DEFAULT 16 -static int +static int xmlC14NIsNodeInNodeset(xmlNodeSetPtr nodes, xmlNodePtr node, xmlNodePtr parent) { if((nodes != NULL) && (node != NULL)) { if(node->type != XML_NAMESPACE_DECL) { return(xmlXPathNodeSetContains(nodes, node)); } else { xmlNs ns; - - memcpy(&ns, node, sizeof(ns)); - + + memcpy(&ns, node, sizeof(ns)); + /* this is a libxml hack! check xpath.c for details */ if((parent != NULL) && (parent->type == XML_ATTRIBUTE_NODE)) { ns.next = (xmlNsPtr)parent->parent; } else { - ns.next = (xmlNsPtr)parent; + ns.next = (xmlNsPtr)parent; } - /* - * If the input is an XPath node-set, then the node-set must explicitly + /* + * If the input is an XPath node-set, then the node-set must explicitly * contain every node to be rendered to the canonical form. */ return(xmlXPathNodeSetContains(nodes, (xmlNodePtr)&ns)); @@ -305,12 +307,12 @@ } memset(cur, 0, sizeof(xmlC14NVisibleNsStack)); xmlFree(cur); - + } -static void +static void xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node) { - if((cur == NULL) || + if((cur == NULL) || ((cur->nsTab == NULL) && (cur->nodeTab != NULL)) || ((cur->nsTab != NULL) && (cur->nodeTab == NULL))) { xmlC14NErrParam("adding namespace to stack"); @@ -328,9 +330,9 @@ memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr)); cur->nsMax = XML_NAMESPACES_DEFAULT; } else if(cur->nsMax == cur->nsCurEnd) { - void *tmp; + void *tmp; int tmpSize; - + tmpSize = 2 * cur->nsMax; tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr)); if (tmp == NULL) { @@ -360,7 +362,7 @@ xmlC14NErrParam("saving namespaces stack"); return; } - + state->nsCurEnd = cur->nsCurEnd; state->nsPrevStart = cur->nsPrevStart; state->nsPrevEnd = cur->nsPrevEnd; @@ -377,7 +379,7 @@ cur->nsPrevEnd = state->nsPrevEnd; } -static void +static void xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) { if(cur == NULL) { xmlC14NErrParam("shifting namespaces stack"); @@ -400,7 +402,7 @@ /** * xmlC14NVisibleNsStackFind: - * @ctx: the C14N context + * @ctx: the C14N context * @ns: the namespace to check * * Checks whether the given namespace was already rendered or not @@ -414,14 +416,14 @@ const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -432,7 +434,7 @@ int start = (has_empty_ns) ? 0 : cur->nsPrevStart; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { return(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)); } @@ -441,20 +443,20 @@ return(has_empty_ns); } -static int +static int xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) { int i; const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (exc c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -465,10 +467,10 @@ int start = 0; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) { - return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); + return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); } else { return(0); } @@ -483,8 +485,8 @@ /** * xmlC14NIsXmlNs: - * @ns: the namespace to check - * + * @ns: the namespace to check + * * Checks whether the given namespace is a default "xml:" namespace * with href="http://www.w3.org/XML/1998/namespace" * @@ -504,7 +506,7 @@ /** * xmlC14NNsCompare: * @ns1: the pointer to first namespace - * @ns2: the pointer to second namespace + * @ns2: the pointer to second namespace * * Compares the namespaces by names (prefixes). * @@ -527,7 +529,7 @@ /** * xmlC14NPrintNamespaces: * @ns: the pointer to namespace - * @ctx: the C14N context + * @ctx: the C14N context * * Prints the given namespace to the output buffer from C14N context. * @@ -558,39 +560,39 @@ /** * xmlC14NProcessNamespacesAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @node: the current node * * Prints out canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Namespace Axis - * Consider a list L containing only namespace nodes in the - * axis and in the node-set in lexicographic order (ascending). To begin - * processing L, if the first node is not the default namespace node (a node - * with no namespace URI and no local name), then generate a space followed + * Consider a list L containing only namespace nodes in the + * axis and in the node-set in lexicographic order (ascending). To begin + * processing L, if the first node is not the default namespace node (a node + * with no namespace URI and no local name), then generate a space followed * by xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - The nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - The nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) - * The latter condition eliminates unnecessary occurrences of xmlns="" in - * the canonical form since an element only receives an xmlns="" if its - * default namespace is empty and if it has an immediate parent in the - * canonical form that has a non-empty default namespace. To finish - * processing L, simply process every namespace node in L, except omit - * namespace node with local name xml, which defines the xml prefix, + * The latter condition eliminates unnecessary occurrences of xmlns="" in + * the canonical form since an element only receives an xmlns="" if its + * default namespace is empty and if it has an immediate parent in the + * canonical form that has a non-empty default namespace. To finish + * processing L, simply process every namespace node in L, except omit + * namespace node with local name xml, which defines the xml prefix, * if its string value is http://www.w3.org/XML/1998/namespace. * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -603,7 +605,7 @@ xmlListPtr list; int already_rendered; int has_empty_ns = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (c14n)"); return (-1); @@ -622,29 +624,29 @@ for(n = cur; n != NULL; n = n->parent) { for(ns = n->nsDef; ns != NULL; ns = ns->next) { tmp = xmlSearchNs(cur->doc, cur, ns->prefix); - + if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } - if(xmlStrlen(ns->prefix) == 0) { + if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } } } - + /** - * if the first node is not the default namespace node (a node with no - * namespace URI and no local name), then generate a space followed by + * if the first node is not the default namespace node (a node with no + * namespace URI and no local name), then generate a space followed by * xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - the nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - the nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) */ if(visible && !has_empty_ns) { @@ -652,17 +654,17 @@ memset(&ns_default, 0, sizeof(ns_default)); if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } - - - /* - * print out all elements from list + + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -672,28 +674,28 @@ /** * xmlExcC14NProcessNamespacesAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @node: the current node * * Prints out exclusive canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Exclusive XML Canonicalization * http://www.w3.org/TR/xml-exc-c14n * - * If the element node is in the XPath subset then output the node in - * accordance with Canonical XML except for namespace nodes which are + * If the element node is in the XPath subset then output the node in + * accordance with Canonical XML except for namespace nodes which are * rendered as follows: * * 1. Render each namespace node iff: - * * it is visibly utilized by the immediate parent element or one of + * * it is visibly utilized by the immediate parent element or one of * its attributes, or is present in InclusiveNamespaces PrefixList, and - * * its prefix and value do not appear in ns_rendered. ns_rendered is - * obtained by popping the state stack in order to obtain a list of - * prefixes and their values which have already been rendered by + * * its prefix and value do not appear in ns_rendered. ns_rendered is + * obtained by popping the state stack in order to obtain a list of + * prefixes and their values which have already been rendered by * an output ancestor of the namespace node's parent element. - * 2. Append the rendered namespace node to the list ns_rendered of namespace - * nodes rendered by output ancestors. Push ns_rendered on state stack and + * 2. Append the rendered namespace node to the list ns_rendered of namespace + * nodes rendered by output ancestors. Push ns_rendered on state stack and * recurse. * 3. After the recursion returns, pop thestate stack. * @@ -710,7 +712,7 @@ int has_empty_ns = 0; int has_visibly_utilized_empty_ns = 0; int has_empty_ns_in_inclusive_list = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (exc c14n)"); return (-1); @@ -731,15 +733,15 @@ return (-1); } - /* + /* * process inclusive namespaces: - * All namespace nodes appearing on inclusive ns list are + * All namespace nodes appearing on inclusive ns list are * handled as provided in Canonical XML */ if(ctx->inclusive_ns_prefixes != NULL) { - xmlChar *prefix; + xmlChar *prefix; int i; - + for (i = 0; ctx->inclusive_ns_prefixes[i] != NULL; ++i) { prefix = ctx->inclusive_ns_prefixes[i]; /* @@ -750,23 +752,23 @@ prefix = NULL; has_empty_ns_in_inclusive_list = 1; } - - ns = xmlSearchNs(cur->doc, cur, prefix); + + ns = xmlSearchNs(cur->doc, cur, prefix); if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } - if(xmlStrlen(ns->prefix) == 0) { + if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } } } - + /* add node namespace */ if(cur->ns != NULL) { ns = cur->ns; @@ -775,32 +777,32 @@ has_visibly_utilized_empty_ns = 1; } if((ns != NULL) && !xmlC14NIsXmlNs(ns)) { - if(visible && xmlC14NIsVisible(ctx, ns, cur)) { + if(visible && xmlC14NIsVisible(ctx, ns, cur)) { if(!xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, ns, ctx)) { xmlListInsert(list, ns); } } if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } - - + + /* add attributes */ for(attr = cur->properties; attr != NULL; attr = attr->next) { - /* + /* * we need to check that attribute is visible and has non - * default namespace (XML Namespaces: "default namespaces - * do not apply directly to attributes") + * default namespace (XML Namespaces: "default namespaces + * do not apply directly to attributes") */ if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) { already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx); - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); if(!already_rendered && visible) { - xmlListInsert(list, attr->ns); + xmlListInsert(list, attr->ns); } if(xmlStrlen(attr->ns->prefix) == 0) { has_empty_ns = 1; @@ -813,33 +815,33 @@ /* * Process xmlns="" */ - if(visible && has_visibly_utilized_empty_ns && + if(visible && has_visibly_utilized_empty_ns && !has_empty_ns && !has_empty_ns_in_inclusive_list) { static xmlNs ns_default; memset(&ns_default, 0, sizeof(ns_default)); - + already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx); if(!already_rendered) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) { static xmlNs ns_default; memset(&ns_default, 0, sizeof(ns_default)); if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } - - /* - * print out all elements from list + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -849,8 +851,8 @@ /** * xmlC14NIsXmlAttr: - * @attr: the attr to check - * + * @attr: the attr to check + * * Checks whether the given attribute is a default "xml:" namespace * with href="http://www.w3.org/XML/1998/namespace" * @@ -861,7 +863,7 @@ static int xmlC14NIsXmlAttr(xmlAttrPtr attr) { - return ((attr->ns != NULL) && + return ((attr->ns != NULL) && (xmlC14NIsXmlNs(attr->ns) != 0)); } @@ -869,7 +871,7 @@ /** * xmlC14NAttrsCompare: * @attr1: the pointer tls o first attr - * @attr2: the pointer to second attr + * @attr2: the pointer to second attr * * Prints the given attribute to the output buffer from C14N context. * @@ -893,7 +895,7 @@ return (xmlStrcmp(attr1->name, attr2->name)); } - /* + /* * Attributes in the default namespace are first * because the default namespace is not applied to * unqualified attributes @@ -918,10 +920,10 @@ /** * xmlC14NPrintAttrs: * @attr: the pointer to attr - * @ctx: the C14N context + * @ctx: the C14N context * * Prints out canonical attribute urrent node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * @@ -968,7 +970,7 @@ * xmlC14NFindHiddenParentAttr: * * Finds an attribute in a hidden parent node. - * + * * Returns a pointer to the attribute node (if found) or NULL otherwise. */ static xmlAttrPtr @@ -996,7 +998,7 @@ */ static xmlAttrPtr xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr) -{ +{ xmlChar * res = NULL; xmlNodePtr cur; xmlAttrPtr attr; @@ -1028,9 +1030,9 @@ xmlC14NErrInternal("processing xml:base attribute - can't get attr value"); return (NULL); - } + } - /* we need to add '/' if our current base uri ends with '..' or '.' + /* we need to add '/' if our current base uri ends with '..' or '.' to ensure that we are forced to go "up" all the time */ tmp_str_len = xmlStrlen(tmp_str); if(tmp_str_len > 1 && tmp_str[tmp_str_len - 2] == '.') { @@ -1047,7 +1049,7 @@ } /* build uri */ - tmp_str2 = xmlBuildURI(res, tmp_str); + tmp_str2 = xmlBuildURI(res, tmp_str); if(tmp_str2 == NULL) { xmlFree(tmp_str); xmlFree(res); @@ -1080,7 +1082,7 @@ xmlC14NErrInternal("processing xml:base attribute - can't construct attribute"); return (NULL); } - + /* done */ xmlFree(res); return (attr); @@ -1088,33 +1090,33 @@ /** * xmlC14NProcessAttrsAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @cur: the current node * @parent_visible: the visibility of parent node * @all_parents_visible: the visibility of all parent nodes * * Prints out canonical attribute axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * - * Attribute Axis - * In lexicographic order (ascending), process each node that + * Attribute Axis + * In lexicographic order (ascending), process each node that * is in the element's attribute axis and in the node-set. - * - * The processing of an element node E MUST be modified slightly - * when an XPath node-set is given as input and the element's + * + * The processing of an element node E MUST be modified slightly + * when an XPath node-set is given as input and the element's * parent is omitted from the node-set. * * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) * - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -1123,9 +1125,9 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) { xmlAttrPtr attr; - xmlListPtr list; + xmlListPtr list; xmlAttrPtr attrs_to_delete = NULL; - + /* special processing for 1.1 spec */ xmlAttrPtr xml_base_attr = NULL; xmlAttrPtr xml_lang_attr = NULL; @@ -1147,19 +1149,19 @@ switch(ctx->mode) { case XML_C14N_1_0: - /* The processing of an element node E MUST be modified slightly when an XPath node-set is - * given as input and the element's parent is omitted from the node-set. The method for processing - * the attribute axis of an element E in the node-set is enhanced. All element nodes along E's - * ancestor axis are examined for nearest occurrences of attributes in the xml namespace, such - * as xml:lang and xml:space (whether or not they are in the node-set). From this list of attributes, - * remove any that are in E's attribute axis (whether or not they are in the node-set). Then, - * lexicographically merge this attribute list with the nodes of E's attribute axis that are in - * the node-set. The result of visiting the attribute axis is computed by processing the attribute - * nodes in this merged attribute list. + /* The processing of an element node E MUST be modified slightly when an XPath node-set is + * given as input and the element's parent is omitted from the node-set. The method for processing + * the attribute axis of an element E in the node-set is enhanced. All element nodes along E's + * ancestor axis are examined for nearest occurrences of attributes in the xml namespace, such + * as xml:lang and xml:space (whether or not they are in the node-set). From this list of attributes, + * remove any that are in E's attribute axis (whether or not they are in the node-set). Then, + * lexicographically merge this attribute list with the nodes of E's attribute axis that are in + * the node-set. The result of visiting the attribute axis is computed by processing the attribute + * nodes in this merged attribute list. */ - - /* - * Add all visible attributes from current node. + + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1170,16 +1172,16 @@ attr = attr->next; } - /* + /* * Handle xml attributes */ - if (parent_visible && (cur->parent != NULL) && - (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) + if (parent_visible && (cur->parent != NULL) && + (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) { xmlNodePtr tmp; /* - * If XPath node-set is not specified then the parent is always + * If XPath node-set is not specified then the parent is always * visible! */ tmp = cur->parent; @@ -1200,12 +1202,12 @@ /* done */ break; case XML_C14N_EXCLUSIVE_1_0: - /* attributes in the XML namespace, such as xml:lang and xml:space - * are not imported into orphan nodes of the document subset + /* attributes in the XML namespace, such as xml:lang and xml:space + * are not imported into orphan nodes of the document subset */ - /* - * Add all visible attributes from current node. + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1219,36 +1221,36 @@ /* do nothing special for xml attributes */ break; case XML_C14N_1_1: - /* The processing of an element node E MUST be modified slightly when an XPath node-set is - * given as input and some of the element's ancestors are omitted from the node-set. + /* The processing of an element node E MUST be modified slightly when an XPath node-set is + * given as input and some of the element's ancestors are omitted from the node-set. * - * Simple inheritable attributes are attributes that have a value that requires at most a simple - * redeclaration. This redeclaration is done by supplying a new value in the child axis. The - * redeclaration of a simple inheritable attribute A contained in one of E's ancestors is done - * by supplying a value to an attribute Ae inside E with the same name. Simple inheritable attributes + * Simple inheritable attributes are attributes that have a value that requires at most a simple + * redeclaration. This redeclaration is done by supplying a new value in the child axis. The + * redeclaration of a simple inheritable attribute A contained in one of E's ancestors is done + * by supplying a value to an attribute Ae inside E with the same name. Simple inheritable attributes * are xml:lang and xml:space. - * - * The method for processing the attribute axis of an element E in the node-set is hence enhanced. - * All element nodes along E's ancestor axis are examined for the nearest occurrences of simple - * inheritable attributes in the xml namespace, such as xml:lang and xml:space (whether or not they - * are in the node-set). From this list of attributes, any simple inheritable attributes that are - * already in E's attribute axis (whether or not they are in the node-set) are removed. Then, - * lexicographically merge this attribute list with the nodes of E's attribute axis that are in - * the node-set. The result of visiting the attribute axis is computed by processing the attribute + * + * The method for processing the attribute axis of an element E in the node-set is hence enhanced. + * All element nodes along E's ancestor axis are examined for the nearest occurrences of simple + * inheritable attributes in the xml namespace, such as xml:lang and xml:space (whether or not they + * are in the node-set). From this list of attributes, any simple inheritable attributes that are + * already in E's attribute axis (whether or not they are in the node-set) are removed. Then, + * lexicographically merge this attribute list with the nodes of E's attribute axis that are in + * the node-set. The result of visiting the attribute axis is computed by processing the attribute * nodes in this merged attribute list. - * - * The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is + * + * The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is * performed. - * - * The xml:base attribute is not a simple inheritable attribute and requires special processing beyond + * + * The xml:base attribute is not a simple inheritable attribute and requires special processing beyond * a simple redeclaration. - * - * Attributes in the XML namespace other than xml:base, xml:id, xml:lang, and xml:space MUST be processed + * + * Attributes in the XML namespace other than xml:base, xml:id, xml:lang, and xml:space MUST be processed * as ordinary attributes. */ - /* - * Add all visible attributes from current node. + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1265,7 +1267,7 @@ if((!matched) && (xml_lang_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "lang")) { xml_lang_attr = attr; matched = 1; - } + } if((!matched) && (xml_space_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "space")) { xml_space_attr = attr; matched = 1; @@ -1282,11 +1284,11 @@ xmlListInsert(list, attr); } } - + /* move to the next one */ attr = attr->next; } - + /* special processing for XML attribute kiks in only when we have invisible parents */ if ((parent_visible)) { @@ -1311,7 +1313,7 @@ } if(xml_base_attr != NULL) { xml_base_attr = xmlC14NFixupBaseAttr(ctx, xml_base_attr); - if(xml_base_attr != NULL) { + if(xml_base_attr != NULL) { xmlListInsert(list, xml_base_attr); /* note that we MUST delete returned attr node ourselves! */ @@ -1325,12 +1327,12 @@ break; } - /* - * print out all elements from list + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintAttrs, (const void *) ctx); - /* + /* * Cleanup */ xmlFreePropList(attrs_to_delete); @@ -1338,7 +1340,7 @@ return (0); } -/** +/** * xmlC14NCheckForRelativeNamespaces: * @ctx: the C14N context * @cur: the current element node @@ -1388,23 +1390,23 @@ /** * xmlC14NProcessElementNode: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to process * @visible: this node is visible * @all_parents_visible: whether all the parents of this node are visible - * + * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Element Nodes - * If the element is not in the node-set, then the result is obtained - * by processing the namespace axis, then the attribute axis, then - * processing the child nodes of the element that are in the node-set - * (in document order). If the element is in the node-set, then the result - * is an open angle bracket (<), the element QName, the result of - * processing the namespace axis, the result of processing the attribute - * axis, a close angle bracket (>), the result of processing the child - * nodes of the element that are in the node-set (in document order), an - * open angle bracket, a forward slash (/), the element QName, and a close + * If the element is not in the node-set, then the result is obtained + * by processing the namespace axis, then the attribute axis, then + * processing the child nodes of the element that are in the node-set + * (in document order). If the element is in the node-set, then the result + * is an open angle bracket (<), the element QName, the result of + * processing the namespace axis, the result of processing the attribute + * axis, a close angle bracket (>), the result of processing the child + * nodes of the element that are in the node-set (in document order), an + * open angle bracket, a forward slash (/), the element QName, and a close * angle bracket. * * Returns non-negative value on success or negative value on fail @@ -1421,7 +1423,7 @@ return (-1); } - /* + /* * Check relative relative namespaces: * implementations of XML canonicalization MUST report an operation * failure on documents containing relative namespace URIs. @@ -1432,13 +1434,13 @@ } - /* + /* * Save ns_rendered stack position */ memset(&state, 0, sizeof(state)); xmlC14NVisibleNsStackSave(ctx->ns_rendered, &state); - if (visible) { + if (visible) { if (ctx->parent_is_doc) { /* save this flag into the stack */ parent_is_doc = ctx->parent_is_doc; @@ -1468,14 +1470,14 @@ if(visible) { xmlC14NVisibleNsStackShift(ctx->ns_rendered); } - + ret = xmlC14NProcessAttrsAxis(ctx, cur, visible); if (ret < 0) { xmlC14NErrInternal("processing attributes axis"); - return (-1); + return (-1); } - if (visible) { + if (visible) { xmlOutputBufferWriteString(ctx->buf, ">"); } if (cur->children != NULL) { @@ -1501,7 +1503,7 @@ } } - /* + /* * Restore ns_rendered stack position */ xmlC14NVisibleNsStackRestore(ctx->ns_rendered, &state); @@ -1510,9 +1512,9 @@ /** * xmlC14NProcessNode: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to process - * + * * Processes the given node * * Returns non-negative value on success or negative value on fail @@ -1537,9 +1539,9 @@ case XML_TEXT_NODE: /* * Text Nodes - * the string value, except all ampersands are replaced - * by &, all open angle brackets (<) are replaced by <, all closing - * angle brackets (>) are replaced by >, and all #xD characters are + * the string value, except all ampersands are replaced + * by &, all open angle brackets (<) are replaced by <, all closing + * angle brackets (>) are replaced by >, and all #xD characters are * replaced by . */ /* cdata sections are processed as text nodes */ @@ -1559,16 +1561,16 @@ } break; case XML_PI_NODE: - /* - * Processing Instruction (PI) Nodes- - * The opening PI symbol (). If the string value is empty, - * then the leading space is not added. Also, a trailing #xA is - * rendered after the closing PI symbol for PI children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening PI - * symbol of PI children of the root node with a greater document + /* + * Processing Instruction (PI) Nodes- + * The opening PI symbol (). If the string value is empty, + * then the leading space is not added. Also, a trailing #xA is + * rendered after the closing PI symbol for PI children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening PI + * symbol of PI children of the root node with a greater document * order than the document element. */ if (visible) { @@ -1607,17 +1609,17 @@ case XML_COMMENT_NODE: /* * Comment Nodes - * Nothing if generating canonical XML without comments. For - * canonical XML with comments, generate the opening comment - * symbol (). Also, a trailing #xA is rendered - * after the closing comment symbol for comment children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening - * comment symbol of comment children of the root node with a - * greater document order than the document element. (Comment - * children of the root node represent comments outside of the - * top-level document element and outside of the document type + * Nothing if generating canonical XML without comments. For + * canonical XML with comments, generate the opening comment + * symbol (). Also, a trailing #xA is rendered + * after the closing comment symbol for comment children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening + * comment symbol of comment children of the root node with a + * greater document order than the document element. (Comment + * children of the root node represent comments outside of the + * top-level document element and outside of the document type * declaration). */ if (visible && ctx->with_comments) { @@ -1687,8 +1689,8 @@ case XML_XINCLUDE_START: case XML_XINCLUDE_END: #endif - /* - * should be ignored according to "W3C Canonical XML" + /* + * should be ignored according to "W3C Canonical XML" */ break; default: @@ -1701,9 +1703,9 @@ /** * xmlC14NProcessNodeList: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to start from - * + * * Processes all nodes in the row starting from cur. * * Returns non-negative value on success or negative value on fail @@ -1728,7 +1730,7 @@ /** * xmlC14NFreeCtx: * @ctx: the pointer to C14N context object - * + * * Cleanups the C14N context object. */ @@ -1748,27 +1750,27 @@ /** * xmlC14NNewCtx: - * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @doc: the XML document for canonization + * @is_visible_callback:the function to use to determine is node visible * or not - * @user_data: the first parameter for @is_visible_callback function + * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixe the list of inclusive namespace prefixes + * @inclusive_ns_prefixe the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for ` + * inclusive namespaces (only for ` * canonicalization) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Creates new C14N context object to store C14N parameters. * * Returns pointer to newly created object (success) or NULL (fail) */ static xmlC14NCtxPtr -xmlC14NNewCtx(xmlDocPtr doc, +xmlC14NNewCtx(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, xmlC14NMode mode, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) @@ -1840,28 +1842,28 @@ /** * xmlC14NExecute: - * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @doc: the XML document for canonization + * @is_visible_callback:the function to use to determine is node visible * or not - * @user_data: the first parameter for @is_visible_callback function + * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ -int +int xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, int mode, xmlChar **inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { @@ -1875,15 +1877,15 @@ return (-1); } - /* for backward compatibility, we have to have "mode" as "int" + /* for backward compatibility, we have to have "mode" as "int" and here we check that user gives valid value */ switch(mode) { case XML_C14N_1_0: case XML_C14N_EXCLUSIVE_1_0: - case XML_C14N_1_1: + case XML_C14N_1_1: c14n_mode = (xmlC14NMode)mode; break; - default: + default: xmlC14NErrParam("invalid mode for executing c14n"); return (-1); } @@ -1897,7 +1899,7 @@ return (-1); } - ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, + ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, c14n_mode, inclusive_ns_prefixes, with_comments, buf); if (ctx == NULL) { @@ -1908,12 +1910,12 @@ - /* + /* * Root Node - * The root node is the parent of the top-level document element. The - * result of processing each of its child nodes that is in the node-set - * in document order. The root node does not generate a byte order mark, - * XML declaration, nor anything from within the document type + * The root node is the parent of the top-level document element. The + * result of processing each of its child nodes that is in the node-set + * in document order. The root node does not generate a byte order mark, + * XML declaration, nor anything from within the document type * declaration. */ if (doc->children != NULL) { @@ -1935,7 +1937,7 @@ return (-1); } - /* + /* * Cleanup */ xmlC14NFreeCtx(ctx); @@ -1944,30 +1946,30 @@ /** * xmlC14NDocSaveTo: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ int xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes, int mode, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { - return(xmlC14NExecute(doc, + return(xmlC14NExecute(doc, (xmlC14NIsVisibleCallback)xmlC14NIsNodeInNodeset, nodes, mode, @@ -1979,24 +1981,24 @@ /** * xmlC14NDocDumpMemory: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @doc_txt_ptr: the memory pointer for allocated canonical XML text; + * @with_comments: include comments in the result (!=0) or not (==0) + * @doc_txt_ptr: the memory pointer for allocated canonical XML text; * the caller of this functions is responsible for calling - * xmlFree() to free allocated memory - * + * xmlFree() to free allocated memory + * * Dumps the canonized image of given XML document into memory. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written on success or a negative value on fail + * Returns the number of bytes written on success or a negative value on fail */ int xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -2014,7 +2016,7 @@ *doc_txt_ptr = NULL; /* - * create memory buffer with UTF8 (default) encoding + * create memory buffer with UTF8 (default) encoding */ buf = xmlAllocOutputBuffer(NULL); if (buf == NULL) { @@ -2033,9 +2035,9 @@ return (-1); } - ret = buf->buffer->use; + ret = xmlBufUse(buf->buffer); if (ret > 0) { - *doc_txt_ptr = xmlStrndup(buf->buffer->content, ret); + *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret); } (void) xmlOutputBufferClose(buf); @@ -2048,26 +2050,26 @@ /** * xmlC14NDocSave: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * 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 requred): + * @with_comments: include comments in the result (!=0) or not (==0) + * @filename: the filename to store canonical XML image + * @compression: the compression level (zlib requred): * -1 - libxml default, - * 0 - uncompressed, + * 0 - uncompressed, * >0 - compression level - * + * * Dumps the canonized image of given XML document into the file. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written success or a negative value on fail + * Returns the number of bytes written success or a negative value on fail */ int xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -2086,7 +2088,7 @@ compression = xmlGetCompressMode(); #endif - /* + /* * save the content to a temp buffer, use default UTF8 encoding. */ buf = xmlOutputBufferCreateFilename(filename, NULL, compression); @@ -2106,8 +2108,8 @@ return (-1); } - /* - * get the numbers of bytes written + /* + * get the numbers of bytes written */ ret = xmlOutputBufferClose(buf); return (ret); @@ -2121,14 +2123,14 @@ #define growBufferReentrant() { \ buffer_size *= 2; \ buffer = (xmlChar *) \ - xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ + xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ if (buffer == NULL) { \ xmlC14NErrMemory("growing buffer"); \ return(NULL); \ } \ } -/** +/** * xmlC11NNormalizeString: * @input: the input string * @mode: the normalization mode (attribute, comment, PI or text) Index: lib/3rdparty/libxml2/catalog.c =================================================================== --- lib/3rdparty/libxml2/catalog.c (revision 58293) +++ lib/3rdparty/libxml2/catalog.c (working copy) @@ -1,5 +1,5 @@ /** - * catalog.c: set of generic Catalog related routines + * catalog.c: set of generic Catalog related routines * * Reference: SGML Open Technical Resolution TR9401:1997. * http://www.jclark.com/sp/catalog.htm @@ -41,6 +41,8 @@ #include #include +#include "buf.h" + #define MAX_DELEGATE 50 #define MAX_CATAL_DEPTH 50 @@ -60,7 +62,7 @@ *> values "system" and "public". I have made the default be "system" to *> match yours. */ -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -206,7 +208,7 @@ /************************************************************************ * * - * Catalog error handlers * + * Catalog error handlers * * * ************************************************************************/ @@ -259,9 +261,9 @@ * @name: name of the entry * @value: value of the entry * @prefer: the PUBLIC vs. SYSTEM current preference value - * @group: for members of a group, the group entry + * @group: for members of a group, the group entry * - * create a new Catalog entry, this type is shared both by XML and + * create a new Catalog entry, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogEntryPtr or NULL in case of error @@ -399,7 +401,7 @@ * @type: type of catalog * @prefer: the PUBLIC vs. SYSTEM current preference value * - * create a new Catalog, this type is shared both by XML and + * create a new Catalog, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogPtr or NULL in case of error @@ -567,7 +569,7 @@ xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE); if (xns != NULL) xmlSetNsProp(node, xns, BAD_CAST "base", - cur->value); + cur->value); } switch (cur->prefer) { case XML_CATA_PREFER_NONE: @@ -685,7 +687,7 @@ xmlAddChild((xmlNodePtr) doc, catalog); xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); - + /* * reserialize it */ @@ -822,7 +824,7 @@ if (xmlStrncmp(urn, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) return(NULL); urn += sizeof(XML_URN_PUBID) - 1; - + while (*urn != 0) { if (i > sizeof(result) - 4) break; @@ -912,10 +914,7 @@ inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename); inputStream->buf = buf; - inputStream->base = inputStream->buf->buffer->content; - inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = - &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; + xmlBufResetInput(buf->buffer, inputStream); inputPush(ctxt, inputStream); if ((ctxt->directory == NULL) && (directory == NULL)) @@ -938,7 +937,7 @@ ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -1328,7 +1327,7 @@ * * Parses the catalog file to extract the XML tree and then analyze the * tree to build a list of Catalog entries corresponding to this catalog - * + * * Returns the resulting Catalog entries list */ static xmlCatalogEntryPtr @@ -1396,19 +1395,17 @@ * @catal: an existing but incomplete catalog entry * * Fetch and parse the subcatalog referenced by an entry - * + * * Returns 0 in case of success, -1 otherwise */ static int xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { xmlCatalogEntryPtr doc; - if (catal == NULL) + if (catal == NULL) return(-1); if (catal->URL == NULL) return(-1); - if (catal->children != NULL) - return(-1); /* * lock the whole catalog for modification @@ -1497,7 +1494,7 @@ xmlCatalogEntryType typ; int doregister = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1573,7 +1570,7 @@ xmlCatalogEntryPtr cur; int ret = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1788,7 +1785,7 @@ } if (nbList < MAX_DELEGATE) delegates[nbList++] = cur->URL; - + if (cur->children == NULL) { xmlFetchXMLCatalogFile(cur); } @@ -2001,7 +1998,7 @@ xmlChar *ret = NULL; xmlChar *urnID = NULL; xmlChar *normid; - + if (catal == NULL) return(NULL); if ((pubID == NULL) && (sysID == NULL)) @@ -2010,7 +2007,7 @@ normid = xmlCatalogNormalizePublic(pubID); if (normid != NULL) pubID = (*normid != 0 ? normid : NULL); - + if (!xmlStrncmp(pubID, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) { urnID = xmlCatalogUnWrapURN(pubID); if (xmlDebugCatalogs) { @@ -2090,7 +2087,7 @@ xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { xmlChar *ret = NULL; xmlChar *urnID = NULL; - + if (catal == NULL) return(NULL); if (URI == NULL) @@ -2150,7 +2147,7 @@ */ static const xmlChar * xmlParseSGMLCatalogComment(const xmlChar *cur) { - if ((cur[0] != '-') || (cur[1] != '-')) + if ((cur[0] != '-') || (cur[1] != '-')) return(cur); SKIP(2); while ((cur[0] != 0) && ((cur[0] != '-') || ((cur[1] != '-')))) @@ -2685,7 +2682,7 @@ first = content; - + while ((*first != 0) && (*first != '-') && (*first != '<') && (!(((*first >= 'A') && (*first <= 'Z')) || ((*first >= 'a') && (*first <= 'z'))))) @@ -2780,7 +2777,7 @@ if ((sysID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve sysID %s\n", sysID); @@ -2815,7 +2812,7 @@ if ((pubID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve pubID %s\n", pubID); @@ -2934,7 +2931,7 @@ } else { xmlHashScan(catal->sgml, (xmlHashScanner) xmlCatalogDumpEntry, out); - } + } } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2942,7 +2939,7 @@ * xmlACatalogAdd: * @catal: a Catalog * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -3001,7 +2998,7 @@ (xmlHashDeallocator) xmlFreeCatalogEntry); if (res == 0) res = 1; - } + } return(res); } @@ -3060,7 +3057,7 @@ return(1); if (res < 0) return(-1); - } + } return(0); } @@ -3083,7 +3080,7 @@ if (xmlCatalogInitialized != 0) return; - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; xmlCatalogMutex = xmlNewRMutex(); @@ -3104,7 +3101,7 @@ xmlInitializeCatalogData(); xmlRMutexLock(xmlCatalogMutex); - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; if (xmlDefaultCatalog == NULL) { @@ -3127,7 +3124,7 @@ unsigned long len = GetModuleFileNameA(hmodule, buf, 255); if (len != 0) { char* p = &(buf[len]); - while (*p != '\\' && p > buf) + while (*p != '\\' && p > buf) p--; if (p != buf) { xmlChar* uri; @@ -3146,15 +3143,15 @@ catalogs = XML_XML_DEFAULT_CATALOG; #endif - catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, + catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer); if (catal != NULL) { - /* the XML_CATALOG_FILES envvar is allowed to contain a + /* the XML_CATALOG_FILES envvar is allowed to contain a space-separated list of entries. */ cur = catalogs; nextent = &catal->xml; while (*cur != '\0') { - while (xmlIsBlank_ch(*cur)) + while (xmlIsBlank_ch(*cur)) cur++; if (*cur != 0) { paths = cur; @@ -3279,7 +3276,7 @@ xmlGenericError(xmlGenericErrorContext, "Catalogs cleanup\n"); if (xmlCatalogXMLFiles != NULL) - xmlHashFree(xmlCatalogXMLFiles, + xmlHashFree(xmlCatalogXMLFiles, (xmlHashDeallocator)xmlFreeCatalogHashEntryList); xmlCatalogXMLFiles = NULL; if (xmlDefaultCatalog != NULL) @@ -3394,7 +3391,7 @@ /** * xmlCatalogAdd: * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -3425,7 +3422,7 @@ xmlRMutexUnlock(xmlCatalogMutex); return(0); - } + } res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace); xmlRMutexUnlock(xmlCatalogMutex); @@ -3613,7 +3610,7 @@ * * Returns the updated list */ -void * +void * xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { xmlCatalogEntryPtr catal, add; @@ -3633,7 +3630,7 @@ return(catalogs); catal = (xmlCatalogEntryPtr) catalogs; - if (catal == NULL) + if (catal == NULL) return((void *) add); while (catal->next != NULL) @@ -3648,7 +3645,7 @@ * @pubID: the public ID string * @sysID: the system ID string * - * Do a complete resolution lookup of an External Identifier using a + * Do a complete resolution lookup of an External Identifier using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3693,7 +3690,7 @@ * @catalogs: a document's list of catalogs * @URI: the URI * - * Do a complete resolution lookup of an URI using a + * Do a complete resolution lookup of an URI using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3754,7 +3751,7 @@ if (sysID == NULL) return(NULL); - + /* * Check first the XML catalogs */ @@ -3798,7 +3795,7 @@ if (pubID == NULL) return(NULL); - + /* * Check first the XML catalogs */ Index: lib/3rdparty/libxml2/chvalid.c =================================================================== --- lib/3rdparty/libxml2/chvalid.c (revision 58293) +++ lib/3rdparty/libxml2/chvalid.c (working copy) @@ -46,109 +46,109 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, - {0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, - {0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, - {0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, - {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, - {0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, - {0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, - {0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, - {0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, - {0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, - {0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, - {0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, - {0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, - {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, - {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, - {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, - {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, - {0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, - {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, - {0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, - {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, - {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, - {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, - {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, - {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, - {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, - {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, - {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, - {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, - {0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, - {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, - {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, - {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, - {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, - {0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, - {0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, - {0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, - {0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, - {0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, - {0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, - {0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, - {0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, - {0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, - {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, - {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, - {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, - {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, - {0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, +static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, + {0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, + {0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, + {0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, + {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, + {0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, + {0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, + {0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, + {0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, + {0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, + {0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, + {0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, + {0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, + {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, + {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, + {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, + {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, + {0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, + {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, + {0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, + {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, + {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, + {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, + {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, + {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, + {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, + {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, + {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, + {0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, + {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, + {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, + {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, + {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, + {0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, + {0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, + {0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, + {0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, + {0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, + {0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, + {0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, + {0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, + {0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, + {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, + {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, + {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, + {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, + {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, + {0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}}; const xmlChRangeGroup xmlIsBaseCharGroup = {197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, +static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, {0xe000, 0xfffd}}; static const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}}; const xmlChRangeGroup xmlIsCharGroup = {2, 1, xmlIsChar_srng, xmlIsChar_lrng}; -static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, - {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, - {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, - {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, - {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, - {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, - {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, - {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, - {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, - {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, - {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, - {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, - {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, - {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, - {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, - {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, - {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, - {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, - {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, - {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, - {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, - {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, - {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, - {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, +static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, + {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, + {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, + {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, + {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, + {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, + {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, + {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, + {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, + {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, + {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, + {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, + {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, + {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, + {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, + {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, + {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, + {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, + {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, + {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, + {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, + {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, + {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, + {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, {0x3099, 0x3099}, {0x309a, 0x309a}}; const xmlChRangeGroup xmlIsCombiningGroup = {95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, - {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, - {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, - {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, +static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, + {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, + {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, + {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf29}}; const xmlChRangeGroup xmlIsDigitGroup = {14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, - {0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, - {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, +static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, + {0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, + {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, {0x30fc, 0x30fe}}; const xmlChRangeGroup xmlIsExtenderGroup = {10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, +static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, {0x3021, 0x3029}, {0x4e00, 0x9fa5}}; const xmlChRangeGroup xmlIsIdeographicGroup = {3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0}; Index: lib/3rdparty/libxml2/config.guess =================================================================== --- lib/3rdparty/libxml2/config.guess (revision 58293) +++ lib/3rdparty/libxml2/config.guess (working copy) @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2012-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -144,7 +145,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -180,7 +181,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -223,7 +224,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +270,10 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +299,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -394,23 +398,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -480,8 +484,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -494,7 +498,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -551,7 +555,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -594,52 +598,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -730,22 +734,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -769,14 +773,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -788,13 +792,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -803,15 +806,18 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -866,7 +872,7 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -878,21 +884,30 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build @@ -933,7 +948,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -959,7 +974,7 @@ echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -967,14 +982,17 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -983,11 +1001,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1019,7 +1037,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1047,13 +1065,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1088,8 +1106,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1132,10 +1150,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1161,11 +1179,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1230,6 +1248,9 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1275,13 +1296,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1321,11 +1342,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif Index: lib/3rdparty/libxml2/config.h =================================================================== --- lib/3rdparty/libxml2/config.h (revision 58293) +++ lib/3rdparty/libxml2/config.h (working copy) @@ -306,13 +306,7 @@ #define GetModuleHandleA GetModuleHandleA_ #endif #if defined(__MINGW32__) -//#include -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H -#include -#include -#include +#include #endif #if defined(_MSC_VER) #undef GetModuleHandleA Index: lib/3rdparty/libxml2/config.h.in =================================================================== --- lib/3rdparty/libxml2/config.h.in (revision 58293) +++ lib/3rdparty/libxml2/config.h.in (working copy) @@ -1,21 +1,5 @@ /* config.h.in. Generated from configure.in by autoheader. */ -#undef PACKAGE -#undef VERSION -#undef HAVE_LIBZ -#undef HAVE_LIBM -#undef HAVE_ISINF -#undef HAVE_ISNAN -#undef HAVE_LIBHISTORY -#undef HAVE_LIBREADLINE -#undef HAVE_LIBPTHREAD -#undef HAVE_PTHREAD_H -/* Define if IPV6 support is there */ -#undef SUPPORT_IP6 - -/* Define if getaddrinfo is there */ -#undef HAVE_GETADDRINFO - /* Define to 1 if you have the header file. */ #undef HAVE_ANSIDECL_H @@ -85,8 +69,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H_H +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII /* Define if isinf is there */ #undef HAVE_ISINF @@ -100,6 +84,9 @@ /* Define if history library is there (-lhistory) */ #undef HAVE_LIBHISTORY +/* Have compression library */ +#undef HAVE_LIBLZMA + /* Define if pthread library is there (-lpthread) */ #undef HAVE_LIBPTHREAD @@ -115,6 +102,9 @@ /* Define to 1 if you have the `localtime' function. */ #undef HAVE_LOCALTIME +/* Define to 1 if you have the header file. */ +#undef HAVE_LZMA_H + /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H @@ -124,6 +114,17 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + /* Define to 1 if you have the header file. */ #undef HAVE_NAN_H @@ -145,6 +146,15 @@ /* Define if is there */ #undef HAVE_PTHREAD_H +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the `rand' function. */ +#undef HAVE_RAND + +/* Define to 1 if you have the `rand_r' function. */ +#undef HAVE_RAND_R + /* Define to 1 if you have the header file. */ #undef HAVE_RESOLV_H @@ -163,6 +173,9 @@ /* Define to 1 if you have the `sprintf' function. */ #undef HAVE_SPRINTF +/* Define to 1 if you have the `srand' function. */ +#undef HAVE_SRAND + /* Define to 1 if you have the `sscanf' function. */ #undef HAVE_SSCANF @@ -225,6 +238,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the `time' function. */ +#undef HAVE_TIME + /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H @@ -280,9 +296,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -295,17 +308,17 @@ /* Determine what socket length (socklen_t) data type is */ #undef XML_SOCKLEN_T +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + /* Using the Win32 Socket implementation */ #undef _WINSOCKAPI_ -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES - -/* Win32 Std C name mangling work-around */ -#undef snprintf - /* ss_family is not defined here, use __ss_family instead */ #undef ss_family -/* Win32 Std C name mangling work-around */ -#undef vsnprintf +/* 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 Index: lib/3rdparty/libxml2/config.sub =================================================================== --- lib/3rdparty/libxml2/config.sub (revision 58293) +++ lib/3rdparty/libxml2/config.sub (working copy) @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2012-01-01' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -75,8 +75,9 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,8 +124,9 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -156,8 +158,8 @@ os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -173,10 +175,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -249,13 +251,17 @@ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -281,29 +287,39 @@ | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -313,6 +329,18 @@ basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -332,16 +360,19 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -367,25 +398,29 @@ | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -410,7 +445,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -480,11 +515,20 @@ basic_machine=powerpc-ibm os=-cnk ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -516,7 +560,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -674,7 +718,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -732,7 +775,7 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -771,10 +814,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -839,6 +890,12 @@ np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -921,9 +978,10 @@ ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1017,6 +1075,9 @@ basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1073,20 +1134,8 @@ basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1156,6 +1205,9 @@ xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1253,11 +1305,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1293,8 +1345,9 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1341,7 +1394,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1390,7 +1443,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1435,6 +1488,8 @@ -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1457,10 +1512,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1472,9 +1527,18 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1493,14 +1557,11 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1527,7 +1588,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) Index: lib/3rdparty/libxml2/configure =================================================================== --- lib/3rdparty/libxml2/configure (revision 58293) +++ lib/3rdparty/libxml2/configure (working copy) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.66. +# Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,6 +89,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -171,7 +172,6 @@ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -179,7 +179,8 @@ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -222,11 +223,18 @@ # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -637,6 +645,7 @@ TEST_SCHEMATRON WITH_SCHEMATRON WITH_ISO8859X +ICU_LIBS WITH_ICU WITH_ICONV WITH_OUTPUT @@ -667,6 +676,8 @@ TEST_PUSH WITH_PUSH TEST_SAX +WITH_SAX1_SOURCES_FALSE +WITH_SAX1_SOURCES_TRUE WITH_SAX1 TEST_PATTERN WITH_PATTERN @@ -679,7 +690,8 @@ FTP_OBJ WITH_FTP WITH_TREE -THREADS_W32 +THREADS_W32_FALSE +THREADS_W32_TRUE TEST_THREADS THREAD_CFLAGS WITH_THREADS @@ -699,6 +711,9 @@ WITH_PYTHON_FALSE WITH_PYTHON_TRUE PYTHON +WITH_LZMA +LZMA_LIBS +LZMA_CFLAGS WITH_ZLIB Z_LIBS Z_CFLAGS @@ -713,23 +728,21 @@ LIPO NMEDIT DSYMUTIL +MANIFEST_TOOL RANLIB +ac_ct_AR AR -LN_S +DLLTOOL +OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP +EGREP +GREP SED LIBTOOL -OBJDUMP -DLLTOOL -AS -ANSI2KNR -U -EGREP -GREP XSLTPROC XMLLINT WGET @@ -738,9 +751,11 @@ MV RM CPP +LN_S am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -754,6 +769,10 @@ LDFLAGS CFLAGS CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -833,12 +852,14 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock with_c14n with_catalog @@ -878,6 +899,7 @@ with_xptr with_modules with_zlib +with_lzma with_coverage enable_rebuild_docs enable_ipv6 @@ -953,8 +975,9 @@ fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1294,7 +1317,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1508,6 +1531,8 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1515,15 +1540,17 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=yes] + --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=no] --enable-ipv6[=yes/no] enables compilation of IPv6 code [default=yes] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --with-c14n add the Canonicalization support (on) --with-catalog add the Catalog support (on) --with-debug add the debugging module (on) @@ -1564,6 +1591,7 @@ --with-xptr add the XPointer support (on) --with-modules add the dynamic modules support (on) --with-zlib[=DIR] use libz in DIR + --with-lzma[=DIR] use liblzma in DIR --with-coverage build for code coverage with GCC (off) Some influential environment variables: @@ -1643,7 +1671,7 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.66 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1689,7 +1717,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1715,7 +1743,7 @@ mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1726,11 +1754,88 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes @@ -1768,11 +1873,78 @@ ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -1781,10 +1953,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1820,7 +1992,7 @@ else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1847,7 +2019,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1856,159 +2028,68 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - +$ac_includes_default int main () { -return $2 (); +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0 + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + else - eval "$3=no" + break fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_func +} # ac_fn_c_find_uintX_t cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.66. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2355,6 +2436,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_config_headers="$ac_config_headers config.h" @@ -2393,7 +2475,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -2427,7 +2509,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -2460,8 +2542,8 @@ LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=8 +LIBXML_MINOR_VERSION=9 +LIBXML_MICRO_VERSION=0 LIBXML_MICRO_VERSION_SUFFIX= LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION @@ -2483,7 +2565,7 @@ LIBXML_VERSION_EXTRA="-SVN$extra" fi else if test -d .git ; then - extra=`git describe | sed 's+LIBXML[0-9.]*-++'` + extra=`git describe 2>/dev/null | sed 's+LIBXML[0-9.]*-++'` echo extra=$extra if test "$extra" != "" then @@ -2521,7 +2603,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2698,7 +2780,7 @@ set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2738,7 +2820,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2791,7 +2873,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2842,7 +2924,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2882,7 +2964,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2970,17 +3052,60 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +# Support silent build rules, requires at least automake-1.11. Disable +# by either passing --disable-silent-rules to configure or passing V=1 +# to make +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2991,7 +3116,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3031,7 +3156,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3084,7 +3209,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3124,7 +3249,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3183,7 +3308,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3227,7 +3352,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3510,7 +3635,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3561,7 +3686,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3598,7 +3723,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3676,7 +3801,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3822,6 +3947,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3837,7 +3963,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -3846,6 +3972,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3905,7 +4032,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -3961,7 +4088,18 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3974,7 +4112,7 @@ CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4004,7 +4142,7 @@ # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4020,11 +4158,11 @@ ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4063,7 +4201,7 @@ # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4079,11 +4217,11 @@ ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else @@ -4103,7 +4241,7 @@ set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_RM+set}" = set; then : +if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in @@ -4144,7 +4282,7 @@ set dummy mv; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MV+set}" = set; then : +if ${ac_cv_path_MV+:} false; then : $as_echo_n "(cached) " >&6 else case $MV in @@ -4185,7 +4323,7 @@ set dummy tar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TAR+set}" = set; then : +if ${ac_cv_path_TAR+:} false; then : $as_echo_n "(cached) " >&6 else case $TAR in @@ -4226,7 +4364,7 @@ set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PERL+set}" = set; then : +if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in @@ -4267,7 +4405,7 @@ set dummy wget; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_WGET+set}" = set; then : +if ${ac_cv_path_WGET+:} false; then : $as_echo_n "(cached) " >&6 else case $WGET in @@ -4308,7 +4446,7 @@ set dummy xmllint; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XMLLINT+set}" = set; then : +if ${ac_cv_path_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLLINT in @@ -4349,7 +4487,7 @@ set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XSLTPROC+set}" = set; then : +if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in @@ -4387,609 +4525,6 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 -$as_echo_n "checking for function prototypes... " >&6; } -if test "$ac_cv_prog_cc_c89" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define PROTOTYPES 1" >>confdefs.h - - -$as_echo "#define __PROTOTYPES 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. - -for ac_header in string.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRING_H 1 -_ACEOF - -fi - -done - - -test "x$U" != "x" && as_fn_error $? "Compiler not ANSI compliant" "$LINENO" 5 - -enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - - ;; -esac - -test -z "$AS" && AS=as - - - - - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -4998,8 +4533,8 @@ -macro_version='2.2.10' -macro_revision='1.3175' +macro_version='2.4.2' +macro_revision='1.3337' @@ -5039,7 +4574,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. -if test "X`print -r -- -n 2>/dev/null`" = X-n && \ +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -5086,7 +4621,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -5166,9 +4701,139 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -5299,7 +4964,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -5339,7 +5004,7 @@ test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -5366,7 +5031,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then : +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5429,7 +5094,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5473,7 +5138,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5545,7 +5210,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" @@ -5566,21 +5231,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then : +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5643,6 +5297,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -5682,7 +5341,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -5725,8 +5384,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5775,9 +5434,83 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -5791,6 +5524,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5813,7 +5551,7 @@ set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5853,7 +5591,7 @@ set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5907,9 +5645,12 @@ + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then : +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -6029,7 +5770,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -6111,6 +5852,21 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6126,14 +5882,168 @@ + + + + + + + + + + if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6144,7 +6054,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6164,14 +6074,18 @@ fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_AR"; then +if test -z "$AR"; then ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -6184,7 +6098,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6203,6 +6117,10 @@ $as_echo "no" >&6; } fi + + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then AR="false" else @@ -6214,12 +6132,10 @@ esac AR=$ac_ct_AR fi -else - AR="$ac_cv_prog_AR" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +: ${AR=ar} +: ${AR_FLAGS=cru} @@ -6231,12 +6147,70 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -6276,7 +6250,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6335,7 +6309,7 @@ set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6375,7 +6349,7 @@ set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6437,13 +6411,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6504,7 +6478,7 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6565,8 +6539,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6590,6 +6564,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6602,6 +6577,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6643,6 +6619,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -6654,7 +6642,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -6680,8 +6668,8 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6691,8 +6679,8 @@ test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6729,6 +6717,12 @@ $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi @@ -6750,6 +6744,49 @@ + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; @@ -6875,7 +6912,7 @@ CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -6916,7 +6953,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -6927,7 +6964,20 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -6943,7 +6993,124 @@ need_locks="$enable_libtool_lock" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then @@ -6951,7 +7118,7 @@ set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -6991,7 +7158,7 @@ set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7043,7 +7210,7 @@ set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then : +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7083,7 +7250,7 @@ set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7135,7 +7302,7 @@ set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7175,7 +7342,7 @@ set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7227,7 +7394,7 @@ set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then : +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7267,7 +7434,7 @@ set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7319,7 +7486,7 @@ set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then : +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7359,7 +7526,7 @@ set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7434,7 +7601,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then : +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7450,7 +7617,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7461,9 +7634,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7493,9 +7667,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } -if test "${lt_cv_ld_force_load+set}" = set; then : +if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no @@ -7514,7 +7689,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7560,11 +7737,141 @@ ;; esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -7584,7 +7891,9 @@ enable_dlopen=no + enable_win32_dll=no + # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} @@ -7650,7 +7959,22 @@ # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -7728,6 +8052,10 @@ + + + + test -z "$LN_S" && LN_S="ln -s" @@ -7749,7 +8077,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -7827,7 +8155,7 @@ if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -7893,7 +8221,7 @@ if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8035,7 +8363,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8088,8 +8416,6 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8189,7 +8515,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi ;; esac else @@ -8254,6 +8582,12 @@ lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -8274,18 +8608,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; esac ;; esac @@ -8373,21 +8722,25 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - - - - # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -8440,13 +8793,18 @@ + + + + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -8489,7 +8847,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -8544,7 +8902,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -8638,7 +8996,6 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -8790,7 +9147,8 @@ allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -8838,7 +9196,7 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler @@ -8887,8 +9245,7 @@ xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ @@ -8908,8 +9265,8 @@ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -8927,8 +9284,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -8974,8 +9331,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9105,7 +9462,13 @@ allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9118,23 +9481,30 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else @@ -9145,7 +9515,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9158,23 +9534,30 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. @@ -9218,20 +9601,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -9243,6 +9670,7 @@ hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else whole_archive_flag_spec='' fi @@ -9271,10 +9699,6 @@ hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9287,7 +9711,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9296,7 +9720,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -9304,7 +9728,7 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -9320,13 +9744,12 @@ hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -9344,10 +9767,10 @@ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -9364,7 +9787,7 @@ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } -if test "${lt_cv_prog_compiler__b+set}" = set; then : +if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no @@ -9426,23 +9849,36 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo(void) {} +int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' @@ -9527,7 +9963,7 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' @@ -9546,9 +9982,9 @@ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -9736,7 +10172,7 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : +if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* @@ -9937,11 +10373,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -10031,7 +10462,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10040,7 +10471,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10105,7 +10536,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10124,8 +10555,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10158,13 +10590,71 @@ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' ;; + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -10185,7 +10675,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10193,10 +10683,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10204,7 +10690,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10222,7 +10708,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10242,17 +10728,18 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -10313,7 +10800,7 @@ ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10329,7 +10816,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10366,9 +10853,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10378,7 +10865,7 @@ shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no @@ -10454,7 +10941,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10523,7 +11010,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10548,7 +11035,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10572,7 +11059,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -10603,7 +11090,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10613,7 +11100,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10802,7 +11289,7 @@ # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10836,7 +11323,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -10850,12 +11337,12 @@ *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10889,16 +11376,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10932,12 +11419,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then : +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10971,12 +11458,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then : +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11010,7 +11497,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11051,7 +11538,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : +if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11104,10 +11591,10 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); +int fnord () __attribute__((visibility("default"))); #endif -void fnord () { int i=42; } +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11157,7 +11644,7 @@ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : +if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11210,10 +11697,10 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); +int fnord () __attribute__((visibility("default"))); #endif -void fnord () { int i=42; } +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11395,6 +11882,8 @@ + + ac_config_commands="$ac_config_commands libtool" @@ -11414,7 +11903,7 @@ esac fi - if test -z "$VERSION_SCRIPT_FLAGS"; then + if test -n "$VERSION_SCRIPT_FLAGS"; then USE_VERSION_SCRIPT_TRUE= USE_VERSION_SCRIPT_FALSE='#' else @@ -11425,7 +11914,7 @@ _cppflags="${CPPFLAGS}" -_ldflags="${LDFLAGS}" +_libs="${LIBS}" # Check whether --with-c14n was given. @@ -11572,7 +12061,7 @@ if test "$withval" != "no" -a "$withval" != "yes"; then RDL_DIR=$withval CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" + LIBS="${LIBS} -L$withval/lib" fi fi @@ -11668,12 +12157,24 @@ if test "$withval" != "no" -a "$withval" != "yes"; then Z_DIR=$withval CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" + LIBS="${LIBS} -L$withval/lib" fi fi +# Check whether --with-lzma was given. +if test "${with_lzma+set}" = set; then : + withval=$with_lzma; + if test "$withval" != "no" -a "$withval" != "yes"; then + LZMA_DIR=$withval + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LIBS="${LIBS} -L$withval/lib" + fi + +fi + + # Check whether --with-coverage was given. if test "${with_coverage+set}" = set; then : withval=$with_coverage; @@ -11685,7 +12186,10 @@ enableval=$enable_rebuild_docs; fi - if test "$enable_rebuild_docs" = "no"; then +if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then + as_fn_error $? "cannot rebuild docs when builddir != srcdir" "$LINENO" 5 +fi + if test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"; then REBUILD_DOCS_TRUE= REBUILD_DOCS_FALSE='#' else @@ -11864,13 +12368,13 @@ for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : +if test "x$ac_cv_header_zlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ZLIB_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 $as_echo_n "checking for gzread in -lz... " >&6; } -if test "${ac_cv_lib_z_gzread+set}" = set; then : +if ${ac_cv_lib_z_gzread+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11904,7 +12408,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 $as_echo "$ac_cv_lib_z_gzread" >&6; } -if test "x$ac_cv_lib_z_gzread" = x""yes; then : +if test "x$ac_cv_lib_z_gzread" = xyes; then : $as_echo "#define HAVE_LIBZ 1" >>confdefs.h @@ -11933,8 +12437,82 @@ +echo Checking lzma + + +WITH_LZMA=0 +if test "$with_lzma" = "no"; then + echo "Disabling compression support" +else + for ac_header in lzma.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" +if test "x$ac_cv_header_lzma_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LZMA_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 +$as_echo_n "checking for lzma_code in -llzma... " >&6; } +if ${ac_cv_lib_lzma_lzma_code+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_code (); +int +main () +{ +return lzma_code (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lzma_lzma_code=yes +else + ac_cv_lib_lzma_lzma_code=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 +$as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } +if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : + + +$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h + + WITH_LZMA=1 + if test "x${LZMA_DIR}" != "x"; then + LZMA_CFLAGS="-I${LZMA_DIR}/include" + LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" + else + LZMA_LIBS="-llzma" + fi +fi + +fi + +done + +fi + + + + + CPPFLAGS=${_cppflags} -LDFLAGS=${_ldflags} +LIBS=${_libs} echo Checking headers @@ -11943,7 +12521,7 @@ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval "test \"\${$as_ac_Header+set}\"" = set; then : +if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11983,7 +12561,7 @@ if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -12017,11 +12595,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -12040,7 +12618,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -12074,11 +12652,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -12098,7 +12676,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12211,7 +12789,7 @@ for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = x""yes; then : +if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_H 1 _ACEOF @@ -12223,7 +12801,7 @@ for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = x""yes; then : +if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF @@ -12235,7 +12813,7 @@ for ac_header in ctype.h do : ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" -if test "x$ac_cv_header_ctype_h" = x""yes; then : +if test "x$ac_cv_header_ctype_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CTYPE_H 1 _ACEOF @@ -12247,7 +12825,7 @@ for ac_header in dirent.h do : ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" -if test "x$ac_cv_header_dirent_h" = x""yes; then : +if test "x$ac_cv_header_dirent_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DIRENT_H 1 _ACEOF @@ -12259,7 +12837,7 @@ for ac_header in errno.h do : ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = x""yes; then : +if test "x$ac_cv_header_errno_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERRNO_H 1 _ACEOF @@ -12271,7 +12849,7 @@ for ac_header in malloc.h do : ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = x""yes; then : +if test "x$ac_cv_header_malloc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC_H 1 _ACEOF @@ -12283,7 +12861,7 @@ for ac_header in stdarg.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" -if test "x$ac_cv_header_stdarg_h" = x""yes; then : +if test "x$ac_cv_header_stdarg_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDARG_H 1 _ACEOF @@ -12295,7 +12873,7 @@ for ac_header in sys/stat.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_stat_h" = x""yes; then : +if test "x$ac_cv_header_sys_stat_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_STAT_H 1 _ACEOF @@ -12307,7 +12885,7 @@ for ac_header in sys/types.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = x""yes; then : +if test "x$ac_cv_header_sys_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TYPES_H 1 _ACEOF @@ -12319,7 +12897,7 @@ for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = x""yes; then : +if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF @@ -12328,12 +12906,12 @@ done -for ac_header in inttypes.h.h +for ac_header in inttypes.h do : - ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h.h" "ac_cv_header_inttypes_h_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h_h" = x""yes; then : + ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H_H 1 +#define HAVE_INTTYPES_H 1 _ACEOF fi @@ -12343,7 +12921,7 @@ for ac_header in time.h do : ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" -if test "x$ac_cv_header_time_h" = x""yes; then : +if test "x$ac_cv_header_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIME_H 1 _ACEOF @@ -12355,7 +12933,7 @@ for ac_header in ansidecl.h do : ac_fn_c_check_header_mongrel "$LINENO" "ansidecl.h" "ac_cv_header_ansidecl_h" "$ac_includes_default" -if test "x$ac_cv_header_ansidecl_h" = x""yes; then : +if test "x$ac_cv_header_ansidecl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ANSIDECL_H 1 _ACEOF @@ -12367,7 +12945,7 @@ for ac_header in ieeefp.h do : ac_fn_c_check_header_mongrel "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" -if test "x$ac_cv_header_ieeefp_h" = x""yes; then : +if test "x$ac_cv_header_ieeefp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IEEEFP_H 1 _ACEOF @@ -12379,7 +12957,7 @@ for ac_header in nan.h do : ac_fn_c_check_header_mongrel "$LINENO" "nan.h" "ac_cv_header_nan_h" "$ac_includes_default" -if test "x$ac_cv_header_nan_h" = x""yes; then : +if test "x$ac_cv_header_nan_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NAN_H 1 _ACEOF @@ -12391,7 +12969,7 @@ for ac_header in math.h do : ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" -if test "x$ac_cv_header_math_h" = x""yes; then : +if test "x$ac_cv_header_math_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MATH_H 1 _ACEOF @@ -12403,7 +12981,7 @@ for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = x""yes; then : +if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIMITS_H 1 _ACEOF @@ -12415,7 +12993,7 @@ for ac_header in fp_class.h do : ac_fn_c_check_header_mongrel "$LINENO" "fp_class.h" "ac_cv_header_fp_class_h" "$ac_includes_default" -if test "x$ac_cv_header_fp_class_h" = x""yes; then : +if test "x$ac_cv_header_fp_class_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FP_CLASS_H 1 _ACEOF @@ -12427,7 +13005,7 @@ for ac_header in float.h do : ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" -if test "x$ac_cv_header_float_h" = x""yes; then : +if test "x$ac_cv_header_float_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLOAT_H 1 _ACEOF @@ -12439,7 +13017,7 @@ for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : +if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF @@ -12455,7 +13033,7 @@ # endif " -if test "x$ac_cv_header_sys_socket_h" = x""yes; then : +if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SOCKET_H 1 _ACEOF @@ -12471,7 +13049,7 @@ # endif " -if test "x$ac_cv_header_netinet_in_h" = x""yes; then : +if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETINET_IN_H 1 _ACEOF @@ -12490,7 +13068,7 @@ # endif " -if test "x$ac_cv_header_arpa_inet_h" = x""yes; then : +if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF @@ -12502,7 +13080,7 @@ for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = x""yes; then : +if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETDB_H 1 _ACEOF @@ -12514,7 +13092,7 @@ for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = x""yes; then : +if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF @@ -12526,7 +13104,7 @@ for ac_header in sys/select.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = x""yes; then : +if test "x$ac_cv_header_sys_select_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SELECT_H 1 _ACEOF @@ -12538,7 +13116,7 @@ for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_poll_h" = x""yes; then : +if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POLL_H 1 _ACEOF @@ -12550,7 +13128,7 @@ for ac_header in sys/mman.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = x""yes; then : +if test "x$ac_cv_header_sys_mman_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_MMAN_H 1 _ACEOF @@ -12562,7 +13140,7 @@ for ac_header in sys/timeb.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : +if test "x$ac_cv_header_sys_timeb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIMEB_H 1 _ACEOF @@ -12574,7 +13152,7 @@ for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_signal_h" = x""yes; then : +if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF @@ -12590,7 +13168,7 @@ # endif " -if test "x$ac_cv_header_arpa_nameser_h" = x""yes; then : +if test "x$ac_cv_header_arpa_nameser_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_NAMESER_H 1 _ACEOF @@ -12612,7 +13190,7 @@ # endif " -if test "x$ac_cv_header_resolv_h" = x""yes; then : +if test "x$ac_cv_header_resolv_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RESOLV_H 1 _ACEOF @@ -12624,7 +13202,7 @@ for ac_header in dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" -if test "x$ac_cv_header_dl_h" = x""yes; then : +if test "x$ac_cv_header_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DL_H 1 _ACEOF @@ -12636,7 +13214,7 @@ for ac_header in dlfcn.h do : ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -12647,12 +13225,30 @@ +echo Checking types + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + + + echo Checking libraries for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = x""yes; then : +if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF @@ -12661,7 +13257,7 @@ # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } -if test "${ac_cv_lib_intl_strftime+set}" = set; then : +if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12695,7 +13291,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = x""yes; then : +if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" @@ -12752,8 +13348,19 @@ fi done +for ac_func in rand rand_r srand time +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf +fi +done + +for ac_func in isascii mmap munmap putenv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -12762,12 +13369,12 @@ #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - NEED_TRIO=1 fi done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 $as_echo_n "checking for va_copy... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12828,7 +13435,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 $as_echo_n "checking for library containing gethostent... " >&6; } -if test "${ac_cv_search_gethostent+set}" = set; then : +if ${ac_cv_search_gethostent+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -12862,11 +13469,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_gethostent+set}" = set; then : + if ${ac_cv_search_gethostent+:} false; then : break fi done -if test "${ac_cv_search_gethostent+set}" = set; then : +if ${ac_cv_search_gethostent+:} false; then : else ac_cv_search_gethostent=no @@ -12884,7 +13491,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 $as_echo_n "checking for library containing setsockopt... " >&6; } -if test "${ac_cv_search_setsockopt+set}" = set; then : +if ${ac_cv_search_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -12918,11 +13525,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_setsockopt+set}" = set; then : + if ${ac_cv_search_setsockopt+:} false; then : break fi done -if test "${ac_cv_search_setsockopt+set}" = set; then : +if ${ac_cv_search_setsockopt+:} false; then : else ac_cv_search_setsockopt=no @@ -12940,7 +13547,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5 $as_echo_n "checking for library containing connect... " >&6; } -if test "${ac_cv_search_connect+set}" = set; then : +if ${ac_cv_search_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -12974,11 +13581,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_connect+set}" = set; then : + if ${ac_cv_search_connect+:} false; then : break fi done -if test "${ac_cv_search_connect+set}" = set; then : +if ${ac_cv_search_connect+:} false; then : else ac_cv_search_connect=no @@ -12998,7 +13605,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5 $as_echo_n "checking for type of socket length (socklen_t)... " >&6; } cat > conftest.$ac_ext < @@ -13009,7 +13616,7 @@ (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:13012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t *" >&5 @@ -13021,7 +13628,7 @@ rm -rf conftest* cat > conftest.$ac_ext < @@ -13032,7 +13639,7 @@ (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:13035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t *" >&5 @@ -13044,7 +13651,7 @@ rm -rf conftest* cat > conftest.$ac_ext < @@ -13055,7 +13662,7 @@ (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:13058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: int *" >&5 @@ -13100,8 +13707,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include +# include +# include int main () @@ -13135,8 +13742,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include +# include +# include int main () @@ -13164,8 +13771,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include +# include +# include int main () @@ -13202,7 +13809,7 @@ have_getaddrinfo=no ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = x""yes; then : +if test "x$ac_cv_func_getaddrinfo" = xyes; then : have_getaddrinfo=yes fi @@ -13211,7 +13818,7 @@ as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_getaddrinfo" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -l$lib" >&5 $as_echo_n "checking for getaddrinfo in -l$lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13263,14 +13870,14 @@ ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan" -if test "x$ac_cv_func_isnan" = x""yes; then : +if test "x$ac_cv_func_isnan" = xyes; then : $as_echo "#define HAVE_ISNAN /**/" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan in -lm" >&5 $as_echo_n "checking for isnan in -lm... " >&6; } -if test "${ac_cv_lib_m_isnan+set}" = set; then : +if ${ac_cv_lib_m_isnan+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13304,7 +13911,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnan" >&5 $as_echo "$ac_cv_lib_m_isnan" >&6; } -if test "x$ac_cv_lib_m_isnan" = x""yes; then : +if test "x$ac_cv_lib_m_isnan" = xyes; then : $as_echo "#define HAVE_ISNAN /**/" >>confdefs.h @@ -13314,14 +13921,14 @@ ac_fn_c_check_func "$LINENO" "isinf" "ac_cv_func_isinf" -if test "x$ac_cv_func_isinf" = x""yes; then : +if test "x$ac_cv_func_isinf" = xyes; then : $as_echo "#define HAVE_ISINF /**/" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 $as_echo_n "checking for isinf in -lm... " >&6; } -if test "${ac_cv_lib_m_isinf+set}" = set; then : +if ${ac_cv_lib_m_isinf+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13355,7 +13962,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 $as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = x""yes; then : +if test "x$ac_cv_lib_m_isinf" = xyes; then : $as_echo "#define HAVE_ISINF /**/" >>confdefs.h @@ -13392,7 +13999,10 @@ CFLAGS="${CFLAGS} -fexceptions" fi + # warnings we'd like to see CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" + # warnings we'd like to supress + CFLAGS="${CFLAGS} -Wno-long-long" case "${host}" in alpha*-*-linux* ) CFLAGS="${CFLAGS} -mieee" @@ -13454,7 +14064,7 @@ set dummy python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then : +if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -13570,7 +14180,7 @@ MODULE_EXTENSION=".dll" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lcygwin" >&5 $as_echo_n "checking for dlopen in -lcygwin... " >&6; } -if test "${ac_cv_lib_cygwin_dlopen+set}" = set; then : +if ${ac_cv_lib_cygwin_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13604,7 +14214,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygwin_dlopen" >&5 $as_echo "$ac_cv_lib_cygwin_dlopen" >&6; } -if test "x$ac_cv_lib_cygwin_dlopen" = x""yes; then : +if test "x$ac_cv_lib_cygwin_dlopen" = xyes; then : WITH_MODULES=1 MODULE_PLATFORM_LIBS= @@ -13621,13 +14231,13 @@ ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : libxml_have_shl_load=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13661,20 +14271,20 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : MODULE_PLATFORM_LIBS="-ldld" libxml_have_shl_load=yes else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : libxml_have_dlopen=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13708,7 +14318,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : MODULE_PLATFORM_LIBS="-ldl" libxml_have_dlopen=yes @@ -13812,12 +14422,23 @@ echo Disabling multithreaded support else echo Enabling multithreaded support + + case $host_os in + *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then + WITH_THREADS="1" + THREADS_W32="1" + THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" + fi + ;; + esac + + if test -z "$THREADS_W32"; then if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = x""yes; then : + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 $as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_join+set}" = set; then : +if ${ac_cv_lib_pthread_pthread_join+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13851,29 +14472,25 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 $as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = x""yes; then : +if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : - THREAD_LIBS="-lpthread" + THREAD_LIBS="-lpthread" $as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h $as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h - WITH_THREADS="1" + WITH_THREADS="1" fi fi + fi fi + case $host_os in - *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then - WITH_THREADS="1" - THREADS_W32="Win32" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" - fi - ;; *cygwin*) THREAD_LIBS="" ;; *beos*) WITH_THREADS="1" @@ -13916,6 +14533,13 @@ + if test -n "$THREADS_W32"; then + THREADS_W32_TRUE= + THREADS_W32_FALSE='#' +else + THREADS_W32_TRUE='#' + THREADS_W32_FALSE= +fi if test "$with_history" = "yes" ; then @@ -13925,7 +14549,7 @@ as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tputs" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -l${termlib}" >&5 $as_echo_n "checking for tputs in -l${termlib}... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -13968,10 +14592,10 @@ done ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = x""yes; then : +if test "x$ac_cv_header_readline_history_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lhistory" >&5 $as_echo_n "checking for append_history in -lhistory... " >&6; } -if test "${ac_cv_lib_history_append_history+set}" = set; then : +if ${ac_cv_lib_history_append_history+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -14005,7 +14629,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_append_history" >&5 $as_echo "$ac_cv_lib_history_append_history" >&6; } -if test "x$ac_cv_lib_history_append_history" = x""yes; then : +if test "x$ac_cv_lib_history_append_history" = xyes; then : RDL_LIBS="-lhistory" @@ -14017,10 +14641,10 @@ ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = x""yes; then : +if test "x$ac_cv_header_readline_readline_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } -if test "${ac_cv_lib_readline_readline+set}" = set; then : +if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -14054,7 +14678,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = x""yes; then : +if test "x$ac_cv_lib_readline_readline" = xyes; then : RDL_LIBS="-lreadline $RDL_LIBS $tcap" @@ -14163,8 +14787,16 @@ TEST_SAX=SAXtests fi + if test "${WITH_TRIO}" = "1"; then + WITH_SAX1_SOURCES_TRUE= + WITH_SAX1_SOURCES_FALSE='#' +else + WITH_SAX1_SOURCES_TRUE='#' + WITH_SAX1_SOURCES_FALSE= +fi + if test "$with_push" = "no" ; then echo Disabling the PUSH parser interfaces WITH_PUSH=0 @@ -14325,7 +14957,7 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = x""yes; then : +if test "x$ac_cv_header_iconv_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14400,7 +15032,7 @@ if test "$WITH_ICONV" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } - if test "${xml_cv_iconv_arg2+set}" = set; then : + if ${xml_cv_iconv_arg2+:} false; then : $as_echo_n "(cached) " >&6 else @@ -14462,14 +15094,14 @@ WITH_ICU=0 +ICU_LIBS="" if test "$with_icu" != "yes" ; then echo Disabling ICU support else ICU_CONFIG=icu-config if ${ICU_CONFIG} --cflags >/dev/null 2>&1 then - ICU_LIBS=`icu-config --ldflags` - LDFLAGS="$LDFLAGS $ICU_LIBS" + ICU_LIBS=`${ICU_CONFIG} --ldflags` WITH_ICU=1 echo Enabling ICU support else @@ -14478,6 +15110,7 @@ fi + WITH_ISO8859X=1 if test "$WITH_ICONV" != "1" ; then if test "$with_iso8859x" = "no" ; then @@ -14576,15 +15209,9 @@ $as_echo "#define _WINSOCKAPI_ 1" >>confdefs.h - -$as_echo "#define snprintf _snprintf" >>confdefs.h - - -$as_echo "#define vsnprintf _vsnprintf" >>confdefs.h - if test "${PYTHON}" != "" then - WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}" + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" fi ;; *-*-cygwin*) @@ -14601,6 +15228,21 @@ +for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + NEED_TRIO=1 +fi +done + + if test "$with_coverage" = "yes" -a "${GCC}" = "yes" then echo Enabling code coverage for GCC @@ -14636,7 +15278,7 @@ rm -f COPYING.LIB COPYING -ln -s Copyright COPYING +ln -s $srcdir/Copyright COPYING # keep on one line for cygwin c.f. #130896 ac_config_files="$ac_config_files libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py" @@ -14705,10 +15347,21 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -14724,6 +15377,7 @@ ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -14770,8 +15424,16 @@ as_fn_error $? "conditional \"WITH_TRIO_SOURCES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${THREADS_W32_TRUE}" && test -z "${THREADS_W32_FALSE}"; then + as_fn_error $? "conditional \"THREADS_W32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_SAX1_SOURCES_TRUE}" && test -z "${WITH_SAX1_SOURCES_FALSE}"; then + as_fn_error $? "conditional \"WITH_SAX1_SOURCES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -14872,6 +15534,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15179,7 +15842,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.66. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -15245,7 +15908,7 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.66, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -15266,11 +15929,16 @@ while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -15292,6 +15960,7 @@ $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -15367,9 +16036,6 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' @@ -15378,6 +16044,7 @@ enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' @@ -15398,12 +16065,20 @@ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' @@ -15418,14 +16093,17 @@ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' @@ -15449,7 +16127,6 @@ allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' @@ -15458,12 +16135,12 @@ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' @@ -15503,11 +16180,9 @@ } # Quote evaled strings. -for var in AS \ -DLLTOOL \ -OBJDUMP \ -SHELL \ +for var in SHELL \ ECHO \ +PATH_SEPARATOR \ SED \ GREP \ EGREP \ @@ -15518,10 +16193,16 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ +OBJDUMP \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -15531,12 +16212,14 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ lt_prog_compiler_wl \ -lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -15550,9 +16233,7 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -15588,6 +16269,7 @@ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ @@ -15674,9 +16356,10 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -15684,12 +16367,13 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -15711,7 +16395,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -15739,7 +16423,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -15787,7 +16471,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -15819,7 +16503,7 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -15853,7 +16537,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -15865,8 +16549,8 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -15986,7 +16670,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -16021,7 +16705,7 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ + *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; @@ -16158,21 +16842,22 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -16183,20 +16868,20 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ + mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. @@ -16358,8 +17043,8 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -16391,15 +17076,6 @@ # ### BEGIN LIBTOOL CONFIG -# Assembler program. -AS=$lt_AS - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Object dumper program. -OBJDUMP=$lt_OBJDUMP - # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision @@ -16422,6 +17098,9 @@ # An echo program that protects backslashes. ECHO=$lt_ECHO +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -16471,16 +17150,42 @@ # turn newlines into spaces. NL2SP=$lt_lt_NL2SP +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -16510,6 +17215,12 @@ # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -16519,6 +17230,9 @@ # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -16633,12 +17347,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -16688,10 +17402,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator @@ -16725,9 +17435,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -16743,6 +17450,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -16775,210 +17485,169 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` -} + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} +fi -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -_LT_EOF -esac -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -_LT_EOF - ;; - esac +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" Index: lib/3rdparty/libxml2/configure.in =================================================================== --- lib/3rdparty/libxml2/configure.in (revision 58293) +++ lib/3rdparty/libxml2/configure.in (working copy) @@ -1,13 +1,14 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.59) -AC_INIT(entities.c) -AM_CONFIG_HEADER(config.h) +AC_PREREQ([2.68]) +AC_INIT +AC_CONFIG_SRCDIR([entities.c]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=8 +LIBXML_MINOR_VERSION=9 +LIBXML_MICRO_VERSION=0 LIBXML_MICRO_VERSION_SUFFIX= LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION @@ -29,7 +30,7 @@ LIBXML_VERSION_EXTRA="-SVN$extra" fi else if test -d .git ; then - extra=`git describe | sed 's+LIBXML[[0-9.]]*-++'` + extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'` echo extra=$extra if test "$extra" != "" then @@ -50,9 +51,15 @@ AM_INIT_AUTOMAKE(libxml2, $VERSION) +# Support silent build rules, requires at least automake-1.11. Disable +# by either passing --disable-silent-rules to configure or passing V=1 +# to make +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL +AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_CPP AC_PATH_PROG(RM, rm, /bin/rm) @@ -63,13 +70,8 @@ AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) -dnl Make sure we have an ANSI compiler -AM_C_PROTOTYPES -test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) +LT_INIT -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL - dnl dnl if the system support linker version scripts for symbol versioning dnl then add it @@ -84,7 +86,7 @@ esac fi AC_SUBST(VERSION_SCRIPT_FLAGS) -AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -z "$VERSION_SCRIPT_FLAGS"]) +AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) dnl dnl We process the AC_ARG_WITH first so that later we can modify @@ -96,7 +98,7 @@ dnl zlib option might change flags, so we save them initially dnl _cppflags="${CPPFLAGS}" -_ldflags="${LDFLAGS}" +_libs="${LIBS}" AC_ARG_WITH(c14n, [ --with-c14n add the Canonicalization support (on)]) @@ -115,11 +117,11 @@ AC_ARG_WITH(html, [ --with-html add the HTML support (on)]) dnl Specific dir for HTML output ? -AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path], +AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path], [path to base html directory, default $datadir/doc/html]), [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) -AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path], +AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path], [directory used under html-dir, default $PACKAGE-$VERSION/html]), [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"], [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"]) @@ -153,7 +155,7 @@ if test "$withval" != "no" -a "$withval" != "yes"; then RDL_DIR=$withval CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" + LIBS="${LIBS} -L$withval/lib" fi ]) AC_ARG_WITH(regexps, @@ -189,15 +191,26 @@ if test "$withval" != "no" -a "$withval" != "yes"; then Z_DIR=$withval CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" + LIBS="${LIBS} -L$withval/lib" fi ]) +AC_ARG_WITH(lzma, +[ --with-lzma[[=DIR]] use liblzma in DIR],[ + if test "$withval" != "no" -a "$withval" != "yes"; then + LZMA_DIR=$withval + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LIBS="${LIBS} -L$withval/lib" + fi +]) AC_ARG_WITH(coverage, [ --with-coverage build for code coverage with GCC (off)]) AC_ARG_ENABLE(rebuild-docs, -[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]]) -AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"]) +[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]]) +if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then + AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir]) +fi +AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"]) dnl dnl hard dependancies on options @@ -394,8 +407,32 @@ AC_SUBST(Z_LIBS) AC_SUBST(WITH_ZLIB) +echo Checking lzma + +dnl Checks for lzma library. + +WITH_LZMA=0 +if test "$with_lzma" = "no"; then + echo "Disabling compression support" +else + AC_CHECK_HEADERS(lzma.h, + AC_CHECK_LIB(lzma, lzma_code,[ + AC_DEFINE([HAVE_LIBLZMA], [1], [Have compression library]) + WITH_LZMA=1 + if test "x${LZMA_DIR}" != "x"; then + LZMA_CFLAGS="-I${LZMA_DIR}/include" + LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" + else + LZMA_LIBS="-llzma" + fi])) +fi + +AC_SUBST(LZMA_CFLAGS) +AC_SUBST(LZMA_LIBS) +AC_SUBST(WITH_LZMA) + CPPFLAGS=${_cppflags} -LDFLAGS=${_ldflags} +LIBS=${_libs} echo Checking headers @@ -412,7 +449,7 @@ AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_HEADERS([stdint.h]) -AC_CHECK_HEADERS([inttypes.h.h]) +AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([ansidecl.h]) AC_CHECK_HEADERS([ieeefp.h]) @@ -467,6 +504,11 @@ AC_CHECK_HEADERS([dlfcn.h]) +echo Checking types + +AC_TYPE_UINT32_T + + echo Checking libraries dnl Checks for library functions. @@ -475,15 +517,18 @@ AC_CHECK_FUNCS(finite isnand fp_class class fpclass) AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) AC_CHECK_FUNCS(stat _stat signal) +AC_CHECK_FUNCS(rand rand_r srand time) +AC_CHECK_FUNCS(isascii mmap munmap putenv) -dnl Checking the standard string functions availability -AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, - NEED_TRIO=1) +AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif]) dnl Checking for va_copy availability AC_MSG_CHECKING([for va_copy]) -AC_TRY_LINK([#include -va_list ap1,ap2;], [va_copy(ap1,ap2);], +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])], have_va_copy=yes, have_va_copy=no) AC_MSG_RESULT($have_va_copy) @@ -491,8 +536,8 @@ AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) else AC_MSG_CHECKING([for __va_copy]) - AC_TRY_LINK([#include - va_list ap1,ap2;], [__va_copy(ap1,ap2);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])], have___va_copy=yes, have___va_copy=no) AC_MSG_RESULT($have___va_copy) @@ -543,13 +588,13 @@ fi if test $enable_ipv6 = yes; then have_ipv6=no - AC_TRY_COMPILE([ - #include - #include - ], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +# include +# include + ]], [[ struct sockaddr_storage ss; socket(AF_INET6, SOCK_STREAM, 0) - ], + ]])], have_ipv6=yes, have_ipv6=no ) @@ -567,26 +612,26 @@ dnl present. dnl ******************************************************************** AC_MSG_CHECKING([struct sockaddr::ss_family]) - AC_TRY_COMPILE([ - #include - #include - ], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +# include +# include + ]], [[ struct sockaddr_storage ss ; ss.ss_family = 0 ; - ], + ]])], have_ss_family=yes, have_ss_family=no ) AC_MSG_RESULT($have_ss_family) if test x$have_ss_family = xno ; then AC_MSG_CHECKING([broken struct sockaddr::ss_family]) - AC_TRY_COMPILE([ - #include - #include - ], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +# include +# include + ]], [[ struct sockaddr_storage ss ; ss.__ss_family = 0 ; - ], + ]])], have_broken_ss_family=yes, have_broken_ss_family=no ) @@ -659,8 +704,11 @@ # CFLAGS="${CFLAGS} -fexceptions" fi - - CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" + + # warnings we'd like to see + CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" + # warnings we'd like to supress + CFLAGS="${CFLAGS} -Wno-long-long" case "${host}" in alpha*-*-linux* ) CFLAGS="${CFLAGS} -mieee" @@ -911,22 +959,30 @@ echo Disabling multithreaded support else echo Enabling multithreaded support - dnl Use pthread by default - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - AC_CHECK_HEADER(pthread.h, - AC_CHECK_LIB(pthread, pthread_join,[ - THREAD_LIBS="-lpthread" - AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) - AC_DEFINE([HAVE_PTHREAD_H], [], [Define if is there]) - WITH_THREADS="1"])) - fi + + dnl Default to native threads on Win32 case $host_os in - *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then + *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then WITH_THREADS="1" - THREADS_W32="Win32" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" + THREADS_W32="1" + THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" fi ;; + esac + + dnl Use pthread by default in other cases + if test -z "$THREADS_W32"; then + if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then + AC_CHECK_HEADER(pthread.h, + AC_CHECK_LIB(pthread, pthread_join,[ + THREAD_LIBS="-lpthread" + AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) + AC_DEFINE([HAVE_PTHREAD_H], [], [Define if is there]) + WITH_THREADS="1"])) + fi + fi + + case $host_os in *cygwin*) THREAD_LIBS="" ;; *beos*) WITH_THREADS="1" @@ -969,7 +1025,7 @@ AC_SUBST(WITH_THREADS) AC_SUBST(THREAD_CFLAGS) AC_SUBST(TEST_THREADS) -AC_SUBST(THREADS_W32) +AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"]) dnl dnl xmllint shell history @@ -1093,6 +1149,7 @@ TEST_SAX=SAXtests fi AC_SUBST(WITH_SAX1) +AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1") AC_SUBST(TEST_SAX) if test "$with_push" = "no" ; then @@ -1259,10 +1316,10 @@ AC_CHECK_HEADER(iconv.h, AC_MSG_CHECKING(for iconv) - AC_TRY_LINK([#include -#include ],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]],[[ iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL);],[ +iconv (cd, NULL, NULL, NULL, NULL);]])],[ AC_MSG_RESULT(yes) WITH_ICONV=1],[ AC_MSG_RESULT(no) @@ -1273,10 +1330,10 @@ LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" LIBS="${LIBS} -liconv" - AC_TRY_LINK([#include -#include ],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]],[[ iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL);],[ +iconv (cd, NULL, NULL, NULL, NULL);]])],[ AC_MSG_RESULT(yes) WITH_ICONV=1 ICONV_LIBS="${ICONV_LIBS} -liconv" @@ -1289,7 +1346,7 @@ if test "$WITH_ICONV" = "1" ; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(xml_cv_iconv_arg2, [ - AC_TRY_COMPILE([#include + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include extern #ifdef __cplusplus @@ -1300,7 +1357,7 @@ #else size_t iconv(); #endif -], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")]) +]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")]) xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" AC_MSG_RESULT([${xml_xxx:- @@ -1324,14 +1381,14 @@ AC_SUBST(WITH_ICONV) WITH_ICU=0 +ICU_LIBS="" if test "$with_icu" != "yes" ; then echo Disabling ICU support else ICU_CONFIG=icu-config if ${ICU_CONFIG} --cflags >/dev/null 2>&1 then - ICU_LIBS=`icu-config --ldflags` - LDFLAGS="$LDFLAGS $ICU_LIBS" + ICU_LIBS=`${ICU_CONFIG} --ldflags` WITH_ICU=1 echo Enabling ICU support else @@ -1339,6 +1396,7 @@ fi fi AC_SUBST(WITH_ICU) +AC_SUBST(ICU_LIBS) WITH_ISO8859X=1 if test "$WITH_ICONV" != "1" ; then @@ -1436,11 +1494,9 @@ WIN32_EXTRA_LIBADD="-lws2_32" WIN32_EXTRA_LDFLAGS="-no-undefined" AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) - AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) - AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) if test "${PYTHON}" != "" then - WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}" + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" fi ;; *-*-cygwin*) @@ -1457,6 +1513,24 @@ AC_SUBST(CYGWIN_EXTRA_LDFLAGS) AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) +dnl Checking the standard string functions availability +dnl +dnl Note mingw* has C99 implementation that produce expected xml numbers +dnl if code use {v}snprintf functions. +dnl If you like to activate at run-time C99 compatible number output +dnl see release note for mingw runtime 3.15: +dnl http://sourceforge.net/project/shownotes.php?release_id=24832 +dnl +dnl Also *win32*config.h files redefine them for various MSC compilers. +dnl +dnl So do not redefine {v}snprintf to _{v}snprintf like follwing: +dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) +dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) +dnl and do not redefine those functions is C-source files. +dnl +AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, + NEED_TRIO=1) + if test "$with_coverage" = "yes" -a "${GCC}" = "yes" then echo Enabling code coverage for GCC @@ -1493,10 +1567,11 @@ AC_SUBST(PYTHON_TESTS) rm -f COPYING.LIB COPYING -ln -s Copyright COPYING +ln -s $srcdir/Copyright COPYING # keep on one line for cygwin c.f. #130896 -AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py) +AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py]) +AC_OUTPUT chmod +x xml2-config python/setup.py echo Done configuring Index: lib/3rdparty/libxml2/debugXML.c =================================================================== --- lib/3rdparty/libxml2/debugXML.c (revision 58293) +++ lib/3rdparty/libxml2/debugXML.c (working copy) @@ -85,7 +85,7 @@ * * Check that a given namespace is in scope on a node. * - * Returns 1 if in scope, -1 in case of argument error, + * Returns 1 if in scope, -1 in case of argument error, * -2 if the namespace is not in scope, and -3 if not on * an ancestor node. */ @@ -311,7 +311,7 @@ (node != (xmlNodePtr) node->parent->properties)) xmlDebugErr(ctxt, XML_CHECK_NO_PREV, "Attr has no prev and not first of attr list\n"); - + } else if ((node->parent != NULL) && (node->parent->children != node)) xmlDebugErr(ctxt, XML_CHECK_NO_PREV, "Node has no prev and not first of parent list\n"); @@ -1068,7 +1068,7 @@ return; } xmlCtxtDumpOneNode(ctxt, node); - if ((node->type != XML_NAMESPACE_DECL) && + if ((node->type != XML_NAMESPACE_DECL) && (node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) { ctxt->depth++; xmlCtxtDumpNodeList(ctxt, node->children); @@ -1603,7 +1603,7 @@ xmlLsCountNode(xmlNodePtr node) { int ret = 0; xmlNodePtr list = NULL; - + if (node == NULL) return(0); @@ -1644,7 +1644,7 @@ ret = 1; break; } - for (;list != NULL;ret++) + for (;list != NULL;ret++) list = list->next; return(ret); } @@ -1712,11 +1712,11 @@ if (node->type != XML_NAMESPACE_DECL) { if (node->properties != NULL) fprintf(output, "a"); - else + else fprintf(output, "-"); - if (node->nsDef != NULL) + if (node->nsDef != NULL) fprintf(output, "n"); - else + else fprintf(output, "-"); } @@ -1724,8 +1724,11 @@ switch (node->type) { case XML_ELEMENT_NODE: - if (node->name != NULL) + if (node->name != NULL) { + if ((node->ns != NULL) && (node->ns->prefix != NULL)) + fprintf(output, "%s:", node->ns->prefix); fprintf(output, "%s", (const char *) node->name); + } break; case XML_ATTRIBUTE_NODE: if (node->name != NULL) @@ -1783,7 +1786,7 @@ * xmlBoolToText: * @boolval: a bool to turn into text * - * Convenient way to turn bool into text + * Convenient way to turn bool into text * * Returns a pointer to either "True" or "False" */ @@ -1799,7 +1802,7 @@ #ifdef LIBXML_XPATH_ENABLED /**************************************************************** * * - * The XML shell related functions * + * The XML shell related functions * * * ****************************************************************/ @@ -2050,7 +2053,7 @@ if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } base = xmlNodeGetBase(node->doc, node); @@ -2277,7 +2280,7 @@ if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } if ((node->type == XML_DOCUMENT_NODE) || (node->type == XML_HTML_DOCUMENT_NODE)) { xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node); @@ -2412,7 +2415,7 @@ if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) { #ifdef LIBXML_HTML_ENABLED if (node->type == XML_HTML_DOCUMENT_NODE) @@ -2696,6 +2699,8 @@ } else if (node->type == XML_ELEMENT_NODE) { for (i = 0; i < indent; i++) fprintf(ctxt->output, " "); + if ((node->ns) && (node->ns->prefix)) + fprintf(ctxt->output, "%s:", node->ns->prefix); fprintf(ctxt->output, "%s\n", node->name); } else { } @@ -2748,7 +2753,7 @@ * xmlShellPwd: * @ctxt: the shell context * @buffer: the output buffer - * @node: a node + * @node: a node * @node2: unused * * Implements the XML shell function "pwd" @@ -2793,7 +2798,7 @@ * @input: the line reading function * @output: the output FILE*, defaults to stdout if NULL * - * Implements the XML shell + * Implements the XML shell * This allow to load, validate, view, modify and save a document * using a environment similar to a UNIX commandline. */ @@ -2837,6 +2842,10 @@ while (1) { if (ctxt->node == (xmlNodePtr) ctxt->doc) snprintf(prompt, sizeof(prompt), "%s > ", "/"); + else if ((ctxt->node != NULL) && (ctxt->node->name) && + (ctxt->node->ns) && (ctxt->node->ns->prefix)) + snprintf(prompt, sizeof(prompt), "%s:%s > ", + (ctxt->node->ns->prefix), ctxt->node->name); else if ((ctxt->node != NULL) && (ctxt->node->name)) snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name); else @@ -2911,6 +2920,7 @@ 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"); + fprintf(ctxt->output, "\twhereis display absolute path of [path] or current working directory\n"); fprintf(ctxt->output, "\tquit leave shell\n"); #ifdef LIBXML_OUTPUT_ENABLED fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n"); @@ -2960,7 +2970,79 @@ if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL)) fprintf(ctxt->output, "%s\n", dir); } else if (!strcmp(command, "du")) { - xmlShellDu(ctxt, NULL, ctxt->node, NULL); + if (arg[0] == 0) { + xmlShellDu(ctxt, NULL, ctxt->node, NULL); + } else { + ctxt->pctxt->node = ctxt->node; +#ifdef LIBXML_XPATH_ENABLED + ctxt->pctxt->node = ctxt->node; + list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); +#else + list = NULL; +#endif /* LIBXML_XPATH_ENABLED */ + if (list != NULL) { + switch (list->type) { + case XPATH_UNDEFINED: + xmlGenericError(xmlGenericErrorContext, + "%s: no such node\n", arg); + break; + case XPATH_NODESET:{ + int indx; + + if (list->nodesetval == NULL) + break; + + for (indx = 0; + indx < list->nodesetval->nodeNr; + indx++) + xmlShellDu(ctxt, NULL, + list->nodesetval-> + nodeTab[indx], NULL); + break; + } + case XPATH_BOOLEAN: + xmlGenericError(xmlGenericErrorContext, + "%s is a Boolean\n", arg); + break; + case XPATH_NUMBER: + xmlGenericError(xmlGenericErrorContext, + "%s is a number\n", arg); + break; + case XPATH_STRING: + xmlGenericError(xmlGenericErrorContext, + "%s is a string\n", arg); + break; + case XPATH_POINT: + xmlGenericError(xmlGenericErrorContext, + "%s is a point\n", arg); + break; + case XPATH_RANGE: + xmlGenericError(xmlGenericErrorContext, + "%s is a range\n", arg); + break; + case XPATH_LOCATIONSET: + xmlGenericError(xmlGenericErrorContext, + "%s is a range\n", arg); + break; + case XPATH_USERS: + xmlGenericError(xmlGenericErrorContext, + "%s is user-defined\n", arg); + break; + case XPATH_XSLT_TREE: + xmlGenericError(xmlGenericErrorContext, + "%s is an XSLT value tree\n", + arg); + break; + } +#ifdef LIBXML_XPATH_ENABLED + xmlXPathFreeObject(list); +#endif + } else { + xmlGenericError(xmlGenericErrorContext, + "%s: no such node\n", arg); + } + ctxt->pctxt->node = NULL; + } } else if (!strcmp(command, "base")) { xmlShellBase(ctxt, NULL, ctxt->node, NULL); } else if (!strcmp(command, "set")) { @@ -3078,6 +3160,83 @@ } ctxt->pctxt->node = NULL; } + } else if (!strcmp(command, "whereis")) { + char dir[500]; + + if (arg[0] == 0) { + if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL)) + fprintf(ctxt->output, "%s\n", dir); + } else { + ctxt->pctxt->node = ctxt->node; +#ifdef LIBXML_XPATH_ENABLED + list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); +#else + list = NULL; +#endif /* LIBXML_XPATH_ENABLED */ + if (list != NULL) { + switch (list->type) { + case XPATH_UNDEFINED: + xmlGenericError(xmlGenericErrorContext, + "%s: no such node\n", arg); + break; + case XPATH_NODESET:{ + int indx; + + if (list->nodesetval == NULL) + break; + + for (indx = 0; + indx < list->nodesetval->nodeNr; + indx++) { + if (!xmlShellPwd(ctxt, dir, list->nodesetval-> + nodeTab[indx], NULL)) + fprintf(ctxt->output, "%s\n", dir); + } + break; + } + case XPATH_BOOLEAN: + xmlGenericError(xmlGenericErrorContext, + "%s is a Boolean\n", arg); + break; + case XPATH_NUMBER: + xmlGenericError(xmlGenericErrorContext, + "%s is a number\n", arg); + break; + case XPATH_STRING: + xmlGenericError(xmlGenericErrorContext, + "%s is a string\n", arg); + break; + case XPATH_POINT: + xmlGenericError(xmlGenericErrorContext, + "%s is a point\n", arg); + break; + case XPATH_RANGE: + xmlGenericError(xmlGenericErrorContext, + "%s is a range\n", arg); + break; + case XPATH_LOCATIONSET: + xmlGenericError(xmlGenericErrorContext, + "%s is a range\n", arg); + break; + case XPATH_USERS: + xmlGenericError(xmlGenericErrorContext, + "%s is user-defined\n", arg); + break; + case XPATH_XSLT_TREE: + xmlGenericError(xmlGenericErrorContext, + "%s is an XSLT value tree\n", + arg); + break; + } +#ifdef LIBXML_XPATH_ENABLED + xmlXPathFreeObject(list); +#endif + } else { + xmlGenericError(xmlGenericErrorContext, + "%s: no such node\n", arg); + } + ctxt->pctxt->node = NULL; + } } else if (!strcmp(command, "cd")) { if (arg[0] == 0) { ctxt->node = (xmlNodePtr) ctxt->doc; Index: lib/3rdparty/libxml2/depcomp =================================================================== --- lib/3rdparty/libxml2/depcomp (revision 58293) +++ lib/3rdparty/libxml2/depcomp (working copy) @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-12-04.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -90,10 +90,18 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -158,10 +166,12 @@ ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -405,6 +415,52 @@ rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/ \1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/ / + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -503,7 +559,9 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation Index: lib/3rdparty/libxml2/dict.c =================================================================== --- lib/3rdparty/libxml2/dict.c (revision 58293) +++ lib/3rdparty/libxml2/dict.c (working copy) @@ -2,7 +2,7 @@ * dict.c: dictionary of reusable strings, just used to avoid allocation * and freeing operations. * - * Copyright (C) 2003 Daniel Veillard. + * Copyright (C) 2003-2012 Daniel Veillard. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -19,6 +19,29 @@ #define IN_LIBXML #include "libxml.h" +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif + +/* + * Following http://www.ocert.org/advisories/ocert-2011-003.html + * it seems that having hash randomization might be a good idea + * when using XML with untrusted data + * Note1: that it works correctly only if compiled with WITH_BIG_KEY + * which is the default. + * Note2: the fast function used for a small dict won't protect very + * well but since the attack is based on growing a very big hash + * 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) +#define DICT_RANDOMIZATION +#endif + #include #ifdef HAVE_STDINT_H #include @@ -44,23 +67,23 @@ #define WITH_BIG_KEY #ifdef WITH_BIG_KEY -#define xmlDictComputeKey(dict, name, len) \ - (((dict)->size == MIN_DICT_SIZE) ? \ - xmlDictComputeFastKey(name, len) : \ - xmlDictComputeBigKey(name, len)) +#define xmlDictComputeKey(dict, name, len) \ + (((dict)->size == MIN_DICT_SIZE) ? \ + xmlDictComputeFastKey(name, len, (dict)->seed) : \ + xmlDictComputeBigKey(name, len, (dict)->seed)) -#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ - (((prefix) == NULL) ? \ - (xmlDictComputeKey(dict, name, len)) : \ - (((dict)->size == MIN_DICT_SIZE) ? \ - xmlDictComputeFastQKey(prefix, plen, name, len) : \ - xmlDictComputeBigQKey(prefix, plen, name, len))) +#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ + (((prefix) == NULL) ? \ + (xmlDictComputeKey(dict, name, len)) : \ + (((dict)->size == MIN_DICT_SIZE) ? \ + xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) : \ + xmlDictComputeBigQKey(prefix, plen, name, len, (dict)->seed))) #else /* !WITH_BIG_KEY */ -#define xmlDictComputeKey(dict, name, len) \ - xmlDictComputeFastKey(name, len) -#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ - xmlDictComputeFastQKey(prefix, plen, name, len) +#define xmlDictComputeKey(dict, name, len) \ + xmlDictComputeFastKey(name, len, (dict)->seed) +#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ + xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) #endif /* WITH_BIG_KEY */ /* @@ -71,7 +94,7 @@ struct _xmlDictEntry { struct _xmlDictEntry *next; const xmlChar *name; - int len; + unsigned int len; int valid; unsigned long okey; }; @@ -82,8 +105,8 @@ xmlDictStringsPtr next; xmlChar *free; xmlChar *end; - int size; - int nbStrings; + size_t size; + size_t nbStrings; xmlChar array[1]; }; /* @@ -93,11 +116,15 @@ int ref_counter; struct _xmlDictEntry *dict; - int size; - int nbElems; + size_t size; + unsigned int nbElems; xmlDictStringsPtr strings; struct _xmlDict *subdict; + /* used for randomization */ + int seed; + /* used to impose a limit on size */ + size_t limit; }; /* @@ -111,28 +138,69 @@ */ static int xmlDictInitialized = 0; +#ifdef DICT_RANDOMIZATION +#ifdef HAVE_RAND_R +/* + * Internal data for random function, protected by xmlDictMutex + */ +unsigned int rand_seed = 0; +#endif +#endif + /** * xmlInitializeDict: * * Do the dictionary mutex initialization. * this function is not thread safe, initialization should * preferably be done once at startup + * + * Returns 0 if initialization was already done, and 1 if that + * call led to the initialization */ -static int xmlInitializeDict(void) { +int xmlInitializeDict(void) { if (xmlDictInitialized) return(1); if ((xmlDictMutex = xmlNewRMutex()) == NULL) return(0); + xmlRMutexLock(xmlDictMutex); +#ifdef DICT_RANDOMIZATION +#ifdef HAVE_RAND_R + rand_seed = time(NULL); + rand_r(& rand_seed); +#else + srand(time(NULL)); +#endif +#endif xmlDictInitialized = 1; + xmlRMutexUnlock(xmlDictMutex); return(1); } +#ifdef DICT_RANDOMIZATION +int __xmlRandom(void) { + int ret; + + if (xmlDictInitialized == 0) + xmlInitializeDict(); + + xmlRMutexLock(xmlDictMutex); +#ifdef HAVE_RAND_R + ret = rand_r(& rand_seed); +#else + ret = rand(); +#endif + xmlRMutexUnlock(xmlDictMutex); + return(ret); +} +#endif + /** * xmlDictCleanup: * - * Free the dictionary mutex. + * Free the dictionary mutex. Do not call unless sure the library + * is not in use anymore ! */ void xmlDictCleanup(void) { @@ -148,17 +216,18 @@ * xmlDictAddString: * @dict: the dictionnary * @name: the name of the userdata - * @len: the length of the name, if -1 it is recomputed + * @len: the length of the name * * Add the string to the array[s] * * Returns the pointer of the local string, or NULL in case of error. */ static const xmlChar * -xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) { +xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) { xmlDictStringsPtr pool; const xmlChar *ret; - int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ + size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ + size_t limit = 0; #ifdef DICT_DEBUG_PATTERNS fprintf(stderr, "-"); @@ -168,15 +237,20 @@ if (pool->end - pool->free > namelen) goto found_pool; if (pool->size > size) size = pool->size; + limit += pool->size; pool = pool->next; } /* * Not found, need to allocate */ if (pool == NULL) { + if ((dict->limit > 0) && (limit > dict->limit)) { + return(NULL); + } + if (size == 0) size = 1000; else size *= 4; /* exponential growth */ - if (size < 4 * namelen) + if (size < 4 * namelen) size = 4 * namelen; /* just in case ! */ pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size); if (pool == NULL) @@ -206,19 +280,20 @@ * @prefix: the prefix of the userdata * @plen: the prefix length * @name: the name of the userdata - * @len: the length of the name, if -1 it is recomputed + * @len: the length of the name * * Add the QName to the array[s] * * Returns the pointer of the local string, or NULL in case of error. */ static const xmlChar * -xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, int plen, - const xmlChar *name, int namelen) +xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen, + const xmlChar *name, unsigned int namelen) { xmlDictStringsPtr pool; const xmlChar *ret; - int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ + size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ + size_t limit = 0; if (prefix == NULL) return(xmlDictAddString(dict, name, namelen)); @@ -230,12 +305,17 @@ if (pool->end - pool->free > namelen + plen + 1) goto found_pool; if (pool->size > size) size = pool->size; + limit += pool->size; pool = pool->next; } /* * Not found, need to allocate */ if (pool == NULL) { + if ((dict->limit > 0) && (limit > dict->limit)) { + return(NULL); + } + if (size == 0) size = 1000; else size *= 4; /* exponential growth */ if (size < 4 * (namelen + plen + 1)) @@ -277,13 +357,13 @@ */ static uint32_t -xmlDictComputeBigKey(const xmlChar* data, int namelen) { +xmlDictComputeBigKey(const xmlChar* data, int namelen, int seed) { uint32_t hash; int i; if (namelen <= 0 || data == NULL) return(0); - hash = 0; + hash = seed; for (i = 0;i < namelen; i++) { hash += data[i]; @@ -310,12 +390,12 @@ */ static unsigned long xmlDictComputeBigQKey(const xmlChar *prefix, int plen, - const xmlChar *name, int len) + const xmlChar *name, int len, int seed) { uint32_t hash; int i; - hash = 0; + hash = seed; for (i = 0;i < plen; i++) { hash += prefix[i]; @@ -346,8 +426,8 @@ * for low hash table fill. */ static unsigned long -xmlDictComputeFastKey(const xmlChar *name, int namelen) { - unsigned long value = 0L; +xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) { + unsigned long value = seed; if (name == NULL) return(0); value = *name; @@ -381,9 +461,9 @@ */ static unsigned long xmlDictComputeFastQKey(const xmlChar *prefix, int plen, - const xmlChar *name, int len) + const xmlChar *name, int len, int seed) { - unsigned long value = 0L; + unsigned long value = (unsigned long) seed; if (plen == 0) value += 30 * (unsigned long) ':'; @@ -452,6 +532,7 @@ dict = xmlMalloc(sizeof(xmlDict)); if (dict) { dict->ref_counter = 1; + dict->limit = 0; dict->size = MIN_DICT_SIZE; dict->nbElems = 0; @@ -460,6 +541,11 @@ dict->subdict = NULL; if (dict->dict) { memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry)); +#ifdef DICT_RANDOMIZATION + dict->seed = __xmlRandom(); +#else + dict->seed = 0; +#endif return(dict); } xmlFree(dict); @@ -486,6 +572,7 @@ #ifdef DICT_DEBUG_PATTERNS fprintf(stderr, "R"); #endif + dict->seed = sub->seed; dict->subdict = sub; xmlDictReference(dict->subdict); } @@ -523,9 +610,9 @@ * Returns 0 in case of success, -1 in case of failure */ static int -xmlDictGrow(xmlDictPtr dict, int size) { +xmlDictGrow(xmlDictPtr dict, size_t size) { unsigned long key, okey; - int oldsize, i; + size_t oldsize, i; xmlDictEntryPtr iter, next; struct _xmlDictEntry *olddict; #ifdef DEBUG_GROW @@ -642,7 +729,7 @@ #ifdef DEBUG_GROW xmlGenericError(xmlGenericErrorContext, - "xmlDictGrow : from %d to %d, %d elems\n", oldsize, size, nbElem); + "xmlDictGrow : from %lu to %lu, %u elems\n", oldsize, size, nbElem); #endif return(ret); @@ -657,7 +744,7 @@ */ void xmlDictFree(xmlDictPtr dict) { - int i; + size_t i; xmlDictEntryPtr iter; xmlDictEntryPtr next; int inside_dict = 0; @@ -726,17 +813,24 @@ xmlDictEntryPtr entry; xmlDictEntryPtr insert; const xmlChar *ret; + unsigned int l; if ((dict == NULL) || (name == NULL)) return(NULL); if (len < 0) - len = strlen((const char *) name); + l = strlen((const char *) name); + else + l = len; + if (((dict->limit > 0) && (l >= dict->limit)) || + (l > INT_MAX / 2)) + return(NULL); + /* * Check for duplicate and insertion location. */ - okey = xmlDictComputeKey(dict, name, len); + okey = xmlDictComputeKey(dict, name, l); key = okey % dict->size; if (dict->dict[key].valid == 0) { insert = NULL; @@ -744,25 +838,25 @@ for (insert = &(dict->dict[key]); insert->next != NULL; insert = insert->next) { #ifdef __GNUC__ - if ((insert->okey == okey) && (insert->len == len)) { - if (!memcmp(insert->name, name, len)) + if ((insert->okey == okey) && (insert->len == l)) { + if (!memcmp(insert->name, name, l)) return(insert->name); } #else - if ((insert->okey == okey) && (insert->len == len) && - (!xmlStrncmp(insert->name, name, len))) + if ((insert->okey == okey) && (insert->len == l) && + (!xmlStrncmp(insert->name, name, l))) return(insert->name); #endif nbi++; } #ifdef __GNUC__ - if ((insert->okey == okey) && (insert->len == len)) { - if (!memcmp(insert->name, name, len)) + if ((insert->okey == okey) && (insert->len == l)) { + if (!memcmp(insert->name, name, l)) return(insert->name); } #else - if ((insert->okey == okey) && (insert->len == len) && - (!xmlStrncmp(insert->name, name, len))) + if ((insert->okey == okey) && (insert->len == l) && + (!xmlStrncmp(insert->name, name, l))) return(insert->name); #endif } @@ -775,7 +869,7 @@ (dict->subdict->size != MIN_DICT_SIZE)) || ((dict->size != MIN_DICT_SIZE) && (dict->subdict->size == MIN_DICT_SIZE))) - skey = xmlDictComputeKey(dict->subdict, name, len); + skey = xmlDictComputeKey(dict->subdict, name, l); else skey = okey; @@ -786,32 +880,32 @@ for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL; tmp = tmp->next) { #ifdef __GNUC__ - if ((tmp->okey == skey) && (tmp->len == len)) { - if (!memcmp(tmp->name, name, len)) + if ((tmp->okey == skey) && (tmp->len == l)) { + if (!memcmp(tmp->name, name, l)) return(tmp->name); } #else - if ((tmp->okey == skey) && (tmp->len == len) && - (!xmlStrncmp(tmp->name, name, len))) + if ((tmp->okey == skey) && (tmp->len == l) && + (!xmlStrncmp(tmp->name, name, l))) return(tmp->name); #endif nbi++; } #ifdef __GNUC__ - if ((tmp->okey == skey) && (tmp->len == len)) { - if (!memcmp(tmp->name, name, len)) + if ((tmp->okey == skey) && (tmp->len == l)) { + if (!memcmp(tmp->name, name, l)) return(tmp->name); } #else - if ((tmp->okey == skey) && (tmp->len == len) && - (!xmlStrncmp(tmp->name, name, len))) + if ((tmp->okey == skey) && (tmp->len == l) && + (!xmlStrncmp(tmp->name, name, l))) return(tmp->name); #endif } key = okey % dict->size; } - ret = xmlDictAddString(dict, name, len); + ret = xmlDictAddString(dict, name, l); if (ret == NULL) return(NULL); if (insert == NULL) { @@ -822,13 +916,13 @@ return(NULL); } entry->name = ret; - entry->len = len; + entry->len = l; entry->next = NULL; entry->valid = 1; entry->okey = okey; - if (insert != NULL) + if (insert != NULL) insert->next = entry; dict->nbElems++; @@ -857,17 +951,23 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) { unsigned long key, okey, nbi = 0; xmlDictEntryPtr insert; + unsigned int l; if ((dict == NULL) || (name == NULL)) return(NULL); if (len < 0) - len = strlen((const char *) name); + l = strlen((const char *) name); + else + l = len; + if (((dict->limit > 0) && (l >= dict->limit)) || + (l > INT_MAX / 2)) + return(NULL); /* * Check for duplicate and insertion location. */ - okey = xmlDictComputeKey(dict, name, len); + okey = xmlDictComputeKey(dict, name, l); key = okey % dict->size; if (dict->dict[key].valid == 0) { insert = NULL; @@ -875,25 +975,25 @@ for (insert = &(dict->dict[key]); insert->next != NULL; insert = insert->next) { #ifdef __GNUC__ - if ((insert->okey == okey) && (insert->len == len)) { - if (!memcmp(insert->name, name, len)) + if ((insert->okey == okey) && (insert->len == l)) { + if (!memcmp(insert->name, name, l)) return(insert->name); } #else - if ((insert->okey == okey) && (insert->len == len) && - (!xmlStrncmp(insert->name, name, len))) + if ((insert->okey == okey) && (insert->len == l) && + (!xmlStrncmp(insert->name, name, l))) return(insert->name); #endif nbi++; } #ifdef __GNUC__ - if ((insert->okey == okey) && (insert->len == len)) { - if (!memcmp(insert->name, name, len)) + if ((insert->okey == okey) && (insert->len == l)) { + if (!memcmp(insert->name, name, l)) return(insert->name); } #else - if ((insert->okey == okey) && (insert->len == len) && - (!xmlStrncmp(insert->name, name, len))) + if ((insert->okey == okey) && (insert->len == l) && + (!xmlStrncmp(insert->name, name, l))) return(insert->name); #endif } @@ -906,7 +1006,7 @@ (dict->subdict->size != MIN_DICT_SIZE)) || ((dict->size != MIN_DICT_SIZE) && (dict->subdict->size == MIN_DICT_SIZE))) - skey = xmlDictComputeKey(dict->subdict, name, len); + skey = xmlDictComputeKey(dict->subdict, name, l); else skey = okey; @@ -917,25 +1017,25 @@ for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL; tmp = tmp->next) { #ifdef __GNUC__ - if ((tmp->okey == skey) && (tmp->len == len)) { - if (!memcmp(tmp->name, name, len)) + if ((tmp->okey == skey) && (tmp->len == l)) { + if (!memcmp(tmp->name, name, l)) return(tmp->name); } #else - if ((tmp->okey == skey) && (tmp->len == len) && - (!xmlStrncmp(tmp->name, name, len))) + if ((tmp->okey == skey) && (tmp->len == l) && + (!xmlStrncmp(tmp->name, name, l))) return(tmp->name); #endif nbi++; } #ifdef __GNUC__ - if ((tmp->okey == skey) && (tmp->len == len)) { - if (!memcmp(tmp->name, name, len)) + if ((tmp->okey == skey) && (tmp->len == l)) { + if (!memcmp(tmp->name, name, l)) return(tmp->name); } #else - if ((tmp->okey == skey) && (tmp->len == len) && - (!xmlStrncmp(tmp->name, name, len))) + if ((tmp->okey == skey) && (tmp->len == l) && + (!xmlStrncmp(tmp->name, name, l))) return(tmp->name); #endif } @@ -961,7 +1061,7 @@ xmlDictEntryPtr entry; xmlDictEntryPtr insert; const xmlChar *ret; - int len, plen, l; + unsigned int len, plen, l; if ((dict == NULL) || (name == NULL)) return(NULL); @@ -1037,7 +1137,7 @@ entry->valid = 1; entry->okey = okey; - if (insert != NULL) + if (insert != NULL) insert->next = entry; dict->nbElems++; @@ -1095,6 +1195,50 @@ return(dict->nbElems); } +/** + * xmlDictSetLimit: + * @dict: the dictionnary + * @limit: the limit in bytes + * + * Set a size limit for the dictionary + * Added in 2.9.0 + * + * Returns the previous limit of the dictionary or 0 + */ +size_t +xmlDictSetLimit(xmlDictPtr dict, size_t limit) { + size_t ret; + if (dict == NULL) + return(0); + ret = dict->limit; + dict->limit = limit; + return(ret); +} + +/** + * xmlDictGetUsage: + * @dict: the dictionnary + * + * Get how much memory is used by a dictionary for strings + * Added in 2.9.0 + * + * Returns the amount of strings allocated + */ +size_t +xmlDictGetUsage(xmlDictPtr dict) { + xmlDictStringsPtr pool; + size_t limit = 0; + + if (dict == NULL) + return(0); + pool = dict->strings; + while (pool != NULL) { + limit += pool->size; + pool = pool->next; + } + return(limit); +} + #define bottom_dict #include "elfgcchack.h" Index: lib/3rdparty/libxml2/DOCBparser.c =================================================================== --- lib/3rdparty/libxml2/DOCBparser.c (revision 58293) +++ lib/3rdparty/libxml2/DOCBparser.c (working copy) @@ -53,7 +53,7 @@ /** * docbParseDocument: * @ctxt: an SGML parser context - * + * * parse an SGML document (and build a tree if using the standard SAX * interface). * @@ -163,12 +163,12 @@ * @cur: a pointer to an array of xmlChar * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML in-memory document and build a tree. * It use the given SAX function block to handle the parsing callback. * If sax is NULL, fallback to the default DOM tree building routines. - * + * * Returns the resulting document tree */ @@ -196,7 +196,7 @@ * @encoding: a free form C string describing the SGML document encoding, or NULL * * parse an SGML in-memory document and build a tree. - * + * * Returns the resulting document tree */ @@ -221,7 +221,7 @@ * @filename: the filename * @encoding: the SGML document encoding, or NULL * - * Create a parser context for a file content. + * Create a parser context for a file content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * @@ -247,7 +247,7 @@ * @filename: the filename * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML file and build a tree. Automatic support for ZLIB/Compress * compressed document is provided by default if found at compile-time. Index: lib/3rdparty/libxml2/enc.h =================================================================== --- lib/3rdparty/libxml2/enc.h (revision 0) +++ lib/3rdparty/libxml2/enc.h (working copy) @@ -0,0 +1,32 @@ +/* + * Summary: Internal Interfaces for encoding in libxml2 + * Description: this module describes a few interfaces which were + * addded 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. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_ENC_H__ +#define __XML_ENC_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, + xmlBufferPtr in, int len); +int xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len); +int xmlCharEncInput(xmlParserInputBufferPtr input); +int xmlCharEncOutput(xmlOutputBufferPtr output, int init); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_ENC_H__ */ + + Index: lib/3rdparty/libxml2/encoding.c =================================================================== --- lib/3rdparty/libxml2/encoding.c (revision 58293) +++ lib/3rdparty/libxml2/encoding.c (working copy) @@ -24,6 +24,7 @@ #include "libxml.h" #include +#include #ifdef HAVE_CTYPE_H #include @@ -44,6 +45,9 @@ #include #include +#include "buf.h" +#include "enc.h" + static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL; static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL; @@ -1825,7 +1829,7 @@ /************************************************************************ * * - * ICU based generic conversion functions * + * ICU based generic conversion functions * * * ************************************************************************/ @@ -1897,9 +1901,6 @@ * The real API used by libxml for on-the-fly conversion * * * ************************************************************************/ -int -xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, - xmlBufferPtr in, int len); /** * xmlCharEncFirstLineInt: @@ -1928,7 +1929,7 @@ if (in == NULL) return(-1); /* calculate space available */ - written = out->size - out->use; + written = out->size - out->use - 1; /* count '\0' */ toconv = in->use; /* * echo '' | wc -c => 38 @@ -1946,7 +1947,7 @@ toconv = 180; } if (toconv * 2 >= written) { - xmlBufferGrow(out, toconv); + xmlBufferGrow(out, toconv * 2); written = out->size - out->use - 1; } @@ -2029,6 +2030,251 @@ } /** + * xmlCharEncFirstLineInput: + * @input: a parser input buffer + * @len: number of bytes to convert for the first line, or -1 + * + * Front-end for the encoding handler input function, but handle only + * the very first line. Point is that this is based on autodetection + * of the encoding and once that first line is converted we may find + * out that a different decoder is needed to process the input. + * + * Returns the number of byte written if success, or + * -1 general error + * -2 if the transcoding fails (for *in is not valid utf8 string or + * the result of transformation can't fit into the encoding we want), or + */ +int +xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) +{ + int ret = -2; + size_t written; + size_t toconv; + int c_in; + int c_out; + xmlBufPtr in; + xmlBufPtr out; + + if ((input == NULL) || (input->encoder == NULL) || + (input->buffer == NULL) || (input->raw == NULL)) + return (-1); + out = input->buffer; + in = input->raw; + + toconv = xmlBufUse(in); + if (toconv == 0) + return (0); + written = xmlBufAvail(out) - 1; /* count '\0' */ + /* + * echo '' | wc -c => 38 + * 45 chars should be sufficient to reach the end of the encoding + * declaration without going too far inside the document content. + * on UTF-16 this means 90bytes, on UCS4 this means 180 + * The actual value depending on guessed encoding is passed as @len + * if provided + */ + if (len >= 0) { + if (toconv > (unsigned int) len) + toconv = len; + } else { + if (toconv > 180) + toconv = 180; + } + if (toconv * 2 >= written) { + xmlBufGrow(out, toconv * 2); + written = xmlBufAvail(out) - 1; + } + if (written > 360) + written = 360; + + c_in = toconv; + c_out = written; + if (input->encoder->input != NULL) { + ret = input->encoder->input(xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + } +#ifdef LIBXML_ICONV_ENABLED + else if (input->encoder->iconv_in != NULL) { + ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out), + &c_out, xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (input->encoder->uconv_in != NULL) { + ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out), + &c_out, xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + } +#endif /* LIBXML_ICU_ENABLED */ + switch (ret) { + case 0: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input\n", + c_in, c_out); +#endif + break; + case -1: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input, %d left\n", + c_in, c_out, (int)xmlBufUse(in)); +#endif + break; + case -3: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input, %d left\n", + c_in, c_out, (int)xmlBufUse(in)); +#endif + break; + case -2: { + char buf[50]; + const xmlChar *content = xmlBufContent(in); + + snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", + content[0], content[1], + content[2], content[3]); + buf[49] = 0; + xmlEncodingErr(XML_I18N_CONV_FAILED, + "input conversion failed due to input error, bytes %s\n", + buf); + } + } + /* + * Ignore when input buffer is not on a boundary + */ + if (ret == -3) ret = 0; + if (ret == -1) ret = 0; + return(ret); +} + +/** + * xmlCharEncInput: + * @input: a parser input buffer + * + * Generic front-end for the encoding handler on parser input + * + * Returns the number of byte written if success, or + * -1 general error + * -2 if the transcoding fails (for *in is not valid utf8 string or + * the result of transformation can't fit into the encoding we want), or + */ +int +xmlCharEncInput(xmlParserInputBufferPtr input) +{ + int ret = -2; + size_t written; + size_t toconv; + int c_in; + int c_out; + xmlBufPtr in; + xmlBufPtr out; + + if ((input == NULL) || (input->encoder == NULL) || + (input->buffer == NULL) || (input->raw == NULL)) + return (-1); + out = input->buffer; + in = input->raw; + + toconv = xmlBufUse(in); + if (toconv == 0) + return (0); + if (toconv > 64 * 1024) + toconv = 64 * 1024; + written = xmlBufAvail(out); + if (written > 0) + written--; /* count '\0' */ + if (toconv * 2 >= written) { + xmlBufGrow(out, toconv * 2); + written = xmlBufAvail(out); + if (written > 0) + written--; /* count '\0' */ + } + if (written > 128 * 1024) + written = 128 * 1024; + + c_in = toconv; + c_out = written; + if (input->encoder->input != NULL) { + ret = input->encoder->input(xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + } +#ifdef LIBXML_ICONV_ENABLED + else if (input->encoder->iconv_in != NULL) { + ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out), + &c_out, xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (input->encoder->uconv_in != NULL) { + ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out), + &c_out, xmlBufContent(in), &c_in); + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + if (ret == -1) + ret = -3; + } +#endif /* LIBXML_ICU_ENABLED */ + switch (ret) { + case 0: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input\n", + c_in, c_out); +#endif + break; + case -1: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input, %d left\n", + c_in, c_out, (int)xmlBufUse(in)); +#endif + break; + case -3: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of input, %d left\n", + c_in, c_out, (int)xmlBufUse(in)); +#endif + break; + case -2: { + char buf[50]; + const xmlChar *content = xmlBufContent(in); + + snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", + content[0], content[1], + content[2], content[3]); + buf[49] = 0; + xmlEncodingErr(XML_I18N_CONV_FAILED, + "input conversion failed due to input error, bytes %s\n", + buf); + } + } + /* + * Ignore when input buffer is not on a boundary + */ + if (ret == -3) + ret = 0; + return (c_out? c_out : ret); +} + +/** * xmlCharEncInFunc: * @handler: char encoding transformation data structure * @out: an xmlBuffer for the output. @@ -2059,7 +2305,7 @@ toconv = in->use; if (toconv == 0) return (0); - written = out->size - out->use; + written = out->size - out->use -1; /* count '\0' */ if (toconv * 2 >= written) { xmlBufferGrow(out, out->size + toconv * 2); written = out->size - out->use - 1; @@ -2136,6 +2382,235 @@ } /** + * xmlCharEncOutput: + * @output: a parser output buffer + * @init: is this an initialization call without data + * + * Generic front-end for the encoding handler on parser output + * a first call with @init == 1 has to be made first to initiate the + * output in case of non-stateless encoding needing to initiate their + * state or the output (like the BOM in UTF16). + * In case of UTF8 sequence conversion errors for the given encoder, + * the content will be automatically remapped to a CharRef sequence. + * + * Returns the number of byte written if success, or + * -1 general error + * -2 if the transcoding fails (for *in is not valid utf8 string or + * the result of transformation can't fit into the encoding we want), or + */ +int +xmlCharEncOutput(xmlOutputBufferPtr output, int init) +{ + int ret = -2; + size_t written; + size_t writtentot = 0; + size_t toconv; + int c_in; + int c_out; + xmlBufPtr in; + xmlBufPtr out; + int charref_len = 0; + + if ((output == NULL) || (output->encoder == NULL) || + (output->buffer == NULL) || (output->conv == NULL)) + return (-1); + out = output->conv; + in = output->buffer; + +retry: + + written = xmlBufAvail(out); + if (written > 0) + written--; /* count '\0' */ + + /* + * First specific handling of the initialization call + */ + if (init) { + c_in = 0; + c_out = written; + if (output->encoder->output != NULL) { + ret = output->encoder->output(xmlBufEnd(out), &c_out, + NULL, &c_in); + if (ret > 0) /* Gennady: check return value */ + xmlBufAddLen(out, c_out); + } +#ifdef LIBXML_ICONV_ENABLED + else if (output->encoder->iconv_out != NULL) { + ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out), + &c_out, NULL, &c_in); + xmlBufAddLen(out, c_out); + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (output->encoder->uconv_out != NULL) { + ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out), + &c_out, NULL, &c_in); + xmlBufAddLen(out, c_out); + } +#endif /* LIBXML_ICU_ENABLED */ +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "initialized encoder\n"); +#endif + return(0); + } + + /* + * Conversion itself. + */ + toconv = xmlBufUse(in); + if (toconv == 0) + return (0); + if (toconv > 64 * 1024) + toconv = 64 * 1024; + if (toconv * 4 >= written) { + xmlBufGrow(out, toconv * 4); + written = xmlBufAvail(out) - 1; + } + if (written > 256 * 1024) + written = 256 * 1024; + + c_in = toconv; + c_out = written; + if (output->encoder->output != NULL) { + ret = output->encoder->output(xmlBufEnd(out), &c_out, + xmlBufContent(in), &c_in); + if (c_out > 0) { + xmlBufShrink(in, c_in); + xmlBufAddLen(out, c_out); + writtentot += c_out; + } + } +#ifdef LIBXML_ICONV_ENABLED + else if (output->encoder->iconv_out != NULL) { + ret = xmlIconvWrapper(output->encoder->iconv_out, 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 + */ + charref_len = 0; + goto retry; + } + ret = -3; + } + } +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + else if (output->encoder->uconv_out != NULL) { + ret = xmlUconvWrapper(output->encoder->uconv_out, 0, 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 uconv + */ + charref_len = 0; + goto retry; + } + ret = -3; + } + } +#endif /* LIBXML_ICU_ENABLED */ + else { + xmlEncodingErr(XML_I18N_NO_OUTPUT, + "xmlCharEncOutFunc: no output function !\n", NULL); + return(-1); + } + + if (ret >= 0) output += ret; + + /* + * Attempt to handle error cases + */ + switch (ret) { + case 0: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "converted %d bytes to %d bytes of output\n", + c_in, c_out); +#endif + break; + case -1: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext, + "output conversion failed by lack of space\n"); +#endif + break; + case -3: +#ifdef DEBUG_ENCODING + xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of output %d left\n", + c_in, c_out, (int) xmlBufUse(in)); +#endif + break; + case -2: { + int len = (int) xmlBufUse(in); + xmlChar *content = xmlBufContent(in); + int cur; + + cur = xmlGetUTF8Char(content, &len); + if ((charref_len != 0) && (c_out < charref_len)) { + /* + * We attempted to insert a character reference and failed. + * Undo what was written and skip the remaining charref. + */ + xmlBufErase(out, c_out); + writtentot -= c_out; + xmlBufShrink(in, charref_len - c_out); + charref_len = 0; + + ret = -1; + break; + } else if (cur > 0) { + xmlChar charref[20]; + +#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]); +#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. + */ + charref_len = snprintf((char *) &charref[0], sizeof(charref), + "&#%d;", cur); + xmlBufShrink(in, len); + xmlBufAddHead(in, charref, -1); + + goto retry; + } else { + char buf[50]; + + snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", + content[0], content[1], + content[2], content[3]); + buf[49] = 0; + xmlEncodingErr(XML_I18N_CONV_FAILED, + "output conversion failed due to conv error, bytes %s\n", + buf); + if (xmlBufGetAllocationScheme(in) != XML_BUFFER_ALLOC_IMMUTABLE) + content[0] = ' '; + } + break; + } + } + return(ret); +} + +/** * xmlCharEncOutFunc: * @handler: char enconding transformation data structure * @out: an xmlBuffer for the output. @@ -2161,6 +2636,7 @@ int writtentot = 0; int toconv; int output = 0; + int charref_len = 0; if (handler == NULL) return(-1); if (out == NULL) return(-1); @@ -2197,7 +2673,7 @@ else if (handler->uconv_out != NULL) { ret = xmlUconvWrapper(handler->uconv_out, 0, &out->content[out->use], - &written, NULL, &toconv); + &written, NULL, &toconv); out->use += written; out->content[out->use] = 0; } @@ -2242,6 +2718,7 @@ /* * Can be a limitation of iconv */ + charref_len = 0; goto retry; } ret = -3; @@ -2262,6 +2739,7 @@ /* * Can be a limitation of iconv */ + charref_len = 0; goto retry; } ret = -3; @@ -2305,7 +2783,19 @@ int cur; cur = xmlGetUTF8Char(utf, &len); - if (cur > 0) { + if ((charref_len != 0) && (written < charref_len)) { + /* + * We attempted to insert a character reference and failed. + * Undo what was written and skip the remaining charref. + */ + out->use -= written; + writtentot -= written; + xmlBufferShrink(in, charref_len - written); + charref_len = 0; + + ret = -1; + break; + } else if (cur > 0) { xmlChar charref[20]; #ifdef DEBUG_ENCODING @@ -2321,7 +2811,8 @@ * and continue the transcoding phase, hoping the error * did not mangle the encoder state. */ - snprintf((char *) &charref[0], sizeof(charref), "&#%d;", cur); + charref_len = snprintf((char *) &charref[0], sizeof(charref), + "&#%d;", cur); xmlBufferShrink(in, len); xmlBufferAddHead(in, charref, -1); @@ -2603,7 +3094,7 @@ c2 = c2 & 0x3F; d = d & 0x0F; d = xlattable [48 + c2 + xlattable [48 + c1 + - xlattable [32 + d] * 64] * 64]; + xlattable [32 + d] * 64] * 64]; if (d == 0) { /* not in character set */ *outlen = out - outstart; Index: lib/3rdparty/libxml2/entities.c =================================================================== --- lib/3rdparty/libxml2/entities.c (revision 58293) +++ lib/3rdparty/libxml2/entities.c (working copy) @@ -22,41 +22,43 @@ #include #include +#include "save.h" + /* * The XML predefined entities. */ static xmlEntity xmlEntityLt = { NULL, XML_ENTITY_DECL, BAD_CAST "lt", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "<", BAD_CAST "<", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityGt = { NULL, XML_ENTITY_DECL, BAD_CAST "gt", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST ">", BAD_CAST ">", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityAmp = { NULL, XML_ENTITY_DECL, BAD_CAST "amp", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "&", BAD_CAST "&", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityQuot = { NULL, XML_ENTITY_DECL, BAD_CAST "quot", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "\"", BAD_CAST "\"", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityApos = { NULL, XML_ENTITY_DECL, BAD_CAST "apos", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "'", BAD_CAST "'", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0, 1 @@ -426,7 +428,7 @@ * * Do an entity lookup in the table. * returns the corresponding parameter entity, if found. - * + * * Returns A pointer to the entity structure or NULL if not found. */ static xmlEntityPtr @@ -441,7 +443,7 @@ * * Do an entity lookup in the internal and external subsets and * returns the corresponding parameter entity, if found. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -472,7 +474,7 @@ * Do an entity lookup in the DTD entity hash table and * returns the corresponding entity, if found. * Note: the first argument is the document node, not the DTD node. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -496,7 +498,7 @@ * Do an entity lookup in the document entity hash table and * returns the corresponding entity, otherwise a lookup is done * in the predefined entities too. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -528,20 +530,20 @@ * Macro used to grow the current buffer. */ #define growBufferReentrant() { \ - buffer_size *= 2; \ - buffer = (xmlChar *) \ - xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ - if (buffer == NULL) { \ - xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed");\ - return(NULL); \ - } \ + xmlChar *tmp; \ + size_t new_size = buffer_size * 2; \ + if (new_size < buffer_size) goto mem_error; \ + tmp = (xmlChar *) xmlRealloc(buffer, new_size); \ + if (tmp == NULL) goto mem_error; \ + buffer = tmp; \ + buffer_size = new_size; \ } - /** - * xmlEncodeEntitiesReentrant: + * xmlEncodeEntitiesInternal: * @doc: the document containing the string * @input: A string to convert to XML. + * @attr: are we handling an atrbute value * * Do a global encoding of a string, replacing the predefined entities * and non ASCII values with their entities and CharRef counterparts. @@ -550,12 +552,12 @@ * * Returns A newly allocated string with the substitution done. */ -xmlChar * -xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) { +static xmlChar * +xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) { const xmlChar *cur = input; xmlChar *buffer = NULL; xmlChar *out = NULL; - int buffer_size = 0; + size_t buffer_size = 0; int html = 0; if (input == NULL) return(NULL); @@ -568,14 +570,14 @@ buffer_size = 1000; buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar)); if (buffer == NULL) { - xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: malloc failed"); + xmlEntitiesErrMemory("xmlEncodeEntities: malloc failed"); return(NULL); } out = buffer; while (*cur != '\0') { - if (out - buffer > buffer_size - 100) { - int indx = out - buffer; + size_t indx = out - buffer; + if (indx + 100 > buffer_size) { growBufferReentrant(); out = &buffer[indx]; @@ -585,6 +587,27 @@ * By default one have to encode at least '<', '>', '"' and '&' ! */ if (*cur == '<') { + const xmlChar *end; + + /* + * Special handling of server side include in HTML attributes + */ + if (html && attr && + (cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') && + ((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) { + while (cur != end) { + *out++ = *cur++; + indx = out - buffer; + if (indx + 100 > buffer_size) { + growBufferReentrant(); + out = &buffer[indx]; + } + } + *out++ = *cur++; + *out++ = *cur++; + *out++ = *cur++; + continue; + } *out++ = '&'; *out++ = 'l'; *out++ = 't'; @@ -595,6 +618,23 @@ *out++ = 't'; *out++ = ';'; } else if (*cur == '&') { + /* + * Special handling of &{...} construct from HTML 4, see + * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1 + */ + if (html && attr && (cur[1] == '{') && + (strchr((const char *) cur, '}'))) { + while (*cur != '}') { + *out++ = *cur++; + indx = out - buffer; + if (indx + 100 > buffer_size) { + growBufferReentrant(); + out = &buffer[indx]; + } + } + *out++ = *cur++; + continue; + } *out++ = '&'; *out++ = 'a'; *out++ = 'm'; @@ -627,7 +667,7 @@ if (*cur < 0xC0) { xmlEntitiesErr(XML_CHECK_NOT_UTF8, - "xmlEncodeEntitiesReentrant : input not UTF-8"); + "xmlEncodeEntities: input not UTF-8"); if (doc != NULL) doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); snprintf(buf, sizeof(buf), "&#%d;", *cur); @@ -660,7 +700,7 @@ } if ((l == 1) || (!IS_CHAR(val))) { xmlEntitiesErr(XML_ERR_INVALID_CHAR, - "xmlEncodeEntitiesReentrant : char out of range\n"); + "xmlEncodeEntities: char out of range\n"); if (doc != NULL) doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); snprintf(buf, sizeof(buf), "&#%d;", *cur); @@ -692,9 +732,47 @@ } *out = 0; return(buffer); + +mem_error: + xmlEntitiesErrMemory("xmlEncodeEntities: realloc failed"); + xmlFree(buffer); + return(NULL); } /** + * xmlEncodeAttributeEntities: + * @doc: the document containing the string + * @input: A string to convert to XML. + * + * Do a global encoding of a string, replacing the predefined entities + * and non ASCII values with their entities and CharRef counterparts for + * attribute values. + * + * Returns A newly allocated string with the substitution done. + */ +xmlChar * +xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input) { + return xmlEncodeEntitiesInternal(doc, input, 1); +} + +/** + * xmlEncodeEntitiesReentrant: + * @doc: the document containing the string + * @input: A string to convert to XML. + * + * Do a global encoding of a string, replacing the predefined entities + * and non ASCII values with their entities and CharRef counterparts. + * Contrary to xmlEncodeEntities, this routine is reentrant, and result + * must be deallocated. + * + * Returns A newly allocated string with the substitution done. + */ +xmlChar * +xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) { + return xmlEncodeEntitiesInternal(doc, input, 0); +} + +/** * xmlEncodeSpecialChars: * @doc: the document containing the string * @input: A string to convert to XML. @@ -709,7 +787,7 @@ const xmlChar *cur = input; xmlChar *buffer = NULL; xmlChar *out = NULL; - int buffer_size = 0; + size_t buffer_size = 0; if (input == NULL) return(NULL); /* @@ -724,8 +802,8 @@ out = buffer; while (*cur != '\0') { - if (out - buffer > buffer_size - 10) { - int indx = out - buffer; + size_t indx = out - buffer; + if (indx + 10 > buffer_size) { growBufferReentrant(); out = &buffer[indx]; @@ -774,6 +852,11 @@ } *out = 0; return(buffer); + +mem_error: + xmlEntitiesErrMemory("xmlEncodeSpecialChars: realloc failed"); + xmlFree(buffer); + return(NULL); } /** @@ -820,7 +903,7 @@ * @ent: An entity * * Build a copy of an entity - * + * * Returns the new xmlEntitiesPtr or NULL in case of error. */ static xmlEntityPtr @@ -856,7 +939,7 @@ * @table: An entity table * * Build a copy of an entity table. - * + * * Returns the new xmlEntitiesTablePtr or NULL in case of error. */ xmlEntitiesTablePtr @@ -1005,7 +1088,7 @@ xmlDumpEntityDeclScan(xmlEntityPtr ent, xmlBufferPtr buf) { xmlDumpEntityDecl(buf, ent); } - + /** * xmlDumpEntitiesTable: * @buf: An XML buffer. Index: lib/3rdparty/libxml2/error.c =================================================================== --- lib/3rdparty/libxml2/error.c (revision 58293) +++ lib/3rdparty/libxml2/error.c (working copy) @@ -33,7 +33,7 @@ \ while (size < 64000) { \ va_start(ap, msg); \ - chars = vsnprintf(str, size, msg, ap); \ + chars = vsnprintf(str, size, msg, ap); \ va_end(ap); \ if ((chars > -1) && (chars < size)) { \ if (prev_size == chars) { \ @@ -54,9 +54,9 @@ } /************************************************************************ - * * - * Handling of out of context errors * - * * + * * + * Handling of out of context errors * + * * ************************************************************************/ /** @@ -64,7 +64,7 @@ * @ctx: an error context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Default handler for out of context error messages. */ void XMLCDECL @@ -82,7 +82,7 @@ /** * initGenericErrorDefaultFunc: * @handler: the handler - * + * * Set or reset (if NULL) the default handler for generic errors * to the builtin error function. */ @@ -137,15 +137,15 @@ } /************************************************************************ - * * - * Handling of parsing errors * - * * + * * + * Handling of parsing errors * + * * ************************************************************************/ /** * xmlParserPrintFileInfo: * @input: an xmlParserInputPtr input - * + * * Displays the associated file and line informations for the current input */ @@ -165,12 +165,12 @@ /** * xmlParserPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , +xmlParserPrintFileContextInternal(xmlParserInputPtr input , xmlGenericErrorFunc channel, void *data ) { const xmlChar *cur, *base; unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ @@ -186,8 +186,8 @@ } n = 0; /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && - (*(cur) != '\n') && (*(cur) != '\r')) + while ((n++ < (sizeof(content)-1)) && (cur > base) && + (*(cur) != '\n') && (*(cur) != '\r')) cur--; if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; /* calculate the error position in terms of the current position */ @@ -196,8 +196,8 @@ n = 0; ctnt = content; /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && - (*(cur) != '\r') && (n < sizeof(content)-1)) { + while ((*cur != 0) && (*(cur) != '\n') && + (*(cur) != '\r') && (n < sizeof(content)-1)) { *ctnt++ = *cur++; n++; } @@ -221,7 +221,7 @@ /** * xmlParserPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ void @@ -292,7 +292,10 @@ } else { if (file != NULL) channel(data, "%s:%d: ", file, line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) + else if ((line != 0) && + ((domain == XML_FROM_PARSER) || (domain == XML_FROM_SCHEMASV)|| + (domain == XML_FROM_SCHEMASP)||(domain == XML_FROM_DTD) || + (domain == XML_FROM_RELAXNGP)||(domain == XML_FROM_RELAXNGV))) channel(data, "Entity: line %d: ", line); } if (name != NULL) { @@ -360,6 +363,15 @@ case XML_FROM_I18N: channel(data, "encoding "); break; + case XML_FROM_SCHEMATRONV: + channel(data, "schematron "); + break; + case XML_FROM_BUFFER: + channel(data, "internal buffer "); + break; + case XML_FROM_URI: + channel(data, "URI "); + break; default: break; } @@ -429,7 +441,7 @@ * @str2: extra string info * @str3: extra string info * @int1: extra int info - * @col: column number of the error or 0 if N/A + * @col: column number of the error or 0 if N/A * @msg: the message to display/transmit * @...: extra parameters for the message display * @@ -452,6 +464,8 @@ xmlErrorPtr to = &xmlLastError; xmlNodePtr baseptr = NULL; + if (code == XML_ERR_OK) + return; if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING)) return; if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || @@ -459,8 +473,11 @@ (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { ctxt = (xmlParserCtxtPtr) ctx; if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) && - (ctxt->sax->initialized == XML_SAX2_MAGIC)) + (ctxt->sax->initialized == XML_SAX2_MAGIC) && + (ctxt->sax->serror != NULL)) { schannel = ctxt->sax->serror; + data = ctxt->userData; + } } /* * Check if structured error handler set @@ -473,16 +490,6 @@ if (schannel != NULL) data = xmlStructuredErrorContext; } - if ((domain == XML_FROM_VALID) && - ((channel == xmlParserValidityError) || - (channel == xmlParserValidityWarning))) { - ctxt = (xmlParserCtxtPtr) ctx; - if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) && - (ctxt->sax->initialized == XML_SAX2_MAGIC)) - schannel = ctxt->sax->serror; - } - if (code == XML_ERR_OK) - return; /* * Formatting the message */ @@ -526,6 +533,8 @@ if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) line = node->line; + if ((line == 0) || (line == 65535)) + line = xmlGetLineNo(node); } /* @@ -589,6 +598,11 @@ if (to != &xmlLastError) xmlCopyError(to,&xmlLastError); + if (schannel != NULL) { + schannel(data, to); + return; + } + /* * Find the callback channel if channel param is NULL */ @@ -600,20 +614,13 @@ channel = ctxt->sax->error; data = ctxt->userData; } else if (channel == NULL) { - if ((schannel == NULL) && (xmlStructuredError != NULL)) { - schannel = xmlStructuredError; - data = xmlStructuredErrorContext; + channel = xmlGenericError; + if (ctxt != NULL) { + data = ctxt; } else { - channel = xmlGenericError; - if (!data) { - data = xmlGenericErrorContext; - } + data = xmlGenericErrorContext; } } - if (schannel != NULL) { - schannel(data, to); - return; - } if (channel == NULL) return; @@ -664,7 +671,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an error messages, gives file, line, position and * extra parameters. */ @@ -707,7 +714,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a warning messages, gives file, line, position and * extra parameters. */ @@ -728,7 +735,7 @@ } xmlParserPrintFileInfo(input); } - + xmlGenericError(xmlGenericErrorContext, "warning: "); XML_GET_VAR_STR(msg, str); xmlGenericError(xmlGenericErrorContext, "%s", str); @@ -746,9 +753,9 @@ } /************************************************************************ - * * - * Handling of validation errors * - * * + * * + * Handling of validation errors * + * * ************************************************************************/ /** @@ -756,7 +763,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an validity error messages, gives file, * line, position and extra parameters. */ @@ -774,7 +781,7 @@ input = ctxt->input; if ((input->filename == NULL) && (ctxt->inputNr > 1)) input = ctxt->inputTab[ctxt->inputNr - 2]; - + if (had_info == 0) { xmlParserPrintFileInfo(input); } @@ -800,7 +807,7 @@ * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a validity warning messages, gives file, line, * position and extra parameters. */ @@ -819,7 +826,7 @@ xmlParserPrintFileInfo(input); } - + xmlGenericError(xmlGenericErrorContext, "validity warning: "); XML_GET_VAR_STR(msg, str); xmlGenericError(xmlGenericErrorContext, "%s", str); Index: lib/3rdparty/libxml2/globals.c =================================================================== --- lib/3rdparty/libxml2/globals.c (revision 58293) +++ lib/3rdparty/libxml2/globals.c (working copy) @@ -65,9 +65,9 @@ } /************************************************************************ - * * + * * * All the user accessible global variables of the library * - * * + * * ************************************************************************/ /* @@ -246,7 +246,7 @@ * xmlLineNumbersDefaultValue: * * Global setting, indicate that the parser should store the line number - * in the content field of elements in the DOM tree. + * in the content field of elements in the DOM tree. * Disabled by default since this may not be safe for old classes of * applicaton. */ @@ -509,7 +509,7 @@ #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED) initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); #endif -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) +#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED) inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); #endif @@ -523,7 +523,7 @@ gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; - gs->xmlDoValidityCheckingDefaultValue = + gs->xmlDoValidityCheckingDefaultValue = xmlDoValidityCheckingDefaultValueThrDef; #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) gs->xmlFree = (xmlFreeFunc) xmlMemFree; @@ -548,7 +548,7 @@ gs->xmlParserVersion = LIBXML_VERSION_STRING; gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; - gs->xmlSubstituteEntitiesDefaultValue = + gs->xmlSubstituteEntitiesDefaultValue = xmlSubstituteEntitiesDefaultValueThrDef; gs->xmlGenericError = xmlGenericErrorThrDef; @@ -600,7 +600,7 @@ xmlRegisterNodeDefault(xmlRegisterNodeFunc func) { xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; - + __xmlRegisterCallbacks = 1; xmlRegisterNodeDefaultValue = func; return(old); @@ -610,10 +610,10 @@ xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) { xmlRegisterNodeFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlRegisterNodeDefaultValueThrDef; - + __xmlRegisterCallbacks = 1; xmlRegisterNodeDefaultValueThrDef = func; xmlMutexUnlock(xmlThrDefMutex); @@ -633,7 +633,7 @@ xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) { xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; - + __xmlRegisterCallbacks = 1; xmlDeregisterNodeDefaultValue = func; return(old); @@ -646,7 +646,7 @@ xmlMutexLock(xmlThrDefMutex); old = xmlDeregisterNodeDefaultValueThrDef; - + __xmlRegisterCallbacks = 1; xmlDeregisterNodeDefaultValueThrDef = func; xmlMutexUnlock(xmlThrDefMutex); @@ -658,7 +658,7 @@ xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func) { xmlParserInputBufferCreateFilenameFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlParserInputBufferCreateFilenameValueThrDef; if (old == NULL) { @@ -675,7 +675,7 @@ xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func) { xmlOutputBufferCreateFilenameFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlOutputBufferCreateFilenameValueThrDef; #ifdef LIBXML_OUTPUT_ENABLED @@ -732,7 +732,7 @@ if (IS_MAIN_THREAD) return (&xmlMalloc); else - return (&xmlGetGlobalState()->xmlMalloc); + return (&xmlGetGlobalState()->xmlMalloc); } #undef xmlMallocAtomic Index: lib/3rdparty/libxml2/hash.c =================================================================== --- lib/3rdparty/libxml2/hash.c (revision 58293) +++ lib/3rdparty/libxml2/hash.c (working copy) @@ -3,7 +3,7 @@ * * Reference: Your favorite introductory book on algorithms * - * Copyright (C) 2000 Bjorn Reese and Daniel Veillard. + * Copyright (C) 2000,2012 Bjorn Reese and Daniel Veillard. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -21,6 +21,22 @@ #include "libxml.h" #include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif + +/* + * Following http://www.ocert.org/advisories/ocert-2011-003.html + * 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) +#define HASH_RANDOMIZATION +#endif + #include #include #include @@ -53,6 +69,9 @@ int size; int nbElems; xmlDictPtr dict; +#ifdef HASH_RANDOMIZATION + int random_seed; +#endif }; /* @@ -64,7 +83,10 @@ const xmlChar *name2, const xmlChar *name3) { unsigned long value = 0L; char ch; - + +#ifdef HASH_RANDOMIZATION + value = table->random_seed; +#endif if (name != NULL) { value += 30 * (*name); while ((ch = *name++) != 0) { @@ -91,7 +113,10 @@ const xmlChar *prefix3, const xmlChar *name3) { unsigned long value = 0L; char ch; - + +#ifdef HASH_RANDOMIZATION + value = table->random_seed; +#endif if (prefix != NULL) value += 30 * (*prefix); else @@ -144,10 +169,10 @@ xmlHashTablePtr xmlHashCreate(int size) { xmlHashTablePtr table; - + if (size <= 0) size = 256; - + table = xmlMalloc(sizeof(xmlHashTable)); if (table) { table->dict = NULL; @@ -155,8 +180,11 @@ table->nbElems = 0; table->table = xmlMalloc(size * sizeof(xmlHashEntry)); if (table->table) { - memset(table->table, 0, size * sizeof(xmlHashEntry)); - return(table); + memset(table->table, 0, size * sizeof(xmlHashEntry)); +#ifdef HASH_RANDOMIZATION + table->random_seed = __xmlRandom(); +#endif + return(table); } xmlFree(table); } @@ -202,7 +230,7 @@ #ifdef DEBUG_GROW unsigned long nbElem = 0; #endif - + if (table == NULL) return(-1); if (size < 8) @@ -214,7 +242,7 @@ oldtable = table->table; if (oldtable == NULL) return(-1); - + table->table = xmlMalloc(size * sizeof(xmlHashEntry)); if (table->table == NULL) { table->table = oldtable; @@ -224,13 +252,13 @@ table->size = size; /* If the two loops are merged, there would be situations where - a new entry needs to allocated and data copied into it from + a new entry needs to allocated and data copied into it from the main table. So instead, we run through the array twice, first copying all the elements in the main array (where we can't get conflicts) and then the rest, so we only free (and don't allocate) */ for (i = 0; i < oldsize; i++) { - if (oldtable[i].valid == 0) + if (oldtable[i].valid == 0) continue; key = xmlHashComputeKey(table, oldtable[i].name, oldtable[i].name2, oldtable[i].name3); @@ -254,8 +282,8 @@ table->table[key].next = NULL; xmlFree(iter); } else { - iter->next = table->table[key].next; - table->table[key].next = iter; + iter->next = table->table[key].next; + table->table[key].next = iter; } #ifdef DEBUG_GROW @@ -571,7 +599,7 @@ entry->valid = 1; - if (insert != NULL) + if (insert != NULL) insert->next = entry; table->nbElems++; @@ -720,7 +748,7 @@ * Returns the a pointer to the userdata */ void * -xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, +xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3) { unsigned long key; xmlHashEntryPtr entry; @@ -793,14 +821,14 @@ void *data; } stubData; -static void -stubHashScannerFull (void *payload, void *data, const xmlChar *name, +static void +stubHashScannerFull (void *payload, void *data, const xmlChar *name, const xmlChar *name2 ATTRIBUTE_UNUSED, const xmlChar *name3 ATTRIBUTE_UNUSED) { stubData *stubdata = (stubData *) data; stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name); -} - +} + /** * xmlHashScan: * @table: the hash table @@ -813,7 +841,7 @@ xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) { stubData stubdata; stubdata.data = data; - stubdata.hashscanner = f; + stubdata.hashscanner = f; xmlHashScanFull (table, stubHashScannerFull, &stubdata); } @@ -838,7 +866,7 @@ if (table->table) { for(i = 0; i < table->size; i++) { - if (table->table[i].valid == 0) + if (table->table[i].valid == 0) continue; iter = &(table->table[i]); while (iter) { @@ -877,7 +905,7 @@ * the comparison is considered to match. */ void -xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, +xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data) { xmlHashScanFull3 (table, name, name2, name3, @@ -898,7 +926,7 @@ * the comparison is considered to match. */ void -xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, +xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data) { int i; Index: lib/3rdparty/libxml2/HTMLparser.c =================================================================== --- lib/3rdparty/libxml2/HTMLparser.c (revision 58293) +++ lib/3rdparty/libxml2/HTMLparser.c (working copy) @@ -44,6 +44,9 @@ #include #include +#include "buf.h" +#include "enc.h" + #define HTML_MAX_NAMELEN 1000 #define HTML_PARSER_BIG_BUFFER_SIZE 1000 #define HTML_PARSER_BUFFER_SIZE 100 @@ -727,7 +730,7 @@ static const char* const name_attr[] = { "name", NULL } ; static const char* const action_attr[] = { "action", NULL } ; static const char* const blockli_elt[] = { BLOCK, "li", NULL } ; -static const char* const meta_attrs[] = { I18N, "http-equiv", "name", "scheme", NULL } ; +static const char* const meta_attrs[] = { I18N, "http-equiv", "name", "scheme", "charset", NULL } ; static const char* const content_attr[] = { "content", NULL } ; static const char* const type_attr[] = { "type", NULL } ; static const char* const noframes_content[] = { "body", FLOW MODIFIER, NULL } ; @@ -1080,9 +1083,9 @@ "menu", "p", "head", "ul", NULL, "p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL, "div", "p", "head", NULL, -"noscript", "p", "head", NULL, +"noscript", "p", NULL, "center", "font", "b", "i", "p", "head", NULL, -"a", "a", NULL, +"a", "a", "head", NULL, "caption", "p", NULL, "colgroup", "caption", "colgroup", "col", "p", NULL, "col", "caption", "col", "p", NULL, @@ -1100,6 +1103,43 @@ "option", "option", NULL, "fieldset", "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "listing", "xmp", "a", NULL, +/* most tags in in FONTSTYLE, PHRASE and SPECIAL should close */ +"tt", "head", NULL, +"i", "head", NULL, +"b", "head", NULL, +"u", "head", NULL, +"s", "head", NULL, +"strike", "head", NULL, +"big", "head", NULL, +"small", "head", NULL, + +"em", "head", NULL, +"strong", "head", NULL, +"dfn", "head", NULL, +"code", "head", NULL, +"samp", "head", NULL, +"kbd", "head", NULL, +"var", "head", NULL, +"cite", "head", NULL, +"abbr", "head", NULL, +"acronym", "head", NULL, + +/* "a" */ +"img", "head", NULL, +/* "applet" */ +/* "embed" */ +/* "object" */ +"font", "head", NULL, +/* "basefont" */ +"br", "head", NULL, +/* "script" */ +"map", "head", NULL, +"q", "head", NULL, +"sub", "head", NULL, +"sup", "head", NULL, +"span", "head", NULL, +"bdo", "head", NULL, +"iframe", "head", NULL, NULL }; @@ -2941,9 +2981,14 @@ */ if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if (areBlanks(ctxt, buf, nbchar)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - buf, nbchar); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, nbchar); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace(ctxt->userData, + buf, nbchar); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -2974,8 +3019,14 @@ */ if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if (areBlanks(ctxt, buf, nbchar)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, buf, nbchar); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, nbchar); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace(ctxt->userData, + buf, nbchar); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -3435,35 +3486,27 @@ } /** - * htmlCheckEncoding: + * htmlCheckEncodingDirect: * @ctxt: an HTML parser context * @attvalue: the attribute value * - * Checks an http-equiv attribute from a Meta tag to detect + * Checks an attribute value to detect * the encoding * If a new encoding is detected the parser is switched to decode * it and pass UTF8 */ static void -htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { - const xmlChar *encoding; +htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) { - if ((ctxt == NULL) || (attvalue == NULL)) + if ((ctxt == NULL) || (encoding == NULL) || + (ctxt->options & HTML_PARSE_IGNORE_ENC)) return; /* do not change encoding */ if (ctxt->input->encoding != NULL) return; - encoding = xmlStrcasestr(attvalue, BAD_CAST"charset="); if (encoding != NULL) { - encoding += 8; - } else { - encoding = xmlStrcasestr(attvalue, BAD_CAST"charset ="); - if (encoding != NULL) - encoding += 9; - } - if (encoding != NULL) { xmlCharEncoding enc; xmlCharEncodingHandlerPtr handler; @@ -3500,7 +3543,9 @@ xmlSwitchToEncoding(ctxt, handler); ctxt->charset = XML_CHAR_ENCODING_UTF8; } else { - ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; + htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING, + "htmlCheckEncoding: unknown encoding %s\n", + encoding, NULL); } } @@ -3515,24 +3560,51 @@ * convert as much as possible to the parser reading buffer. */ processed = ctxt->input->cur - ctxt->input->base; - xmlBufferShrink(ctxt->input->buf->buffer, processed); - nbchars = xmlCharEncInFunc(ctxt->input->buf->encoder, - ctxt->input->buf->buffer, - ctxt->input->buf->raw); + xmlBufShrink(ctxt->input->buf->buffer, processed); + nbchars = xmlCharEncInput(ctxt->input->buf); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "htmlCheckEncoding: encoder error\n", NULL, NULL); } - ctxt->input->base = - ctxt->input->cur = ctxt->input->buf->buffer->content; - ctxt->input->end = - &ctxt->input->base[ctxt->input->buf->buffer->use]; + xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input); } } } /** + * htmlCheckEncoding: + * @ctxt: an HTML parser context + * @attvalue: the attribute value + * + * Checks an http-equiv attribute from a Meta tag to detect + * the encoding + * If a new encoding is detected the parser is switched to decode + * it and pass UTF8 + */ +static void +htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { + const xmlChar *encoding; + + if (!attvalue) + return; + + encoding = xmlStrcasestr(attvalue, BAD_CAST"charset"); + if (encoding != NULL) { + encoding += 7; + } + /* + * skip blank + */ + if (encoding && IS_BLANK_CH(*encoding)) + encoding = xmlStrcasestr(attvalue, BAD_CAST"="); + if (encoding && *encoding == '=') { + encoding ++; + htmlCheckEncodingDirect(ctxt, encoding); + } +} + +/** * htmlCheckMeta: * @ctxt: an HTML parser context * @atts: the attributes values @@ -3556,6 +3628,8 @@ if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"http-equiv")) && (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) http = 1; + else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"charset"))) + htmlCheckEncodingDirect(ctxt, value); else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"content"))) content = value; att = atts[i++]; @@ -3885,6 +3959,7 @@ if ((oldname != NULL) && (xmlStrEqual(oldname, name))) { if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) ctxt->sax->endElement(ctxt->userData, name); + htmlNodeInfoPop(ctxt); htmlnamePop(ctxt); ret = 1; } else { @@ -4877,9 +4952,7 @@ input->filename = NULL; input->buf = buf; - input->base = input->buf->buffer->content; - input->cur = input->buf->buffer->content; - input->end = &input->buf->buffer->content[input->buf->buffer->use]; + xmlBufResetInput(buf->buffer, input); inputPush(ctxt, input); return(ctxt); @@ -4996,8 +5069,8 @@ buf = in->base; len = in->length; } else { - buf = in->buf->buffer->content; - len = in->buf->buffer->use; + buf = xmlBufContent(in->buf->buffer); + len = xmlBufUse(in->buf->buffer); } /* take into account the sequence length */ @@ -5089,13 +5162,13 @@ * @stop: Array of chars, which stop the lookup. * @stopLen: Length of stop-Array * - * Try to find if any char of the stop-Array is available in the input + * Try to find if any char of the stop-Array is available in the input * stream. * This function has a side effect of (possibly) incrementing ctxt->checkIndex * to avoid rescanning sequences of bytes, it DOES change the state of the * parser, do not use liberally. * - * Returns the index to the current parsing point if a stopChar + * Returns the index to the current parsing point if a stopChar * is available, -1 otherwise. */ static int @@ -5123,8 +5196,8 @@ buf = in->base; len = in->length; } else { - buf = in->buf->buffer->content; - len = in->buf->buffer->use; + buf = xmlBufContent(in->buf->buffer); + len = xmlBufUse(in->buf->buffer); } for (; base < len; base++) { @@ -5173,6 +5246,8 @@ int avail = 0; xmlChar cur, next; + htmlParserNodeInfo node_info; + #ifdef DEBUG_PUSH switch (ctxt->instate) { case XML_PARSER_EOF: @@ -5233,7 +5308,7 @@ if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if ((avail == 0) && (terminate)) { htmlAutoCloseOnEnd(ctxt); if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { @@ -5269,7 +5344,7 @@ if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); } if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, @@ -5311,11 +5386,24 @@ if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); - if (avail < 2) + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); + /* + * no chars in buffer + */ + if (avail < 1) goto done; + /* + * not enouth chars in buffer + */ + if (avail < 2) { + if (!terminate) + goto done; + else + next = ' '; + } else { + next = in->cur[1]; + } cur = in->cur[0]; - next = in->cur[1]; if ((cur == '<') && (next == '!') && (in->cur[2] == '-') && (in->cur[3] == '-')) { if ((!terminate) && @@ -5371,7 +5459,7 @@ if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if (avail < 2) goto done; cur = in->cur[0]; @@ -5412,7 +5500,7 @@ if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if (avail < 1) goto done; cur = in->cur[0]; @@ -5465,8 +5553,22 @@ int failed; const htmlElemDesc * info; - if (avail < 2) + /* + * no chars in buffer + */ + if (avail < 1) goto done; + /* + * not enouth chars in buffer + */ + if (avail < 2) { + if (!terminate) + goto done; + else + next = ' '; + } else { + next = in->cur[1]; + } cur = in->cur[0]; if (cur != '<') { ctxt->instate = XML_PARSER_CONTENT; @@ -5476,7 +5578,7 @@ #endif break; } - if (in->cur[1] == '/') { + if (next == '/') { ctxt->instate = XML_PARSER_END_TAG; ctxt->checkIndex = 0; #ifdef DEBUG_PUSH @@ -5489,6 +5591,14 @@ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0)) goto done; + /* Capture start position */ + if (ctxt->record_info) { + node_info.begin_pos = ctxt->input->consumed + + (CUR_PTR - ctxt->input->base); + node_info.begin_line = ctxt->input->line; + } + + failed = htmlParseStartTag(ctxt); name = ctxt->name; if ((failed == -1) || @@ -5538,6 +5648,9 @@ htmlnamePop(ctxt); } + if (ctxt->record_info) + htmlNodeInfoPush(ctxt, &node_info); + ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, @@ -5554,6 +5667,10 @@ ctxt->sax->endElement(ctxt->userData, name); htmlnamePop(ctxt); } + + if (ctxt->record_info) + htmlNodeInfoPush(ctxt, &node_info); + ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, @@ -5581,9 +5698,15 @@ if ((cur != '<') && (cur != '&')) { if (ctxt->sax != NULL) { if (IS_BLANK_CH(cur)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace( - ctxt->userData, &cur, 1); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters( + ctxt->userData, &cur, 1); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace( + ctxt->userData, &cur, 1); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -5906,8 +6029,8 @@ } if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && (ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) { - int base = ctxt->input->base - ctxt->input->buf->buffer->content; - int cur = ctxt->input->cur - ctxt->input->base; + size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input); + size_t cur = ctxt->input->cur - ctxt->input->base; int res; res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk); @@ -5916,10 +6039,7 @@ ctxt->disableSAX = 1; return (XML_PARSER_EOF); } - ctxt->input->base = ctxt->input->buf->buffer->content + base; - ctxt->input->cur = ctxt->input->base + cur; - ctxt->input->end = - &ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use]; + xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif @@ -5935,7 +6055,7 @@ (in->raw != NULL)) { int nbchars; - nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); + nbchars = xmlCharEncInput(in); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "encoder error\n", NULL, NULL); @@ -6034,24 +6154,18 @@ inputStream->filename = (char *) xmlCanonicPath((const xmlChar *) filename); inputStream->buf = buf; - inputStream->base = inputStream->buf->buffer->content; - inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = - &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; + xmlBufResetInput(buf->buffer, inputStream); inputPush(ctxt, inputStream); if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && (ctxt->input->buf != NULL)) { - int base = ctxt->input->base - ctxt->input->buf->buffer->content; - int cur = ctxt->input->cur - ctxt->input->base; + size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input); + size_t cur = ctxt->input->cur - ctxt->input->base; xmlParserInputBufferPush(ctxt->input->buf, size, chunk); - ctxt->input->base = ctxt->input->buf->buffer->content + base; - ctxt->input->cur = ctxt->input->base + cur; - ctxt->input->end = - &ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use]; + xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif @@ -6537,6 +6651,14 @@ ctxt->options |= HTML_PARSE_NODEFDTD; options -= HTML_PARSE_NODEFDTD; } + if (options & HTML_PARSE_IGNORE_ENC) { + ctxt->options |= HTML_PARSE_IGNORE_ENC; + options -= HTML_PARSE_IGNORE_ENC; + } + if (options & HTML_PARSE_NOIMPLIED) { + ctxt->options |= HTML_PARSE_NOIMPLIED; + options -= HTML_PARSE_NOIMPLIED; + } ctxt->dictNames = 0; return (options); } @@ -6730,8 +6852,11 @@ input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (NULL); + } ctxt = htmlNewParserCtxt(); if (ctxt == NULL) { xmlFreeParserInputBuffer(input); @@ -6930,8 +7055,11 @@ input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (NULL); + } stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE); if (stream == NULL) { xmlFreeParserInputBuffer(input); Index: lib/3rdparty/libxml2/HTMLtree.c =================================================================== --- lib/3rdparty/libxml2/HTMLtree.c (revision 58293) +++ lib/3rdparty/libxml2/HTMLtree.c (working copy) @@ -30,16 +30,18 @@ #include #include +#include "buf.h" + /************************************************************************ * * - * Getting/Setting encoding meta tags * + * Getting/Setting encoding meta tags * * * ************************************************************************/ /** * htmlGetMetaEncoding: * @doc: the document - * + * * Encoding definition lookup in the Meta tags * * Returns the current encoding as flagged in the HTML source @@ -126,17 +128,17 @@ found_content: encoding = xmlStrstr(content, BAD_CAST"charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET="); if (encoding != NULL) { encoding += 8; } else { encoding = xmlStrstr(content, BAD_CAST"charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET ="); if (encoding != NULL) encoding += 9; @@ -151,7 +153,7 @@ * htmlSetMetaEncoding: * @doc: the document * @encoding: the encoding string - * + * * Sets the current encoding in the Meta tags * NOTE: this will not change the document content encoding, just * the META flag associated. @@ -164,6 +166,7 @@ const xmlChar *content = NULL; char newcontent[100]; + newcontent[0] = 0; if (doc == NULL) return(-1); @@ -244,7 +247,7 @@ http = 1; else { - if ((value != NULL) && + if ((value != NULL) && (!xmlStrcasecmp(attr->name, BAD_CAST"content"))) content = value; } @@ -278,8 +281,13 @@ xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent); } } else { + /* remove the meta tag if NULL is passed */ + if (encoding == NULL) { + xmlUnlinkNode(meta); + xmlFreeNode(meta); + } /* change the document only if there is a real encoding change */ - if (xmlStrcasestr(content, encoding) == NULL) { + else if (xmlStrcasestr(content, encoding) == NULL) { xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent); } } @@ -308,7 +316,7 @@ * @name: the name of the attribute to check * * Determine if a given attribute is a boolean attribute. - * + * * returns: false if the attribute is not boolean, true otherwise. */ int @@ -332,7 +340,7 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder); /************************************************************************ * * - * Output error handlers * + * Output error handlers * * * ************************************************************************/ /** @@ -381,17 +389,13 @@ /************************************************************************ * * - * Dumping HTML tree content to a simple buffer * + * Dumping HTML tree content to a simple buffer * * * ************************************************************************/ -static int -htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, - int format); - /** - * htmlNodeDumpFormat: - * @buf: the HTML buffer output + * htmlBufNodeDumpFormat: + * @buf: the xmlBufPtr output * @doc: the document * @cur: the current node * @format: should formatting spaces been added @@ -400,10 +404,10 @@ * * Returns the number of byte written or -1 in case of error */ -static int -htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, +static size_t +htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int format) { - unsigned int use; + size_t use; int ret; xmlOutputBufferPtr outbuf; @@ -426,10 +430,10 @@ outbuf->context = NULL; outbuf->written = 0; - use = buf->use; + use = xmlBufUse(buf); htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format); xmlFree(outbuf); - ret = buf->use - use; + ret = xmlBufUse(buf) - use; return (ret); } @@ -446,9 +450,24 @@ */ int htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { + xmlBufPtr buffer; + size_t ret; + + if ((buf == NULL) || (cur == NULL)) + return(-1); + xmlInitParser(); + buffer = xmlBufFromBuffer(buf); + if (buffer == NULL) + return(-1); - return(htmlNodeDumpFormat(buf, doc, cur, 1)); + ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1); + + xmlBufBackToBuffer(buffer); + + if (ret > INT_MAX) + return(-1); + return((int) ret); } /** @@ -481,7 +500,7 @@ if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } } @@ -493,7 +512,7 @@ if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFile(out, handler); @@ -562,11 +581,9 @@ } handler = xmlFindCharEncodingHandler(encoding); - if (handler == NULL) { - *mem = NULL; - *size = 0; - return; - } + if (handler == NULL) + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); + } else { handler = xmlFindCharEncodingHandler(encoding); } @@ -587,15 +604,15 @@ return; } - htmlDocContentDumpFormatOutput(buf, cur, NULL, format); + htmlDocContentDumpFormatOutput(buf, cur, NULL, format); xmlOutputBufferFlush(buf); if (buf->conv != NULL) { - *size = buf->conv->use; - *mem = xmlStrndup(buf->conv->content, *size); + *size = xmlBufUse(buf->conv); + *mem = xmlStrndup(xmlBufContent(buf->conv), *size); } else { - *size = buf->buffer->use; - *mem = xmlStrndup(buf->buffer->content, *size); + *size = xmlBufUse(buf->buffer); + *mem = xmlStrndup(xmlBufContent(buf->buffer), *size); } (void)xmlOutputBufferClose(buf); } @@ -617,7 +634,7 @@ /************************************************************************ * * - * Dumping HTML tree content to an I/O output buffer * + * Dumping HTML tree content to an I/O output buffer * * * ************************************************************************/ @@ -628,7 +645,7 @@ * @buf: the HTML buffer output * @doc: the document * @encoding: the encoding string - * + * * TODO: check whether encoding is needed * * Dump the HTML document DTD, if any. @@ -646,14 +663,14 @@ xmlOutputBufferWriteString(buf, (const char *)cur->name); if (cur->ExternalID != NULL) { xmlOutputBufferWriteString(buf, " PUBLIC "); - xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID); + xmlBufWriteQuotedString(buf->buffer, cur->ExternalID); if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " "); - xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); - } + xmlBufWriteQuotedString(buf->buffer, cur->SystemID); + } } else if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " SYSTEM "); - xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); + xmlBufWriteQuotedString(buf->buffer, cur->SystemID); } xmlOutputBufferWriteString(buf, ">\n"); } @@ -673,9 +690,10 @@ xmlChar *value; /* - * TODO: The html output method should not escape a & character - * occurring in an attribute value immediately followed by - * a { character (see Section B.7.1 of the HTML 4.0 Recommendation). + * The html output method should not escape a & character + * occurring in an attribute value immediately followed by + * a { character (see Section B.7.1 of the HTML 4.0 Recommendation). + * This is implemented in xmlEncodeEntitiesReentrant */ if (cur == NULL) { @@ -703,15 +721,19 @@ while (IS_BLANK_CH(*tmp)) tmp++; - escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+"); + /* + * the < and > have already been escaped at the entity level + * And doing so here breaks server side includes + */ + escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>"); if (escaped != NULL) { - xmlBufferWriteQuotedString(buf->buffer, escaped); + xmlBufWriteQuotedString(buf->buffer, escaped); xmlFree(escaped); } else { - xmlBufferWriteQuotedString(buf->buffer, value); + xmlBufWriteQuotedString(buf->buffer, value); } } else { - xmlBufferWriteQuotedString(buf->buffer, value); + xmlBufWriteQuotedString(buf->buffer, value); } xmlFree(value); } else { @@ -1061,7 +1083,7 @@ handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } else { handler = xmlFindCharEncodingHandler(encoding); } @@ -1101,7 +1123,7 @@ if ((cur == NULL) || (filename == NULL)) return(-1); - + xmlInitParser(); encoding = (const char *) htmlGetMetaEncoding(cur); @@ -1120,7 +1142,7 @@ handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } } @@ -1132,7 +1154,7 @@ if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); @@ -1152,7 +1174,7 @@ * @encoding: the document encoding * * Dump an HTML document to a file using a given encoding. - * + * * returns: the number of byte written or -1 in case of failure. */ int @@ -1181,7 +1203,7 @@ handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } htmlSetMetaEncoding(cur, (const xmlChar *) encoding); } else { @@ -1196,7 +1218,7 @@ if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, 0); @@ -1216,7 +1238,7 @@ * * Dump an HTML document to a file using a given encoding * and formatting returns/spaces are added. - * + * * returns: the number of byte written or -1 in case of failure. */ int Index: lib/3rdparty/libxml2/include/Makefile.in =================================================================== --- lib/3rdparty/libxml2/include/Makefile.in (revision 58293) +++ lib/3rdparty/libxml2/include/Makefile.in (working copy) @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -46,6 +46,12 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -91,8 +97,8 @@ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -129,6 +135,7 @@ HTML_OBJ = @HTML_OBJ@ HTTP_OBJ = @HTTP_OBJ@ ICONV_LIBS = @ICONV_LIBS@ +ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -149,7 +156,10 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULE_EXTENSION = @MODULE_EXTENSION@ MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ @@ -206,10 +216,8 @@ TEST_XINCLUDE = @TEST_XINCLUDE@ TEST_XPATH = @TEST_XPATH@ TEST_XPTR = @TEST_XPTR@ -THREADS_W32 = @THREADS_W32@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ -U = @U@ VERSION = @VERSION@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ WGET = @WGET@ @@ -227,6 +235,7 @@ WITH_ICU = @WITH_ICU@ WITH_ISO8859X = @WITH_ISO8859X@ WITH_LEGACY = @WITH_LEGACY@ +WITH_LZMA = @WITH_LZMA@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ WITH_MODULES = @WITH_MODULES@ WITH_OUTPUT = @WITH_OUTPUT@ @@ -263,6 +272,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -561,10 +571,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: Index: lib/3rdparty/libxml2/include/wsockcompat.h =================================================================== --- lib/3rdparty/libxml2/include/wsockcompat.h (revision 58293) +++ lib/3rdparty/libxml2/include/wsockcompat.h (working copy) @@ -27,7 +27,7 @@ #endif #endif -#ifdef __MINGW32__ +#if defined( __MINGW32__ ) || defined( _MSC_VER ) /* Include here to ensure that it doesn't get included later * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ #include @@ -39,6 +39,9 @@ #endif #define EWOULDBLOCK WSAEWOULDBLOCK +#define ESHUTDOWN WSAESHUTDOWN + +#if (!defined(_MSC_VER) || (_MSC_VER < 1600)) #define EINPROGRESS WSAEINPROGRESS #define EALREADY WSAEALREADY #define ENOTSOCK WSAENOTSOCK @@ -61,7 +64,6 @@ #define ENOBUFS WSAENOBUFS #define EISCONN WSAEISCONN #define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS #define ETIMEDOUT WSAETIMEDOUT #define ECONNREFUSED WSAECONNREFUSED @@ -79,5 +81,6 @@ #define ENAMETOOLONG WSAENAMETOOLONG #define ENOTEMPTY WSAENOTEMPTY */ +#endif /* _MSC_VER */ #endif /* __XML_WSOCKCOMPAT_H__ */ Index: lib/3rdparty/libxml2/INSTALL =================================================================== --- lib/3rdparty/libxml2/INSTALL (revision 58293) +++ lib/3rdparty/libxml2/INSTALL (working copy) @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -226,6 +226,11 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended Index: lib/3rdparty/libxml2/install-sh =================================================================== --- lib/3rdparty/libxml2/install-sh (revision 58293) +++ lib/3rdparty/libxml2/install-sh (working copy) @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then Index: lib/3rdparty/libxml2/legacy.c =================================================================== --- lib/3rdparty/libxml2/legacy.c (revision 58293) +++ lib/3rdparty/libxml2/legacy.c (working copy) @@ -393,7 +393,7 @@ * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * This function is deprecated, we now always process entities content * through xmlStringDecodeEntities * @@ -456,7 +456,7 @@ /** * xmlNamespaceParseQName: * @ctxt: an XML parser context - * @prefix: a xmlChar ** + * @prefix: a xmlChar ** * * TODO: this seems not in use anymore, the namespace handling is done on * top of the SAX interfaces, i.e. not on raw input. @@ -603,7 +603,7 @@ /** * xmlParserHandleReference: * @ctxt: the parser context - * + * * TODO: Remove, now deprecated ... the test is done directly in the * content parsing * routines. @@ -615,7 +615,7 @@ * [ WFC: Entity Declared ] * the Name given in the entity reference must match that in an entity * declaration, except that well-formed documents need not declare any - * of the following entities: amp, lt, gt, apos, quot. + * of the following entities: amp, lt, gt, apos, quot. * * [ WFC: Parsed Entity ] * An entity reference must not contain the name of an unparsed entity @@ -624,7 +624,7 @@ * '&#x' [0-9a-fA-F]+ ';' * * A PEReference may have been detected in the current input stream - * the handling is done accordingly to + * the handling is done accordingly to * http://www.w3.org/TR/REC-xml#entproc */ void @@ -693,7 +693,7 @@ /** * xmlUpgradeOldNs: * @doc: a document pointer - * + * * Upgrade old style Namespaces (PI) and move them to the root of the document. * DEPRECATED */ @@ -719,7 +719,7 @@ * * People must migrate their code to xmlEncodeEntitiesReentrant ! * This routine will issue a warning when encountered. - * + * * Returns NULL */ const xmlChar * @@ -740,7 +740,7 @@ /************************************************************************ * * - * Old set of SAXv1 functions * + * Old set of SAXv1 functions * * * ************************************************************************/ static int deprecated_v1_msg = 0; @@ -961,8 +961,8 @@ /** * entityDecl: * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -983,8 +983,8 @@ * attributeDecl: * @ctx: the user data (XML parser context) * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type + * @fullname: the attribute name + * @type: the attribute type * @def: the type of default value * @defaultValue: the attribute default value * @tree: the tree of enumerated value set @@ -1005,8 +1005,8 @@ /** * elementDecl: * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value tree * * An element definition has been parsed @@ -1159,7 +1159,7 @@ * @ctx: the user data (XML parser context) * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. * DEPRECATED: use xmlSAX2Reference() */ void Index: lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in =================================================================== --- lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in (revision 58293) +++ lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in (working copy) @@ -8,5 +8,5 @@ Version: @VERSION@ Description: libXML library version2. Requires: -Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ +Libs: -L${libdir} -lxml2 @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@ Index: lib/3rdparty/libxml2/libxml-2.0.pc.in =================================================================== --- lib/3rdparty/libxml2/libxml-2.0.pc.in (revision 58293) +++ lib/3rdparty/libxml2/libxml-2.0.pc.in (working copy) @@ -9,5 +9,5 @@ Description: libXML library version2. Requires: Libs: -L${libdir} -lxml2 -Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ +Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ Index: lib/3rdparty/libxml2/libxml.3 =================================================================== --- lib/3rdparty/libxml2/libxml.3 (revision 58293) +++ lib/3rdparty/libxml2/libxml.3 (working copy) @@ -5,7 +5,7 @@ The .I libxml library is used to parse XML files. -Its internal document repesentation is as close as possible to the +Its internal document representation is as close as possible to the .I DOM (Document Object Model) interface, an API for accessing XML or HTML structured documents. Index: lib/3rdparty/libxml2/libxml.h =================================================================== --- lib/3rdparty/libxml2/libxml.h (revision 58293) +++ lib/3rdparty/libxml2/libxml.h (working copy) @@ -29,6 +29,11 @@ #include #include #else +/* + * Currently supported platforms use either autoconf or + * copy to config.h own "preset" configuration file. + * As result ifdef HAVE_CONFIG_H is omited here. + */ #include "config.h" #include #endif @@ -79,6 +84,13 @@ void __xmlGlobalInitMutexUnlock(void); void __xmlGlobalInitMutexDestroy(void); +#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) +/* + * internal thread safe random function + */ +int __xmlRandom(void); +#endif + #ifdef IN_LIBXML #ifdef __GNUC__ #ifdef PIC @@ -90,4 +102,7 @@ #endif #endif #endif +#if !defined(PIC) && !defined(NOLIBTOOL) +# define LIBXML_STATIC +#endif #endif /* ! __XML_LIBXML_H__ */ Index: lib/3rdparty/libxml2/libxml.spec.in =================================================================== --- lib/3rdparty/libxml2/libxml.spec.in (revision 58293) +++ lib/3rdparty/libxml2/libxml.spec.in (working copy) @@ -6,7 +6,7 @@ Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: python python-devel zlib-devel pkgconfig +BuildRequires: python python-devel zlib-devel pkgconfig xz-devel URL: http://xmlsoft.org/ %description @@ -25,6 +25,7 @@ Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Requires: zlib-devel +Requires: xz-devel Requires: pkgconfig %description devel Index: lib/3rdparty/libxml2/libxml2.spec =================================================================== --- lib/3rdparty/libxml2/libxml2.spec (revision 58293) +++ lib/3rdparty/libxml2/libxml2.spec (working copy) @@ -1,12 +1,12 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.7.8 +Version: 2.9.0 Release: 1 License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: python python-devel zlib-devel pkgconfig +BuildRequires: python python-devel zlib-devel pkgconfig xz-devel URL: http://xmlsoft.org/ %description @@ -25,6 +25,7 @@ Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Requires: zlib-devel +Requires: xz-devel Requires: pkgconfig %description devel @@ -127,6 +128,6 @@ %doc doc/python.html %changelog -* Thu Nov 4 2010 Daniel Veillard -- upstream release 2.7.8 see http://xmlsoft.org/news.html +* Tue Sep 11 2012 Daniel Veillard +- upstream release 2.9.0 see http://xmlsoft.org/news.html Index: lib/3rdparty/libxml2/libxml2.syms =================================================================== --- lib/3rdparty/libxml2/libxml2.syms (revision 0) +++ lib/3rdparty/libxml2/libxml2.syms (working copy) @@ -0,0 +1,2273 @@ +# +# 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; # variable + forbiddenExp; # variable + xmlExpCtxtNbCons; + xmlExpCtxtNbNodes; + xmlExpDump; + xmlExpExpDerive; + xmlExpFreeCtxt; + xmlExpFree; + xmlExpGetLanguage; + xmlExpGetStart; + xmlExpIsNillable; + xmlExpMaxToken; + xmlExpNewAtom; + xmlExpNewCtxt; + xmlExpNewOr; + xmlExpNewRange; + xmlExpNewSeq; + xmlExpParse; + xmlExpRef; + xmlExpStringDerive; + xmlExpSubsume; + +# 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; + Index: lib/3rdparty/libxml2/list.c =================================================================== --- lib/3rdparty/libxml2/list.c (revision 58293) +++ lib/3rdparty/libxml2/list.c (working copy) @@ -94,15 +94,15 @@ * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLowerSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLowerSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(NULL); for(lk = l->sentinel->next;lk != l->sentinel && l->linkCompare(lk->data, data) <0 ;lk = lk->next); - return lk; + return lk; } /** @@ -114,15 +114,15 @@ * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListHigherSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListHigherSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(NULL); for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev); - return lk; + return lk; } /** @@ -134,8 +134,8 @@ * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLinkSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLinkSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -159,8 +159,8 @@ * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLinkReverseSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLinkReverseSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -189,16 +189,16 @@ { xmlListPtr l; if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for list"); return (NULL); } /* Initialize the list to NULL */ memset(l, 0, sizeof(xmlList)); - + /* Add the sentinel */ if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for sentinel"); xmlFree(l); return (NULL); @@ -206,7 +206,7 @@ l->sentinel->next = l->sentinel; l->sentinel->prev = l->sentinel; l->sentinel->data = NULL; - + /* If there is a link deallocator, use it */ if (deallocator != NULL) l->linkDeallocator = deallocator; @@ -217,7 +217,7 @@ l->linkCompare = xmlLinkCompare; return l; } - + /** * xmlListSearch: * @l: a list @@ -228,7 +228,7 @@ * Returns the value associated to @data or NULL in case of error */ void * -xmlListSearch(xmlListPtr l, void *data) +xmlListSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -249,7 +249,7 @@ * Returns the value associated to @data or NULL in case of error */ void * -xmlListReverseSearch(xmlListPtr l, void *data) +xmlListReverseSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -270,7 +270,7 @@ * Returns 0 in case of success, 1 in case of failure */ int -xmlListInsert(xmlListPtr l, void *data) +xmlListInsert(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -280,7 +280,7 @@ /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (1); } @@ -302,7 +302,7 @@ * * Returns 0 in case of success, 1 in case of failure */ -int xmlListAppend(xmlListPtr l, void *data) +int xmlListAppend(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -312,7 +312,7 @@ /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (1); } @@ -353,7 +353,7 @@ xmlListRemoveFirst(xmlListPtr l, void *data) { xmlLinkPtr lk; - + if (l == NULL) return(0); /*Find the first instance of this data */ @@ -378,7 +378,7 @@ xmlListRemoveLast(xmlListPtr l, void *data) { xmlLinkPtr lk; - + if (l == NULL) return(0); /*Find the last instance of this data */ @@ -403,7 +403,7 @@ xmlListRemoveAll(xmlListPtr l, void *data) { int count=0; - + if (l == NULL) return(0); @@ -422,7 +422,7 @@ xmlListClear(xmlListPtr l) { xmlLinkPtr lk; - + if (l == NULL) return; lk = l->sentinel->next; @@ -458,14 +458,14 @@ * * Returns the first element in the list, or NULL */ -xmlLinkPtr +xmlLinkPtr xmlListFront(xmlListPtr l) { if (l == NULL) return(NULL); return (l->sentinel->next); } - + /** * xmlListEnd: * @l: a list @@ -474,14 +474,14 @@ * * Returns the last element in the list, or NULL */ -xmlLinkPtr +xmlLinkPtr xmlListEnd(xmlListPtr l) { if (l == NULL) return(NULL); return (l->sentinel->prev); } - + /** * xmlListSize: * @l: a list @@ -539,7 +539,7 @@ * Returns 1 if successful, 0 otherwise */ int -xmlListPushFront(xmlListPtr l, void *data) +xmlListPushFront(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -549,7 +549,7 @@ /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (0); } @@ -571,7 +571,7 @@ * Returns 1 if successful, 0 otherwise */ int -xmlListPushBack(xmlListPtr l, void *data) +xmlListPushBack(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -580,7 +580,7 @@ lkPlace = l->sentinel->prev; /* Add the new link */ if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (0); } @@ -643,7 +643,7 @@ xmlListSort(xmlListPtr l) { xmlListPtr lTemp; - + if (l == NULL) return; if(xmlListEmpty(l)) @@ -725,10 +725,10 @@ * @old: the list * * Duplicate the list - * + * * Returns a new copy of the list or NULL in case of error */ -xmlListPtr +xmlListPtr xmlListDup(const xmlListPtr old) { xmlListPtr cur; @@ -754,7 +754,7 @@ * @old: the old list * * Move all the element from the old list in the new list - * + * * Returns 0 in case of success 1 in case of error */ int @@ -771,7 +771,7 @@ return (1); } } - return (0); + return (0); } /* xmlListUnique() */ /* xmlListSwap */ Index: lib/3rdparty/libxml2/ltmain.sh =================================================================== --- lib/3rdparty/libxml2/ltmain.sh (revision 58293) +++ lib/3rdparty/libxml2/ltmain.sh (working copy) @@ -1,10 +1,9 @@ -# Generated from ltmain.m4sh. -# libtool (GNU libtool) 2.2.10 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -42,6 +41,7 @@ # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) +# --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages @@ -70,17 +70,19 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.10 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.10 +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3175 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -135,15 +137,10 @@ : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -163,6 +160,27 @@ dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -177,18 +195,32 @@ # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation -# Generated shell functions inserted here. +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' @@ -351,7 +383,7 @@ ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -370,6 +402,15 @@ # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -398,7 +439,7 @@ # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -424,14 +465,14 @@ # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -650,11 +691,30 @@ fi } +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + # func_version # Echo version message to standard output and exit. func_version () { + $opt_debug + $SED -n '/(C)/!b go :more /\./!{ @@ -676,6 +736,8 @@ # Echo short help message to standard output and exit. func_usage () { + $opt_debug + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// @@ -692,7 +754,10 @@ # unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -702,10 +767,14 @@ s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" ret=$? if test -z "$1"; then exit $ret @@ -717,40 +786,106 @@ # exit_cmd. func_missing_arg () { + $opt_debug + func_error "missing argument for $1." exit_cmd=exit } + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + exit_cmd=: - magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. -# $mode is unset nonopt= -execute_dlfiles= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 -opt_dry_run=false -opt_duplicate_deps=false -opt_silent=false -opt_debug=: - # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -840,213 +975,255 @@ esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac + exit $EXIT_MISMATCH + fi +} - # Parse non-mode specific arguments: - while test "$#" -gt 0; do + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - opt_verbose=false + opt_preserve_dup_deps=: ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; - --no-quiet|--no-silent) - preserve_args="$preserve_args $opt" - opt_silent=false + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --no-silent|--no-quiet) opt_silent=false - opt_verbose=: +func_append preserve_args " $opt" ;; - - --no-verbose) preserve_args="$preserve_args $opt" + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) opt_verbose=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --help-all) opt_help=': help-all' ;; - --version) func_version ;; + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi -## ----------- ## -## Main. ## -## ----------- ## + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } -$opt_help || { - # Sanity checks first: - func_check_version_match - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" +## ----------- ## +## Main. ## +## ----------- ## - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} - - # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -1110,12 +1287,9 @@ # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1161,6 +1335,37 @@ } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1173,8 +1378,7 @@ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -1193,8 +1397,7 @@ CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -1263,6 +1466,486 @@ } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1303,12 +1986,12 @@ ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1329,15 +2012,14 @@ save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1353,8 +2035,7 @@ esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1379,7 +2060,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1485,17 +2166,16 @@ $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1515,7 +2195,7 @@ if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1562,11 +2242,11 @@ command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1611,13 +2291,13 @@ } $opt_help || { - test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1793,7 +2473,7 @@ ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac @@ -1808,13 +2488,13 @@ else { func_help noexit - for mode in compile link execute install finish uninstall clean; do + for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit - for mode in compile link execute install finish uninstall clean; do + for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done @@ -1843,13 +2523,16 @@ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1871,7 +2554,7 @@ dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1928,8 +2611,7 @@ ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1961,22 +2643,59 @@ fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug - libdirs="$nonopt" + libs= + libdirs= admincmds= + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1986,7 +2705,7 @@ if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1995,53 +2714,55 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -2066,7 +2787,7 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -2086,7 +2807,7 @@ do arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -2124,11 +2845,11 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi - install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -2140,7 +2861,7 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" - install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi @@ -2198,10 +2919,13 @@ case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -2215,19 +2939,19 @@ if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. @@ -2304,7 +3028,7 @@ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2478,11 +3202,13 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -2501,7 +3227,7 @@ fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2548,6 +3274,18 @@ #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2559,8 +3297,9 @@ # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2609,10 +3348,52 @@ func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2650,26 +3431,9 @@ const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - echo >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - echo >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2709,7 +3473,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -2725,7 +3489,7 @@ for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2788,7 +3552,8 @@ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - win32_nmres=`eval $NM -f posix -A $1 | + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2817,8 +3582,133 @@ $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + # func_extract_an_archive dir oldlib func_extract_an_archive () { @@ -3095,14 +3985,17 @@ # launches target application with the remaining arguments. func_exec_program () { - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac func_exec_program_core \${1+\"\$@\"} } @@ -3195,6 +4088,18 @@ if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -3209,14 +4114,6 @@ " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. @@ -3234,166 +4131,6 @@ } -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1"; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_result=`cygpath -w "$1" | - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result= - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1"; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_pathlist_tmp1=$func_stripname_result - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - func_to_host_pathlist_result=` - ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_append func_to_host_pathlist_result ";$func_to_host_path_result" - fi - fi - fi - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result"; then - func_error "Could not determine the host path(s) corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_append func_to_host_pathlist_result ";" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist - # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because @@ -3563,14 +4300,14 @@ EOF cat </dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6999,7 +7827,7 @@ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -7024,7 +7852,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -7040,7 +7868,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -7053,7 +7881,7 @@ potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -7078,7 +7906,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -7182,7 +8010,7 @@ *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7192,10 +8020,10 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -7207,15 +8035,22 @@ # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -7224,18 +8059,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -7243,17 +8078,13 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -7261,7 +8092,7 @@ fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -7287,7 +8118,7 @@ linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic @@ -7298,7 +8129,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7329,14 +8160,46 @@ $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then func_show_eval "$cmd" 'exit $?' skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." @@ -7369,7 +8232,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7379,7 +8242,7 @@ case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7399,21 +8262,21 @@ test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7475,10 +8338,13 @@ echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output - delfiles="$delfiles $output" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7492,10 +8358,12 @@ fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7546,7 +8414,7 @@ if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7580,7 +8448,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7613,7 +8481,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7654,10 +8522,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7673,7 +8541,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7685,7 +8553,7 @@ IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7769,13 +8637,16 @@ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test @@ -7849,8 +8720,8 @@ if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi @@ -7870,7 +8741,7 @@ *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7880,17 +8751,17 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7898,7 +8769,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7917,18 +8788,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7937,12 +8808,12 @@ case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7968,18 +8839,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -8030,6 +8901,12 @@ exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -8052,7 +8929,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8060,7 +8937,7 @@ # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8075,6 +8952,13 @@ $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -8108,6 +8992,12 @@ func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -8205,7 +9095,7 @@ else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -8213,10 +9103,10 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -8227,10 +9117,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -8248,7 +9138,7 @@ else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -8272,18 +9162,30 @@ esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8377,12 +9279,23 @@ *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8396,9 +9309,9 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8415,7 +9328,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8427,7 +9340,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8436,7 +9349,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi @@ -8521,7 +9434,7 @@ exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8541,9 +9454,9 @@ for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8552,24 +9465,23 @@ rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8595,18 +9507,17 @@ # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8634,19 +9545,19 @@ # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8656,7 +9567,7 @@ noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8665,7 +9576,7 @@ func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8673,12 +9584,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8686,7 +9597,6 @@ esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8698,16 +9608,16 @@ exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" Index: lib/3rdparty/libxml2/Makefile.am =================================================================== --- lib/3rdparty/libxml2/Makefile.am (revision 58293) +++ lib/3rdparty/libxml2/Makefile.am (working copy) @@ -2,23 +2,25 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@ +SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) DIST_SUBDIRS = include . doc example python xstc -INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ +AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) + noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ testThreads testC14N testAutomata testRegexp \ testReader testapi testModule runtest runsuite testchar \ - testdict runxmlconf testrecurse + testdict runxmlconf testrecurse testlimits bin_PROGRAMS = xmllint xmlcatalog bin_SCRIPTS=xml2-config lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ +libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) if USE_VERSION_SCRIPT LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms @@ -26,35 +28,37 @@ LIBXML2_VERSION_SCRIPT = endif -libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info @LIBXML_VERSION_INFO@ \ - @MODULE_PLATFORM_LIBS@ +libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ + $(LIBXML2_VERSION_SCRIPT) \ + -version-info $(LIBXML_VERSION_INFO) \ + $(MODULE_PLATFORM_LIBS) +if WITH_SAX1_SOURCES +docb_sources = DOCBparser.c +else +docb_sources = +endif + if WITH_TRIO_SOURCES -libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ - parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ - valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ - xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \ - catalog.c globals.c threads.c c14n.c xmlstring.c \ - xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ - xmlmodule.c schematron.c +trio_sources = triostr.c trio.c else +trio_sources = +endif + libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ - xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \ - catalog.c globals.c threads.c c14n.c xmlstring.c \ + xpointer.c xinclude.c nanohttp.c nanoftp.c \ + $(docb_sources) \ + catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ + $(trio_sources) \ xmlreader.c relaxng.c dict.c SAX2.c \ xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ - xmlmodule.c schematron.c -endif + xmlmodule.c schematron.c xzlib.c DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ +LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) man_MANS = xml2-config.1 libxml.3 @@ -65,32 +69,37 @@ runtest_SOURCES=runtest.c runtest_LDFLAGS = runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +runtest_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testrecurse_SOURCES=testrecurse.c testrecurse_LDFLAGS = testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +testrecurse_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) +testlimits_SOURCES=testlimits.c +testlimits_LDFLAGS = +testlimits_DEPENDENCIES = $(DEPS) +testlimits_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) + testchar_SOURCES=testchar.c testchar_LDFLAGS = testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD= @RDL_LIBS@ $(LDADDS) +testchar_LDADD= $(RDL_LIBS) $(LDADDS) testdict_SOURCES=testdict.c testdict_LDFLAGS = testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD= @RDL_LIBS@ $(LDADDS) +testdict_LDADD= $(RDL_LIBS) $(LDADDS) runsuite_SOURCES=runsuite.c runsuite_LDFLAGS = runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD= @RDL_LIBS@ $(LDADDS) +runsuite_LDADD= $(RDL_LIBS) $(LDADDS) xmllint_SOURCES=xmllint.c xmllint_LDFLAGS = xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD= @RDL_LIBS@ $(LDADDS) +xmllint_LDADD= $(RDL_LIBS) $(LDADDS) testSAX_SOURCES=testSAX.c testSAX_LDFLAGS = @@ -105,7 +114,7 @@ xmlcatalog_SOURCES=xmlcatalog.c xmlcatalog_LDFLAGS = xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS) +xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) testXPath_SOURCES=testXPath.c testXPath_LDFLAGS = @@ -117,10 +126,14 @@ testC14N_DEPENDENCIES = $(DEPS) testC14N_LDADD= $(LDADDS) -testThreads_SOURCES=testThreads@THREADS_W32@.c +if THREADS_W32 +testThreads_SOURCES = testThreadsWin32.c +else +testThreads_SOURCES = testThreads.c +endif testThreads_LDFLAGS = testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD= @BASE_THREAD_LIBS@ $(LDADDS) +testThreads_LDADD= $(BASE_THREAD_LIBS) $(LDADDS) testURI_SOURCES=testURI.c testURI_LDFLAGS = @@ -172,6 +185,8 @@ -@(if [ "$(PYTHON)" != "" ] ; then \ $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) +BUILT_SOURCES = testapi.c + testapi_SOURCES=testapi.c testapi_LDFLAGS = testapi_DEPENDENCIES = $(DEPS) @@ -188,29 +203,26 @@ #testOOM_LDADD= $(LDADDS) runtests: + [ -d test ] || $(LN_S) $(srcdir)/test . + [ -d result ] || $(LN_S) $(srcdir)/result . $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) check: all runtests -check-valgrind: all +check-valgrind valgrind: all @echo '## Running the regression tests under Valgrind' @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' check + $(MAKE) CHECKER='valgrind -q' runtests testall : tests SVGtests SAXtests -tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_PATTERN@ @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_SCHEMATRON@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@ - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) - @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests) +tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + @(cd doc/examples ; $(MAKE) tests) -valgrind: - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' tests - APItests: testapi$(EXEEXT) @echo "## Running the API regression tests this may take a little while" -@($(CHECKER) $(top_builddir)/testapi -q) @@ -1115,7 +1127,7 @@ echo "## It is normal to see 11 errors reported" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) + @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) Patterntests: xmllint$(EXEEXT) @(echo > .memdump) @@ -1147,19 +1159,19 @@ cleanup: -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o *.gcno -exec rm {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;) + -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) + -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) dist-source: distdir $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz dist-test: distdir (mkdir -p $(distdir)) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn xstc/Tests) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz @(rm -rf $(distdir)/xstc/Test) @@ -1183,7 +1195,8 @@ < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ && mv xml2Conf.tmp xml2Conf.sh -CLEANFILES=xml2Conf.sh *.gcda *.gcno +CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res +DISTCLEANFILES = COPYING missing.lst confexecdir=$(libdir) confexec_DATA = xml2Conf.sh @@ -1195,10 +1208,10 @@ example/Makefile.am example/gjobread.c example/gjobs.xml \ $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ - triop.h triodef.h libxml.h elfgcchack.h \ - testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ + triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ + enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - README.tests Makefile.tests libxml2.syms \ + README.tests Makefile.tests libxml2.syms timsort.h \ $(CVS_EXTRA_DIST) @@ -1213,13 +1226,13 @@ EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples install-data-local: - @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) + $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) uninstall-local: rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c @@ -1231,7 +1244,7 @@ rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) tst: tst.c - $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz + $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma sparse: clean $(MAKE) CC=cgcc Index: lib/3rdparty/libxml2/Makefile.in =================================================================== --- lib/3rdparty/libxml2/Makefile.in (revision 58293) +++ lib/3rdparty/libxml2/Makefile.in (working copy) @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -43,7 +43,7 @@ testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT) \ testapi$(EXEEXT) testModule$(EXEEXT) runtest$(EXEEXT) \ runsuite$(EXEEXT) testchar$(EXEEXT) testdict$(EXEEXT) \ - runxmlconf$(EXEEXT) testrecurse$(EXEEXT) + runxmlconf$(EXEEXT) testrecurse$(EXEEXT) testlimits$(EXEEXT) bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ @@ -51,8 +51,8 @@ $(srcdir)/libxml-2.0-uninstalled.pc.in \ $(srcdir)/libxml-2.0.pc.in $(srcdir)/libxml.spec.in \ $(srcdir)/xml2-config.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL NEWS TODO acconfig.h config.guess \ - config.sub depcomp install-sh ltmain.sh missing + COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ + depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -88,170 +88,173 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(confexecdir)" \ "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -libxml2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +libxml2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am__libxml2_la_SOURCES_DIST = SAX.c entities.c encoding.c error.c \ parserInternals.c parser.c tree.c hash.c list.c xmlIO.c \ xmlmemory.c uri.c valid.c xlink.c HTMLparser.c HTMLtree.c \ debugXML.c xpath.c xpointer.c xinclude.c nanohttp.c nanoftp.c \ DOCBparser.c catalog.c globals.c threads.c c14n.c xmlstring.c \ - xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - xmlreader.c relaxng.c dict.c SAX2.c xmlwriter.c legacy.c \ - chvalid.c pattern.c xmlsave.c xmlmodule.c schematron.c \ - triostr.c trio.c -@WITH_TRIO_SOURCES_FALSE@am_libxml2_la_OBJECTS = SAX.lo entities.lo \ -@WITH_TRIO_SOURCES_FALSE@ encoding.lo error.lo \ -@WITH_TRIO_SOURCES_FALSE@ parserInternals.lo parser.lo tree.lo \ -@WITH_TRIO_SOURCES_FALSE@ hash.lo list.lo xmlIO.lo xmlmemory.lo \ -@WITH_TRIO_SOURCES_FALSE@ uri.lo valid.lo xlink.lo \ -@WITH_TRIO_SOURCES_FALSE@ HTMLparser.lo HTMLtree.lo debugXML.lo \ -@WITH_TRIO_SOURCES_FALSE@ xpath.lo xpointer.lo xinclude.lo \ -@WITH_TRIO_SOURCES_FALSE@ nanohttp.lo nanoftp.lo DOCBparser.lo \ -@WITH_TRIO_SOURCES_FALSE@ catalog.lo globals.lo threads.lo \ -@WITH_TRIO_SOURCES_FALSE@ c14n.lo xmlstring.lo xmlregexp.lo \ -@WITH_TRIO_SOURCES_FALSE@ xmlschemas.lo xmlschemastypes.lo \ -@WITH_TRIO_SOURCES_FALSE@ xmlunicode.lo xmlreader.lo relaxng.lo \ -@WITH_TRIO_SOURCES_FALSE@ dict.lo SAX2.lo xmlwriter.lo \ -@WITH_TRIO_SOURCES_FALSE@ legacy.lo chvalid.lo pattern.lo \ -@WITH_TRIO_SOURCES_FALSE@ xmlsave.lo xmlmodule.lo schematron.lo -@WITH_TRIO_SOURCES_TRUE@am_libxml2_la_OBJECTS = SAX.lo entities.lo \ -@WITH_TRIO_SOURCES_TRUE@ encoding.lo error.lo \ -@WITH_TRIO_SOURCES_TRUE@ parserInternals.lo parser.lo tree.lo \ -@WITH_TRIO_SOURCES_TRUE@ hash.lo list.lo xmlIO.lo xmlmemory.lo \ -@WITH_TRIO_SOURCES_TRUE@ uri.lo valid.lo xlink.lo HTMLparser.lo \ -@WITH_TRIO_SOURCES_TRUE@ HTMLtree.lo debugXML.lo xpath.lo \ -@WITH_TRIO_SOURCES_TRUE@ xpointer.lo xinclude.lo nanohttp.lo \ -@WITH_TRIO_SOURCES_TRUE@ nanoftp.lo DOCBparser.lo catalog.lo \ -@WITH_TRIO_SOURCES_TRUE@ globals.lo threads.lo c14n.lo \ -@WITH_TRIO_SOURCES_TRUE@ xmlstring.lo xmlregexp.lo \ -@WITH_TRIO_SOURCES_TRUE@ xmlschemas.lo xmlschemastypes.lo \ -@WITH_TRIO_SOURCES_TRUE@ xmlunicode.lo triostr.lo trio.lo \ -@WITH_TRIO_SOURCES_TRUE@ xmlreader.lo relaxng.lo dict.lo \ -@WITH_TRIO_SOURCES_TRUE@ SAX2.lo xmlwriter.lo legacy.lo \ -@WITH_TRIO_SOURCES_TRUE@ chvalid.lo pattern.lo xmlsave.lo \ -@WITH_TRIO_SOURCES_TRUE@ xmlmodule.lo schematron.lo + buf.c xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ + triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ + xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c xmlmodule.c \ + schematron.c xzlib.c +@WITH_SAX1_SOURCES_TRUE@am__objects_1 = DOCBparser.lo +@WITH_TRIO_SOURCES_TRUE@am__objects_2 = triostr.lo trio.lo +am_libxml2_la_OBJECTS = SAX.lo entities.lo encoding.lo error.lo \ + parserInternals.lo parser.lo tree.lo hash.lo list.lo xmlIO.lo \ + xmlmemory.lo uri.lo valid.lo xlink.lo HTMLparser.lo \ + HTMLtree.lo debugXML.lo xpath.lo xpointer.lo xinclude.lo \ + nanohttp.lo nanoftp.lo $(am__objects_1) catalog.lo globals.lo \ + threads.lo c14n.lo xmlstring.lo buf.lo xmlregexp.lo \ + xmlschemas.lo xmlschemastypes.lo xmlunicode.lo \ + $(am__objects_2) xmlreader.lo relaxng.lo dict.lo SAX2.lo \ + xmlwriter.lo legacy.lo chvalid.lo pattern.lo xmlsave.lo \ + xmlmodule.lo schematron.lo xzlib.lo libxml2_la_OBJECTS = $(am_libxml2_la_OBJECTS) -libxml2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +libxml2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libxml2_la_LDFLAGS) $(LDFLAGS) -o $@ testdso_la_LIBADD = am_testdso_la_OBJECTS = testdso.lo testdso_la_OBJECTS = $(am_testdso_la_OBJECTS) -testdso_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testdso_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testdso_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_runsuite_OBJECTS = runsuite.$(OBJEXT) runsuite_OBJECTS = $(am_runsuite_OBJECTS) -am__DEPENDENCIES_2 = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) -runsuite_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(runsuite_LDFLAGS) \ - $(LDFLAGS) -o $@ +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +runsuite_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(runsuite_LDFLAGS) $(LDFLAGS) -o $@ am_runtest_OBJECTS = runtest.$(OBJEXT) runtest_OBJECTS = $(am_runtest_OBJECTS) -runtest_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(runtest_LDFLAGS) \ - $(LDFLAGS) -o $@ +runtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(runtest_LDFLAGS) $(LDFLAGS) -o $@ am_runxmlconf_OBJECTS = runxmlconf.$(OBJEXT) runxmlconf_OBJECTS = $(am_runxmlconf_OBJECTS) -runxmlconf_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +runxmlconf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(runxmlconf_LDFLAGS) $(LDFLAGS) -o $@ am_testAutomata_OBJECTS = testAutomata.$(OBJEXT) testAutomata_OBJECTS = $(am_testAutomata_OBJECTS) -testAutomata_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testAutomata_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testAutomata_LDFLAGS) $(LDFLAGS) -o $@ am_testC14N_OBJECTS = testC14N.$(OBJEXT) testC14N_OBJECTS = $(am_testC14N_OBJECTS) -testC14N_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testC14N_LDFLAGS) \ - $(LDFLAGS) -o $@ +testC14N_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testC14N_LDFLAGS) $(LDFLAGS) -o $@ am_testHTML_OBJECTS = testHTML.$(OBJEXT) testHTML_OBJECTS = $(am_testHTML_OBJECTS) -testHTML_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testHTML_LDFLAGS) \ - $(LDFLAGS) -o $@ +testHTML_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testHTML_LDFLAGS) $(LDFLAGS) -o $@ am_testModule_OBJECTS = testModule.$(OBJEXT) testModule_OBJECTS = $(am_testModule_OBJECTS) -testModule_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testModule_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testModule_LDFLAGS) $(LDFLAGS) -o $@ am_testReader_OBJECTS = testReader.$(OBJEXT) testReader_OBJECTS = $(am_testReader_OBJECTS) -testReader_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testReader_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testReader_LDFLAGS) $(LDFLAGS) -o $@ am_testRegexp_OBJECTS = testRegexp.$(OBJEXT) testRegexp_OBJECTS = $(am_testRegexp_OBJECTS) -testRegexp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testRegexp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testRegexp_LDFLAGS) $(LDFLAGS) -o $@ am_testRelax_OBJECTS = testRelax.$(OBJEXT) testRelax_OBJECTS = $(am_testRelax_OBJECTS) -testRelax_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testRelax_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testRelax_LDFLAGS) $(LDFLAGS) -o $@ am_testSAX_OBJECTS = testSAX.$(OBJEXT) testSAX_OBJECTS = $(am_testSAX_OBJECTS) -testSAX_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testSAX_LDFLAGS) \ - $(LDFLAGS) -o $@ +testSAX_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testSAX_LDFLAGS) $(LDFLAGS) -o $@ am_testSchemas_OBJECTS = testSchemas.$(OBJEXT) testSchemas_OBJECTS = $(am_testSchemas_OBJECTS) -testSchemas_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testSchemas_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testSchemas_LDFLAGS) $(LDFLAGS) -o $@ -am_testThreads_OBJECTS = testThreads@THREADS_W32@.$(OBJEXT) +am__testThreads_SOURCES_DIST = testThreads.c testThreadsWin32.c +@THREADS_W32_FALSE@am_testThreads_OBJECTS = testThreads.$(OBJEXT) +@THREADS_W32_TRUE@am_testThreads_OBJECTS = testThreadsWin32.$(OBJEXT) testThreads_OBJECTS = $(am_testThreads_OBJECTS) -testThreads_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testThreads_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testThreads_LDFLAGS) $(LDFLAGS) -o $@ am_testURI_OBJECTS = testURI.$(OBJEXT) testURI_OBJECTS = $(am_testURI_OBJECTS) -testURI_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testURI_LDFLAGS) \ - $(LDFLAGS) -o $@ +testURI_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testURI_LDFLAGS) $(LDFLAGS) -o $@ am_testXPath_OBJECTS = testXPath.$(OBJEXT) testXPath_OBJECTS = $(am_testXPath_OBJECTS) -testXPath_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testXPath_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testXPath_LDFLAGS) $(LDFLAGS) -o $@ am_testapi_OBJECTS = testapi.$(OBJEXT) testapi_OBJECTS = $(am_testapi_OBJECTS) -testapi_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testapi_LDFLAGS) \ - $(LDFLAGS) -o $@ +testapi_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testapi_LDFLAGS) $(LDFLAGS) -o $@ am_testchar_OBJECTS = testchar.$(OBJEXT) testchar_OBJECTS = $(am_testchar_OBJECTS) -testchar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testchar_LDFLAGS) \ - $(LDFLAGS) -o $@ +testchar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testchar_LDFLAGS) $(LDFLAGS) -o $@ am_testdict_OBJECTS = testdict.$(OBJEXT) testdict_OBJECTS = $(am_testdict_OBJECTS) -testdict_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testdict_LDFLAGS) \ - $(LDFLAGS) -o $@ +testdict_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testdict_LDFLAGS) $(LDFLAGS) -o $@ +am_testlimits_OBJECTS = testlimits.$(OBJEXT) +testlimits_OBJECTS = $(am_testlimits_OBJECTS) +testlimits_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testlimits_LDFLAGS) $(LDFLAGS) -o $@ am_testrecurse_OBJECTS = testrecurse.$(OBJEXT) testrecurse_OBJECTS = $(am_testrecurse_OBJECTS) -testrecurse_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +testrecurse_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testrecurse_LDFLAGS) $(LDFLAGS) -o $@ am_xmlcatalog_OBJECTS = xmlcatalog.$(OBJEXT) xmlcatalog_OBJECTS = $(am_xmlcatalog_OBJECTS) -xmlcatalog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +xmlcatalog_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xmlcatalog_LDFLAGS) $(LDFLAGS) -o $@ am_xmllint_OBJECTS = xmllint.$(OBJEXT) xmllint_OBJECTS = $(am_xmllint_OBJECTS) -xmllint_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(xmllint_LDFLAGS) \ - $(LDFLAGS) -o $@ +xmllint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(xmllint_LDFLAGS) $(LDFLAGS) -o $@ SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -259,13 +262,26 @@ am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libxml2_la_SOURCES) $(testdso_la_SOURCES) \ $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ $(testAutomata_SOURCES) $(testC14N_SOURCES) \ @@ -274,16 +290,17 @@ $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \ $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \ - $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \ - $(xmllint_SOURCES) + $(testlimits_SOURCES) $(testrecurse_SOURCES) \ + $(xmlcatalog_SOURCES) $(xmllint_SOURCES) DIST_SOURCES = $(am__libxml2_la_SOURCES_DIST) $(testdso_la_SOURCES) \ $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ $(testAutomata_SOURCES) $(testC14N_SOURCES) \ $(testHTML_SOURCES) $(testModule_SOURCES) \ $(testReader_SOURCES) $(testRegexp_SOURCES) \ $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ - $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \ - $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \ + $(am__testThreads_SOURCES_DIST) $(testURI_SOURCES) \ + $(testXPath_SOURCES) $(testapi_SOURCES) $(testchar_SOURCES) \ + $(testdict_SOURCES) $(testlimits_SOURCES) \ $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \ $(xmllint_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -309,9 +326,11 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -340,11 +359,13 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -381,6 +402,7 @@ HTML_OBJ = @HTML_OBJ@ HTTP_OBJ = @HTTP_OBJ@ ICONV_LIBS = @ICONV_LIBS@ +ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -401,7 +423,10 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULE_EXTENSION = @MODULE_EXTENSION@ MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ @@ -458,10 +483,8 @@ TEST_XINCLUDE = @TEST_XINCLUDE@ TEST_XPATH = @TEST_XPATH@ TEST_XPTR = @TEST_XPTR@ -THREADS_W32 = @THREADS_W32@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ -U = @U@ VERSION = @VERSION@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ WGET = @WGET@ @@ -479,6 +502,7 @@ WITH_ICU = @WITH_ICU@ WITH_ISO8859X = @WITH_ISO8859X@ WITH_LEGACY = @WITH_LEGACY@ +WITH_LZMA = @WITH_LZMA@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ WITH_MODULES = @WITH_MODULES@ WITH_OUTPUT = @WITH_OUTPUT@ @@ -515,6 +539,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -564,68 +589,69 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@ +SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) DIST_SUBDIRS = include . doc example python xstc -INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ +AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) bin_SCRIPTS = xml2-config lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ +libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) @USE_VERSION_SCRIPT_FALSE@LIBXML2_VERSION_SCRIPT = @USE_VERSION_SCRIPT_TRUE@LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms -libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info @LIBXML_VERSION_INFO@ \ - @MODULE_PLATFORM_LIBS@ +libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ + $(LIBXML2_VERSION_SCRIPT) \ + -version-info $(LIBXML_VERSION_INFO) \ + $(MODULE_PLATFORM_LIBS) -@WITH_TRIO_SOURCES_FALSE@libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ -@WITH_TRIO_SOURCES_FALSE@ parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ -@WITH_TRIO_SOURCES_FALSE@ valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ -@WITH_TRIO_SOURCES_FALSE@ xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \ -@WITH_TRIO_SOURCES_FALSE@ catalog.c globals.c threads.c c14n.c xmlstring.c \ -@WITH_TRIO_SOURCES_FALSE@ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ -@WITH_TRIO_SOURCES_FALSE@ xmlreader.c relaxng.c dict.c SAX2.c \ -@WITH_TRIO_SOURCES_FALSE@ xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ -@WITH_TRIO_SOURCES_FALSE@ xmlmodule.c schematron.c +@WITH_SAX1_SOURCES_FALSE@docb_sources = +@WITH_SAX1_SOURCES_TRUE@docb_sources = DOCBparser.c +@WITH_TRIO_SOURCES_FALSE@trio_sources = +@WITH_TRIO_SOURCES_TRUE@trio_sources = triostr.c trio.c +libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ + parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ + valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ + xpointer.c xinclude.c nanohttp.c nanoftp.c \ + $(docb_sources) \ + catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ + xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ + $(trio_sources) \ + xmlreader.c relaxng.c dict.c SAX2.c \ + xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ + xmlmodule.c schematron.c xzlib.c -@WITH_TRIO_SOURCES_TRUE@libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ -@WITH_TRIO_SOURCES_TRUE@ parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ -@WITH_TRIO_SOURCES_TRUE@ valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ -@WITH_TRIO_SOURCES_TRUE@ xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \ -@WITH_TRIO_SOURCES_TRUE@ catalog.c globals.c threads.c c14n.c xmlstring.c \ -@WITH_TRIO_SOURCES_TRUE@ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ -@WITH_TRIO_SOURCES_TRUE@ triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ -@WITH_TRIO_SOURCES_TRUE@ xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ -@WITH_TRIO_SOURCES_TRUE@ xmlmodule.c schematron.c - DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ +LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) man_MANS = xml2-config.1 libxml.3 m4datadir = $(datadir)/aclocal m4data_DATA = libxml.m4 runtest_SOURCES = runtest.c runtest_LDFLAGS = runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD = @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +runtest_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testrecurse_SOURCES = testrecurse.c testrecurse_LDFLAGS = testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD = @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +testrecurse_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) +testlimits_SOURCES = testlimits.c +testlimits_LDFLAGS = +testlimits_DEPENDENCIES = $(DEPS) +testlimits_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testchar_SOURCES = testchar.c testchar_LDFLAGS = testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD = @RDL_LIBS@ $(LDADDS) +testchar_LDADD = $(RDL_LIBS) $(LDADDS) testdict_SOURCES = testdict.c testdict_LDFLAGS = testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD = @RDL_LIBS@ $(LDADDS) +testdict_LDADD = $(RDL_LIBS) $(LDADDS) runsuite_SOURCES = runsuite.c runsuite_LDFLAGS = runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD = @RDL_LIBS@ $(LDADDS) +runsuite_LDADD = $(RDL_LIBS) $(LDADDS) xmllint_SOURCES = xmllint.c xmllint_LDFLAGS = xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD = @RDL_LIBS@ $(LDADDS) +xmllint_LDADD = $(RDL_LIBS) $(LDADDS) testSAX_SOURCES = testSAX.c testSAX_LDFLAGS = testSAX_DEPENDENCIES = $(DEPS) @@ -637,7 +663,7 @@ xmlcatalog_SOURCES = xmlcatalog.c xmlcatalog_LDFLAGS = xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD = @RDL_LIBS@ $(LDADDS) +xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) testXPath_SOURCES = testXPath.c testXPath_LDFLAGS = testXPath_DEPENDENCIES = $(DEPS) @@ -646,10 +672,11 @@ testC14N_LDFLAGS = testC14N_DEPENDENCIES = $(DEPS) testC14N_LDADD = $(LDADDS) -testThreads_SOURCES = testThreads@THREADS_W32@.c +@THREADS_W32_FALSE@testThreads_SOURCES = testThreads.c +@THREADS_W32_TRUE@testThreads_SOURCES = testThreadsWin32.c testThreads_LDFLAGS = testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD = @BASE_THREAD_LIBS@ $(LDADDS) +testThreads_LDADD = $(BASE_THREAD_LIBS) $(LDADDS) testURI_SOURCES = testURI.c testURI_LDFLAGS = testURI_DEPENDENCIES = $(DEPS) @@ -681,6 +708,7 @@ noinst_LTLIBRARIES = testdso.la testdso_la_SOURCES = testdso.c testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir) +BUILT_SOURCES = testapi.c testapi_SOURCES = testapi.c testapi_LDFLAGS = testapi_DEPENDENCIES = $(DEPS) @@ -689,7 +717,8 @@ runxmlconf_LDFLAGS = runxmlconf_DEPENDENCIES = $(DEPS) runxmlconf_LDADD = $(LDADDS) -CLEANFILES = xml2Conf.sh *.gcda *.gcno +CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res +DISTCLEANFILES = COPYING missing.lst confexecdir = $(libdir) confexec_DATA = xml2Conf.sh CVS_EXTRA_DIST = @@ -700,10 +729,10 @@ example/Makefile.am example/gjobread.c example/gjobs.xml \ $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ - triop.h triodef.h libxml.h elfgcchack.h \ - testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ + triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ + enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - README.tests Makefile.tests libxml2.syms \ + README.tests Makefile.tests libxml2.syms timsort.h \ $(CVS_EXTRA_DIST) pkgconfigdir = $(libdir)/pkgconfig @@ -722,12 +751,12 @@ # LCOV = /usr/bin/lcov GENHTML = /usr/bin/genhtml -all: config.h +all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -763,15 +792,13 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h +$(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -826,10 +853,10 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) - $(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS) -testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) - $(testdso_la_LINK) $(testdso_la_OBJECTS) $(testdso_la_LIBADD) $(LIBS) +libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS) +testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES) + $(AM_V_CCLD)$(testdso_la_LINK) $(testdso_la_OBJECTS) $(testdso_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @@ -882,69 +909,72 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -runsuite$(EXEEXT): $(runsuite_OBJECTS) $(runsuite_DEPENDENCIES) +runsuite$(EXEEXT): $(runsuite_OBJECTS) $(runsuite_DEPENDENCIES) $(EXTRA_runsuite_DEPENDENCIES) @rm -f runsuite$(EXEEXT) - $(runsuite_LINK) $(runsuite_OBJECTS) $(runsuite_LDADD) $(LIBS) -runtest$(EXEEXT): $(runtest_OBJECTS) $(runtest_DEPENDENCIES) + $(AM_V_CCLD)$(runsuite_LINK) $(runsuite_OBJECTS) $(runsuite_LDADD) $(LIBS) +runtest$(EXEEXT): $(runtest_OBJECTS) $(runtest_DEPENDENCIES) $(EXTRA_runtest_DEPENDENCIES) @rm -f runtest$(EXEEXT) - $(runtest_LINK) $(runtest_OBJECTS) $(runtest_LDADD) $(LIBS) -runxmlconf$(EXEEXT): $(runxmlconf_OBJECTS) $(runxmlconf_DEPENDENCIES) + $(AM_V_CCLD)$(runtest_LINK) $(runtest_OBJECTS) $(runtest_LDADD) $(LIBS) +runxmlconf$(EXEEXT): $(runxmlconf_OBJECTS) $(runxmlconf_DEPENDENCIES) $(EXTRA_runxmlconf_DEPENDENCIES) @rm -f runxmlconf$(EXEEXT) - $(runxmlconf_LINK) $(runxmlconf_OBJECTS) $(runxmlconf_LDADD) $(LIBS) -testAutomata$(EXEEXT): $(testAutomata_OBJECTS) $(testAutomata_DEPENDENCIES) + $(AM_V_CCLD)$(runxmlconf_LINK) $(runxmlconf_OBJECTS) $(runxmlconf_LDADD) $(LIBS) +testAutomata$(EXEEXT): $(testAutomata_OBJECTS) $(testAutomata_DEPENDENCIES) $(EXTRA_testAutomata_DEPENDENCIES) @rm -f testAutomata$(EXEEXT) - $(testAutomata_LINK) $(testAutomata_OBJECTS) $(testAutomata_LDADD) $(LIBS) -testC14N$(EXEEXT): $(testC14N_OBJECTS) $(testC14N_DEPENDENCIES) + $(AM_V_CCLD)$(testAutomata_LINK) $(testAutomata_OBJECTS) $(testAutomata_LDADD) $(LIBS) +testC14N$(EXEEXT): $(testC14N_OBJECTS) $(testC14N_DEPENDENCIES) $(EXTRA_testC14N_DEPENDENCIES) @rm -f testC14N$(EXEEXT) - $(testC14N_LINK) $(testC14N_OBJECTS) $(testC14N_LDADD) $(LIBS) -testHTML$(EXEEXT): $(testHTML_OBJECTS) $(testHTML_DEPENDENCIES) + $(AM_V_CCLD)$(testC14N_LINK) $(testC14N_OBJECTS) $(testC14N_LDADD) $(LIBS) +testHTML$(EXEEXT): $(testHTML_OBJECTS) $(testHTML_DEPENDENCIES) $(EXTRA_testHTML_DEPENDENCIES) @rm -f testHTML$(EXEEXT) - $(testHTML_LINK) $(testHTML_OBJECTS) $(testHTML_LDADD) $(LIBS) -testModule$(EXEEXT): $(testModule_OBJECTS) $(testModule_DEPENDENCIES) + $(AM_V_CCLD)$(testHTML_LINK) $(testHTML_OBJECTS) $(testHTML_LDADD) $(LIBS) +testModule$(EXEEXT): $(testModule_OBJECTS) $(testModule_DEPENDENCIES) $(EXTRA_testModule_DEPENDENCIES) @rm -f testModule$(EXEEXT) - $(testModule_LINK) $(testModule_OBJECTS) $(testModule_LDADD) $(LIBS) -testReader$(EXEEXT): $(testReader_OBJECTS) $(testReader_DEPENDENCIES) + $(AM_V_CCLD)$(testModule_LINK) $(testModule_OBJECTS) $(testModule_LDADD) $(LIBS) +testReader$(EXEEXT): $(testReader_OBJECTS) $(testReader_DEPENDENCIES) $(EXTRA_testReader_DEPENDENCIES) @rm -f testReader$(EXEEXT) - $(testReader_LINK) $(testReader_OBJECTS) $(testReader_LDADD) $(LIBS) -testRegexp$(EXEEXT): $(testRegexp_OBJECTS) $(testRegexp_DEPENDENCIES) + $(AM_V_CCLD)$(testReader_LINK) $(testReader_OBJECTS) $(testReader_LDADD) $(LIBS) +testRegexp$(EXEEXT): $(testRegexp_OBJECTS) $(testRegexp_DEPENDENCIES) $(EXTRA_testRegexp_DEPENDENCIES) @rm -f testRegexp$(EXEEXT) - $(testRegexp_LINK) $(testRegexp_OBJECTS) $(testRegexp_LDADD) $(LIBS) -testRelax$(EXEEXT): $(testRelax_OBJECTS) $(testRelax_DEPENDENCIES) + $(AM_V_CCLD)$(testRegexp_LINK) $(testRegexp_OBJECTS) $(testRegexp_LDADD) $(LIBS) +testRelax$(EXEEXT): $(testRelax_OBJECTS) $(testRelax_DEPENDENCIES) $(EXTRA_testRelax_DEPENDENCIES) @rm -f testRelax$(EXEEXT) - $(testRelax_LINK) $(testRelax_OBJECTS) $(testRelax_LDADD) $(LIBS) -testSAX$(EXEEXT): $(testSAX_OBJECTS) $(testSAX_DEPENDENCIES) + $(AM_V_CCLD)$(testRelax_LINK) $(testRelax_OBJECTS) $(testRelax_LDADD) $(LIBS) +testSAX$(EXEEXT): $(testSAX_OBJECTS) $(testSAX_DEPENDENCIES) $(EXTRA_testSAX_DEPENDENCIES) @rm -f testSAX$(EXEEXT) - $(testSAX_LINK) $(testSAX_OBJECTS) $(testSAX_LDADD) $(LIBS) -testSchemas$(EXEEXT): $(testSchemas_OBJECTS) $(testSchemas_DEPENDENCIES) + $(AM_V_CCLD)$(testSAX_LINK) $(testSAX_OBJECTS) $(testSAX_LDADD) $(LIBS) +testSchemas$(EXEEXT): $(testSchemas_OBJECTS) $(testSchemas_DEPENDENCIES) $(EXTRA_testSchemas_DEPENDENCIES) @rm -f testSchemas$(EXEEXT) - $(testSchemas_LINK) $(testSchemas_OBJECTS) $(testSchemas_LDADD) $(LIBS) -testThreads$(EXEEXT): $(testThreads_OBJECTS) $(testThreads_DEPENDENCIES) + $(AM_V_CCLD)$(testSchemas_LINK) $(testSchemas_OBJECTS) $(testSchemas_LDADD) $(LIBS) +testThreads$(EXEEXT): $(testThreads_OBJECTS) $(testThreads_DEPENDENCIES) $(EXTRA_testThreads_DEPENDENCIES) @rm -f testThreads$(EXEEXT) - $(testThreads_LINK) $(testThreads_OBJECTS) $(testThreads_LDADD) $(LIBS) -testURI$(EXEEXT): $(testURI_OBJECTS) $(testURI_DEPENDENCIES) + $(AM_V_CCLD)$(testThreads_LINK) $(testThreads_OBJECTS) $(testThreads_LDADD) $(LIBS) +testURI$(EXEEXT): $(testURI_OBJECTS) $(testURI_DEPENDENCIES) $(EXTRA_testURI_DEPENDENCIES) @rm -f testURI$(EXEEXT) - $(testURI_LINK) $(testURI_OBJECTS) $(testURI_LDADD) $(LIBS) -testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES) + $(AM_V_CCLD)$(testURI_LINK) $(testURI_OBJECTS) $(testURI_LDADD) $(LIBS) +testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES) $(EXTRA_testXPath_DEPENDENCIES) @rm -f testXPath$(EXEEXT) - $(testXPath_LINK) $(testXPath_OBJECTS) $(testXPath_LDADD) $(LIBS) -testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES) + $(AM_V_CCLD)$(testXPath_LINK) $(testXPath_OBJECTS) $(testXPath_LDADD) $(LIBS) +testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES) $(EXTRA_testapi_DEPENDENCIES) @rm -f testapi$(EXEEXT) - $(testapi_LINK) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS) -testchar$(EXEEXT): $(testchar_OBJECTS) $(testchar_DEPENDENCIES) + $(AM_V_CCLD)$(testapi_LINK) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS) +testchar$(EXEEXT): $(testchar_OBJECTS) $(testchar_DEPENDENCIES) $(EXTRA_testchar_DEPENDENCIES) @rm -f testchar$(EXEEXT) - $(testchar_LINK) $(testchar_OBJECTS) $(testchar_LDADD) $(LIBS) -testdict$(EXEEXT): $(testdict_OBJECTS) $(testdict_DEPENDENCIES) + $(AM_V_CCLD)$(testchar_LINK) $(testchar_OBJECTS) $(testchar_LDADD) $(LIBS) +testdict$(EXEEXT): $(testdict_OBJECTS) $(testdict_DEPENDENCIES) $(EXTRA_testdict_DEPENDENCIES) @rm -f testdict$(EXEEXT) - $(testdict_LINK) $(testdict_OBJECTS) $(testdict_LDADD) $(LIBS) -testrecurse$(EXEEXT): $(testrecurse_OBJECTS) $(testrecurse_DEPENDENCIES) + $(AM_V_CCLD)$(testdict_LINK) $(testdict_OBJECTS) $(testdict_LDADD) $(LIBS) +testlimits$(EXEEXT): $(testlimits_OBJECTS) $(testlimits_DEPENDENCIES) $(EXTRA_testlimits_DEPENDENCIES) + @rm -f testlimits$(EXEEXT) + $(AM_V_CCLD)$(testlimits_LINK) $(testlimits_OBJECTS) $(testlimits_LDADD) $(LIBS) +testrecurse$(EXEEXT): $(testrecurse_OBJECTS) $(testrecurse_DEPENDENCIES) $(EXTRA_testrecurse_DEPENDENCIES) @rm -f testrecurse$(EXEEXT) - $(testrecurse_LINK) $(testrecurse_OBJECTS) $(testrecurse_LDADD) $(LIBS) -xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES) + $(AM_V_CCLD)$(testrecurse_LINK) $(testrecurse_OBJECTS) $(testrecurse_LDADD) $(LIBS) +xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES) $(EXTRA_xmlcatalog_DEPENDENCIES) @rm -f xmlcatalog$(EXEEXT) - $(xmlcatalog_LINK) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS) -xmllint$(EXEEXT): $(xmllint_OBJECTS) $(xmllint_DEPENDENCIES) + $(AM_V_CCLD)$(xmlcatalog_LINK) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS) +xmllint$(EXEEXT): $(xmllint_OBJECTS) $(xmllint_DEPENDENCIES) $(EXTRA_xmllint_DEPENDENCIES) @rm -f xmllint$(EXEEXT) - $(xmllint_LINK) $(xmllint_OBJECTS) $(xmllint_LDADD) $(LIBS) + $(AM_V_CCLD)$(xmllint_LINK) $(xmllint_OBJECTS) $(xmllint_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @@ -976,9 +1006,7 @@ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -991,6 +1019,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTMLtree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c14n.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catalog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chvalid.Plo@am__quote@ @@ -1022,13 +1051,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testRelax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSAX.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSchemas.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreads@THREADS_W32@.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreads.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreadsWin32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testURI.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testXPath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testchar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdso.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlimits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrecurse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@ @@ -1053,27 +1084,28 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwriter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpointer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xzlib.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -1118,9 +1150,7 @@ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man3: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" @@ -1156,9 +1186,7 @@ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man3dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-confexecDATA: $(confexec_DATA) @$(NORMAL_INSTALL) test -z "$(confexecdir)" || $(MKDIR_P) "$(DESTDIR)$(confexecdir)" @@ -1176,9 +1204,7 @@ @$(NORMAL_UNINSTALL) @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(confexecdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(confexecdir)" && rm -f $$files + dir='$(DESTDIR)$(confexecdir)'; $(am__uninstall_files_from_dir) install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)" @@ -1196,9 +1222,7 @@ @$(NORMAL_UNINSTALL) @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(m4datadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(m4datadir)" && rm -f $$files + dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @@ -1216,9 +1240,7 @@ @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -1443,15 +1465,19 @@ $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -1482,6 +1508,8 @@ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -1491,7 +1519,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -1501,6 +1529,7 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -1529,8 +1558,16 @@ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -1547,7 +1584,8 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ config.h install-binPROGRAMS: install-libLTLIBRARIES @@ -1557,7 +1595,8 @@ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -1567,10 +1606,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1579,10 +1623,12 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ @@ -1665,34 +1711,35 @@ uninstall-man: uninstall-man1 uninstall-man3 -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-binSCRIPTS \ - install-confexecDATA install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-m4dataDATA \ - install-man install-man1 install-man3 install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-binSCRIPTS uninstall-confexecDATA \ - uninstall-libLTLIBRARIES uninstall-local uninstall-m4dataDATA \ - uninstall-man uninstall-man1 uninstall-man3 \ - uninstall-pkgconfigDATA + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS \ + install-binSCRIPTS install-confexecDATA install-data \ + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-m4dataDATA install-man install-man1 install-man3 \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-confexecDATA uninstall-libLTLIBRARIES \ + uninstall-local uninstall-m4dataDATA uninstall-man \ + uninstall-man1 uninstall-man3 uninstall-pkgconfigDATA # that one forces the rebuild when "make rebuild" is run on doc/ @@ -1712,29 +1759,26 @@ #testOOM_LDADD= $(LDADDS) runtests: + [ -d test ] || $(LN_S) $(srcdir)/test . + [ -d result ] || $(LN_S) $(srcdir)/result . $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) check: all runtests -check-valgrind: all +check-valgrind valgrind: all @echo '## Running the regression tests under Valgrind' @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' check + $(MAKE) CHECKER='valgrind -q' runtests testall : tests SVGtests SAXtests -tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_PATTERN@ @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_SCHEMATRON@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@ - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) - @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests) +tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + @(cd doc/examples ; $(MAKE) tests) -valgrind: - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' tests - APItests: testapi$(EXEEXT) @echo "## Running the API regression tests this may take a little while" -@($(CHECKER) $(top_builddir)/testapi -q) @@ -2639,7 +2683,7 @@ echo "## It is normal to see 11 errors reported" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) + @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) Patterntests: xmllint$(EXEEXT) @(echo > .memdump) @@ -2671,19 +2715,19 @@ cleanup: -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o *.gcno -exec rm {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;) + -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) + -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) dist-source: distdir $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz dist-test: distdir (mkdir -p $(distdir)) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn xstc/Tests) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz @(rm -rf $(distdir)/xstc/Test) @@ -2702,13 +2746,13 @@ && mv xml2Conf.tmp xml2Conf.sh install-data-local: - @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) + $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) uninstall-local: rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c @@ -2720,7 +2764,7 @@ rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) tst: tst.c - $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz + $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma sparse: clean $(MAKE) CC=cgcc Index: lib/3rdparty/libxml2/missing =================================================================== --- lib/3rdparty/libxml2/missing (revision 58293) +++ lib/3rdparty/libxml2/missing (working copy) @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. Index: lib/3rdparty/libxml2/nanoftp.c =================================================================== --- lib/3rdparty/libxml2/nanoftp.c (revision 58293) +++ lib/3rdparty/libxml2/nanoftp.c (working copy) @@ -41,7 +41,7 @@ #include #endif #ifdef HAVE_FCNTL_H -#include +#include #endif #ifdef HAVE_ERRNO_H #include @@ -188,7 +188,7 @@ xmlNanoFTPInit(void) { const char *env; #ifdef _WINSOCKAPI_ - WSADATA wsaData; + WSADATA wsaData; #endif if (initialized) @@ -305,15 +305,15 @@ /* * Clear any existing data from the context */ - if (ctxt->protocol != NULL) { + if (ctxt->protocol != NULL) { xmlFree(ctxt->protocol); ctxt->protocol = NULL; } - if (ctxt->hostname != NULL) { + if (ctxt->hostname != NULL) { xmlFree(ctxt->hostname); ctxt->hostname = NULL; } - if (ctxt->path != NULL) { + if (ctxt->path != NULL) { xmlFree(ctxt->path); ctxt->path = NULL; } @@ -327,7 +327,7 @@ xmlFreeURI(uri); return; } - + ctxt->protocol = xmlMemStrdup(uri->scheme); ctxt->hostname = xmlMemStrdup(uri->server); if (uri->path != NULL) @@ -358,7 +358,7 @@ * @URL: The URL used to update the context * * Update an FTP context by parsing the URL and finding - * new path it indicates. If there is an error in the + * new path it indicates. If there is an error in the * protocol, hostname, port or other information, the * error is raised. It indicates a new connection has to * be established. @@ -403,7 +403,7 @@ ctxt->path = NULL; } - if (uri->path == NULL) + if (uri->path == NULL) ctxt->path = xmlMemStrdup("/"); else ctxt->path = xmlMemStrdup(uri->path); @@ -427,7 +427,7 @@ xmlNanoFTPScanProxy(const char *URL) { xmlURIPtr uri; - if (proxy != NULL) { + if (proxy != NULL) { xmlFree(proxy); proxy = NULL; } @@ -451,7 +451,7 @@ xmlFreeURI(uri); return; } - + proxy = xmlMemStrdup(uri->server); if (uri->port != 0) proxyPort = uri->port; @@ -523,7 +523,7 @@ * xmlNanoFTPParseResponse: * @buf: the buffer containing the response * @len: the buffer length - * + * * Parsing of the server answer, we just extract the code. * * returns 0 for errors @@ -535,22 +535,22 @@ int val = 0; if (len < 3) return(-1); - if ((*buf >= '0') && (*buf <= '9')) + if ((*buf >= '0') && (*buf <= '9')) val = val * 10 + (*buf - '0'); else return(0); buf++; - if ((*buf >= '0') && (*buf <= '9')) + if ((*buf >= '0') && (*buf <= '9')) val = val * 10 + (*buf - '0'); else return(0); buf++; - if ((*buf >= '0') && (*buf <= '9')) + if ((*buf >= '0') && (*buf <= '9')) val = val * 10 + (*buf - '0'); else return(0); buf++; - if (*buf == '-') + if (*buf == '-') return(-val); return(val); } @@ -749,7 +749,7 @@ case -1: __xmlIOErr(XML_FROM_FTP, 0, "select"); return(-1); - + } return(xmlNanoFTPReadResponse(ctx)); @@ -947,7 +947,8 @@ ((struct sockaddr_in *)&ctxt->ftpAddr)->sin_family = AF_INET; memcpy (&((struct sockaddr_in *)&ctxt->ftpAddr)->sin_addr, hp->h_addr_list[0], hp->h_length); - ((struct sockaddr_in *)&ctxt->ftpAddr)->sin_port = (u_short)htons ((unsigned short)port); + ((struct sockaddr_in *)&ctxt->ftpAddr)->sin_port = + (unsigned short)htons ((unsigned short)port); ctxt->controlFd = socket (AF_INET, SOCK_STREAM, 0); addrlen = sizeof (struct sockaddr_in); } @@ -1102,7 +1103,7 @@ /* we assume it worked :-\ 1 is error for SITE command */ proxyType = 1; break; - } + } if (proxyType == 1) { closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET; ctxt->controlFd = INVALID_SOCKET; @@ -1133,7 +1134,7 @@ /* we assume it worked :-\ */ proxyType = 2; return(0); - } + } if (ctxt->passwd == NULL) snprintf(buf, sizeof(buf), "PASS anonymous@\r\n"); else @@ -1238,7 +1239,7 @@ int res; xmlNanoFTPInit(); - if (server == NULL) + if (server == NULL) return(NULL); if (port <= 0) return(NULL); @@ -1331,7 +1332,7 @@ * 450, 550 * 500, 501, 502, 421, 530 */ - + snprintf(buf, sizeof(buf), "DELE %s\r\n", file); buf[sizeof(buf) - 1] = 0; len = strlen(buf); @@ -1429,7 +1430,7 @@ ctxt->passive = 0; } } - cur = &ctxt->controlBuf[ctxt->controlBufAnswer]; + cur = &ctxt->controlBuf[ctxt->controlBufAnswer]; while (((*cur < '0') || (*cur > '9')) && *cur != '\0') cur++; #ifdef SUPPORT_IP6 if ((ctxt->ftpAddr).ss_family == AF_INET6) { @@ -1524,7 +1525,7 @@ } } return(ctxt->dataFd); - + } /** @@ -1582,7 +1583,7 @@ * @callback: the user callback * @userData: the user callback data * - * Parse at most one entry from the listing. + * Parse at most one entry from the listing. * * Returns -1 incase of error, the length of data parsed otherwise */ @@ -1619,7 +1620,7 @@ if (*cur == 0) return(0); i = 0; while (*cur != ' ') { - if (i < 10) + if (i < 10) attrib[i++] = *cur; cur++; if (*cur == 0) return(0); @@ -1633,7 +1634,7 @@ if (*cur == 0) return(0); i = 0; while (*cur != ' ') { - if (i < 10) + if (i < 10) owner[i++] = *cur; cur++; if (*cur == 0) return(0); @@ -1643,7 +1644,7 @@ if (*cur == 0) return(0); i = 0; while (*cur != ' ') { - if (i < 10) + if (i < 10) group[i++] = *cur; cur++; if (*cur == 0) return(0); @@ -1985,7 +1986,7 @@ * * Start to fetch the given ftp:// resource * - * Returns an FTP context, or NULL + * Returns an FTP context, or NULL */ void* @@ -2042,9 +2043,9 @@ #ifdef STANDALONE /************************************************************************ - * * - * Basic test in Standalone mode * - * * + * * + * Basic test in Standalone mode * + * * ************************************************************************/ static void ftpList(void *userData, const char *filename, const char* attrib, @@ -2059,7 +2060,7 @@ if (len <= 0) { fclose((FILE*)userData); return; - } + } fwrite(data, len, 1, (FILE*)userData); } @@ -2091,7 +2092,7 @@ if (xmlNanoFTPGet(ctxt, ftpData, (void *) output, tstfile) < 0) xmlGenericError(xmlGenericErrorContext, "Failed to get file\n"); - + } xmlNanoFTPClose(ctxt); xmlMemoryDump(); Index: lib/3rdparty/libxml2/nanohttp.c =================================================================== --- lib/3rdparty/libxml2/nanohttp.c (revision 58293) +++ lib/3rdparty/libxml2/nanohttp.c (working copy) @@ -10,7 +10,7 @@ * * daniel@veillard.com */ - + #define NEED_SOCKETS #define IN_LIBXML #include "libxml.h" @@ -46,7 +46,7 @@ #include #endif #ifdef HAVE_FCNTL_H -#include +#include #endif #ifdef HAVE_ERRNO_H #include @@ -64,9 +64,6 @@ #ifdef HAVE_STRINGS_H #include #endif -#ifdef SUPPORT_IP6 -#include -#endif #ifdef HAVE_ZLIB_H #include #endif @@ -78,9 +75,9 @@ #endif #if defined(__MINGW32__) || defined(_WIN32_WCE) -/*#ifndef _WINSOCKAPI_ +#ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ -#endif*/ +#endif #include #include #undef XML_SOCKLEN_T @@ -216,7 +213,7 @@ xmlNanoHTTPInit(void) { const char *env; #ifdef _WINSOCKAPI_ - WSADATA wsaData; + WSADATA wsaData; #endif if (initialized) @@ -282,19 +279,19 @@ /* * Clear any existing data from the context */ - if (ctxt->protocol != NULL) { + if (ctxt->protocol != NULL) { xmlFree(ctxt->protocol); ctxt->protocol = NULL; } - if (ctxt->hostname != NULL) { + if (ctxt->hostname != NULL) { xmlFree(ctxt->hostname); ctxt->hostname = NULL; } - if (ctxt->path != NULL) { + if (ctxt->path != NULL) { xmlFree(ctxt->path); ctxt->path = NULL; } - if (ctxt->query != NULL) { + if (ctxt->query != NULL) { xmlFree(ctxt->query); ctxt->query = NULL; } @@ -308,7 +305,7 @@ xmlFreeURI(uri); return; } - + ctxt->protocol = xmlMemStrdup(uri->scheme); ctxt->hostname = xmlMemStrdup(uri->server); if (uri->path != NULL) @@ -337,7 +334,7 @@ xmlNanoHTTPScanProxy(const char *URL) { xmlURIPtr uri; - if (proxy != NULL) { + if (proxy != NULL) { xmlFree(proxy); proxy = NULL; } @@ -361,7 +358,7 @@ xmlFreeURI(uri); return; } - + proxy = xmlMemStrdup(uri->server); if (uri->port != 0) proxyPort = uri->port; @@ -647,7 +644,7 @@ char buf[4096]; char *bp = buf; int rc; - + while (bp - buf < 4095) { if (ctxt->inrptr == ctxt->inptr) { if ( (rc = xmlNanoHTTPRecv(ctxt)) == 0) { @@ -784,9 +781,9 @@ xmlFree(ctxt->location); if (*cur == '/') { xmlChar *tmp_http = xmlStrdup(BAD_CAST "http://"); - xmlChar *tmp_loc = + xmlChar *tmp_loc = xmlStrcat(tmp_http, (const xmlChar *) ctxt->hostname); - ctxt->location = + ctxt->location = (char *) xmlStrcat (tmp_loc, (const xmlChar *) cur); } else { ctxt->location = xmlMemStrdup(cur); @@ -1140,10 +1137,12 @@ "Non-recoverable errors: FORMERR, REFUSED, or NOTIMP."; break; +#ifdef NO_ADDRESS case NO_ADDRESS: h_err_txt = "Valid name, no data record of requested type."; break; +#endif default: h_err_txt = "No error text defined."; @@ -1166,7 +1165,7 @@ memcpy (&ia, h->h_addr_list[i], h->h_length); sockin.sin_family = h->h_addrtype; sockin.sin_addr = ia; - sockin.sin_port = (u_short)htons ((unsigned short)port); + sockin.sin_port = (unsigned short)htons ((unsigned short)port); addr = (struct sockaddr *) &sockin; #ifdef SUPPORT_IP6 } else if (have_ipv6 () && (h->h_addrtype == AF_INET6)) { @@ -1268,7 +1267,7 @@ #ifdef HAVE_ZLIB_H if (ctxt->usesGzip == 1) { if (ctxt->strm == NULL) return(0); - + ctxt->strm->next_out = dest; ctxt->strm->avail_out = len; ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr; @@ -1347,7 +1346,7 @@ #ifdef DEBUG_HTTP int xmt_bytes; #endif - + if (URL == NULL) return(NULL); if (method == NULL) method = "GET"; xmlNanoHTTPInit(); @@ -1428,13 +1427,13 @@ if (proxy) { if (ctxt->port != 80) { - p += snprintf( p, blen - (p - bp), "%s http://%s:%d%s", + p += snprintf( p, blen - (p - bp), "%s http://%s:%d%s", method, ctxt->hostname, - ctxt->port, ctxt->path ); + ctxt->port, ctxt->path ); } - else + else p += snprintf( p, blen - (p - bp), "%s http://%s%s", method, - ctxt->hostname, ctxt->path); + ctxt->hostname, ctxt->path); } else p += snprintf( p, blen - (p - bp), "%s %s", method, ctxt->path); @@ -1443,7 +1442,7 @@ p += snprintf( p, blen - (p - bp), "?%s", ctxt->query); if (ctxt->port == 80) { - p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s\r\n", + p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s\r\n", ctxt->hostname); } else { p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s:%d\r\n", @@ -1454,7 +1453,7 @@ p += snprintf(p, blen - (p - bp), "Accept-Encoding: gzip\r\n"); #endif - if (contentType != NULL && *contentType) + if (contentType != NULL && *contentType) p += snprintf(p, blen - (p - bp), "Content-Type: %s\r\n", *contentType); if (headers != NULL) @@ -1493,7 +1492,7 @@ if ( xmt_bytes != ilen ) xmlGenericError( xmlGenericErrorContext, - "xmlNanoHTTPMethodRedir: Only %d of %d %s %s\n", + "xmlNanoHTTPMethodRedir: Only %d of %d %s %s\n", xmt_bytes, ilen, "bytes of HTTP content sent to host", ctxt->hostname ); @@ -1615,12 +1614,13 @@ char *buf = NULL; int fd; int len; - + int ret = 0; + if (filename == NULL) return(-1); ctxt = xmlNanoHTTPOpen(URL, contentType); if (ctxt == NULL) return(-1); - if (!strcmp(filename, "-")) + if (!strcmp(filename, "-")) fd = 0; else { fd = open(filename, O_CREAT | O_WRONLY, 00644); @@ -1636,12 +1636,14 @@ xmlNanoHTTPFetchContent( ctxt, &buf, &len ); if ( len > 0 ) { - write(fd, buf, len); + if (write(fd, buf, len) == -1) { + ret = -1; + } } xmlNanoHTTPClose(ctxt); close(fd); - return(0); + return(ret); } #ifdef LIBXML_OUTPUT_ENABLED @@ -1660,10 +1662,11 @@ char *buf = NULL; int fd; int len; - + int ret = 0; + if ((ctxt == NULL) || (filename == NULL)) return(-1); - if (!strcmp(filename, "-")) + if (!strcmp(filename, "-")) fd = 0; else { fd = open(filename, O_CREAT | O_WRONLY, 0666); @@ -1675,12 +1678,14 @@ xmlNanoHTTPFetchContent( ctxt, &buf, &len ); if ( len > 0 ) { - write(fd, buf, len); + if (write(fd, buf, len) == -1) { + ret = -1; + } } xmlNanoHTTPClose(ctxt); close(fd); - return(0); + return(ret); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -1790,7 +1795,7 @@ * Check if all the content was read * * Returns 0 if all the content was read and available, returns - * -1 if received content length was less than specified or an error + * -1 if received content length was less than specified or an error * occurred. */ static int @@ -1844,7 +1849,7 @@ char *contentType = NULL; if (argv[1] != NULL) { - if (argv[2] != NULL) + if (argv[2] != NULL) xmlNanoHTTPFetch(argv[1], argv[2], &contentType); else xmlNanoHTTPFetch(argv[1], "-", &contentType); Index: lib/3rdparty/libxml2/parser.c =================================================================== --- lib/3rdparty/libxml2/parser.c (revision 58293) +++ lib/3rdparty/libxml2/parser.c (working copy) @@ -17,7 +17,7 @@ * parserInternals.c to reduce this file size. * As much as possible the functions are associated with their relative * production in the XML specification. A few productions defining the - * different ranges of character are actually implanted either in + * different ranges of character are actually implanted either in * parserInternals.h or parserInternals.c * The DOM tree build is realized from the default SAX callbacks in * the module SAX.c. @@ -40,6 +40,7 @@ #endif #include +#include #include #include #include @@ -79,7 +80,13 @@ #ifdef HAVE_ZLIB_H #include #endif +#ifdef HAVE_LZMA_H +#include +#endif +#include "buf.h" +#include "enc.h" + static void xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info); @@ -114,10 +121,10 @@ * parser option. */ static int -xmlParserEntityCheck(xmlParserCtxtPtr ctxt, unsigned long size, +xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, xmlEntityPtr ent) { - unsigned long consumed = 0; + size_t consumed = 0; if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE)) return (0); @@ -191,12 +198,24 @@ #define XML_PARSER_BUFFER_SIZE 100 #define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document" +/** + * XML_PARSER_CHUNK_SIZE + * + * When calling GROW that's the minimal amount of data + * the parser expected to have received. It is not a hard + * limit but an optimization when reading strings like Names + * It is not strictly needed as long as inputs available characters + * are followed by 0, which should be provided by the I/O level + */ +#define XML_PARSER_CHUNK_SIZE 100 + /* * List of XML prefixed PI allowed by W3C specs */ static const char *xmlW3CPIs[] = { "xml-stylesheet", + "xml-model", NULL }; @@ -229,7 +248,7 @@ /************************************************************************ * * - * Some factorized error routines * + * Some factorized error routines * * * ************************************************************************/ @@ -281,193 +300,201 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info) { const char *errmsg; + char errstr[129] = ""; if ((ctxt != NULL) && (ctxt->disableSAX != 0) && (ctxt->instate == XML_PARSER_EOF)) return; switch (error) { case XML_ERR_INVALID_HEX_CHARREF: - errmsg = "CharRef: invalid hexadecimal value\n"; + errmsg = "CharRef: invalid hexadecimal value"; break; case XML_ERR_INVALID_DEC_CHARREF: - errmsg = "CharRef: invalid decimal value\n"; + errmsg = "CharRef: invalid decimal value"; break; case XML_ERR_INVALID_CHARREF: - errmsg = "CharRef: invalid value\n"; + errmsg = "CharRef: invalid value"; break; case XML_ERR_INTERNAL_ERROR: errmsg = "internal error"; break; case XML_ERR_PEREF_AT_EOF: - errmsg = "PEReference at end of document\n"; + errmsg = "PEReference at end of document"; break; case XML_ERR_PEREF_IN_PROLOG: - errmsg = "PEReference in prolog\n"; + errmsg = "PEReference in prolog"; break; case XML_ERR_PEREF_IN_EPILOG: - errmsg = "PEReference in epilog\n"; + errmsg = "PEReference in epilog"; break; case XML_ERR_PEREF_NO_NAME: - errmsg = "PEReference: no name\n"; + errmsg = "PEReference: no name"; break; case XML_ERR_PEREF_SEMICOL_MISSING: - errmsg = "PEReference: expecting ';'\n"; + errmsg = "PEReference: expecting ';'"; break; case XML_ERR_ENTITY_LOOP: - errmsg = "Detected an entity reference loop\n"; + errmsg = "Detected an entity reference loop"; break; case XML_ERR_ENTITY_NOT_STARTED: - errmsg = "EntityValue: \" or ' expected\n"; + errmsg = "EntityValue: \" or ' expected"; break; case XML_ERR_ENTITY_PE_INTERNAL: - errmsg = "PEReferences forbidden in internal subset\n"; + errmsg = "PEReferences forbidden in internal subset"; break; case XML_ERR_ENTITY_NOT_FINISHED: - errmsg = "EntityValue: \" or ' expected\n"; + errmsg = "EntityValue: \" or ' expected"; break; case XML_ERR_ATTRIBUTE_NOT_STARTED: - errmsg = "AttValue: \" or ' expected\n"; + errmsg = "AttValue: \" or ' expected"; break; case XML_ERR_LT_IN_ATTRIBUTE: - errmsg = "Unescaped '<' not allowed in attributes values\n"; + errmsg = "Unescaped '<' not allowed in attributes values"; break; case XML_ERR_LITERAL_NOT_STARTED: - errmsg = "SystemLiteral \" or ' expected\n"; + errmsg = "SystemLiteral \" or ' expected"; break; case XML_ERR_LITERAL_NOT_FINISHED: - errmsg = "Unfinished System or Public ID \" or ' expected\n"; + errmsg = "Unfinished System or Public ID \" or ' expected"; break; case XML_ERR_MISPLACED_CDATA_END: - errmsg = "Sequence ']]>' not allowed in content\n"; + errmsg = "Sequence ']]>' not allowed in content"; break; case XML_ERR_URI_REQUIRED: - errmsg = "SYSTEM or PUBLIC, the URI is missing\n"; + errmsg = "SYSTEM or PUBLIC, the URI is missing"; break; case XML_ERR_PUBID_REQUIRED: - errmsg = "PUBLIC, the Public Identifier is missing\n"; + errmsg = "PUBLIC, the Public Identifier is missing"; break; case XML_ERR_HYPHEN_IN_COMMENT: - errmsg = "Comment must not contain '--' (double-hyphen)\n"; + errmsg = "Comment must not contain '--' (double-hyphen)"; break; case XML_ERR_PI_NOT_STARTED: - errmsg = "xmlParsePI : no target name\n"; + errmsg = "xmlParsePI : no target name"; break; case XML_ERR_RESERVED_XML_NAME: - errmsg = "Invalid PI name\n"; + errmsg = "Invalid PI name"; break; case XML_ERR_NOTATION_NOT_STARTED: - errmsg = "NOTATION: Name expected here\n"; + errmsg = "NOTATION: Name expected here"; break; case XML_ERR_NOTATION_NOT_FINISHED: - errmsg = "'>' required to close NOTATION declaration\n"; + errmsg = "'>' required to close NOTATION declaration"; break; case XML_ERR_VALUE_REQUIRED: - errmsg = "Entity value required\n"; + errmsg = "Entity value required"; break; case XML_ERR_URI_FRAGMENT: errmsg = "Fragment not allowed"; break; case XML_ERR_ATTLIST_NOT_STARTED: - errmsg = "'(' required to start ATTLIST enumeration\n"; + errmsg = "'(' required to start ATTLIST enumeration"; break; case XML_ERR_NMTOKEN_REQUIRED: - errmsg = "NmToken expected in ATTLIST enumeration\n"; + errmsg = "NmToken expected in ATTLIST enumeration"; break; case XML_ERR_ATTLIST_NOT_FINISHED: - errmsg = "')' required to finish ATTLIST enumeration\n"; + errmsg = "')' required to finish ATTLIST enumeration"; break; case XML_ERR_MIXED_NOT_STARTED: - errmsg = "MixedContentDecl : '|' or ')*' expected\n"; + errmsg = "MixedContentDecl : '|' or ')*' expected"; break; case XML_ERR_PCDATA_REQUIRED: - errmsg = "MixedContentDecl : '#PCDATA' expected\n"; + errmsg = "MixedContentDecl : '#PCDATA' expected"; break; case XML_ERR_ELEMCONTENT_NOT_STARTED: - errmsg = "ContentDecl : Name or '(' expected\n"; + errmsg = "ContentDecl : Name or '(' expected"; break; case XML_ERR_ELEMCONTENT_NOT_FINISHED: - errmsg = "ContentDecl : ',' '|' or ')' expected\n"; + errmsg = "ContentDecl : ',' '|' or ')' expected"; break; case XML_ERR_PEREF_IN_INT_SUBSET: errmsg = - "PEReference: forbidden within markup decl in internal subset\n"; + "PEReference: forbidden within markup decl in internal subset"; break; case XML_ERR_GT_REQUIRED: - errmsg = "expected '>'\n"; + errmsg = "expected '>'"; break; case XML_ERR_CONDSEC_INVALID: - errmsg = "XML conditional section '[' expected\n"; + errmsg = "XML conditional section '[' expected"; break; case XML_ERR_EXT_SUBSET_NOT_FINISHED: - errmsg = "Content error in the external subset\n"; + errmsg = "Content error in the external subset"; break; case XML_ERR_CONDSEC_INVALID_KEYWORD: errmsg = - "conditional section INCLUDE or IGNORE keyword expected\n"; + "conditional section INCLUDE or IGNORE keyword expected"; break; case XML_ERR_CONDSEC_NOT_FINISHED: - errmsg = "XML conditional section not closed\n"; + errmsg = "XML conditional section not closed"; break; case XML_ERR_XMLDECL_NOT_STARTED: - errmsg = "Text declaration '' expected\n"; + errmsg = "parsing XML declaration: '?>' expected"; break; case XML_ERR_EXT_ENTITY_STANDALONE: - errmsg = "external parsed entities cannot be standalone\n"; + errmsg = "external parsed entities cannot be standalone"; break; case XML_ERR_ENTITYREF_SEMICOL_MISSING: - errmsg = "EntityRef: expecting ';'\n"; + errmsg = "EntityRef: expecting ';'"; break; case XML_ERR_DOCTYPE_NOT_FINISHED: - errmsg = "DOCTYPE improperly terminated\n"; + errmsg = "DOCTYPE improperly terminated"; break; case XML_ERR_LTSLASH_REQUIRED: - errmsg = "EndTag: 'errNo = error; __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, - XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, errmsg, + XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, &errstr[0], info); if (ctxt != NULL) { ctxt->wellFormed = 0; @@ -622,7 +649,7 @@ */ static void xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, - const char *msg, const xmlChar *str1, int val, + const char *msg, const xmlChar *str1, int val, const xmlChar *str2) { if ((ctxt != NULL) && (ctxt->disableSAX != 0) && @@ -731,7 +758,7 @@ * @info1: extra information string * @info2: extra information string * - * Handle a fatal parser error, i.e. violating Well-Formedness constraints + * Handle a namespace warning error */ static void xmlNsWarn(xmlParserCtxtPtr ctxt, xmlParserErrors error, @@ -750,7 +777,7 @@ /************************************************************************ * * - * Library wide options * + * Library wide options * * * ************************************************************************/ @@ -954,6 +981,12 @@ #else return(0); #endif + case XML_WITH_LZMA: +#ifdef LIBXML_LZMA_ENABLED + return(1); +#else + return(0); +#endif case XML_WITH_ICU: #ifdef LIBXML_ICU_ENABLED return(1); @@ -968,7 +1001,7 @@ /************************************************************************ * * - * SAX2 defaulted attributes handling * + * SAX2 defaulted attributes handling * * * ************************************************************************/ @@ -992,8 +1025,8 @@ 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); - if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) || - (ctxt->str_xml_ns == NULL)) { + if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) || + (ctxt->str_xml_ns == NULL)) { xmlErrMemory(ctxt, NULL); } } @@ -1819,15 +1852,14 @@ if (ctxt->nameNr >= ctxt->nameMax) { const xmlChar * *tmp; - ctxt->nameMax *= 2; tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab, - ctxt->nameMax * + ctxt->nameMax * 2 * sizeof(ctxt->nameTab[0])); if (tmp == NULL) { - ctxt->nameMax /= 2; goto mem_error; } ctxt->nameTab = tmp; + ctxt->nameMax *= 2; } ctxt->nameTab[ctxt->nameNr] = value; ctxt->name = value; @@ -1913,7 +1945,7 @@ * to compare on ASCII based substring. * SKIP(n) Skip n xmlChar, and must also be used only to skip ASCII defined * strings without newlines within the parser. - * NEXT1(l) Skip 1 xmlChar, and must also be used only to skip 1 non-newline ASCII + * NEXT1(l) Skip 1 xmlChar, and must also be used only to skip 1 non-newline ASCII * defined char within the parser. * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding * @@ -1962,10 +1994,10 @@ #define SKIPL(val) do { \ int skipl; \ for(skipl=0; skiplinput->cur) == '\n') { \ + if (*(ctxt->input->cur) == '\n') { \ ctxt->input->line++; ctxt->input->col = 1; \ - } else ctxt->input->col++; \ - ctxt->nbChars++; \ + } else ctxt->input->col++; \ + ctxt->nbChars++; \ ctxt->input->cur++; \ } \ if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \ @@ -1991,6 +2023,12 @@ xmlGROW (ctxt); static void xmlGROW (xmlParserCtxtPtr ctxt) { + if ((((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) || + ((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"); + ctxt->instate = XML_PARSER_EOF; + } xmlParserInputGrow(ctxt->input, INPUT_CHUNK); if ((ctxt->input->cur != NULL) && (*ctxt->input->cur == 0) && (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) @@ -2135,6 +2173,8 @@ "Pushing input %d : %.30s\n", ctxt->inputNr+1, input->cur); } ret = inputPush(ctxt, input); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); GROW; return(ret); } @@ -2150,7 +2190,7 @@ * * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. * * Returns the value parsed (as an int), 0 in case of error */ @@ -2171,8 +2211,10 @@ if (count++ > 20) { count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(0); } - if ((RAW >= '0') && (RAW <= '9')) + if ((RAW >= '0') && (RAW <= '9')) val = val * 16 + (CUR - '0'); else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20)) val = val * 16 + (CUR - 'a') + 10; @@ -2202,8 +2244,10 @@ if (count++ > 20) { count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(0); } - if ((RAW >= '0') && (RAW <= '9')) + if ((RAW >= '0') && (RAW <= '9')) val = val * 10 + (CUR - '0'); else { xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL); @@ -2229,7 +2273,7 @@ /* * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. */ if ((IS_CHAR(val) && (outofrange == 0))) { return(val); @@ -2254,7 +2298,7 @@ * * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. * * Returns the value parsed (as an int), 0 in case of error, str will be * updated to the current value of the index @@ -2273,7 +2317,7 @@ ptr += 3; cur = *ptr; while (cur != ';') { /* Non input consuming loop */ - if ((cur >= '0') && (cur <= '9')) + if ((cur >= '0') && (cur <= '9')) val = val * 16 + (cur - '0'); else if ((cur >= 'a') && (cur <= 'f')) val = val * 16 + (cur - 'a') + 10; @@ -2296,7 +2340,7 @@ ptr += 2; cur = *ptr; while (cur != ';') { /* Non input consuming loops */ - if ((cur >= '0') && (cur <= '9')) + if ((cur >= '0') && (cur <= '9')) val = val * 10 + (cur - '0'); else { xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL); @@ -2320,7 +2364,7 @@ /* * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. */ if ((IS_CHAR(val) && (outofrange == 0))) { return(val); @@ -2342,9 +2386,9 @@ * * Returns the new input stream or NULL */ - + static void deallocblankswrapper (xmlChar *str) {xmlFree(str);} - + static xmlParserInputPtr xmlNewBlanksWrapperInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { xmlParserInputPtr input; @@ -2367,7 +2411,7 @@ if (buffer == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(input); - return(NULL); + return(NULL); } buffer [0] = ' '; buffer [1] = '%'; @@ -2386,12 +2430,12 @@ /** * xmlParserHandlePEReference: * @ctxt: the parser context - * + * * [69] PEReference ::= '%' Name ';' * * [ WFC: No Recursion ] * A parsed entity must not contain a recursive - * reference to itself, either directly or indirectly. + * reference to itself, either directly or indirectly. * * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an internal DTD @@ -2409,9 +2453,9 @@ * NOTE: misleading but this is handled. * * A PEReference may have been detected in the current input stream - * the handling is done accordingly to + * the handling is done accordingly to * http://www.w3.org/TR/REC-xml#entproc - * i.e. + * i.e. * - Included in literal in entity values * - Included as Parameter Entity reference within DTDs */ @@ -2489,7 +2533,7 @@ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) entity = ctxt->sax->getParameterEntity(ctxt->userData, name); if (entity == NULL) { - + /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an @@ -2515,7 +2559,7 @@ xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); - } else + } else xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); @@ -2540,7 +2584,7 @@ if (xmlPushInput(ctxt, input) < 0) return; - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -2550,6 +2594,8 @@ * 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); @@ -2580,15 +2626,17 @@ /* * Macro used to grow the current buffer. + * buffer##_size is expected to be a size_t + * mem_error: is expected to handle memory allocation failures */ #define growBuffer(buffer, n) { \ xmlChar *tmp; \ - buffer##_size *= 2; \ - buffer##_size += n; \ - tmp = (xmlChar *) \ - xmlRealloc(buffer, buffer##_size * sizeof(xmlChar)); \ + size_t new_size = buffer##_size * 2 + n; \ + if (new_size < buffer##_size) goto mem_error; \ + tmp = (xmlChar *) xmlRealloc(buffer, new_size); \ if (tmp == NULL) goto mem_error; \ buffer = tmp; \ + buffer##_size = new_size; \ } /** @@ -2600,7 +2648,7 @@ * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * Takes a entity string content and process to do the adequate substitutions. * * [67] Reference ::= EntityRef | CharRef @@ -2614,14 +2662,14 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3) { xmlChar *buffer = NULL; - int buffer_size = 0; + size_t buffer_size = 0; + size_t nbchars = 0; xmlChar *current = NULL; xmlChar *rep = NULL; const xmlChar *last; xmlEntityPtr ent; int c,l; - int nbchars = 0; if ((ctxt == NULL) || (str == NULL) || (len < 0)) return(NULL); @@ -2638,7 +2686,7 @@ * allocate a translation buffer. */ buffer_size = XML_PARSER_BIG_BUFFER_SIZE; - buffer = (xmlChar *) xmlMallocAtomic(buffer_size * sizeof(xmlChar)); + buffer = (xmlChar *) xmlMallocAtomic(buffer_size); if (buffer == NULL) goto mem_error; /* @@ -2658,7 +2706,7 @@ if (val != 0) { COPY_BUF(0,buffer,nbchars,val); } - if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } } else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) { @@ -2676,7 +2724,7 @@ (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { if (ent->content != NULL) { COPY_BUF(0,buffer,nbchars,ent->content[0]); - if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } } else { @@ -2693,8 +2741,7 @@ current = rep; while (*current != 0) { /* non input consuming loop */ buffer[nbchars++] = *current++; - if (nbchars > - buffer_size - XML_PARSER_BUFFER_SIZE) { + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { if (xmlParserEntityCheck(ctxt, nbchars, ent)) goto int_error; growBuffer(buffer, XML_PARSER_BUFFER_SIZE); @@ -2708,8 +2755,8 @@ const xmlChar *cur = ent->name; buffer[nbchars++] = '&'; - if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) { - growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + if (nbchars + i + XML_PARSER_BUFFER_SIZE > buffer_size) { + growBuffer(buffer, i + XML_PARSER_BUFFER_SIZE); } for (;i > 0;i--) buffer[nbchars++] = *cur++; @@ -2736,8 +2783,7 @@ current = rep; while (*current != 0) { /* non input consuming loop */ buffer[nbchars++] = *current++; - if (nbchars > - buffer_size - XML_PARSER_BUFFER_SIZE) { + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { if (xmlParserEntityCheck(ctxt, nbchars, ent)) goto int_error; growBuffer(buffer, XML_PARSER_BUFFER_SIZE); @@ -2750,8 +2796,8 @@ } else { COPY_BUF(l,buffer,nbchars,c); str += l; - if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { - growBuffer(buffer, XML_PARSER_BUFFER_SIZE); + if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { + growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } } if (str < last) @@ -2780,7 +2826,7 @@ * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * Takes a entity string content and process to do the adequate substitutions. * * [67] Reference ::= EntityRef | CharRef @@ -3143,7 +3189,7 @@ } else { if ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c))) return(1); @@ -3168,6 +3214,8 @@ * Handler for more complex cases */ GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); c = CUR_CHAR(l); if ((ctxt->options & XML_PARSE_OLD10) == 0) { /* @@ -3216,9 +3264,11 @@ ((c >= 0xFDF0) && (c <= 0xFFFD)) || ((c >= 0x10000) && (c <= 0xEFFFF)) )) { - if (count++ > 100) { + if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); } len += l; NEXTL(l); @@ -3237,18 +3287,32 @@ while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c)))) { - if (count++ > 100) { + if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); } len += l; NEXTL(l); c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); + c = CUR_CHAR(l); + } } } + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name"); + 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)); @@ -3298,6 +3362,11 @@ in++; if ((*in > 0) && (*in < 0x80)) { count = in - ctxt->input->cur; + if ((count > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name"); + return(NULL); + } ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count); ctxt->input->cur = in; ctxt->nbChars += count; @@ -3333,14 +3402,33 @@ while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ (xmlIsNameChar(ctxt, c) && (c != ':'))) { - if (count++ > 100) { + if (count++ > XML_PARSER_CHUNK_SIZE) { + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); } len += l; NEXTL(l); c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); + c = CUR_CHAR(l); + } } + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); } @@ -3385,6 +3473,11 @@ in++; if ((*in > 0) && (*in < 0x80)) { count = in - ctxt->input->cur; + if ((count > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count); ctxt->input->cur = in; ctxt->nbChars += count; @@ -3416,6 +3509,8 @@ const xmlChar *ret; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); in = ctxt->input->cur; while (*in != 0 && *in == *cmp) { @@ -3451,7 +3546,7 @@ * * [6] Names ::= Name (#x20 Name)* * - * Returns the Name parsed or NULL. The @str pointer + * Returns the Name parsed or NULL. The @str pointer * is updated to the current location in the string. */ @@ -3495,6 +3590,13 @@ while (xmlIsNameChar(ctxt, c)) { if (len + 10 > max) { xmlChar *tmp; + + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + xmlFree(buffer); + return(NULL); + } max *= 2; tmp = (xmlChar *) xmlRealloc(buffer, max * sizeof(xmlChar)); @@ -3514,6 +3616,11 @@ return(buffer); } } + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } *str = cur; return(xmlStrndup(buf, len)); } @@ -3543,16 +3650,25 @@ #endif GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); c = CUR_CHAR(l); while (xmlIsNameChar(ctxt, c)) { - if (count++ > 100) { + if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; } COPY_BUF(l,buf,len,c); NEXTL(l); c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); + c = CUR_CHAR(l); + } if (len >= XML_MAX_NAMELEN) { /* * Okay someone managed to make a huge token, so he's ready to pay @@ -3568,13 +3684,23 @@ } memcpy(buffer, buf, len); while (xmlIsNameChar(ctxt, c)) { - if (count++ > 100) { + if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buffer); + return(NULL); + } } if (len + 10 > max) { xmlChar *tmp; + if ((max > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); + xmlFree(buffer); + return(NULL); + } max *= 2; tmp = (xmlChar *) xmlRealloc(buffer, max * sizeof(xmlChar)); @@ -3595,6 +3721,11 @@ } if (len == 0) return(NULL); + if ((len > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); + return(NULL); + } return(xmlStrndup(buf, len)); } @@ -3641,6 +3772,10 @@ ctxt->instate = XML_PARSER_ENTITY_VALUE; input = ctxt->input; GROW; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return(NULL); + } NEXT; c = CUR_CHAR(l); /* @@ -3648,12 +3783,12 @@ * When a parameter entity reference appears in a literal entity * value, ... a single or double quote character in the replacement * text is always treated as a normal data character and will not - * terminate the literal. + * terminate the literal. * In practice it means we stop the loop only when back at parsing * the initial entity and the quote is found */ - while ((IS_CHAR(c)) && ((c != stop) || /* checked */ - (ctxt->input != input))) { + while (((IS_CHAR(c)) && ((c != stop) || /* checked */ + (ctxt->input != input))) && (ctxt->instate != XML_PARSER_EOF)) { if (len + 5 >= size) { xmlChar *tmp; @@ -3682,6 +3817,10 @@ } } buf[len] = 0; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return(NULL); + } /* * Raise problem w.r.t. '&' and '%' being used in non-entities @@ -3729,12 +3868,12 @@ */ ret = xmlStringDecodeEntities(ctxt, buf, XML_SUBSTITUTE_PEREF, 0, 0, 0); - if (orig != NULL) + if (orig != NULL) *orig = buf; else xmlFree(buf); } - + return(ret); } @@ -3755,8 +3894,8 @@ xmlChar limit = 0; xmlChar *buf = NULL; xmlChar *rep = NULL; - int len = 0; - int buf_size = 0; + size_t len = 0; + size_t buf_size = 0; int c, l, in_space = 0; xmlChar *current = NULL; xmlEntityPtr ent; @@ -3778,15 +3917,26 @@ * allocate a translation buffer. */ buf_size = XML_PARSER_BUFFER_SIZE; - buf = (xmlChar *) xmlMallocAtomic(buf_size * sizeof(xmlChar)); + buf = (xmlChar *) xmlMallocAtomic(buf_size); if (buf == NULL) goto mem_error; /* * OK loop until we reach one of the ending char or a size limit. */ c = CUR_CHAR(l); - while ((NXT(0) != limit) && /* checked */ - (IS_CHAR(c)) && (c != '<')) { + while (((NXT(0) != limit) && /* checked */ + (IS_CHAR(c)) && (c != '<')) && + (ctxt->instate != XML_PARSER_EOF)) { + /* + * Impose a reasonable limit on attribute size, unless XML_PARSE_HUGE + * special option is given + */ + if ((len > XML_MAX_TEXT_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, + "AttValue lenght too long\n"); + goto mem_error; + } if (c == 0) break; if (c == '&') { in_space = 0; @@ -3795,7 +3945,7 @@ if (val == '&') { if (ctxt->replaceEntities) { - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } buf[len++] = '&'; @@ -3804,7 +3954,7 @@ * The reparsing will be done in xmlStringGetNodeList() * called by the attribute() function in SAX.c */ - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } buf[len++] = '&'; @@ -3814,7 +3964,7 @@ buf[len++] = ';'; } } else if (val != 0) { - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } len += xmlCopyChar(0, &buf[len], val); @@ -3826,7 +3976,7 @@ ctxt->nbentities += ent->owner; if ((ent != NULL) && (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } if ((ctxt->replaceEntities == 0) && @@ -3839,7 +3989,7 @@ } else { buf[len++] = ent->content[0]; } - } else if ((ent != NULL) && + } else if ((ent != NULL) && (ctxt->replaceEntities != 0)) { if (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) { rep = xmlStringDecodeEntities(ctxt, ent->content, @@ -3854,7 +4004,7 @@ current++; } else buf[len++] = *current++; - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } } @@ -3862,7 +4012,7 @@ rep = NULL; } } else { - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } if (ent->content != NULL) @@ -3890,7 +4040,7 @@ * Just output the reference */ buf[len++] = '&'; - while (len > buf_size - i - 10) { + while (len + i + 10 > buf_size) { growBuffer(buf, i + 10); } for (;i > 0;i--) @@ -3903,7 +4053,7 @@ if ((len != 0) || (!normalize)) { if ((!normalize) || (!in_space)) { COPY_BUF(l,buf,len,0x20); - while (len > buf_size - 10) { + while (len + 10 > buf_size) { growBuffer(buf, 10); } } @@ -3912,7 +4062,7 @@ } else { in_space = 0; COPY_BUF(l,buf,len,c); - if (len > buf_size - 10) { + if (len + 10 > buf_size) { growBuffer(buf, 10); } } @@ -3921,6 +4071,9 @@ GROW; c = CUR_CHAR(l); } + if (ctxt->instate == XML_PARSER_EOF) + goto error; + if ((in_space) && (normalize)) { while (buf[len - 1] == 0x20) len--; } @@ -3937,11 +4090,23 @@ } } else NEXT; - if (attlen != NULL) *attlen = len; + + /* + * There we potentially risk an overflow, don't allow attribute value of + * lenght more than INT_MAX it is a very reasonnable assumption ! + */ + if (len >= INT_MAX) { + xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, + "AttValue lenght too long\n"); + goto mem_error; + } + + if (attlen != NULL) *attlen = (int) len; return(buf); mem_error: xmlErrMemory(ctxt, NULL); +error: if (buf != NULL) xmlFree(buf); if (rep != NULL) @@ -3962,20 +4127,20 @@ * * 3.3.3 Attribute-Value Normalization: * Before the value of an attribute is passed to the application or - * checked for validity, the XML processor must normalize it as follows: + * checked for validity, the XML processor must normalize it as follows: * - a character reference is processed by appending the referenced * character to the attribute value * - an entity reference is processed by recursively processing the - * replacement text of the entity + * replacement text of the entity * - a whitespace character (#x20, #xD, #xA, #x9) is processed by * appending #x20 to the normalized value, except that only a single * #x20 is appended for a "#xD#xA" sequence that is part of an external - * parsed entity or the literal entity value of an internal parsed entity - * - other characters are processed by appending them to the normalized value + * parsed entity or the literal entity value of an internal parsed entity + * - other characters are processed by appending them to the normalized value * If the declared value is not CDATA, then the XML processor must further * process the normalized attribute value by discarding any leading and * trailing space (#x20) characters, and by replacing sequences of space - * (#x20) characters by a single space (#x20) character. + * (#x20) characters by a single space (#x20) character. * All attributes for which no declaration has been read should be treated * by a non-validating parser as if declared CDATA. * @@ -3992,7 +4157,7 @@ /** * xmlParseSystemLiteral: * @ctxt: an XML parser context - * + * * parse an XML Literal * * [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") @@ -4021,7 +4186,7 @@ xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL); return(NULL); } - + buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); @@ -4033,6 +4198,13 @@ if (len + 5 >= size) { xmlChar *tmp; + if ((size > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); + xmlFree(buf); + ctxt->instate = (xmlParserInputState) state; + return(NULL); + } size *= 2; tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { @@ -4047,6 +4219,10 @@ if (count > 50) { GROW; count = 0; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return(NULL); + } } COPY_BUF(l,buf,len,cur); NEXTL(l); @@ -4110,6 +4286,12 @@ if (len + 1 >= size) { xmlChar *tmp; + if ((size > XML_MAX_NAME_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); + xmlFree(buf); + return(NULL); + } size *= 2; tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { @@ -4124,6 +4306,10 @@ if (count > 50) { GROW; count = 0; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return(NULL); + } } NEXT; cur = CUR; @@ -4194,7 +4380,7 @@ * The right angle bracket (>) may be represented using the string ">", * and must, for compatibility, be escaped using ">" or a character * reference when it appears in the string "]]>" in content, when that - * string is not marking the end of a CDATA section. + * string is not marking the end of a CDATA section. * * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) */ @@ -4330,6 +4516,8 @@ } SHRINK; GROW; + if (ctxt->instate == XML_PARSER_EOF) + return; in = ctxt->input->cur; } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09)); nbchar = 0; @@ -4359,7 +4547,7 @@ GROW; cur = CUR_CHAR(l); while ((cur != '<') && /* checked */ - (cur != '&') && + (cur != '&') && (IS_CHAR(cur))) /* test also done in xmlCurrentChar() */ { if ((cur == ']') && (NXT(1) == ']') && (NXT(2) == '>')) { @@ -4398,6 +4586,8 @@ if (count > 50) { GROW; count = 0; + if (ctxt->instate == XML_PARSER_EOF) + return; } NEXTL(l); cur = CUR_CHAR(l); @@ -4490,7 +4680,7 @@ } } else { /* - * We handle [83] so we return immediately, if + * We handle [83] so we return immediately, if * "S SystemLiteral" is not detected. From a purely parsing * point of view that's a nice mess. */ @@ -4499,7 +4689,7 @@ ptr = CUR_PTR; if (!IS_BLANK_CH(*ptr)) return(NULL); - + while (IS_BLANK_CH(*ptr)) ptr++; /* TODO: dangerous, fix ! */ if ((*ptr != '\'') && (*ptr != '"')) return(NULL); } @@ -4527,11 +4717,12 @@ * [15] Comment ::= '' */ static void -xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, int len, int size) { +xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, + size_t len, size_t size) { int q, ql; int r, rl; int cur, l; - int count = 0; + size_t count = 0; int inputid; inputid = ctxt->input->id; @@ -4577,16 +4768,26 @@ if ((r == '-') && (q == '-')) { xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL); } + if ((len > XML_MAX_TEXT_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, + "Comment too big found", NULL); + xmlFree (buf); + return; + } if (len + 5 >= size) { xmlChar *new_buf; - size *= 2; - new_buf = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); + size_t new_size; + + new_size = size * 2; + new_buf = (xmlChar *) xmlRealloc(buf, new_size); if (new_buf == NULL) { xmlFree (buf); xmlErrMemory(ctxt, NULL); return; } buf = new_buf; + size = new_size; } COPY_BUF(ql,buf,len,q); q = r; @@ -4598,6 +4799,10 @@ if (count > 50) { GROW; count = 0; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return; + } } NEXTL(l); cur = CUR_CHAR(l); @@ -4647,11 +4852,12 @@ void xmlParseComment(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; - int size = XML_PARSER_BUFFER_SIZE; - int len = 0; + size_t size = XML_PARSER_BUFFER_SIZE; + size_t len = 0; xmlParserInputState state; const xmlChar *in; - int nbchar = 0, ccol; + size_t nbchar = 0; + int ccol; int inputid; /* @@ -4731,6 +4937,13 @@ buf[len] = 0; } } + if ((len > XML_MAX_TEXT_LENGTH) && + ((ctxt->options & XML_PARSE_HUGE) == 0)) { + xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, + "Comment too big found", NULL); + xmlFree (buf); + return; + } ctxt->input->cur = in; if (*in == 0xA) { in++; @@ -4748,6 +4961,10 @@ } SHRINK; GROW; + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(buf); + return; + } in = ctxt->input->cur; if (*in == '-') { if (in[1] == '-') { @@ -4769,13 +4986,14 @@ ctxt->instate = state; return; } - if (buf != NULL) - xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment not terminated \n" }, + { "Huge PI node", "huge:piNode", "" }, +}; + +static const char *current; +static int rlen; +static unsigned int currentTest = 0; +static int instate = 0; + +/** + * hugeMatch: + * @URI: an URI to test + * + * Check for an huge: query + * + * Returns 1 if yes and 0 if another Input module should be used + */ +static int +hugeMatch(const char * URI) { + if ((URI != NULL) && (!strncmp(URI, "huge:", 5))) + return(1); + return(0); +} + +/** + * hugeOpen: + * @URI: an URI to test + * + * Return a pointer to the huge: query handler, in this example simply + * the current pointer... + * + * Returns an Input context or NULL in case or error + */ +static void * +hugeOpen(const char * URI) { + if ((URI == NULL) || (strncmp(URI, "huge:", 5))) + return(NULL); + + for (currentTest = 0;currentTest < sizeof(hugeTests)/sizeof(hugeTests[0]); + currentTest++) + if (!strcmp(hugeTests[currentTest].name, URI)) + goto found; + + return(NULL); + +found: + rlen = strlen(hugeTests[currentTest].start); + current = hugeTests[currentTest].start; + instate = 0; + return((void *) current); +} + +/** + * hugeClose: + * @context: the read context + * + * Close the huge: query handler + * + * Returns 0 or -1 in case of error + */ +static int +hugeClose(void * context) { + if (context == NULL) return(-1); + fprintf(stderr, "\n"); + return(0); +} + +#define CHUNK 4096 + +char filling[CHUNK + 1]; + +static void fillFilling(void) { + int i; + + for (i = 0;i < CHUNK;i++) { + filling[i] = 'a'; + } + filling[CHUNK] = 0; +} + +size_t maxlen = 64 * 1024 * 1024; +size_t curlen = 0; +size_t dotlen; + +/** + * hugeRead: + * @context: the read context + * @buffer: where to store data + * @len: number of bytes to read + * + * Implement an huge: query read. + * + * Returns the number of bytes read or -1 in case of error + */ +static int +hugeRead(void *context, char *buffer, int len) +{ + if ((context == NULL) || (buffer == NULL) || (len < 0)) + return (-1); + + if (instate == 0) { + if (len >= rlen) { + len = rlen; + rlen = 0; + memcpy(buffer, current, len); + instate = 1; + curlen = 0; + dotlen = maxlen / 10; + } else { + memcpy(buffer, current, len); + rlen -= len; + current += len; + } + } else if (instate == 2) { + if (len >= rlen) { + len = rlen; + rlen = 0; + memcpy(buffer, current, len); + instate = 3; + curlen = 0; + } else { + memcpy(buffer, current, len); + rlen -= len; + current += len; + } + } else if (instate == 1) { + if (len > CHUNK) len = CHUNK; + memcpy(buffer, &filling[0], len); + curlen += len; + if (curlen >= maxlen) { + rlen = strlen(hugeTests[currentTest].end); + current = hugeTests[currentTest].end; + instate = 2; + } else { + if (curlen > dotlen) { + fprintf(stderr, "."); + dotlen += maxlen / 10; + } + } + } else + len = 0; + return (len); +} + +/************************************************************************ + * * + * Crazy document generator * + * * + ************************************************************************/ + +unsigned int crazy_indx = 0; + +const char *crazy = "\ +\ +\ +\ +\ +\ +\ +]>\ +\ +\ +\ +\ +\ +foo\ +\ +\ +\ +"; + +/** + * crazyMatch: + * @URI: an URI to test + * + * Check for a crazy: query + * + * Returns 1 if yes and 0 if another Input module should be used + */ +static int +crazyMatch(const char * URI) { + if ((URI != NULL) && (!strncmp(URI, "crazy:", 6))) + return(1); + return(0); +} + +/** + * crazyOpen: + * @URI: an URI to test + * + * Return a pointer to the crazy: query handler, in this example simply + * the current pointer... + * + * Returns an Input context or NULL in case or error + */ +static void * +crazyOpen(const char * URI) { + if ((URI == NULL) || (strncmp(URI, "crazy:", 6))) + return(NULL); + + if (crazy_indx > strlen(crazy)) + return(NULL); + reset_timout(); + rlen = crazy_indx; + current = &crazy[0]; + instate = 0; + return((void *) current); +} + +/** + * crazyClose: + * @context: the read context + * + * Close the crazy: query handler + * + * Returns 0 or -1 in case of error + */ +static int +crazyClose(void * context) { + if (context == NULL) return(-1); + return(0); +} + + +/** + * crazyRead: + * @context: the read context + * @buffer: where to store data + * @len: number of bytes to read + * + * Implement an crazy: query read. + * + * Returns the number of bytes read or -1 in case of error + */ +static int +crazyRead(void *context, char *buffer, int len) +{ + if ((context == NULL) || (buffer == NULL) || (len < 0)) + return (-1); + + if ((check_time() <= 0) && (instate == 1)) { + fprintf(stderr, "\ntimeout in crazy(%d)\n", crazy_indx); + rlen = strlen(crazy) - crazy_indx; + current = &crazy[crazy_indx]; + instate = 2; + } + if (instate == 0) { + if (len >= rlen) { + len = rlen; + rlen = 0; + memcpy(buffer, current, len); + instate = 1; + curlen = 0; + } else { + memcpy(buffer, current, len); + rlen -= len; + current += len; + } + } else if (instate == 2) { + if (len >= rlen) { + len = rlen; + rlen = 0; + memcpy(buffer, current, len); + instate = 3; + curlen = 0; + } else { + memcpy(buffer, current, len); + rlen -= len; + current += len; + } + } else if (instate == 1) { + if (len > CHUNK) len = CHUNK; + memcpy(buffer, &filling[0], len); + curlen += len; + if (curlen >= maxlen) { + rlen = strlen(crazy) - crazy_indx; + current = &crazy[crazy_indx]; + instate = 2; + } + } else + len = 0; + return (len); +} +/************************************************************************ + * * + * Libxml2 specific routines * + * * + ************************************************************************/ + +static int nb_tests = 0; +static int nb_errors = 0; +static int nb_leaks = 0; +static int extraMemoryFromResolver = 0; + +/* + * We need to trap calls to the resolver to not account memory for the catalog + * which is shared to the current running test. We also don't want to have + * network downloads modifying tests. + */ +static xmlParserInputPtr +testExternalEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt) { + xmlParserInputPtr ret; + int memused = xmlMemUsed(); + + ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); + extraMemoryFromResolver += xmlMemUsed() - memused; + + return(ret); +} + +/* + * Trapping the error messages at the generic level to grab the equivalent of + * stderr messages on CLI tools. + */ +static char testErrors[32769]; +static int testErrorsSize = 0; + +static void XMLCDECL +channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { + va_list args; + int res; + + if (testErrorsSize >= 32768) + return; + va_start(args, msg); + res = vsnprintf(&testErrors[testErrorsSize], + 32768 - testErrorsSize, + msg, args); + va_end(args); + if (testErrorsSize + res >= 32768) { + /* buffer is full */ + testErrorsSize = 32768; + testErrors[testErrorsSize] = 0; + } else { + testErrorsSize += res; + } + testErrors[testErrorsSize] = 0; +} + +/** + * xmlParserPrintFileContext: + * @input: an xmlParserInputPtr input + * + * Displays current context within the input content for error tracking + */ + +static void +xmlParserPrintFileContextInternal(xmlParserInputPtr input , + xmlGenericErrorFunc chanl, void *data ) { + const xmlChar *cur, *base; + unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ + xmlChar content[81]; /* space for 80 chars + line terminator */ + xmlChar *ctnt; + + if (input == NULL) return; + cur = input->cur; + base = input->base; + /* skip backwards over any end-of-lines */ + while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { + cur--; + } + n = 0; + /* search backwards for beginning-of-line (to max buff size) */ + while ((n++ < (sizeof(content)-1)) && (cur > base) && + (*(cur) != '\n') && (*(cur) != '\r')) + cur--; + if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; + /* calculate the error position in terms of the current position */ + col = input->cur - cur; + /* search forward for end-of-line (to max buff size) */ + n = 0; + ctnt = content; + /* copy selected text to our buffer */ + while ((*cur != 0) && (*(cur) != '\n') && + (*(cur) != '\r') && (n < sizeof(content)-1)) { + *ctnt++ = *cur++; + n++; + } + *ctnt = 0; + /* print out the selected text */ + chanl(data ,"%s\n", content); + /* create blank line with problem pointer */ + n = 0; + ctnt = content; + /* (leave buffer space for pointer + line terminator) */ + while ((nfile; + line = err->line; + code = err->code; + domain = err->domain; + level = err->level; + node = err->node; + if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || + (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) || + (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { + ctxt = err->ctxt; + } + str = err->message; + + if (code == XML_ERR_OK) + return; + + if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) + name = node->name; + + /* + * Maintain the compatibility with the legacy error handling + */ + if (ctxt != NULL) { + input = ctxt->input; + if ((input != NULL) && (input->filename == NULL) && + (ctxt->inputNr > 1)) { + cur = input; + input = ctxt->inputTab[ctxt->inputNr - 2]; + } + if (input != NULL) { + if (input->filename) + channel(data, "%s:%d: ", input->filename, input->line); + else if ((line != 0) && (domain == XML_FROM_PARSER)) + channel(data, "Entity: line %d: ", input->line); + } + } else { + if (file != NULL) + channel(data, "%s:%d: ", file, line); + else if ((line != 0) && (domain == XML_FROM_PARSER)) + channel(data, "Entity: line %d: ", line); + } + if (name != NULL) { + channel(data, "element %s: ", name); + } + if (code == XML_ERR_OK) + return; + switch (domain) { + case XML_FROM_PARSER: + channel(data, "parser "); + break; + case XML_FROM_NAMESPACE: + channel(data, "namespace "); + break; + case XML_FROM_DTD: + case XML_FROM_VALID: + channel(data, "validity "); + break; + case XML_FROM_HTML: + channel(data, "HTML parser "); + break; + case XML_FROM_MEMORY: + channel(data, "memory "); + break; + case XML_FROM_OUTPUT: + channel(data, "output "); + break; + case XML_FROM_IO: + channel(data, "I/O "); + break; + case XML_FROM_XINCLUDE: + channel(data, "XInclude "); + break; + case XML_FROM_XPATH: + channel(data, "XPath "); + break; + case XML_FROM_XPOINTER: + channel(data, "parser "); + break; + case XML_FROM_REGEXP: + channel(data, "regexp "); + break; + case XML_FROM_MODULE: + channel(data, "module "); + break; + case XML_FROM_SCHEMASV: + channel(data, "Schemas validity "); + break; + case XML_FROM_SCHEMASP: + channel(data, "Schemas parser "); + break; + case XML_FROM_RELAXNGP: + channel(data, "Relax-NG parser "); + break; + case XML_FROM_RELAXNGV: + channel(data, "Relax-NG validity "); + break; + case XML_FROM_CATALOG: + channel(data, "Catalog "); + break; + case XML_FROM_C14N: + channel(data, "C14N "); + break; + case XML_FROM_XSLT: + channel(data, "XSLT "); + break; + default: + break; + } + if (code == XML_ERR_OK) + return; + switch (level) { + case XML_ERR_NONE: + channel(data, ": "); + break; + case XML_ERR_WARNING: + channel(data, "warning : "); + break; + case XML_ERR_ERROR: + channel(data, "error : "); + break; + case XML_ERR_FATAL: + channel(data, "error : "); + break; + } + if (code == XML_ERR_OK) + return; + if (str != NULL) { + int len; + len = xmlStrlen((const xmlChar *)str); + if ((len > 0) && (str[len - 1] != '\n')) + channel(data, "%s\n", str); + else + channel(data, "%s", str); + } else { + channel(data, "%s\n", "out of memory error"); + } + if (code == XML_ERR_OK) + return; + + if (ctxt != NULL) { + xmlParserPrintFileContextInternal(input, channel, data); + if (cur != NULL) { + if (cur->filename) + channel(data, "%s:%d: \n", cur->filename, cur->line); + else if ((line != 0) && (domain == XML_FROM_PARSER)) + channel(data, "Entity: line %d: \n", cur->line); + xmlParserPrintFileContextInternal(cur, channel, data); + } + } + if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) && + (err->int1 < 100) && + (err->int1 < xmlStrlen((const xmlChar *)err->str1))) { + xmlChar buf[150]; + int i; + + channel(data, "%s\n", err->str1); + for (i=0;i < err->int1;i++) + buf[i] = ' '; + buf[i++] = '^'; + buf[i] = 0; + channel(data, "%s\n", buf); + } +} + +static void +initializeLibxml2(void) { + xmlGetWarningsDefaultValue = 0; + xmlPedanticParserDefault(0); + + xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); + xmlInitParser(); + xmlSetExternalEntityLoader(testExternalEntityLoader); + xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler); + /* + * register the new I/O handlers + */ + if (xmlRegisterInputCallbacks(hugeMatch, hugeOpen, + hugeRead, hugeClose) < 0) { + fprintf(stderr, "failed to register Huge handlers\n"); + exit(1); + } + if (xmlRegisterInputCallbacks(crazyMatch, crazyOpen, + crazyRead, crazyClose) < 0) { + fprintf(stderr, "failed to register Crazy handlers\n"); + exit(1); + } +} + +/************************************************************************ + * * + * SAX empty callbacks * + * * + ************************************************************************/ + +unsigned long callbacks = 0; + +/** + * isStandaloneCallback: + * @ctxt: An XML parser context + * + * Is this document tagged standalone ? + * + * Returns 1 if true + */ +static int +isStandaloneCallback(void *ctx ATTRIBUTE_UNUSED) +{ + callbacks++; + return (0); +} + +/** + * hasInternalSubsetCallback: + * @ctxt: An XML parser context + * + * Does this document has an internal subset + * + * Returns 1 if true + */ +static int +hasInternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED) +{ + callbacks++; + return (0); +} + +/** + * hasExternalSubsetCallback: + * @ctxt: An XML parser context + * + * Does this document has an external subset + * + * Returns 1 if true + */ +static int +hasExternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED) +{ + callbacks++; + return (0); +} + +/** + * internalSubsetCallback: + * @ctxt: An XML parser context + * + * Does this document has an internal subset + */ +static void +internalSubsetCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + const xmlChar * ExternalID ATTRIBUTE_UNUSED, + const xmlChar * SystemID ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * externalSubsetCallback: + * @ctxt: An XML parser context + * + * Does this document has an external subset + */ +static void +externalSubsetCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + const xmlChar * ExternalID ATTRIBUTE_UNUSED, + const xmlChar * SystemID ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * resolveEntityCallback: + * @ctxt: An XML parser context + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * Special entity resolver, better left to the parser, it has + * more context than the application layer. + * The default behaviour is to NOT resolve the entities, in that case + * the ENTITY_REF nodes are built in the structure (and the parameter + * values). + * + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. + */ +static xmlParserInputPtr +resolveEntityCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * publicId ATTRIBUTE_UNUSED, + const xmlChar * systemId ATTRIBUTE_UNUSED) +{ + callbacks++; + return (NULL); +} + +/** + * getEntityCallback: + * @ctxt: An XML parser context + * @name: The entity name + * + * Get an entity by name + * + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. + */ +static xmlEntityPtr +getEntityCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED) +{ + callbacks++; + return (NULL); +} + +/** + * getParameterEntityCallback: + * @ctxt: An XML parser context + * @name: The entity name + * + * Get a parameter entity by name + * + * Returns the xmlParserInputPtr + */ +static xmlEntityPtr +getParameterEntityCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED) +{ + callbacks++; + return (NULL); +} + + +/** + * entityDeclCallback: + * @ctxt: An XML parser context + * @name: the entity name + * @type: the entity type + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @content: the entity value (without processing). + * + * An entity definition has been parsed + */ +static void +entityDeclCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + const xmlChar * publicId ATTRIBUTE_UNUSED, + const xmlChar * systemId ATTRIBUTE_UNUSED, + xmlChar * content ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * attributeDeclCallback: + * @ctxt: An XML parser context + * @name: the attribute name + * @type: the attribute type + * + * An attribute definition has been parsed + */ +static void +attributeDeclCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * elem ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, int def ATTRIBUTE_UNUSED, + const xmlChar * defaultValue ATTRIBUTE_UNUSED, + xmlEnumerationPtr tree ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * elementDeclCallback: + * @ctxt: An XML parser context + * @name: the element name + * @type: the element type + * @content: the element value (without processing). + * + * An element definition has been parsed + */ +static void +elementDeclCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + xmlElementContentPtr content ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * notationDeclCallback: + * @ctxt: An XML parser context + * @name: The name of the notation + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * What to do when a notation declaration has been parsed. + */ +static void +notationDeclCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + const xmlChar * publicId ATTRIBUTE_UNUSED, + const xmlChar * systemId ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * unparsedEntityDeclCallback: + * @ctxt: An XML parser context + * @name: The name of the entity + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @notationName: the name of the notation + * + * What to do when an unparsed entity declaration is parsed + */ +static void +unparsedEntityDeclCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + const xmlChar * publicId ATTRIBUTE_UNUSED, + const xmlChar * systemId ATTRIBUTE_UNUSED, + const xmlChar * notationName ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * setDocumentLocatorCallback: + * @ctxt: An XML parser context + * @loc: A SAX Locator + * + * Receive the document locator at startup, actually xmlDefaultSAXLocator + * Everything is available on the context, so this is useless in our case. + */ +static void +setDocumentLocatorCallback(void *ctx ATTRIBUTE_UNUSED, + xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * startDocumentCallback: + * @ctxt: An XML parser context + * + * called when the document start being processed. + */ +static void +startDocumentCallback(void *ctx ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * endDocumentCallback: + * @ctxt: An XML parser context + * + * called when the document end has been detected. + */ +static void +endDocumentCallback(void *ctx ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +#if 0 +/** + * startElementCallback: + * @ctxt: An XML parser context + * @name: The element name + * + * called when an opening tag has been processed. + */ +static void +startElementCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED, + const xmlChar ** atts ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * endElementCallback: + * @ctxt: An XML parser context + * @name: The element name + * + * called when the end of an element has been detected. + */ +static void +endElementCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} +#endif + +/** + * charactersCallback: + * @ctxt: An XML parser context + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * receiving some chars from the parser. + * Question: how much at a time ??? + */ +static void +charactersCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * ch ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * referenceCallback: + * @ctxt: An XML parser context + * @name: The entity name + * + * called when an entity reference is detected. + */ +static void +referenceCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * name ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * ignorableWhitespaceCallback: + * @ctxt: An XML parser context + * @ch: a xmlChar string + * @start: the first char in the string + * @len: the number of xmlChar + * + * receiving some ignorable whitespaces from the parser. + * Question: how much at a time ??? + */ +static void +ignorableWhitespaceCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * ch ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * processingInstructionCallback: + * @ctxt: An XML parser context + * @target: the target name + * @data: the PI data's + * @len: the number of xmlChar + * + * A processing instruction has been parsed. + */ +static void +processingInstructionCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * target ATTRIBUTE_UNUSED, + const xmlChar * data ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * cdataBlockCallback: + * @ctx: the user data (XML parser context) + * @value: The pcdata content + * @len: the block length + * + * called when a pcdata block has been parsed + */ +static void +cdataBlockCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * value ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * commentCallback: + * @ctxt: An XML parser context + * @value: the comment content + * + * A comment has been parsed. + */ +static void +commentCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * value ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * warningCallback: + * @ctxt: An XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a warning messages, gives file, line, position and + * extra parameters. + */ +static void XMLCDECL +warningCallback(void *ctx ATTRIBUTE_UNUSED, + const char *msg ATTRIBUTE_UNUSED, ...) +{ + callbacks++; + return; +} + +/** + * errorCallback: + * @ctxt: An XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a error messages, gives file, line, position and + * extra parameters. + */ +static void XMLCDECL +errorCallback(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED, + ...) +{ + callbacks++; + return; +} + +/** + * fatalErrorCallback: + * @ctxt: An XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a fatalError messages, gives file, line, position and + * extra parameters. + */ +static void XMLCDECL +fatalErrorCallback(void *ctx ATTRIBUTE_UNUSED, + const char *msg ATTRIBUTE_UNUSED, ...) +{ + return; +} + + +/* + * SAX2 specific callbacks + */ + +/** + * startElementNsCallback: + * @ctxt: An XML parser context + * @name: The element name + * + * called when an opening tag has been processed. + */ +static void +startElementNsCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * localname ATTRIBUTE_UNUSED, + const xmlChar * prefix ATTRIBUTE_UNUSED, + const xmlChar * URI ATTRIBUTE_UNUSED, + int nb_namespaces ATTRIBUTE_UNUSED, + const xmlChar ** namespaces ATTRIBUTE_UNUSED, + int nb_attributes ATTRIBUTE_UNUSED, + int nb_defaulted ATTRIBUTE_UNUSED, + const xmlChar ** attributes ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +/** + * endElementCallback: + * @ctxt: An XML parser context + * @name: The element name + * + * called when the end of an element has been detected. + */ +static void +endElementNsCallback(void *ctx ATTRIBUTE_UNUSED, + const xmlChar * localname ATTRIBUTE_UNUSED, + const xmlChar * prefix ATTRIBUTE_UNUSED, + const xmlChar * URI ATTRIBUTE_UNUSED) +{ + callbacks++; + return; +} + +static xmlSAXHandler callbackSAX2HandlerStruct = { + internalSubsetCallback, + isStandaloneCallback, + hasInternalSubsetCallback, + hasExternalSubsetCallback, + resolveEntityCallback, + getEntityCallback, + entityDeclCallback, + notationDeclCallback, + attributeDeclCallback, + elementDeclCallback, + unparsedEntityDeclCallback, + setDocumentLocatorCallback, + startDocumentCallback, + endDocumentCallback, + NULL, + NULL, + referenceCallback, + charactersCallback, + ignorableWhitespaceCallback, + processingInstructionCallback, + commentCallback, + warningCallback, + errorCallback, + fatalErrorCallback, + getParameterEntityCallback, + cdataBlockCallback, + externalSubsetCallback, + XML_SAX2_MAGIC, + NULL, + startElementNsCallback, + endElementNsCallback, + NULL +}; + +static xmlSAXHandlerPtr callbackSAX2Handler = &callbackSAX2HandlerStruct; + +/************************************************************************ + * * + * The tests front-ends * + * * + ************************************************************************/ + +/** + * readerTest: + * @filename: the file to parse + * @max_size: size of the limit to test + * @options: parsing options + * @fail: should a failure be reported + * + * Parse a memory generated file using SAX + * + * Returns 0 in case of success, an error code otherwise + */ +static int +saxTest(const char *filename, size_t limit, int options, int fail) { + int res = 0; + xmlParserCtxtPtr ctxt; + xmlDocPtr doc; + xmlSAXHandlerPtr old_sax; + + nb_tests++; + + maxlen = limit; + ctxt = xmlNewParserCtxt(); + if (ctxt == NULL) { + fprintf(stderr, "Failed to create parser context\n"); + return(1); + } + old_sax = ctxt->sax; + ctxt->sax = callbackSAX2Handler; + ctxt->userData = NULL; + doc = xmlCtxtReadFile(ctxt, filename, NULL, options); + + if (doc != NULL) { + fprintf(stderr, "SAX parsing generated a document !\n"); + xmlFreeDoc(doc); + res = 0; + } else if (ctxt->wellFormed == 0) { + if (fail) + res = 0; + else { + fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit); + res = 1; + } + } else { + if (fail) { + fprintf(stderr, "Failed to get failure for '%s' %lu\n", + filename, limit); + res = 1; + } else + res = 0; + } + ctxt->sax = old_sax; + xmlFreeParserCtxt(ctxt); + + return(res); +} +#ifdef LIBXML_READER_ENABLED +/** + * readerTest: + * @filename: the file to parse + * @max_size: size of the limit to test + * @options: parsing options + * @fail: should a failure be reported + * + * Parse a memory generated file using the xmlReader + * + * Returns 0 in case of success, an error code otherwise + */ +static int +readerTest(const char *filename, size_t limit, int options, int fail) { + xmlTextReaderPtr reader; + int res = 0; + int ret; + + nb_tests++; + + maxlen = limit; + reader = xmlReaderForFile(filename , NULL, options); + if (reader == NULL) { + fprintf(stderr, "Failed to open '%s' test\n", filename); + return(1); + } + ret = xmlTextReaderRead(reader); + while (ret == 1) { + ret = xmlTextReaderRead(reader); + } + if (ret != 0) { + if (fail) + res = 0; + else { + if (strncmp(filename, "crazy:", 6) == 0) + fprintf(stderr, "Failed to parse '%s' %u\n", + filename, crazy_indx); + else + fprintf(stderr, "Failed to parse '%s' %lu\n", + filename, limit); + res = 1; + } + } else { + if (fail) { + if (strncmp(filename, "crazy:", 6) == 0) + fprintf(stderr, "Failed to get failure for '%s' %u\n", + filename, crazy_indx); + else + fprintf(stderr, "Failed to get failure for '%s' %lu\n", + filename, limit); + res = 1; + } else + res = 0; + } + if (timeout) + res = 1; + xmlFreeTextReader(reader); + + return(res); +} +#endif + +/************************************************************************ + * * + * Tests descriptions * + * * + ************************************************************************/ + +typedef int (*functest) (const char *filename, size_t limit, int options, + int fail); + +typedef struct limitDesc limitDesc; +typedef limitDesc *limitDescPtr; +struct limitDesc { + const char *name; /* the huge generator name */ + size_t limit; /* the limit to test */ + int options; /* extra parser options */ + int fail; /* whether the test should fail */ +}; + +static limitDesc limitDescriptions[] = { + /* max lenght of a text node in content */ + {"huge:textNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, + {"huge:textNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, + {"huge:textNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, + /* max lenght of a text node in content */ + {"huge:attrNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, + {"huge:attrNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, + {"huge:attrNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, + /* max lenght of a comment node */ + {"huge:commentNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, + {"huge:commentNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, + {"huge:commentNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, + /* max lenght of a PI node */ + {"huge:piNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, + {"huge:piNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, + {"huge:piNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, +}; + +typedef struct testDesc testDesc; +typedef testDesc *testDescPtr; +struct testDesc { + const char *desc; /* descripton of the test */ + functest func; /* function implementing the test */ +}; + +static +testDesc testDescriptions[] = { + { "Parsing of huge files with the sax parser", saxTest}, +/* { "Parsing of huge files with the tree parser", treeTest}, */ +#ifdef LIBXML_READER_ENABLED + { "Parsing of huge files with the reader", readerTest}, +#endif + {NULL, NULL} +}; + +typedef struct testException testException; +typedef testException *testExceptionPtr; +struct testException { + unsigned int test; /* the parser test number */ + unsigned int limit; /* the limit test number */ + int fail; /* new fail value or -1*/ + size_t size; /* new limit value or 0 */ +}; + +static +testException testExceptions[] = { + /* the SAX parser doesn't hit a limit of XML_MAX_TEXT_LENGTH text nodes */ + { 0, 1, 0, 0}, +}; + +static int +launchTests(testDescPtr tst, unsigned int test) { + int res = 0, err = 0; + unsigned int i, j; + size_t limit; + int fail; + + if (tst == NULL) return(-1); + + for (i = 0;i < sizeof(limitDescriptions)/sizeof(limitDescriptions[0]);i++) { + limit = limitDescriptions[i].limit; + fail = limitDescriptions[i].fail; + /* + * Handle exceptions if any + */ + for (j = 0;j < sizeof(testExceptions)/sizeof(testExceptions[0]);j++) { + if ((testExceptions[j].test == test) && + (testExceptions[j].limit == i)) { + if (testExceptions[j].fail != -1) + fail = testExceptions[j].fail; + if (testExceptions[j].size != 0) + limit = testExceptions[j].size; + break; + } + } + res = tst->func(limitDescriptions[i].name, limit, + limitDescriptions[i].options, fail); + if (res != 0) { + nb_errors++; + err++; + } + } + return(err); +} + + +static int +runtest(unsigned int i) { + int ret = 0, res; + int old_errors, old_tests, old_leaks; + + old_errors = nb_errors; + old_tests = nb_tests; + old_leaks = nb_leaks; + if ((tests_quiet == 0) && (testDescriptions[i].desc != NULL)) + printf("## %s\n", testDescriptions[i].desc); + res = launchTests(&testDescriptions[i], i); + if (res != 0) + ret++; + if (verbose) { + if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) + printf("Ran %d tests, no errors\n", nb_tests - old_tests); + else + printf("Ran %d tests, %d errors, %d leaks\n", + nb_tests - old_tests, + nb_errors - old_errors, + nb_leaks - old_leaks); + } + return(ret); +} + +static int +launchCrazySAX(unsigned int test, int fail) { + int res = 0, err = 0; + + crazy_indx = test; + + res = saxTest("crazy::test", XML_MAX_LOOKUP_LIMIT - CHUNK, 0, fail); + if (res != 0) { + nb_errors++; + err++; + } + if (tests_quiet == 0) + fprintf(stderr, "%c", crazy[test]); + + return(err); +} + +static int +launchCrazy(unsigned int test, int fail) { + int res = 0, err = 0; + + crazy_indx = test; + + res = readerTest("crazy::test", XML_MAX_LOOKUP_LIMIT - CHUNK, 0, fail); + if (res != 0) { + nb_errors++; + err++; + } + if (tests_quiet == 0) + fprintf(stderr, "%c", crazy[test]); + + return(err); +} + +static int get_crazy_fail(int test) { + /* + * adding 1000000 of character 'a' leads to parser failure mostly + * everywhere except in those special spots. Need to be updated + * each time crazy is updated + */ + int fail = 1; + if ((test == 44) || /* PI in Misc */ + ((test >= 50) && (test <= 55)) || /* Comment in Misc */ + (test == 79) || /* PI in DTD */ + ((test >= 85) && (test <= 90)) || /* Comment in DTD */ + (test == 154) || /* PI in Misc */ + ((test >= 160) && (test <= 165)) || /* Comment in Misc */ + ((test >= 178) && (test <= 181)) || /* attribute value */ + (test == 183) || /* Text */ + (test == 189) || /* PI in Content */ + (test == 191) || /* Text */ + ((test >= 195) && (test <= 200)) || /* Comment in Content */ + ((test >= 203) && (test <= 206)) || /* Text */ + (test == 215) || (test == 216) || /* in CDATA */ + (test == 219) || /* Text */ + (test == 231) || /* PI in Misc */ + ((test >= 237) && (test <= 242))) /* Comment in Misc */ + fail = 0; + return(fail); +} + +static int +runcrazy(void) { + int ret = 0, res = 0; + int old_errors, old_tests, old_leaks; + unsigned int i; + + old_errors = nb_errors; + old_tests = nb_tests; + old_leaks = nb_leaks; + if (tests_quiet == 0) { + printf("## Crazy tests on reader\n"); + } + for (i = 0;i < strlen(crazy);i++) { + res += launchCrazy(i, get_crazy_fail(i)); + if (res != 0) + ret++; + } + if (tests_quiet == 0) { + printf("\n## Crazy tests on SAX\n"); + } + for (i = 0;i < strlen(crazy);i++) { + res += launchCrazySAX(i, get_crazy_fail(i)); + if (res != 0) + ret++; + } + if (tests_quiet == 0) + fprintf(stderr, "\n"); + if (verbose) { + if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) + printf("Ran %d tests, no errors\n", nb_tests - old_tests); + else + printf("Ran %d tests, %d errors, %d leaks\n", + nb_tests - old_tests, + nb_errors - old_errors, + nb_leaks - old_leaks); + } + return(ret); +} + + +int +main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { + int i, a, ret = 0; + int subset = 0; + + fillFilling(); + initializeLibxml2(); + + for (a = 1; a < argc;a++) { + if (!strcmp(argv[a], "-v")) + verbose = 1; + else if (!strcmp(argv[a], "-quiet")) + tests_quiet = 1; + else if (!strcmp(argv[a], "-crazy")) + subset = 1; + } + if (subset == 0) { + for (i = 0; testDescriptions[i].func != NULL; i++) { + ret += runtest(i); + } + } + ret += runcrazy(); + if ((nb_errors == 0) && (nb_leaks == 0)) { + ret = 0; + printf("Total %d tests, no errors\n", + nb_tests); + } else { + ret = 1; + printf("Total %d tests, %d errors, %d leaks\n", + nb_tests, nb_errors, nb_leaks); + } + xmlCleanupParser(); + xmlMemoryDump(); + + return(ret); +} Index: lib/3rdparty/libxml2/testModule.c =================================================================== --- lib/3rdparty/libxml2/testModule.c (revision 58293) +++ lib/3rdparty/libxml2/testModule.c (working copy) @@ -39,7 +39,7 @@ #endif typedef int (*hello_world_t)(void); - + int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { xmlChar filename[PATH_MAX]; xmlModulePtr module = NULL; @@ -62,7 +62,7 @@ fprintf(stderr, "Lookup returned NULL\n"); return(1); } - + (*hello_world)(); xmlModuleClose(module); Index: lib/3rdparty/libxml2/testrecurse.c =================================================================== --- lib/3rdparty/libxml2/testrecurse.c (revision 58293) +++ lib/3rdparty/libxml2/testrecurse.c (working copy) @@ -10,11 +10,8 @@ * daniel@veillard.com */ -#ifdef HAVE_CONFIG_H #include "libxml.h" -#else #include -#endif #if !defined(_WIN32) || defined(__CYGWIN__) #include @@ -148,8 +145,7 @@ free(pglob->gl_pathv[i]); } } -#define vsnprintf _vsnprintf -#define snprintf _snprintf + #else #include #endif @@ -684,12 +680,10 @@ xmlDocPtr doc; xmlParserCtxtPtr ctxt; int res = 0; - int mem; nb_tests++; ctxt = xmlNewParserCtxt(); - mem = xmlMemUsed(); /* * base of the test, parse with the old API */ @@ -725,12 +719,10 @@ xmlDocPtr doc; xmlParserCtxtPtr ctxt; int res = 0; - int mem; nb_tests++; ctxt = xmlNewParserCtxt(); - mem = xmlMemUsed(); /* * base of the test, parse with the old API */ Index: lib/3rdparty/libxml2/testRegexp.c =================================================================== --- lib/3rdparty/libxml2/testRegexp.c (revision 58293) +++ lib/3rdparty/libxml2/testRegexp.c (working copy) @@ -49,10 +49,10 @@ while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { if (expression[0] == '#') continue; @@ -103,10 +103,10 @@ while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { if (expression[0] == '#') continue; @@ -115,7 +115,7 @@ if (expr != NULL) { xmlExpFree(ctxt, expr); - if (xmlExpCtxtNbNodes(ctxt) != 0) + if (xmlExpCtxtNbNodes(ctxt) != 0) printf(" Parse/free of Expression leaked %d\n", xmlExpCtxtNbNodes(ctxt)); expr = NULL; @@ -142,7 +142,7 @@ break; } else { int ret; - + nodes2 = xmlExpCtxtNbNodes(ctxt); ret = xmlExpSubsume(ctxt, expr, sub); @@ -174,14 +174,14 @@ } if (expr != NULL) { xmlExpFree(ctxt, expr); - if (xmlExpCtxtNbNodes(ctxt) != 0) + if (xmlExpCtxtNbNodes(ctxt) != 0) printf(" Parse/free of Expression leaked %d\n", xmlExpCtxtNbNodes(ctxt)); } fclose(input); } -static void +static void testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) { xmlBufferPtr xmlExpBuf; xmlExpNodePtr sub, deriv; @@ -213,7 +213,7 @@ xmlExpFree(ctxt, sub); } -static void +static void exprDebug(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr) { xmlBufferPtr xmlExpBuf; xmlExpNodePtr deriv; Index: lib/3rdparty/libxml2/testRelax.c =================================================================== --- lib/3rdparty/libxml2/testRelax.c (revision 58293) +++ lib/3rdparty/libxml2/testRelax.c (working copy) @@ -49,7 +49,7 @@ #endif static int noout = 0; static int tree = 0; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif @@ -65,7 +65,7 @@ debug++; else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { memory++; } else @@ -84,12 +84,12 @@ if (schema == NULL) { xmlRelaxNGParserCtxtPtr ctxt; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { int fd; struct stat info; const char *base; - if (stat(argv[i], &info) < 0) + if (stat(argv[i], &info) < 0) break; if ((fd = open(argv[i], O_RDONLY)) < 0) break; @@ -174,7 +174,7 @@ #endif printf("\t--noout : do not print the result\n"); printf("\t--tree : print the intermediate Relax-NG document tree\n"); -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : test the schemas in memory parsing\n"); #endif } Index: lib/3rdparty/libxml2/testSAX.c =================================================================== --- lib/3rdparty/libxml2/testSAX.c (revision 58293) +++ lib/3rdparty/libxml2/testSAX.c (working copy) @@ -71,7 +71,7 @@ * function calls */ -#ifndef HAVE_GETTIMEOFDAY +#ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_SYS_TIMEB_H #ifdef HAVE_SYS_TIME_H #ifdef HAVE_FTIME @@ -368,7 +368,7 @@ return(NULL); /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - + fprintf(stdout, "SAX.resolveEntity("); if (publicId != NULL) fprintf(stdout, "%s", (char *)publicId); @@ -428,8 +428,8 @@ /** * entityDeclDebug: * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -458,8 +458,8 @@ /** * attributeDeclDebug: * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type + * @name: the attribute name + * @type: the attribute type * * An attribute definition has been parsed */ @@ -483,8 +483,8 @@ /** * elementDeclDebug: * @ctxt: An XML parser context - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value (without processing). * * An element definition has been parsed @@ -670,7 +670,7 @@ * @ctxt: An XML parser context * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. */ static void referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) @@ -906,7 +906,7 @@ else fprintf(stdout, ", '%s'", (char *) URI); fprintf(stdout, ", %d", nb_namespaces); - + if (namespaces != NULL) { for (i = 0;i < nb_namespaces * 2;i++) { fprintf(stdout, ", xmlns"); @@ -1131,7 +1131,7 @@ int files = 0; LIBXML_TEST_VERSION /* be safe, plus calls xmlInitParser */ - + for (i = 1; i < argc ; i++) { if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) debug++; Index: lib/3rdparty/libxml2/testSchemas.c =================================================================== --- lib/3rdparty/libxml2/testSchemas.c (revision 58293) +++ lib/3rdparty/libxml2/testSchemas.c (working copy) @@ -49,7 +49,7 @@ static int debug = 0; #endif static int noout = 0; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif @@ -65,7 +65,7 @@ debug++; else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { memory++; } else @@ -80,12 +80,12 @@ if (schema == NULL) { xmlSchemaParserCtxtPtr ctxt; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { int fd; struct stat info; const char *base; - if (stat(argv[i], &info) < 0) + if (stat(argv[i], &info) < 0) break; if ((fd = open(argv[i], O_RDONLY)) < 0) break; @@ -164,7 +164,7 @@ printf("\t--debug : dump a debug tree of the in-memory document\n"); #endif printf("\t--noout : do not print the result\n"); -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : test the schemas in memory parsing\n"); #endif } Index: lib/3rdparty/libxml2/testThreads.c =================================================================== --- lib/3rdparty/libxml2/testThreads.c (revision 58293) +++ lib/3rdparty/libxml2/testThreads.c (working copy) @@ -105,10 +105,8 @@ for (repeat = 0;repeat < 500;repeat++) { xmlLoadCatalog(catalog); - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (pthread_t) -1; - } + memset(results, 0, sizeof(*results)*num_threads); + memset(tid, 0xff, sizeof(*tid)*num_threads); for (i = 0; i < num_threads; i++) { ret = pthread_create(&tid[i], NULL, thread_specific_data, Index: lib/3rdparty/libxml2/testThreadsWin32.c =================================================================== --- lib/3rdparty/libxml2/testThreadsWin32.c (revision 58293) +++ lib/3rdparty/libxml2/testThreadsWin32.c (working copy) @@ -104,7 +104,7 @@ for (i = 0; i < num_threads; i++) { DWORD useless; - tid[i] = CreateThread(NULL, 0, + tid[i] = CreateThread(NULL, 0, thread_specific_data, testfiles[i], 0, &useless); if (tid[i] == NULL) { @@ -113,7 +113,7 @@ } } - if (WaitForMultipleObjects (num_threads, tid, TRUE, INFINITE) == WAIT_FAILED) + if (WaitForMultipleObjects (num_threads, tid, TRUE, INFINITE) == WAIT_FAILED) perror ("WaitForMultipleObjects failed"); for (i = 0; i < num_threads; i++) @@ -129,7 +129,7 @@ xmlCatalogCleanup(); for (i = 0; i < num_threads; i++) { - if (results[i] != (DWORD) Okay) + if (results[i] != (DWORD) Okay) printf("Thread %d handling %s failed\n", i, testfiles[i]); } } Index: lib/3rdparty/libxml2/testXPath.c =================================================================== --- lib/3rdparty/libxml2/testXPath.c (revision 58293) +++ lib/3rdparty/libxml2/testXPath.c (working copy) @@ -51,7 +51,7 @@ /* * Default document */ -static xmlChar buffer[] = +static xmlChar buffer[] = "\n\ \n\ \n\ @@ -79,7 +79,7 @@ testXPath(const char *str) { xmlXPathObjectPtr res; xmlXPathContextPtr ctxt; - + #if defined(LIBXML_XPTR_ENABLED) if (xptr) { ctxt = xmlXPtrNewContext(document, NULL, NULL); @@ -96,7 +96,7 @@ comp = xmlXPathCompile(BAD_CAST str); if (comp != NULL) { - if (tree) + if (tree) xmlXPathDebugDumpCompExpr(stdout, comp, 0); res = xmlXPathCompiledEval(comp, ctxt); @@ -127,10 +127,10 @@ while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { printf("\n========================\nExpression: %s\n", expression) ; testXPath(expression); @@ -150,7 +150,7 @@ #if defined(LIBXML_XPTR_ENABLED) if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr"))) xptr++; - else + else #endif if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) debug++; @@ -172,10 +172,12 @@ xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; xmlSubstituteEntitiesDefaultValue = 1; +#ifdef LIBXML_SAX1_ENABLED if (nocdata != 0) { xmlDefaultSAXHandlerInit(); xmlDefaultSAXHandler.cdataBlock = NULL; } +#endif if (document == NULL) { if (filename == NULL) document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT); @@ -211,7 +213,7 @@ printf("\t--file : or\n"); printf("\t-f : read queries from files, args\n"); } - if (document != NULL) + if (document != NULL) xmlFreeDoc(document); xmlCleanupParser(); xmlMemoryDump(); Index: lib/3rdparty/libxml2/threads.c =================================================================== --- lib/3rdparty/libxml2/threads.c (revision 58293) +++ lib/3rdparty/libxml2/threads.c (working copy) @@ -27,7 +27,7 @@ #ifdef HAVE_PTHREAD_H #include #elif defined HAVE_WIN32_THREADS -//#include +#include #ifndef HAVE_COMPILER_TLS #include #endif @@ -439,7 +439,7 @@ /* 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. */ - if (pthread_mutex_lock) + if (pthread_mutex_lock != NULL) pthread_mutex_lock(&global_init_lock); #elif defined HAVE_WIN32_THREADS LPCRITICAL_SECTION cs; @@ -509,7 +509,7 @@ __xmlGlobalInitMutexUnlock(void) { #ifdef HAVE_PTHREAD_H - if (pthread_mutex_unlock) + if (pthread_mutex_unlock != NULL) pthread_mutex_unlock(&global_init_lock); #elif defined HAVE_WIN32_THREADS if (global_init_lock != NULL) { @@ -915,6 +915,7 @@ #ifdef HAVE_PTHREAD_H if ((libxml_is_threaded) && (pthread_key_delete != NULL)) pthread_key_delete(globalkey); + once_control = PTHREAD_ONCE_INIT; #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) if (globalkey != TLS_OUT_OF_INDEXES) { xmlGlobalStateCleanupHelperParams *p; Index: lib/3rdparty/libxml2/timsort.h =================================================================== --- lib/3rdparty/libxml2/timsort.h (revision 0) +++ lib/3rdparty/libxml2/timsort.h (working copy) @@ -0,0 +1,506 @@ +/* + * taken from https://github.com/swenson/sort + * Kept as is for the moment to be able to apply upstream patches for that + * code, currently used only to speed up XPath node sorting, see xpath.c + */ + +/* + * All code in this header, unless otherwise specified, is hereby licensed under the MIT Public License: + +Copyright (c) 2010 Christopher Swenson + +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 +#include +#include +#ifdef HAVE_STDINT_H +#include +#else +#ifdef HAVE_INTTYPES_H +#include +#elif defined(WIN32) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif +#endif + +#ifndef MAX +#define MAX(x,y) (((x) > (y) ? (x) : (y))) +#endif +#ifndef MIN +#define MIN(x,y) (((x) < (y) ? (x) : (y))) +#endif + +int compute_minrun(uint64_t); + +#ifndef CLZ +#ifdef __GNUC__ +#define CLZ __builtin_clzll +#else + +int clzll(uint64_t); + +/* adapted from Hacker's Delight */ +int clzll(uint64_t x) /* {{{ */ +{ + int n; + + 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;} + return n; +} +/* }}} */ + +#define CLZ clzll +#endif +#endif + +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; + return minrun; +} +/* }}} */ + +#ifndef SORT_NAME +#error "Must declare SORT_NAME" +#endif + +#ifndef SORT_TYPE +#error "Must declare SORT_TYPE" +#endif + +#ifndef SORT_CMP +#define SORT_CMP(x, y) ((x) < (y) ? -1 : ((x) == (y) ? 0 : 1)) +#endif + + +#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;} + +#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) + +#define TIM_SORT_RUN_T SORT_MAKE_STR(tim_sort_run_t) +#define TEMP_STORAGE_T SORT_MAKE_STR(temp_storage_t) + +typedef struct { + int64_t start; + int64_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 int64_t BINARY_INSERTION_FIND(SORT_TYPE *dst, const SORT_TYPE x, const size_t size) +{ + int64_t l, c, r; + SORT_TYPE lx; + SORT_TYPE cx; + l = 0; + r = size - 1; + c = r >> 1; + lx = dst[l]; + + /* check for beginning conditions */ + if (SORT_CMP(x, lx) < 0) + return 0; + else if (SORT_CMP(x, lx) == 0) + { + int64_t i = 1; + while (SORT_CMP(x, dst[i]) == 0) i++; + return i; + } + + cx = dst[c]; + while (1) + { + const int val = SORT_CMP(x, cx); + if (val < 0) + { + if (c - l <= 1) return c; + r = c; + } + else if (val > 0) + { + if (r - c <= 1) return c + 1; + l = c; + lx = cx; + } + else + { + do + { + cx = dst[++c]; + } while (SORT_CMP(x, cx) == 0); + return 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) +{ + int64_t i; + for (i = start; i < (int64_t) size; i++) + { + int64_t j; + SORT_TYPE x; + int64_t location; + /* If this entry is already correct, just move along */ + 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--) + { + dst[j + 1] = dst[j]; + } + dst[location] = x; + } +} + +/* Binary insertion sort */ +void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) +{ + BINARY_INSERTION_SORT_START(dst, 1, size); +} + +/* timsort implementation, based on timsort.txt */ + +static void REVERSE_ELEMENTS(SORT_TYPE *dst, int64_t start, int64_t end) +{ + while (1) + { + if (start >= end) return; + SORT_SWAP(dst[start], dst[end]); + start++; + end--; + } +} + +static int64_t COUNT_RUN(SORT_TYPE *dst, const int64_t start, const size_t size) +{ + int64_t curr; + if (size - start == 1) return 1; + if (start >= (int64_t) 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) + { + /* increasing run */ + while (1) + { + if (curr == (int64_t) size - 1) break; + if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) break; + curr++; + } + return curr - start; + } + else + { + /* decreasing run */ + while (1) + { + if (curr == (int64_t) 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; + } +} + +#define PUSH_NEXT() do {\ +len = COUNT_RUN(dst, curr, size);\ +run = minrun;\ +if (run < minrun) run = minrun;\ +if (run > (int64_t) 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 == (int64_t) 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;\ +}\ +}\ +while (0) + +static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) +{ + int64_t A, B, C; + if (stack_curr < 2) return 1; + if (stack_curr == 2) + { + const int64_t A1 = stack[stack_curr - 2].length; + const int64_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; + return 1; +} + +typedef struct { + size_t alloc; + 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)); + if (tempstore == NULL) + { + fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", 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 int64_t A = stack[stack_curr - 2].length; + const int64_t B = stack[stack_curr - 1].length; + const int64_t curr = stack[stack_curr - 2].start; + SORT_TYPE *storage; + int64_t i, j, k; + + TIM_SORT_RESIZE(store, MIN(A, B)); + storage = store->storage; + + /* left merge */ + 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) + dst[k] = storage[i++]; + else + dst[k] = dst[j++]; + } + else if (i < A) + { + dst[k] = storage[i++]; + } + else + dst[k] = dst[j++]; + } + } + /* right merge */ + else + { + memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE)); + i = B - 1; + j = curr + A - 1; + + for (k = curr + A + B - 1; k >= curr; k--) + { + if ((i >= 0) && (j >= curr)) + { + if (SORT_CMP(dst[j], storage[i]) > 0) + dst[k] = dst[j--]; + else + dst[k] = storage[i--]; + } + else if (i >= 0) + dst[k] = storage[i--]; + else + dst[k] = dst[j--]; + } + } +} + +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) + { + int64_t A, B, C; + /* if the stack only has one thing on it, we are done with the collapse */ + if (stack_curr <= 1) break; + /* if this is the last merge, just do it */ + if ((stack_curr == 2) && + (stack[0].length + stack[1].length == (int64_t) 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)) + { + TIM_SORT_MERGE(dst, stack, stack_curr, store); + stack[0].length += stack[1].length; + stack_curr--; + break; + } + else if (stack_curr == 2) + break; + + A = stack[stack_curr - 3].length; + B = stack[stack_curr - 2].length; + C = stack[stack_curr - 1].length; + + /* check first invariant */ + if (A <= B + C) + { + if (A < C) + { + 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 + { + TIM_SORT_MERGE(dst, stack, stack_curr, store); + stack[stack_curr - 2].length += stack[stack_curr - 1].length; + stack_curr--; + } + } + /* check second invariant */ + else if (B <= C) + { + TIM_SORT_MERGE(dst, stack, stack_curr, store); + stack[stack_curr - 2].length += stack[stack_curr - 1].length; + stack_curr--; + } + else + break; + } + return stack_curr; +} + +void TIM_SORT(SORT_TYPE *dst, const size_t size) +{ + int minrun; + TEMP_STORAGE_T _store, *store; + TIM_SORT_RUN_T run_stack[128]; + int stack_curr = 0; + int64_t len, run; + int64_t curr = 0; + + if (size < 64) + { + BINARY_INSERTION_SORT(dst, size); + return; + } + + /* compute the minimum run length */ + minrun = compute_minrun(size); + + /* temporary storage for merges */ + store = &_store; + store->alloc = 0; + store->storage = NULL; + + PUSH_NEXT(); + PUSH_NEXT(); + PUSH_NEXT(); + + while (1) + { + if (!CHECK_INVARIANT(run_stack, stack_curr)) + { + stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size); + continue; + } + PUSH_NEXT(); + } +} + +#undef SORT_CONCAT +#undef SORT_MAKE_STR1 +#undef SORT_MAKE_STR +#undef SORT_NAME +#undef SORT_TYPE +#undef SORT_CMP +#undef TEMP_STORAGE_T +#undef TIM_SORT_RUN_T +#undef PUSH_NEXT +#undef SORT_SWAP +#undef SORT_CONCAT +#undef SORT_MAKE_STR1 +#undef SORT_MAKE_STR +#undef BINARY_INSERTION_FIND +#undef BINARY_INSERTION_SORT_START +#undef BINARY_INSERTION_SORT +#undef REVERSE_ELEMENTS +#undef COUNT_RUN +#undef TIM_SORT +#undef TIM_SORT_RESIZE +#undef TIM_SORT_COLLAPSE +#undef TIM_SORT_RUN_T +#undef TEMP_STORAGE_T Index: lib/3rdparty/libxml2/tree.c =================================================================== --- lib/3rdparty/libxml2/tree.c (revision 58293) +++ lib/3rdparty/libxml2/tree.c (working copy) @@ -41,6 +41,9 @@ #include #endif +#include "buf.h" +#include "save.h" + int __xmlRegisterCallbacks = 0; /************************************************************************ @@ -682,7 +685,8 @@ void xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme) { if ((scheme == XML_BUFFER_ALLOC_EXACT) || - (scheme == XML_BUFFER_ALLOC_DOUBLEIT)) + (scheme == XML_BUFFER_ALLOC_DOUBLEIT) || + (scheme == XML_BUFFER_ALLOC_HYBRID)) xmlBufferAllocScheme = scheme; } @@ -693,6 +697,9 @@ * XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, * improves performance + * XML_BUFFER_ALLOC_HYBRID - use exact sizes on small strings to keep memory usage tight + * in normal usage, and doubleit on large strings to avoid + * pathological performance. * * Returns the current allocation scheme */ @@ -1261,9 +1268,14 @@ const xmlChar *cur = value, *end = cur + len; const xmlChar *q; xmlEntityPtr ent; + xmlBufPtr buf; if (value == NULL) return(NULL); + buf = xmlBufCreateSize(0); + if (buf == NULL) return(NULL); + xmlBufSetAllocationScheme(buf, XML_BUFFER_ALLOC_HYBRID); + q = cur; while ((cur < end) && (*cur != 0)) { if (cur[0] == '&') { @@ -1274,19 +1286,8 @@ * Save the current text. */ if (cur != q) { - if ((last != NULL) && (last->type == XML_TEXT_NODE)) { - xmlNodeAddContentLen(last, q, cur - q); - } else { - node = xmlNewDocTextLen(doc, q, cur - q); - if (node == NULL) return(ret); - if (last == NULL) - last = ret = node; - else { - last->next = node; - node->prev = last; - last = node; - } - } + if (xmlBufAdd(buf, q, cur - q)) + goto out; } q = cur; if ((cur + 2 < end) && (cur[1] == '#') && (cur[2] == 'x')) { @@ -1351,7 +1352,7 @@ if ((cur >= end) || (*cur == 0)) { xmlTreeErr(XML_TREE_UNTERMINATED_ENTITY, (xmlNodePtr) doc, (const char *) q); - return(ret); + goto out; } if (cur != q) { /* @@ -1361,23 +1362,36 @@ ent = xmlGetDocEntity(doc, val); if ((ent != NULL) && (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { - if (last == NULL) { - node = xmlNewDocText(doc, ent->content); - last = ret = node; - } else if (last->type != XML_TEXT_NODE) { - node = xmlNewDocText(doc, ent->content); - last = xmlAddNextSibling(last, node); - } else - xmlNodeAddContent(last, ent->content); + if (xmlBufCat(buf, ent->content)) + goto out; + } else { /* + * Flush buffer so far + */ + if (!xmlBufIsEmpty(buf)) { + node = xmlNewDocText(doc, NULL); + if (node == NULL) { + if (val != NULL) xmlFree(val); + goto out; + } + node->content = xmlBufDetach(buf); + + if (last == NULL) { + last = ret = node; + } else { + last = xmlAddNextSibling(last, node); + } + } + + /* * Create a new REFERENCE_REF node */ node = xmlNewReference(doc, val); if (node == NULL) { if (val != NULL) xmlFree(val); - return(ret); + goto out; } else if ((ent != NULL) && (ent->children == NULL)) { xmlNodePtr temp; @@ -1404,40 +1418,44 @@ q = cur; } if (charval != 0) { - xmlChar buf[10]; + xmlChar buffer[10]; int l; - l = xmlCopyCharMultiByte(buf, charval); - buf[l] = 0; - node = xmlNewDocText(doc, buf); - if (node != NULL) { - if (last == NULL) { - last = ret = node; - } else { - last = xmlAddNextSibling(last, node); - } - } + l = xmlCopyCharMultiByte(buffer, charval); + buffer[l] = 0; + + if (xmlBufCat(buf, buffer)) + goto out; charval = 0; } } else cur++; } - if ((cur != q) || (ret == NULL)) { + + if (cur != q) { /* * Handle the last piece of text. */ - if ((last != NULL) && (last->type == XML_TEXT_NODE)) { - xmlNodeAddContentLen(last, q, cur - q); + if (xmlBufAdd(buf, q, cur - q)) + goto out; + } + + if (!xmlBufIsEmpty(buf)) { + node = xmlNewDocText(doc, NULL); + if (node == NULL) goto out; + node->content = xmlBufDetach(buf); + + if (last == NULL) { + last = ret = node; } else { - node = xmlNewDocTextLen(doc, q, cur - q); - if (node == NULL) return(ret); - if (last == NULL) { - ret = node; - } else { - xmlAddNextSibling(last, node); - } + last = xmlAddNextSibling(last, node); } + } else if (ret == NULL) { + ret = xmlNewDocText(doc, BAD_CAST ""); } + +out: + xmlBufFree(buf); return(ret); } @@ -1458,9 +1476,14 @@ const xmlChar *cur = value; const xmlChar *q; xmlEntityPtr ent; + xmlBufPtr buf; if (value == NULL) return(NULL); + buf = xmlBufCreateSize(0); + if (buf == NULL) return(NULL); + xmlBufSetAllocationScheme(buf, XML_BUFFER_ALLOC_HYBRID); + q = cur; while (*cur != 0) { if (cur[0] == '&') { @@ -1471,19 +1494,8 @@ * Save the current text. */ if (cur != q) { - if ((last != NULL) && (last->type == XML_TEXT_NODE)) { - xmlNodeAddContentLen(last, q, cur - q); - } else { - node = xmlNewDocTextLen(doc, q, cur - q); - if (node == NULL) return(ret); - if (last == NULL) - last = ret = node; - else { - last->next = node; - node->prev = last; - last = node; - } - } + if (xmlBufAdd(buf, q, cur - q)) + goto out; } q = cur; if ((cur[1] == '#') && (cur[2] == 'x')) { @@ -1536,7 +1548,7 @@ if (*cur == 0) { xmlTreeErr(XML_TREE_UNTERMINATED_ENTITY, (xmlNodePtr) doc, (const char *) q); - return(ret); + goto out; } if (cur != q) { /* @@ -1546,23 +1558,32 @@ ent = xmlGetDocEntity(doc, val); if ((ent != NULL) && (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { - if (last == NULL) { - node = xmlNewDocText(doc, ent->content); - last = ret = node; - } else if (last->type != XML_TEXT_NODE) { - node = xmlNewDocText(doc, ent->content); - last = xmlAddNextSibling(last, node); - } else - xmlNodeAddContent(last, ent->content); + if (xmlBufCat(buf, ent->content)) + goto out; + } else { /* + * Flush buffer so far + */ + if (!xmlBufIsEmpty(buf)) { + node = xmlNewDocText(doc, NULL); + node->content = xmlBufDetach(buf); + + if (last == NULL) { + last = ret = node; + } else { + last = xmlAddNextSibling(last, node); + } + } + + /* * Create a new REFERENCE_REF node */ node = xmlNewReference(doc, val); if (node == NULL) { if (val != NULL) xmlFree(val); - return(ret); + goto out; } else if ((ent != NULL) && (ent->children == NULL)) { xmlNodePtr temp; @@ -1588,19 +1609,15 @@ q = cur; } if (charval != 0) { - xmlChar buf[10]; + xmlChar buffer[10]; int len; - len = xmlCopyCharMultiByte(buf, charval); - buf[len] = 0; - node = xmlNewDocText(doc, buf); - if (node != NULL) { - if (last == NULL) { - last = ret = node; - } else { - last = xmlAddNextSibling(last, node); - } - } + len = xmlCopyCharMultiByte(buffer, charval); + buffer[len] = 0; + + if (xmlBufCat(buf, buffer)) + goto out; + charval = 0; } } else cur++; @@ -1609,18 +1626,22 @@ /* * Handle the last piece of text. */ - if ((last != NULL) && (last->type == XML_TEXT_NODE)) { - xmlNodeAddContentLen(last, q, cur - q); + xmlBufAdd(buf, q, cur - q); + } + + if (!xmlBufIsEmpty(buf)) { + node = xmlNewDocText(doc, NULL); + node->content = xmlBufDetach(buf); + + if (last == NULL) { + last = ret = node; } else { - node = xmlNewDocTextLen(doc, q, cur - q); - if (node == NULL) return(ret); - if (last == NULL) { - last = ret = node; - } else { - last = xmlAddNextSibling(last, node); - } + last = xmlAddNextSibling(last, node); } } + +out: + xmlBufFree(buf); return(ret); } @@ -1641,9 +1662,14 @@ xmlNodePtr node = list; xmlChar *ret = NULL; xmlEntityPtr ent; + int attr; if (list == NULL) return (NULL); + if ((list->parent != NULL) && (list->parent->type == XML_ATTRIBUTE_NODE)) + attr = 1; + else + attr = 0; while (node != NULL) { if ((node->type == XML_TEXT_NODE) || @@ -1653,7 +1679,10 @@ } else { xmlChar *buffer; - buffer = xmlEncodeEntitiesReentrant(doc, node->content); + if (attr) + buffer = xmlEncodeAttributeEntities(doc, node->content); + else + buffer = xmlEncodeEntitiesReentrant(doc, node->content); if (buffer != NULL) { ret = xmlStrcat(ret, buffer); xmlFree(buffer); @@ -2759,7 +2788,7 @@ xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) { xmlAttrPtr prop; - if (tree == NULL) + if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL)) return; if (tree->doc != doc) { if(tree->type == XML_ELEMENT_NODE) { @@ -2787,7 +2816,7 @@ xmlSetListDoc(xmlNodePtr list, xmlDocPtr doc) { xmlNodePtr cur; - if (list == NULL) + if ((list == NULL) || (list->type == XML_NAMESPACE_DECL)) return; cur = list; while (cur != NULL) { @@ -2894,7 +2923,9 @@ xmlAddPropSibling(xmlNodePtr prev, xmlNodePtr cur, xmlNodePtr prop) { xmlAttrPtr attr; - if (cur->type != XML_ATTRIBUTE_NODE) + if ((cur == NULL) || (cur->type != XML_ATTRIBUTE_NODE) || + (prop == NULL) || (prop->type != XML_ATTRIBUTE_NODE) || + ((prev != NULL) && (prev->type != XML_ATTRIBUTE_NODE))) return(NULL); /* check if an attribute with the same name exists */ @@ -2942,14 +2973,14 @@ */ xmlNodePtr xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddNextSibling : cur == NULL\n"); #endif return(NULL); } - if (elem == NULL) { + if ((elem == NULL) || (elem->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddNextSibling : elem == NULL\n"); @@ -3020,14 +3051,14 @@ */ xmlNodePtr xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddPrevSibling : cur == NULL\n"); #endif return(NULL); } - if (elem == NULL) { + if ((elem == NULL) || (elem->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddPrevSibling : elem == NULL\n"); @@ -3098,7 +3129,7 @@ xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) { xmlNodePtr parent; - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddSibling : cur == NULL\n"); @@ -3106,7 +3137,7 @@ return(NULL); } - if (elem == NULL) { + if ((elem == NULL) || (elem->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddSibling : elem == NULL\n"); @@ -3174,7 +3205,7 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { xmlNodePtr prev; - if (parent == NULL) { + if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddChildList : parent == NULL\n"); @@ -3182,7 +3213,7 @@ return(NULL); } - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddChildList : child == NULL\n"); @@ -3260,7 +3291,7 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { xmlNodePtr prev; - if (parent == NULL) { + if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddChild : parent == NULL\n"); @@ -3268,7 +3299,7 @@ return(NULL); } - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlAddChild : child == NULL\n"); @@ -3382,7 +3413,7 @@ */ xmlNodePtr xmlGetLastChild(xmlNodePtr parent) { - if (parent == NULL) { + if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlGetLastChild : parent == NULL\n"); @@ -3732,6 +3763,10 @@ * @cur: the node * * Unlink a node from it's current context, the node is not freed + * If one need to free the node, use xmlFreeNode() routine after the + * unlink to discard it. + * Note that namespace nodes can't be unlinked as they do not have + * pointer to their parent. */ void xmlUnlinkNode(xmlNodePtr cur) { @@ -3742,6 +3777,8 @@ #endif return; } + if (cur->type == XML_NAMESPACE_DECL) + return; if (cur->type == XML_DTD_NODE) { xmlDocPtr doc; doc = cur->doc; @@ -3810,14 +3847,15 @@ xmlNodePtr xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) { if (old == cur) return(NULL); - if ((old == NULL) || (old->parent == NULL)) { + if ((old == NULL) || (old->type == XML_NAMESPACE_DECL) || + (old->parent == NULL)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlReplaceNode : old == NULL or without parent\n"); #endif return(NULL); } - if (cur == NULL) { + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { xmlUnlinkNode(old); return(old); } @@ -3931,6 +3969,8 @@ xmlAttrPtr ret; if (cur == NULL) return(NULL); + if ((target != NULL) && (target->type != XML_ELEMENT_NODE)) + return(NULL); if (target != NULL) ret = xmlNewDocProp(target->doc, cur->name, NULL); else if (doc != NULL) @@ -4050,6 +4090,8 @@ xmlAttrPtr ret = NULL; xmlAttrPtr p = NULL,q; + if ((target != NULL) && (target->type != XML_ELEMENT_NODE)) + return(NULL); while (cur != NULL) { q = xmlCopyProp(target, cur); if (q == NULL) @@ -4495,39 +4537,71 @@ ************************************************************************/ /** - * xmlGetLineNo: + * xmlGetLineNoInternal: * @node: valid node + * @depth: used to limit any risk of recursion * - * Get line number of @node. This requires activation of this option - * before invoking the parser by calling xmlLineNumbersDefault(1) + * Get line number of @node. + * Try to override the limitation of lines being store in 16 bits ints * * Returns the line number if successful, -1 otherwise */ -long -xmlGetLineNo(xmlNodePtr node) +static long +xmlGetLineNoInternal(xmlNodePtr node, int depth) { long result = -1; + if (depth >= 5) + return(-1); + if (!node) return result; if ((node->type == XML_ELEMENT_NODE) || (node->type == XML_TEXT_NODE) || (node->type == XML_COMMENT_NODE) || - (node->type == XML_PI_NODE)) - result = (long) node->line; - else if ((node->prev != NULL) && + (node->type == XML_PI_NODE)) { + if (node->line == 65535) { + if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL)) + result = (long) node->psvi; + else if ((node->type == XML_ELEMENT_NODE) && + (node->children != NULL)) + result = xmlGetLineNoInternal(node->children, depth + 1); + else if (node->next != NULL) + result = xmlGetLineNoInternal(node->next, depth + 1); + else if (node->prev != NULL) + result = xmlGetLineNoInternal(node->prev, depth + 1); + } + if ((result == -1) || (result == 65535)) + result = (long) node->line; + } else if ((node->prev != NULL) && ((node->prev->type == XML_ELEMENT_NODE) || (node->prev->type == XML_TEXT_NODE) || (node->prev->type == XML_COMMENT_NODE) || (node->prev->type == XML_PI_NODE))) - result = xmlGetLineNo(node->prev); + result = xmlGetLineNoInternal(node->prev, depth + 1); else if ((node->parent != NULL) && (node->parent->type == XML_ELEMENT_NODE)) - result = xmlGetLineNo(node->parent); + result = xmlGetLineNoInternal(node->parent, depth + 1); return result; } +/** + * xmlGetLineNo: + * @node: valid node + * + * Get line number of @node. + * Try to override the limitation of lines being store in 16 bits ints + * if XML_PARSE_BIG_LINES parser option was used + * + * Returns the line number if successful, -1 otherwise + */ +long +xmlGetLineNo(xmlNodePtr node) +{ + return(xmlGetLineNoInternal(node, 0)); +} + #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) /** * xmlGetNodePath: @@ -4550,7 +4624,7 @@ char nametemp[100]; int occur = 0, generic; - if (node == NULL) + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) return (NULL); buf_len = 500; @@ -4815,7 +4889,7 @@ xmlNodePtr old = NULL; if (doc == NULL) return(NULL); - if (root == NULL) + if ((root == NULL) || (root->type == XML_NAMESPACE_DECL)) return(NULL); xmlUnlinkNode(root); xmlSetTreeDoc(root, doc); @@ -4902,6 +4976,8 @@ xmlNodeGetLang(xmlNodePtr cur) { xmlChar *lang; + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) + return(NULL); while (cur != NULL) { lang = xmlGetNsProp(cur, BAD_CAST "lang", XML_XML_NAMESPACE); if (lang != NULL) @@ -4981,6 +5057,8 @@ xmlNodeGetSpacePreserve(xmlNodePtr cur) { xmlChar *space; + if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) + return(-1); while (cur != NULL) { space = xmlGetNsProp(cur, BAD_CAST "space", XML_XML_NAMESPACE); if (space != NULL) { @@ -5147,6 +5225,8 @@ if ((cur == NULL) && (doc == NULL)) return(NULL); + if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) + return(NULL); if (doc == NULL) doc = cur->doc; if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) { cur = doc->children; @@ -5226,11 +5306,39 @@ int xmlNodeBufGetContent(xmlBufferPtr buffer, xmlNodePtr cur) { + xmlBufPtr buf; + int ret; + if ((cur == NULL) || (buffer == NULL)) return(-1); + buf = xmlBufFromBuffer(buffer); + ret = xmlBufGetNodeContent(buf, cur); + buffer = xmlBufBackToBuffer(buf); + if ((ret < 0) || (buffer == NULL)) + return(-1); + return(0); +} + +/** + * xmlBufGetNodeContent: + * @buf: a buffer xmlBufPtr + * @cur: the node being read + * + * Read the value of a node @cur, this can be either the text carried + * directly by this node if it's a TEXT node or the aggregate string + * of the values carried by this node child's (TEXT and ENTITY_REF). + * Entity references are substituted. + * Fills up the buffer @buffer with this value + * + * Returns 0 in case of success and -1 in case of error. + */ +int +xmlBufGetNodeContent(xmlBufPtr buf, xmlNodePtr cur) +{ + if ((cur == NULL) || (buf == NULL)) return(-1); switch (cur->type) { case XML_CDATA_SECTION_NODE: case XML_TEXT_NODE: - xmlBufferCat(buffer, cur->content); + xmlBufCat(buf, cur->content); break; case XML_DOCUMENT_FRAG_NODE: case XML_ELEMENT_NODE:{ @@ -5241,10 +5349,10 @@ case XML_CDATA_SECTION_NODE: case XML_TEXT_NODE: if (tmp->content != NULL) - xmlBufferCat(buffer, tmp->content); + xmlBufCat(buf, tmp->content); break; case XML_ENTITY_REF_NODE: - xmlNodeBufGetContent(buffer, tmp); + xmlBufGetNodeContent(buf, tmp); break; default: break; @@ -5288,16 +5396,16 @@ while (tmp != NULL) { if (tmp->type == XML_TEXT_NODE) - xmlBufferCat(buffer, tmp->content); + xmlBufCat(buf, tmp->content); else - xmlNodeBufGetContent(buffer, tmp); + xmlBufGetNodeContent(buf, tmp); tmp = tmp->next; } break; } case XML_COMMENT_NODE: case XML_PI_NODE: - xmlBufferCat(buffer, cur->content); + xmlBufCat(buf, cur->content); break; case XML_ENTITY_REF_NODE:{ xmlEntityPtr ent; @@ -5315,7 +5423,7 @@ * xmlNodeGetContent() which handles all possible node types */ tmp = ent->children; while (tmp) { - xmlNodeBufGetContent(buffer, tmp); + xmlBufGetNodeContent(buf, tmp); tmp = tmp->next; } break; @@ -5337,13 +5445,13 @@ if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_TEXT_NODE) || (cur->type == XML_CDATA_SECTION_NODE)) { - xmlNodeBufGetContent(buffer, cur); + xmlBufGetNodeContent(buf, cur); } cur = cur->next; } break; case XML_NAMESPACE_DECL: - xmlBufferCat(buffer, ((xmlNsPtr) cur)->href); + xmlBufCat(buf, ((xmlNsPtr) cur)->href); break; case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: @@ -5352,6 +5460,7 @@ } return(0); } + /** * xmlNodeGetContent: * @cur: the node being read @@ -5371,16 +5480,15 @@ switch (cur->type) { case XML_DOCUMENT_FRAG_NODE: case XML_ELEMENT_NODE:{ - xmlBufferPtr buffer; + xmlBufPtr buf; xmlChar *ret; - buffer = xmlBufferCreateSize(64); - if (buffer == NULL) + buf = xmlBufCreateSize(64); + if (buf == NULL) return (NULL); - xmlNodeBufGetContent(buffer, cur); - ret = buffer->content; - buffer->content = NULL; - xmlBufferFree(buffer); + xmlBufGetNodeContent(buf, cur); + ret = xmlBufDetach(buf); + xmlBufFree(buf); return (ret); } case XML_ATTRIBUTE_NODE: @@ -5392,7 +5500,7 @@ return (NULL); case XML_ENTITY_REF_NODE:{ xmlEntityPtr ent; - xmlBufferPtr buffer; + xmlBufPtr buf; xmlChar *ret; /* lookup entity declaration */ @@ -5400,15 +5508,14 @@ if (ent == NULL) return (NULL); - buffer = xmlBufferCreate(); - if (buffer == NULL) + buf = xmlBufCreate(); + if (buf == NULL) return (NULL); - xmlNodeBufGetContent(buffer, cur); + xmlBufGetNodeContent(buf, cur); - ret = buffer->content; - buffer->content = NULL; - xmlBufferFree(buffer); + ret = xmlBufDetach(buf); + xmlBufFree(buf); return (ret); } case XML_ENTITY_NODE: @@ -5423,18 +5530,17 @@ case XML_DOCB_DOCUMENT_NODE: #endif case XML_HTML_DOCUMENT_NODE: { - xmlBufferPtr buffer; + xmlBufPtr buf; xmlChar *ret; - buffer = xmlBufferCreate(); - if (buffer == NULL) + buf = xmlBufCreate(); + if (buf == NULL) return (NULL); - xmlNodeBufGetContent(buffer, (xmlNodePtr) cur); + xmlBufGetNodeContent(buf, (xmlNodePtr) cur); - ret = buffer->content; - buffer->content = NULL; - xmlBufferFree(buffer); + ret = xmlBufDetach(buf); + xmlBufFree(buf); return (ret); } case XML_NAMESPACE_DECL: { @@ -5755,6 +5861,9 @@ int maxns = 10; int i; + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) + return(NULL); + while (node != NULL) { if (node->type == XML_ELEMENT_NODE) { cur = node->nsDef; @@ -5853,7 +5962,7 @@ xmlNsPtr cur; xmlNodePtr orig = node; - if (node == NULL) return(NULL); + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) return(NULL); if ((nameSpace != NULL) && (xmlStrEqual(nameSpace, (const xmlChar *)"xml"))) { if ((doc == NULL) && (node->type == XML_ELEMENT_NODE)) { @@ -5983,7 +6092,7 @@ xmlNodePtr orig = node; int is_attr; - if ((node == NULL) || (href == NULL)) + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) || (href == NULL)) return (NULL); if (xmlStrEqual(href, XML_XML_NAMESPACE)) { /* @@ -6074,7 +6183,7 @@ xmlChar prefix[50]; int counter = 1; - if (tree == NULL) { + if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlNewReconciliedNs : tree == NULL\n"); @@ -6914,6 +7023,34 @@ } /** + * xmlBufferDetach: + * @buf: the buffer + * + * Remove the string contained in a buffer and gie it back to the + * caller. The buffer is reset to an empty content. + * This doesn't work with immutable buffers as they can't be reset. + * + * Returns the previous string contained by the buffer. + */ +xmlChar * +xmlBufferDetach(xmlBufferPtr buf) { + xmlChar *ret; + + if (buf == NULL) + return(NULL); + if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) + return(NULL); + + ret = buf->content; + buf->content = NULL; + buf->size = 0; + buf->use = 0; + + return ret; +} + + +/** * xmlBufferCreateStatic: * @mem: the memory area * @size: the size in byte @@ -6964,6 +7101,7 @@ (buf->alloc == XML_BUFFER_ALLOC_IO)) return; if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) || (scheme == XML_BUFFER_ALLOC_EXACT) || + (scheme == XML_BUFFER_ALLOC_HYBRID) || (scheme == XML_BUFFER_ALLOC_IMMUTABLE)) buf->alloc = scheme; } @@ -7231,6 +7369,21 @@ case XML_BUFFER_ALLOC_EXACT: newSize = size+10; break; + case XML_BUFFER_ALLOC_HYBRID: + if (buf->use < BASE_BUFFER_SIZE) + newSize = size; + else { + newSize = buf->size * 2; + while (size > newSize) { + if (newSize > UINT_MAX / 2) { + xmlTreeErrMemory("growing buffer"); + return 0; + } + newSize *= 2; + } + } + break; + default: newSize = size+10; break; @@ -7887,6 +8040,8 @@ if ((map == NULL) || (*map != NULL)) return (-1); + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) + return (-1); /* * Get in-scope ns-decls of @parent. */ @@ -8154,6 +8309,8 @@ if ((doc == NULL) || (nsName == NULL) || (retNs == NULL)) return (-1); + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) + return(-1); *retNs = NULL; if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) { @@ -8252,8 +8409,8 @@ xmlNodePtr cur; xmlNsPtr ns; - if ((doc == NULL) || (node == NULL)) - return (-1); + if ((doc == NULL) || (node == NULL) || (node->type == XML_NAMESPACE_DECL)) + return(-1); if (retNs) *retNs = NULL; @@ -8321,6 +8478,9 @@ char buf[50]; const xmlChar *pref; int counter = 0; + + if ((doc == NULL) || (elem == NULL) || (elem->type != XML_ELEMENT_NODE)) + return(NULL); /* * Create a ns-decl on @anchor. */ @@ -8837,6 +8997,9 @@ parnsdone = 0; cur = node; + if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) + goto internal_error; + while (cur != NULL) { /* * Paranoid source-doc sanity check. @@ -9216,6 +9379,9 @@ *resNode = NULL; cur = node; + if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) + return(-1); + while (cur != NULL) { if (cur->doc != sourceDoc) { /* @@ -9733,6 +9899,8 @@ if (attr->children == NULL) return (0); cur = attr->children; + if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) + goto internal_error; while (cur != NULL) { cur->doc = destDoc; switch (cur->type) { @@ -9817,7 +9985,8 @@ xmlNodePtr destParent, int options) { - if ((node == NULL) || (destDoc == NULL) || + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) || + (destDoc == NULL) || ((destParent != NULL) && (destParent->doc != destDoc))) return(-1); /* Index: lib/3rdparty/libxml2/trio.c =================================================================== --- lib/3rdparty/libxml2/trio.c (revision 58293) +++ lib/3rdparty/libxml2/trio.c (working copy) @@ -307,6 +307,10 @@ #define NAN_LOWER "nan" #define NAN_UPPER "NAN" +#if !defined(HAVE_ISASCII) && !defined(isascii) +# define isascii(x) ((unsigned int)(x) < 128) +#endif + /* Various constants */ enum { TYPE_PRINT = 1, @@ -376,7 +380,7 @@ /* Maximal string lengths for user-defined specifiers */ MAX_USER_NAME = 64, MAX_USER_DATA = 256, - + /* Maximal length of locale separator strings */ MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX, /* Maximal number of integers in grouping */ @@ -1020,23 +1024,23 @@ trio_userdef_t **prev) { trio_userdef_t *def; - + if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + for (def = internalUserDef; def; def = def->next) { /* Case-sensitive string comparison */ if (trio_equal_case(def->name, name)) break; - + if (prev) *prev = def; } - + if (internalLeaveCriticalRegion) (void)internalLeaveCriticalRegion(NULL); - + return def; } #endif @@ -1200,7 +1204,7 @@ /* One and only one of arglist and argarray must be used */ assert((arglist != NULL) ^ (argarray != NULL)); - + /* * The 'parameters' array is not initialized, but we need to * know which entries we have used. @@ -1213,7 +1217,7 @@ #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + while (format[index]) { #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) @@ -1291,7 +1295,7 @@ /* Skip if no precision */ if (QUALIFIER_DOT == format[index]) break; - + /* After the first dot we have the precision */ flags |= FLAGS_PRECISION; if ((QUALIFIER_STAR == format[index]) @@ -1336,7 +1340,7 @@ else if (dots == 1) /* Base */ { dots++; - + /* After the second dot we have the base */ flags |= FLAGS_BASE; if ((QUALIFIER_STAR == format[index]) @@ -1535,7 +1539,7 @@ } else return TRIO_ERROR_RETURN(TRIO_EINVAL, index); - + flags |= FLAGS_FIXED_SIZE; break; #endif @@ -1563,7 +1567,7 @@ gotSticky = TRUE; break; #endif - + #if defined(QUALIFIER_VARSIZE) case QUALIFIER_VARSIZE: flags |= FLAGS_VARSIZE_PARAMETER; @@ -1628,9 +1632,9 @@ indices[varsize] = pos; varsize = pos++; } - + indices[currentParam] = pos; - + switch (format[index++]) { #if defined(SPECIFIER_CHAR_UPPER) @@ -1689,11 +1693,11 @@ } } break; - + case SPECIFIER_INTEGER: parameters[pos].type = FORMAT_INT; break; - + case SPECIFIER_UNSIGNED: flags |= FLAGS_UNSIGNED; parameters[pos].type = FORMAT_INT; @@ -1793,11 +1797,11 @@ { unsigned int max; int without_namespace = TRUE; - + parameters[pos].type = FORMAT_USER_DEFINED; parameters[pos].user_name[0] = NIL; tmpformat = (char *)&format[index]; - + while ((ch = format[index])) { index++; @@ -1845,7 +1849,7 @@ } break; #endif /* defined(SPECIFIER_USER_DEFINED_BEGIN) */ - + default: /* Bail out completely to make the error more obvious */ return TRIO_ERROR_RETURN(TRIO_EINVAL, index); @@ -1853,7 +1857,7 @@ /* Count the number of times this entry has been used */ usedEntries[currentParam] += 1; - + /* Find last sticky parameters */ if (gotSticky && !(flags & FLAGS_STICKY)) { @@ -1876,7 +1880,7 @@ } } } - + parameters[pos].indexAfterSpecifier = index; parameters[pos].flags = flags; parameters[pos].width = width; @@ -1884,12 +1888,12 @@ parameters[pos].base = (base == NO_BASE) ? BASE_DECIMAL : base; parameters[pos].varsize = varsize; pos++; - + if (! positional) parameterPosition++; - + } /* if identifier */ - + } /* while format characters left */ for (num = 0; num <= maxParam; num++) @@ -1901,7 +1905,7 @@ else /* double references detected */ return TRIO_ERROR_RETURN(TRIO_EDBLREF, num); } - + i = indices[num]; /* @@ -1969,7 +1973,7 @@ if (TYPE_SCAN == type) { if (argarray == NULL) - parameters[i].data.pointer = + parameters[i].data.pointer = (trio_pointer_t)va_arg(*arglist, trio_pointer_t); else { @@ -2009,7 +2013,7 @@ varsize = parameters[i].varsize; } parameters[i].flags &= ~FLAGS_ALL_VARSIZES; - + if (varsize <= (int)sizeof(int)) ; else if (varsize <= (int)sizeof(long)) @@ -2213,7 +2217,7 @@ number &= (unsigned long)-1; else number &= (unsigned int)-1; - + /* Build number */ pointer = bufferend = &buffer[sizeof(buffer) - 1]; *pointer-- = NIL; @@ -2260,7 +2264,7 @@ count = (! ((flags & FLAGS_LEFTADJUST) || (precision == NO_PRECISION))) ? precision : 0; - + /* Adjust width further */ if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) width--; @@ -2495,7 +2499,7 @@ if (width == NO_WIDTH) width = sizeof(buffer); - + size = wctomb(buffer, wch); if ((size <= 0) || (size > width) || (buffer[0] == NIL)) return 0; @@ -2537,13 +2541,13 @@ #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + if (wstring == NULL) { TrioWriteString(self, NULL, flags, width, precision); return; } - + if (NO_PRECISION == precision) { length = INT_MAX; @@ -2638,7 +2642,7 @@ BOOLEAN_T keepTrailingZeroes; BOOLEAN_T keepDecimalPoint; trio_long_double_t epsilon; - + assert(VALID(self)); assert(VALID(self->OutStream)); assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); @@ -2653,7 +2657,7 @@ : NAN_LOWER, flags, width, precision); return; - + case TRIO_FP_INFINITE: if (isNegative) { @@ -2680,7 +2684,7 @@ /* Finitude */ break; } - + /* Normal numbers */ if (flags & FLAGS_LONGDOUBLE) { @@ -2728,13 +2732,13 @@ precision = FLT_DIG; } } - + if (isNegative) number = -number; if (isHex) flags |= FLAGS_FLOAT_E; - + if (flags & FLAGS_FLOAT_G) { if (precision == 0) @@ -2787,7 +2791,7 @@ integerNumber = floorl(number); fractionNumber = number - integerNumber; - + /* * Truncated number. * @@ -2802,7 +2806,7 @@ : zeroes + precision; dblFractionBase = TrioPower(base, fractionDigits); - + workNumber = number + 0.5 / dblFractionBase; if (floorl(number) != floorl(workNumber)) { @@ -2855,7 +2859,7 @@ integerThreshold = INT_MAX; fractionThreshold = INT_MAX; } - + /* * Calculate expected width. * sign + integer part + thousands separators + decimal point @@ -2891,7 +2895,7 @@ ((requireTwoDigitExponent ? sizeof("E+0") : sizeof("E+")) - 1); if (isHex) expectedWidth += sizeof("0X") - 1; - + /* Output prefixing */ if (flags & FLAGS_NILPADDING) { @@ -2937,7 +2941,7 @@ self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); } } - + /* Output the integer part and thousand separators */ dblIntegerBase = 1.0 / TrioPower(base, integerDigits - 1); for (i = 0; i < integerDigits; i++) @@ -2953,7 +2957,7 @@ self->OutStream(self, digits[(int)fmodl(workNumber, dblBase)]); } dblIntegerBase *= dblBase; - + if (((flags & (FLAGS_FLOAT_E | FLAGS_QUOTE)) == FLAGS_QUOTE) && TrioFollowedBySeparator(integerDigits - i)) { @@ -2965,7 +2969,7 @@ } } } - + /* Insert decimal point and build the fraction part */ trailingZeroes = 0; @@ -3014,7 +3018,7 @@ } } } - + if (keepTrailingZeroes) { while (trailingZeroes > 0) @@ -3023,7 +3027,7 @@ trailingZeroes--; } } - + /* Output exponent */ if (exponentDigits > 0) { @@ -3080,13 +3084,13 @@ int precision; int base; int index; - + index = 0; i = 0; #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + while (format[index]) { #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) @@ -3120,7 +3124,7 @@ /* Skip the parameter entries */ while (parameters[i].type == FORMAT_PARAMETER) i++; - + flags = parameters[i].flags; /* Find width */ @@ -3140,7 +3144,7 @@ width = -width; } } - + /* Find precision */ if (flags & FLAGS_PRECISION) { @@ -3171,7 +3175,7 @@ /* Get base from parameter list */ base = (int)parameters[base].data.number.as_signed; } - + switch (parameters[i].type) { case FORMAT_CHAR: @@ -3251,7 +3255,7 @@ case FORMAT_POINTER: { trio_reference_t reference; - + reference.data = data; reference.parameter = ¶meters[i]; trio_print_pointer(&reference, parameters[i].data.pointer); @@ -3354,7 +3358,7 @@ } break; #endif /* defined(FORMAT_USER_DEFINED) */ - + default: break; } /* switch parameter type */ @@ -3564,7 +3568,7 @@ assert(VALID(self)); assert(VALID(self->location)); - + buffer = (char **)self->location; if (self->processed < self->max) @@ -3632,7 +3636,7 @@ va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(stdout, 0, TrioOutStreamFile, format, &args, NULL); TRIO_VA_END(args); @@ -3699,7 +3703,7 @@ assert(VALID(file)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL); TRIO_VA_END(args); @@ -3723,7 +3727,7 @@ { assert(VALID(file)); assert(VALID(format)); - + return TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL); } @@ -3744,7 +3748,7 @@ { assert(VALID(file)); assert(VALID(format)); - + return TrioFormat(file, 0, TrioOutStreamFile, format, NULL, args); } @@ -3771,7 +3775,7 @@ va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL); TRIO_VA_END(args); @@ -3794,7 +3798,7 @@ va_list args) { assert(VALID(format)); - + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL); } @@ -3814,7 +3818,7 @@ trio_pointer_t *args) { assert(VALID(format)); - + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, NULL, args); } @@ -3904,7 +3908,7 @@ assert(VALID(buffer)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args, NULL); *buffer = NIL; /* Terminate with NIL character */ @@ -4098,7 +4102,7 @@ { int status; size_t buf_len; - + assert(VALID(buffer)); assert(VALID(format)); @@ -4126,7 +4130,7 @@ char *result = NULL; assert(VALID(format)); - + info = trio_xstring_duplicate(""); if (info) { @@ -4151,9 +4155,9 @@ { trio_string_t *info; char *result = NULL; - + assert(VALID(format)); - + info = trio_xstring_duplicate(""); if (info) { @@ -4180,7 +4184,7 @@ assert(VALID(format)); *result = NULL; - + info = trio_xstring_duplicate(""); if (info == NULL) { @@ -4211,11 +4215,11 @@ { int status; trio_string_t *info; - + assert(VALID(format)); *result = NULL; - + info = trio_xstring_duplicate(""); if (info == NULL) { @@ -4264,7 +4268,7 @@ @param name @return Handle. */ -TRIO_PUBLIC trio_pointer_t +TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2((callback, name), trio_callback_t callback, @@ -4291,23 +4295,23 @@ } return NULL; } - + /* Bail out if namespace is too long */ if (trio_length(name) >= MAX_USER_NAME) return NULL; - + /* Bail out if namespace already is registered */ def = TrioFindNamespace(name, &prev); if (def) return NULL; } - + def = (trio_userdef_t *)TRIO_MALLOC(sizeof(trio_userdef_t)); if (def) { if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + if (name) { /* Link into internal list */ @@ -4352,12 +4356,12 @@ { if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + if (prev == NULL) internalUserDef = NULL; else prev->next = def->next; - + if (internalLeaveCriticalRegion) (void)internalLeaveCriticalRegion(NULL); } @@ -4377,14 +4381,14 @@ #if defined(FORMAT_USER_DEFINED) assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - + return (((trio_reference_t *)ref)->parameter->user_data); } /************************************************************************* * trio_get_argument [public] */ -trio_pointer_t +trio_pointer_t trio_get_argument TRIO_ARGS1((ref), trio_pointer_t ref) @@ -4392,7 +4396,7 @@ #if defined(FORMAT_USER_DEFINED) assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - + return ((trio_reference_t *)ref)->parameter->data.pointer; } @@ -4924,7 +4928,7 @@ va_list arglist; assert(VALID(format)); - + TRIO_VA_START(arglist, format); status = TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL); TRIO_VA_END(arglist); @@ -4942,7 +4946,7 @@ va_list arglist) { assert(VALID(format)); - + return TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL); } @@ -4957,7 +4961,7 @@ trio_pointer_t *argarray) { assert(VALID(format)); - + return TrioFormatRef((trio_reference_t *)ref, format, NULL, argarray); } @@ -5206,7 +5210,7 @@ switch (ch) { case QUALIFIER_MINUS: /* Scanlist ranges */ - + /* * Both C99 and UNIX98 describes ranges as implementation- * defined. @@ -5233,17 +5237,17 @@ return TRIO_ERROR_RETURN(TRIO_EINVAL, index); if (range_begin > range_end) return TRIO_ERROR_RETURN(TRIO_ERANGE, index); - + for (i = (int)range_begin; i <= (int)range_end; i++) characterclass[i]++; - + ch = range_end; break; - + #if TRIO_EXTENSION case SPECIFIER_GROUP: - + switch (format[index + 1]) { case QUALIFIER_DOT: /* Collating symbol */ @@ -5262,15 +5266,15 @@ } if (format[++i] != SPECIFIER_UNGROUP) return -1; - + index = i; break; - + case QUALIFIER_EQUAL: /* Equivalence class expressions */ { unsigned int j; unsigned int k; - + if (internalCollationUnconverted) { /* Lazy evaluation of collation array */ @@ -5294,13 +5298,13 @@ } if (format[++i] != SPECIFIER_UNGROUP) return -1; - + index = i; } break; - + case QUALIFIER_COLON: /* Character class expressions */ - + if (trio_equal_max(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1, &format[index])) { @@ -5400,9 +5404,9 @@ break; } break; - + #endif /* TRIO_EXTENSION */ - + default: characterclass[(int)ch]++; break; @@ -5448,9 +5452,9 @@ } internalDigitsUnconverted = FALSE; } - + TrioSkipWhitespaces(self); - + if (!(flags & FLAGS_UNSIGNED)) { /* Leading sign */ @@ -5464,9 +5468,9 @@ isNegative = TRUE; } } - + count = self->processed; - + if (flags & FLAGS_ALTERNATIVE) { switch (base) @@ -5527,7 +5531,7 @@ } else break; - + number *= base; number += digit; gotNumber = TRUE; /* we need at least one digit */ @@ -5538,7 +5542,7 @@ /* Was anything read at all? */ if (!gotNumber) return FALSE; - + if (target) *target = (isNegative) ? -((trio_intmax_t)number) : number; return TRUE; @@ -5558,7 +5562,7 @@ int i; char ch; trio_uintmax_t number; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5603,7 +5607,7 @@ break; } } - + if (target) target[i] = ch; } @@ -5622,12 +5626,12 @@ int width) { int i; - + assert(VALID(self)); assert(VALID(self->InStream)); TrioSkipWhitespaces(self); - + /* * Continue until end of string is reached, a whitespace is encountered, * or width is exceeded @@ -5663,7 +5667,7 @@ int amount = 0; trio_wchar_t wch; char buffer[MB_LEN_MAX + 1]; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5720,7 +5724,7 @@ { int i; int size; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5729,7 +5733,7 @@ #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + /* * Continue until end of string is reached, a whitespace is encountered, * or width is exceeded @@ -5767,7 +5771,7 @@ { int ch; int i; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5782,7 +5786,7 @@ target[i] = (char)ch; self->InStream(self, &ch); } - + if (target) target[i] = NIL; return TRUE; @@ -5811,12 +5815,12 @@ BOOLEAN_T isHex = FALSE; doubleString[0] = 0; - + if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1)) width = sizeof(doubleString) - 1; - + TrioSkipWhitespaces(self); - + /* * Read entire double number from stream. trio_to_double requires * a string as input, but InStream can be anything, so we have to @@ -5902,11 +5906,11 @@ self->InStream(self, &ch); } break; - + default: break; } - + while ((ch != EOF) && (index - start < width)) { /* Integer part */ @@ -5966,7 +5970,7 @@ return FALSE; doubleString[index] = 0; - + if (flags & FLAGS_LONGDOUBLE) { *((trio_long_double_t *)target) = trio_to_long_double(doubleString, NULL); @@ -5992,7 +5996,7 @@ char buffer[sizeof(internalNullString)]; flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING); - + if (TrioReadNumber(self, &number, flags, @@ -6013,7 +6017,7 @@ : buffer, 0, sizeof(internalNullString) - 1)) - { + { if (trio_equal_case(buffer, internalNullString)) { if (target) @@ -6077,12 +6081,12 @@ } } #endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */ - + if ((EOF == ch) && (parameters[i].type != FORMAT_COUNT)) { return (assignment > 0) ? assignment : EOF; } - + if (CHAR_IDENTIFIER == format[index]) { if (CHAR_IDENTIFIER == format[index + 1]) @@ -6101,7 +6105,7 @@ /* Skip the parameter entries */ while (parameters[i].type == FORMAT_PARAMETER) i++; - + flags = parameters[i].flags; /* Find width */ width = parameters[i].width; @@ -6117,7 +6121,7 @@ /* Get base from parameter list */ base = (int)parameters[base].data.number.as_signed; } - + switch (parameters[i].type) { case FORMAT_INT: @@ -6165,7 +6169,7 @@ } } break; /* FORMAT_INT */ - + case FORMAT_STRING: #if TRIO_WIDECHAR if (flags & FLAGS_WIDECHAR) @@ -6229,7 +6233,7 @@ } /* Skip over group specifier */ index++; - + memset(characterclass, 0, sizeof(characterclass)); rc = TrioGetCharacterClass(format, &index, @@ -6291,7 +6295,7 @@ } } break; /* FORMAT_COUNT */ - + case FORMAT_CHAR: #if TRIO_WIDECHAR if (flags & FLAGS_WIDECHAR) @@ -6353,7 +6357,7 @@ } else return assignment; - + index++; } } @@ -6392,7 +6396,7 @@ TrioSetLocale(); } #endif - + status = TrioParse(TYPE_SCAN, format, parameters, arglist, argarray); if (status < 0) return status; @@ -6431,7 +6435,7 @@ self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6468,7 +6472,7 @@ self->committed++; self->processed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6485,7 +6489,7 @@ int *intPointer) { trio_custom_t *data; - + assert(VALID(self)); assert(VALID(self->location)); @@ -6494,7 +6498,7 @@ self->current = (data->stream.in == NULL) ? NIL : (data->stream.in)(data->closure); - + if (self->current == NIL) { self->current = EOF; @@ -6504,7 +6508,7 @@ self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6537,7 +6541,7 @@ self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6578,7 +6582,7 @@ va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, @@ -6594,7 +6598,7 @@ va_list args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, format, &args, NULL); @@ -6607,7 +6611,7 @@ trio_pointer_t *args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, format, NULL, args); @@ -6628,7 +6632,7 @@ assert(VALID(file)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, @@ -6646,7 +6650,7 @@ { assert(VALID(file)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, format, &args, NULL); @@ -6661,7 +6665,7 @@ { assert(VALID(file)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, format, NULL, args); @@ -6681,7 +6685,7 @@ va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, @@ -6698,7 +6702,7 @@ va_list args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, format, &args, NULL); @@ -6712,7 +6716,7 @@ trio_pointer_t *args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, format, NULL, args); @@ -6735,7 +6739,7 @@ assert(VALID(stream)); assert(VALID(format)); - + TRIO_VA_START(args, format); data.stream.in = stream; data.closure = closure; @@ -6753,7 +6757,7 @@ va_list args) { trio_custom_t data; - + assert(VALID(stream)); assert(VALID(format)); @@ -6771,7 +6775,7 @@ trio_pointer_t *args) { trio_custom_t data; - + assert(VALID(stream)); assert(VALID(format)); @@ -6795,7 +6799,7 @@ assert(VALID(buffer)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, @@ -6813,7 +6817,7 @@ { assert(VALID(buffer)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, format, &args, NULL); @@ -6828,7 +6832,7 @@ { assert(VALID(buffer)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, format, NULL, args); Index: lib/3rdparty/libxml2/trio.h =================================================================== --- lib/3rdparty/libxml2/trio.h (revision 58293) +++ lib/3rdparty/libxml2/trio.h (working copy) @@ -28,7 +28,7 @@ * Use autoconf defines if present. Packages using trio must define * HAVE_CONFIG_H as a compiler option themselves. */ -#if defined(HAVE_CONFIG_H) +#if defined(TRIO_HAVE_CONFIG_H) # include "config.h" #endif Index: lib/3rdparty/libxml2/trionan.c =================================================================== --- lib/3rdparty/libxml2/trionan.c (revision 58293) +++ lib/3rdparty/libxml2/trionan.c (working copy) @@ -261,7 +261,7 @@ static double result = 0.0; if (result == 0.0) { - + #if defined(INFINITY) && defined(__STDC_IEC_559__) result = (double)INFINITY; @@ -283,7 +283,7 @@ /* Force overflow */ result += HUGE_VAL; } - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif @@ -326,13 +326,13 @@ static double result = 0.0; if (result == 0.0) { - + #if defined(TRIO_COMPILER_SUPPORTS_C99) result = nan(""); #elif defined(NAN) && defined(__STDC_IEC_559__) result = (double)NAN; - + #elif defined(USE_IEEE_754) result = trio_make_double(ieee_754_qnan_array); @@ -349,13 +349,13 @@ # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + result = trio_pinf() / trio_pinf(); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + #endif } return result; @@ -381,7 +381,7 @@ * the conservative approach and only use it for UNIX95. */ return isnan(number); - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _isnan() @@ -398,20 +398,20 @@ int is_special_quantity; is_special_quantity = trio_is_special_quantity(number, &has_mantissa); - + return (is_special_quantity && has_mantissa); - + #else /* * Fallback solution */ int status; double integral, fraction; - + # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + status = (/* * NaN is the only number which does not compare to itself */ @@ -422,13 +422,13 @@ ((number != 0.0) && (fraction = modf(number, &integral), integral == fraction))); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + return status; - + #endif } @@ -459,7 +459,7 @@ return isinf(number) ? ((number > 0.0) ? 1 : -1) : 0; - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _fpclass() @@ -478,7 +478,7 @@ int is_special_quantity; is_special_quantity = trio_is_special_quantity(number, &has_mantissa); - + return (is_special_quantity && !has_mantissa) ? ((number < 0.0) ? -1 : 1) : 0; @@ -488,23 +488,23 @@ * Fallback solution. */ int status; - + # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + double infinity = trio_pinf(); - + status = ((number == infinity) ? 1 : ((number == -infinity) ? -1 : 0)); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + return status; - + #endif } @@ -526,7 +526,7 @@ * C99 defines isfinite() as a macro. */ return isfinite(number); - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder use _finite(). @@ -547,7 +547,7 @@ * Fallback solution. */ return ((trio_isinf(number) == 0) && (trio_isnan(number) == 0)); - + #endif } @@ -596,7 +596,7 @@ # define TRIO_NEGATIVE_ZERO FP_NEG_ZERO # define TRIO_POSITIVE_NORMAL FP_POS_NORM # define TRIO_NEGATIVE_NORMAL FP_NEG_NORM - + # elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _fpclass() @@ -613,7 +613,7 @@ # define TRIO_NEGATIVE_ZERO _FPCLASS_NZ # define TRIO_POSITIVE_NORMAL _FPCLASS_PN # define TRIO_NEGATIVE_NORMAL _FPCLASS_NN - + # elif defined(FP_PLUS_NORM) /* * HP-UX 9.x and 10.x have an fpclassify() function, that is different @@ -678,13 +678,13 @@ *is_negative = (number < 0.0); return TRIO_FP_NORMAL; } - + # else /* * Fallback solution. */ int rc; - + if (number == 0.0) { /* * In IEEE 754 the sign of zero is ignored in comparisons, so we @@ -716,7 +716,7 @@ } *is_negative = (number < 0.0); return TRIO_FP_NORMAL; - + # endif #endif } @@ -734,7 +734,7 @@ double number) { int is_negative; - + (void)trio_fpclassify_and_signbit(number, &is_negative); return is_negative; } @@ -753,7 +753,7 @@ double number) { int dummy; - + return trio_fpclassify_and_signbit(number, &dummy); } @@ -828,7 +828,7 @@ print_class("NNorm", -1.0); print_class("PSub", 1.01e-307 - 1.00e-307); print_class("NSub", 1.00e-307 - 1.01e-307); - + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n", my_nan, ((unsigned char *)&my_nan)[0], @@ -862,11 +862,11 @@ ((unsigned char *)&my_ninf)[6], ((unsigned char *)&my_ninf)[7], trio_isnan(my_ninf), trio_isinf(my_ninf)); - + # if defined(TRIO_PLATFORM_UNIX) signal_handler = signal(SIGFPE, SIG_IGN); # endif - + my_pinf = DBL_MAX + DBL_MAX; my_ninf = -my_pinf; my_nan = my_pinf / my_pinf; @@ -874,7 +874,7 @@ # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n", my_nan, ((unsigned char *)&my_nan)[0], @@ -908,7 +908,7 @@ ((unsigned char *)&my_ninf)[6], ((unsigned char *)&my_ninf)[7], trio_isnan(my_ninf), trio_isinf(my_ninf)); - + return 0; } #endif Index: lib/3rdparty/libxml2/trionan.h =================================================================== --- lib/3rdparty/libxml2/trionan.h (revision 58293) +++ lib/3rdparty/libxml2/trionan.h (working copy) @@ -46,7 +46,7 @@ * Return negative infinity. */ TRIO_PUBLIC double trio_ninf TRIO_PROTO((void)); - + /* * Return negative zero. */ Index: lib/3rdparty/libxml2/triostr.c =================================================================== --- lib/3rdparty/libxml2/triostr.c (revision 58293) +++ lib/3rdparty/libxml2/triostr.c (working copy) @@ -165,11 +165,11 @@ #if !defined(TRIO_MINIMAL) /** Append @p source at the end of @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p target string and @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -184,7 +184,7 @@ { assert(target); assert(source); - + return (strcat(target, source) != NULL); } #endif /* !defined(TRIO_MINIMAL) */ @@ -192,12 +192,12 @@ #if !defined(TRIO_MINIMAL) /** Append at most @p max characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chuck with sufficient room to contain the @p target string and the @p source string (at most @p max characters). @@ -213,12 +213,12 @@ TRIO_CONST char *source) { size_t length; - + assert(target); assert(source); length = trio_length(target); - + if (max > length) { strncat(target, source, max - length - 1); @@ -244,7 +244,7 @@ { assert(string); assert(substring); - + return (0 != strstr(string, substring)); } #endif /* !defined(TRIO_MINIMAL) */ @@ -253,11 +253,11 @@ #if !defined(TRIO_MINIMAL) /** Copy @p source to @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -272,7 +272,7 @@ { assert(target); assert(source); - + (void)strcpy(target, source); return TRUE; } @@ -281,12 +281,12 @@ /** Copy at most @p max characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string (at most @p max characters). @pre No boundary checking is performed, so insufficient memory will @@ -336,10 +336,10 @@ /** Duplicate @p source. - + @param source Source string. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ TRIO_STRING_PUBLIC char * @@ -354,11 +354,11 @@ #if !defined(TRIO_MINIMAL) /** Duplicate at most @p max characters of @p source. - + @param source Source string. @param max Maximum number of characters to duplicate. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ TRIO_STRING_PUBLIC char * @@ -383,11 +383,11 @@ /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ TRIO_STRING_PUBLIC int @@ -422,11 +422,11 @@ /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ TRIO_STRING_PUBLIC int @@ -449,12 +449,12 @@ #if !defined(TRIO_MINIMAL) /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ TRIO_STRING_PUBLIC int @@ -478,7 +478,7 @@ /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. @@ -504,12 +504,12 @@ /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ TRIO_STRING_PUBLIC int @@ -558,7 +558,7 @@ int error_number) { #if defined(USE_STRERROR) - + return strerror(error_number); #elif defined(USE_SYS_ERRLIST) @@ -569,11 +569,11 @@ return ((error_number < 0) || (error_number >= sys_nerr)) ? "unknown" : sys_errlist[error_number]; - + #else - + return "unknown"; - + #endif } @@ -603,7 +603,7 @@ assert(format); assert(datetime); assert(max > 0); - + return strftime(target, max, format, datetime); } #endif /* !defined(TRIO_MINIMAL) */ @@ -630,7 +630,7 @@ char ch; assert(string); - + switch (type) { case TRIO_HASH_PLAIN: @@ -719,7 +719,7 @@ @return Boolean value indicating success or failure. Case-insensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. @@ -732,7 +732,7 @@ { assert(string); assert(pattern); - + for (; ('*' != *pattern); ++pattern, ++string) { if (NIL == *string) @@ -757,7 +757,7 @@ } } while (*string++); - + return FALSE; } #endif /* !defined(TRIO_MINIMAL) */ @@ -772,7 +772,7 @@ @return Boolean value indicating success or failure. Case-sensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. @@ -785,7 +785,7 @@ { assert(string); assert(pattern); - + for (; ('*' != *pattern); ++pattern, ++string) { if (NIL == *string) @@ -810,7 +810,7 @@ } } while (*string++); - + return FALSE; } #endif /* !defined(TRIO_MINIMAL) */ @@ -837,7 +837,7 @@ assert(target); assert(source); assert(Function); - + while (*source != NIL) { *target++ = Function(*source++); @@ -894,7 +894,7 @@ assert(string); assert(substring); - + size = trio_length(substring); if (size <= max) { @@ -929,7 +929,7 @@ TRIO_CONST char *delimiters) { assert(delimiters); - + return strtok(string, delimiters); } #endif /* !defined(TRIO_MINIMAL) */ @@ -1064,7 +1064,7 @@ } } } - + value = integer + fraction; if (exponent != 0) { @@ -1146,7 +1146,7 @@ { assert(string); assert((base >= 2) && (base <= 36)); - + return strtol(string, endp, base); } @@ -1164,16 +1164,16 @@ int source) { #if defined(USE_TOLOWER) - + return tolower(source); - + #else /* Does not handle locales or non-contiguous alphabetic characters */ return ((source >= (int)'A') && (source <= (int)'Z')) ? source - 'A' + 'a' : source; - + #endif } #endif /* !defined(TRIO_MINIMAL) */ @@ -1195,7 +1195,7 @@ { assert(string); assert((base >= 2) && (base <= 36)); - + return strtoul(string, endp, base); } #endif /* !defined(TRIO_MINIMAL) */ @@ -1213,16 +1213,16 @@ int source) { #if defined(USE_TOUPPER) - + return toupper(source); - + #else /* Does not handle locales or non-contiguous alphabetic characters */ return ((source >= (int)'a') && (source <= (int)'z')) ? source - 'a' + 'A' : source; - + #endif } @@ -1266,7 +1266,7 @@ TrioStringAlloc(TRIO_NOARGS) { trio_string_t *self; - + self = (trio_string_t *)TRIO_MALLOC(sizeof(trio_string_t)); if (self) { @@ -1297,7 +1297,7 @@ new_size = (delta == 0) ? ( (self->allocated == 0) ? 1 : self->allocated * 2 ) : self->allocated + delta; - + new_content = (char *)TRIO_REALLOC(self->content, new_size); if (new_content) { @@ -1334,7 +1334,7 @@ #if !defined(TRIO_MINIMAL) /** Create a new dynamic string. - + @param initial_size Initial size of the buffer. @return Newly allocated dynamic string, or NULL if memory allocation failed. */ @@ -1367,7 +1367,7 @@ /** Deallocate the dynamic string and its contents. - + @param self Dynamic string */ TRIO_STRING_PUBLIC void @@ -1376,7 +1376,7 @@ trio_string_t *self) { assert(self); - + if (self) { trio_destroy(self->content); @@ -1388,11 +1388,11 @@ #if !defined(TRIO_MINIMAL) /** Get a pointer to the content. - + @param self Dynamic string. @param offset Offset into content. @return Pointer to the content. - + @p Offset can be zero, positive, or negative. If @p offset is zero, then the start of the content will be returned. If @p offset is positive, then a pointer to @p offset number of characters from the beginning of the @@ -1407,7 +1407,7 @@ int offset) { char *result = NULL; - + assert(self); if (self->content != NULL) @@ -1440,10 +1440,10 @@ /** Extract the content. - + @param self Dynamic String @return Content of dynamic string. - + The content is removed from the dynamic string. This enables destruction of the dynamic string without deallocation of the content. */ @@ -1453,7 +1453,7 @@ trio_string_t *self) { char *result; - + assert(self); result = self->content; @@ -1467,13 +1467,13 @@ #if !defined(TRIO_MINIMAL) /** Set the content of the dynamic string. - + @param self Dynamic String @param buffer The new content. - + Sets the content of the dynamic string to a copy @p buffer. An existing content will be deallocated first, if necessary. - + @remark This function will make a copy of @p buffer. You are responsible for deallocating @p buffer yourself. @@ -1521,7 +1521,7 @@ #if !defined(TRIO_MINIMAL) /** Append the second string to the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. @@ -1533,7 +1533,7 @@ trio_string_t *other) { size_t length; - + assert(self); assert(other); @@ -1543,7 +1543,7 @@ trio_copy(&self->content[self->length], other->content); self->length = length; return TRUE; - + error: return FALSE; } @@ -1561,7 +1561,7 @@ TRIO_CONST char *other) { size_t length; - + assert(self); assert(other); @@ -1571,7 +1571,7 @@ trio_copy(&self->content[self->length], other); self->length = length; return TRUE; - + error: return FALSE; } @@ -1597,7 +1597,7 @@ self->content[self->length] = character; self->length++; return TRUE; - + error: return FALSE; } @@ -1606,7 +1606,7 @@ #if !defined(TRIO_MINIMAL) /** Search for the first occurrence of second parameter in the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. @@ -1691,7 +1691,7 @@ trio_string_t *other) { trio_string_t *self; - + assert(other); self = TrioStringAlloc(); @@ -1722,7 +1722,7 @@ TRIO_CONST char *other) { trio_string_t *self; - + assert(other); self = TrioStringAlloc(); Index: lib/3rdparty/libxml2/uri.c =================================================================== --- lib/3rdparty/libxml2/uri.c (revision 58293) +++ lib/3rdparty/libxml2/uri.c (working copy) @@ -1,5 +1,5 @@ /** - * uri.c: set of generic URI related routines + * uri.c: set of generic URI related routines * * Reference: RFCs 3986, 2732 and 2373 * @@ -18,6 +18,37 @@ #include #include +/** + * MAX_URI_LENGTH: + * + * The definition of the URI regexp in the above RFC has no size limit + * In practice they are usually relativey 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. + * The value below is more a security limit than anything else and + * really should never be hit by 'normal' operations + * Set to 1 MByte in 2012, this is only enforced on output + */ +#define MAX_URI_LENGTH 1024 * 1024 + +static void +xmlURIErrMemory(const char *extra) +{ + if (extra) + __xmlRaiseError(NULL, NULL, NULL, + NULL, NULL, XML_FROM_URI, + XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, + extra, NULL, NULL, 0, 0, + "Memory allocation failed : %s\n", extra); + else + __xmlRaiseError(NULL, NULL, NULL, + NULL, NULL, XML_FROM_URI, + XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, + NULL, NULL, NULL, 0, 0, + "Memory allocation failed\n"); +} + static void xmlCleanURI(xmlURIPtr uri); /* @@ -980,8 +1011,7 @@ ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI)); if (ret == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlCreateURI: out of memory\n"); + xmlURIErrMemory("creating URI structure\n"); return(NULL); } memset(ret, 0, sizeof(xmlURI)); @@ -989,6 +1019,31 @@ } /** + * xmlSaveUriRealloc: + * + * Function to handle properly a reallocation when saving an URI + * Also imposes some limit on the length of an URI string output + */ +static xmlChar * +xmlSaveUriRealloc(xmlChar *ret, int *max) { + xmlChar *temp; + int tmp; + + if (*max > MAX_URI_LENGTH) { + xmlURIErrMemory("reaching arbitrary MAX_URI_LENGTH limit\n"); + return(NULL); + } + tmp = *max * 2; + temp = (xmlChar *) xmlRealloc(ret, (tmp + 1)); + if (temp == NULL) { + xmlURIErrMemory("saving URI\n"); + return(NULL); + } + *max = tmp; + return(temp); +} + +/** * xmlSaveUri: * @uri: pointer to an xmlURI * @@ -1010,8 +1065,7 @@ max = 80; ret = (xmlChar *) xmlMallocAtomic((max + 1) * sizeof(xmlChar)); if (ret == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); + xmlURIErrMemory("saving URI\n"); return(NULL); } len = 0; @@ -1020,28 +1074,16 @@ p = uri->scheme; while (*p != 0) { if (len >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; ret = temp; } ret[len++] = *p++; } if (len >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = ':'; } @@ -1049,15 +1091,9 @@ p = uri->opaque; while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p))) ret[len++] = *p++; @@ -1072,15 +1108,9 @@ } else { if (uri->server != NULL) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '/'; ret[len++] = '/'; @@ -1088,16 +1118,9 @@ p = uri->user; while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } if ((IS_UNRESERVED(*(p))) || ((*(p) == ';')) || ((*(p) == ':')) || @@ -1114,78 +1137,43 @@ } } if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '@'; } p = uri->server; while (*p != 0) { if (len >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = *p++; } if (uri->port > 0) { if (len + 10 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } len += snprintf((char *) &ret[len], max - len, ":%d", uri->port); } } else if (uri->authority != NULL) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '/'; ret[len++] = '/'; p = uri->authority; while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } if ((IS_UNRESERVED(*(p))) || ((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) || @@ -1202,16 +1190,9 @@ } } else if (uri->scheme != NULL) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '/'; ret[len++] = '/'; @@ -1229,14 +1210,9 @@ (p[2] == ':') && (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) { if (len + 3 >= max) { - max *= 2; - ret = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (ret == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - return(NULL); - } + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = *p++; ret[len++] = *p++; @@ -1244,16 +1220,9 @@ } while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) || ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) || @@ -1271,63 +1240,35 @@ } if (uri->query_raw != NULL) { if (len + 1 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '?'; p = uri->query_raw; while (*p != 0) { if (len + 1 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = *p++; } } else if (uri->query != NULL) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '?'; p = uri->query; while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } - if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) + if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) ret[len++] = *p++; else { int val = *(unsigned char *)p++; @@ -1341,33 +1282,19 @@ } if (uri->fragment != NULL) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len++] = '#'; p = uri->fragment; while (*p != 0) { if (len + 3 >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, - (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } - if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) + if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) ret[len++] = *p++; else { int val = *(unsigned char *)p++; @@ -1379,18 +1306,16 @@ } } if (len >= max) { - max *= 2; - temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar)); - if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlSaveUri: out of memory\n"); - xmlFree(ret); - return(NULL); - } - ret = temp; + temp = xmlSaveUriRealloc(ret, &max); + if (temp == NULL) goto mem_error; + ret = temp; } ret[len] = 0; return(ret); + +mem_error: + xmlFree(ret); + return(NULL); } /** @@ -1604,10 +1529,11 @@ break; } /* Valgrind complained, strcpy(cur, segp + 3); */ - /* string will overlap, do not use strcpy */ - tmp = cur; - segp += 3; - while ((*tmp++ = *segp++) != 0); + /* string will overlap, do not use strcpy */ + tmp = cur; + segp += 3; + while ((*tmp++ = *segp++) != 0) + ; /* If there are no previous segments, then keep going from here. */ segp = cur; @@ -1692,8 +1618,7 @@ if (target == NULL) { ret = (char *) xmlMallocAtomic(len + 1); if (ret == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlURIUnescapeString: out of memory\n"); + xmlURIErrMemory("unescaping URI value\n"); return(NULL); } } else @@ -1703,14 +1628,14 @@ while(len > 0) { if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) { in++; - if ((*in >= '0') && (*in <= '9')) + if ((*in >= '0') && (*in <= '9')) *out = (*in - '0'); else if ((*in >= 'a') && (*in <= 'f')) *out = (*in - 'a') + 10; else if ((*in >= 'A') && (*in <= 'F')) *out = (*in - 'A') + 10; in++; - if ((*in >= '0') && (*in <= '9')) + if ((*in >= '0') && (*in <= '9')) *out = *out * 16 + (*in - '0'); else if ((*in >= 'a') && (*in <= 'f')) *out = *out * 16 + (*in - 'a') + 10; @@ -1743,9 +1668,8 @@ xmlChar *ret, ch; xmlChar *temp; const xmlChar *in; + int len, out; - unsigned int len, out; - if (str == NULL) return(NULL); if (str[0] == 0) @@ -1756,19 +1680,16 @@ len += 20; ret = (xmlChar *) xmlMallocAtomic(len); if (ret == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlURIEscapeStr: out of memory\n"); + xmlURIErrMemory("escaping URI value\n"); return(NULL); } in = (const xmlChar *) str; out = 0; while(*in != 0) { if (len - out <= 3) { - len += 20; - temp = (xmlChar *) xmlRealloc(ret, len); + temp = xmlSaveUriRealloc(ret, &len); if (temp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlURIEscapeStr: out of memory\n"); + xmlURIErrMemory("escaping URI value\n"); xmlFree(ret); return(NULL); } @@ -1823,10 +1744,9 @@ int ret2; #define NULLCHK(p) if(!p) { \ - xmlGenericError(xmlGenericErrorContext, \ - "xmlURIEscape: out of memory\n"); \ - xmlFreeURI(uri); \ - return NULL; } \ + xmlURIErrMemory("escaping URI value\n"); \ + xmlFreeURI(uri); \ + return NULL; } \ if (str == NULL) return (NULL); @@ -1869,7 +1789,7 @@ if (uri->user) { segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,"); NULLCHK(segment) - ret = xmlStrcat(ret,BAD_CAST "//"); + ret = xmlStrcat(ret,BAD_CAST "//"); ret = xmlStrcat(ret, segment); ret = xmlStrcat(ret, BAD_CAST "@"); xmlFree(segment); @@ -1947,7 +1867,7 @@ * * Computes he final URI of the reference done by checking that * the given URI is valid, and building the final URI using the - * base URI. This is processed according to section 5.2 of the + * base URI. This is processed according to section 5.2 of the * RFC 2396 * * 5.2. Resolving Relative References to Absolute Form @@ -1971,7 +1891,7 @@ * as a reference to "." rather than as a synonym for the current * URI. Should we do that here? */ - if (URI == NULL) + if (URI == NULL) ret = -1; else { if (*URI) { @@ -2042,7 +1962,7 @@ res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); - res->port = bas->port; + res->port = bas->port; } if (bas->path != NULL) res->path = xmlMemStrdup(bas->path); @@ -2071,7 +1991,7 @@ } if (bas->scheme != NULL) res->scheme = xmlMemStrdup(bas->scheme); - + if (ref->query_raw != NULL) res->query_raw = xmlMemStrdup(ref->query_raw); else if (ref->query != NULL) @@ -2093,7 +2013,7 @@ res->server = xmlMemStrdup(ref->server); if (ref->user != NULL) res->user = xmlMemStrdup(ref->user); - res->port = ref->port; + res->port = ref->port; } if (ref->path != NULL) res->path = xmlMemStrdup(ref->path); @@ -2105,7 +2025,7 @@ res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); - res->port = bas->port; + res->port = bas->port; } /* @@ -2133,8 +2053,7 @@ len += strlen(bas->path); res->path = (char *) xmlMallocAtomic(len); if (res->path == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlBuildURI: out of memory\n"); + xmlURIErrMemory("resolving URI against base\n"); goto done; } res->path[0] = 0; @@ -2380,7 +2299,7 @@ } len = xmlStrlen (uptr) + 1; } - + if (nbslash == 0) { if (uptr != NULL) /* exception characters from xmlSaveUri */ @@ -2395,8 +2314,7 @@ */ val = (xmlChar *) xmlMalloc (len + 3 * nbslash); if (val == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlBuildRelativeURI: out of memory\n"); + xmlURIErrMemory("building relative URI\n"); goto done; } vptr = val; @@ -2448,14 +2366,14 @@ * xmlCanonicPath: * @path: the resource locator in a filesystem notation * - * Constructs a canonic path from the specified path. + * Constructs a canonic path from the specified path. * - * Returns a new canonic path, or a duplicate of the path parameter if the + * Returns a new canonic path, or a duplicate of the path parameter if the * construction fails. The caller is responsible for freeing the memory occupied - * by the returned string. If there is insufficient memory available, or the + * by the returned string. If there is insufficient memory available, or the * argument is NULL, the function returns NULL. */ -#define IS_WINDOWS_PATH(p) \ +#define IS_WINDOWS_PATH(p) \ ((p != NULL) && \ (((p[0] >= 'a') && (p[0] <= 'z')) || \ ((p[0] >= 'A') && (p[0] <= 'Z'))) && \ @@ -2467,7 +2385,7 @@ * For Windows implementations, additional work needs to be done to * replace backslashes in pathnames with "forward slashes" */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) int len = 0; int i = 0; xmlChar *p = NULL; @@ -2479,7 +2397,20 @@ if (path == NULL) return(NULL); - /* sanitize filename starting with // so it can be used as URI */ +#if defined(_WIN32) + /* + * We must not change the backslashes to slashes if the the path + * starts with \\?\ + * Those paths can be up to 32k characters long. + * Was added specifically for OpenOffice, those paths can't be converted + * to URIs anyway. + */ + if ((path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && + (path[3] == '\\') ) + return xmlStrdup((const xmlChar *) path); +#endif + + /* sanitize filename starting with // so it can be used as URI */ if ((path[0] == '/') && (path[1] == '/') && (path[2] != '/')) path++; @@ -2526,7 +2457,7 @@ path_processing: /* For Windows implementations, replace backslashes with 'forward slashes' */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) /* * Create a URI structure */ @@ -2583,7 +2514,7 @@ * * Constructs an URI expressing the existing path * - * Returns a new URI, or a duplicate of the path parameter if the + * Returns a new URI, or a duplicate of the path parameter if the * construction fails. The caller is responsible for freeing the memory * occupied by the returned string. If there is insufficient memory available, * or the argument is NULL, the function returns NULL. @@ -2606,7 +2537,7 @@ if (cal == NULL) return(NULL); #if defined(_WIN32) && !defined(__CYGWIN__) - /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?) + /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?) If 'cal' is a valid URI allready then we are done here, as continuing would make it invalid. */ if ((uri = xmlParseURI((const char *) cal)) != NULL) { Index: lib/3rdparty/libxml2/valid.c =================================================================== --- lib/3rdparty/libxml2/valid.c (revision 58293) +++ lib/3rdparty/libxml2/valid.c (working copy) @@ -31,7 +31,7 @@ /* #define DEBUG_VALID_ALGO */ /* #define DEBUG_REGEXP_ALGO */ -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -301,7 +301,7 @@ if (elemDecl->contModel == NULL) xmlValidBuildContentModel(ctxt, elemDecl); if (elemDecl->contModel != NULL) { - ctxt->vstateTab[ctxt->vstateNr].exec = + ctxt->vstateTab[ctxt->vstateNr].exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL); } else { ctxt->vstateTab[ctxt->vstateNr].exec = NULL; @@ -623,7 +623,7 @@ #define DEBUG_VALID_STATE(n,c) xmlValidStateDebug(ctxt); #define DEBUG_VALID_MSG(m) \ xmlGenericError(xmlGenericErrorContext, "%s\n", m); - + #else #define DEBUG_VALID_STATE(n,c) #define DEBUG_VALID_MSG(m) @@ -676,7 +676,7 @@ xmlAutomataStatePtr oldstate = ctxt->state; xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(content->name, content->prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, "Building content model"); @@ -701,9 +701,9 @@ break; case XML_ELEMENT_CONTENT_MULT: ctxt->state = xmlAutomataNewEpsilon(ctxt->am, - ctxt->state, NULL); + ctxt->state, NULL); xmlAutomataNewTransition(ctxt->am, - ctxt->state, ctxt->state, fullname, NULL); + ctxt->state, ctxt->state, fullname, NULL); break; } if ((fullname != fn) && (fullname != content->name)) @@ -752,7 +752,7 @@ xmlElementContentOccur ocur; ocur = content->ocur; - if ((ocur == XML_ELEMENT_CONTENT_PLUS) || + if ((ocur == XML_ELEMENT_CONTENT_PLUS) || (ocur == XML_ELEMENT_CONTENT_MULT)) { ctxt->state = xmlAutomataNewEpsilon(ctxt->am, ctxt->state, NULL); @@ -944,7 +944,7 @@ } break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); return(NULL); @@ -1001,7 +1001,7 @@ * @cur: An element content pointer. * * Build a copy of an element content description. - * + * * Returns the new xmlElementContentPtr or NULL in case of error. */ xmlElementContentPtr @@ -1028,7 +1028,7 @@ else ret->name = xmlStrdup(cur->name); } - + if (cur->prefix != NULL) { if (dict) ret->prefix = xmlDictLookup(dict, cur->prefix, -1); @@ -1058,7 +1058,7 @@ else tmp->name = xmlStrdup(cur->name); } - + if (cur->prefix != NULL) { if (dict) tmp->prefix = xmlDictLookup(dict, cur->prefix, -1); @@ -1082,7 +1082,7 @@ * * Build a copy of an element content description. * Deprecated, use xmlCopyDocElementContent instead - * + * * Returns the new xmlElementContentPtr or NULL in case of error. */ xmlElementContentPtr @@ -1114,7 +1114,7 @@ case XML_ELEMENT_CONTENT_OR: break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); return; @@ -1200,7 +1200,7 @@ xmlDumpElementContent(buf, content->c2, 0); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); } @@ -1397,7 +1397,7 @@ switch (type) { case XML_ELEMENT_TYPE_EMPTY: if (content != NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content != NULL for EMPTY\n", NULL); return(NULL); @@ -1405,7 +1405,7 @@ break; case XML_ELEMENT_TYPE_ANY: if (content != NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content != NULL for ANY\n", NULL); return(NULL); @@ -1413,7 +1413,7 @@ break; case XML_ELEMENT_TYPE_MIXED: if (content == NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content == NULL for MIXED\n", NULL); return(NULL); @@ -1421,14 +1421,14 @@ break; case XML_ELEMENT_TYPE_ELEMENT: if (content == NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content == NULL for ELEMENT\n", NULL); return(NULL); } break; default: - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT decl corrupted invalid type\n", NULL); return(NULL); @@ -1608,7 +1608,7 @@ * @elem: An element * * Build a copy of an element. - * + * * Returns the new xmlElementPtr or NULL in case of error. */ static xmlElementPtr @@ -1642,7 +1642,7 @@ * @table: An element table * * Build a copy of an element table. - * + * * Returns the new xmlElementTablePtr or NULL in case of error. */ xmlElementTablePtr @@ -1707,7 +1707,7 @@ xmlBufferWriteChar(buf, ">\n"); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT struct corrupted invalid type\n", NULL); } @@ -1818,7 +1818,7 @@ xmlDumpEnumeration(xmlBufferPtr buf, xmlEnumerationPtr cur) { if ((buf == NULL) || (cur == NULL)) return; - + xmlBufferWriteCHAR(buf, cur->name); if (cur->next == NULL) xmlBufferWriteChar(buf, ")"); @@ -1973,13 +1973,13 @@ case XML_ATTRIBUTE_NOTATION: break; default: - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid type\n", NULL); xmlFreeEnumeration(tree); return(NULL); } - if ((defaultValue != NULL) && + if ((defaultValue != NULL) && (!xmlValidateAttributeValueInternal(dtd->doc, type, defaultValue))) { xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT, "Attribute %s of %s: invalid default value\n", @@ -2153,7 +2153,7 @@ * @attr: An attribute * * Build a copy of an attribute. - * + * * Returns the new xmlAttributePtr or NULL in case of error. */ static xmlAttributePtr @@ -2186,7 +2186,7 @@ * @table: An attribute table * * Build a copy of an attribute table. - * + * * Returns the new xmlAttributeTablePtr or NULL in case of error. */ xmlAttributeTablePtr @@ -2251,7 +2251,7 @@ xmlDumpEnumeration(buf, attr->tree); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid type\n", NULL); } @@ -2268,7 +2268,7 @@ xmlBufferWriteChar(buf, " #FIXED"); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid def\n", NULL); } @@ -2398,7 +2398,7 @@ */ if (xmlHashAddEntry(table, name, ret)) { #ifdef LIBXML_VALID_ENABLED - xmlErrValid(NULL, XML_DTD_NOTATION_REDEFINED, + xmlErrValid(NULL, XML_DTD_NOTATION_REDEFINED, "xmlAddNotationDecl: %s already defined\n", (const char *) name); #endif /* LIBXML_VALID_ENABLED */ @@ -2425,7 +2425,7 @@ * @nota: A notation * * Build a copy of a notation. - * + * * Returns the new xmlNotationPtr or NULL in case of error. */ static xmlNotationPtr @@ -2457,7 +2457,7 @@ * @table: A notation table * * Build a copy of a notation table. - * + * * Returns the new xmlNotationTablePtr or NULL in case of error. */ xmlNotationTablePtr @@ -2535,7 +2535,7 @@ * current scope */ #define DICT_FREE(str) \ - if ((str) && ((!dict) || \ + if ((str) && ((!dict) || \ (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \ xmlFree((char *)(str)); @@ -2573,7 +2573,7 @@ * * Returns NULL if not, otherwise the new xmlIDPtr */ -xmlIDPtr +xmlIDPtr xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlIDPtr ret; @@ -2687,7 +2687,7 @@ ((xmlStrEqual(BAD_CAST "name", attr->name)) && ((elem == NULL) || (xmlStrEqual(elem->name, BAD_CAST "a"))))) return(1); - return(0); + return(0); } else if (elem == NULL) { return(0); } else { @@ -2741,7 +2741,7 @@ if (doc == NULL) return(-1); if (attr == NULL) return(-1); table = (xmlIDTablePtr) doc->ids; - if (table == NULL) + if (table == NULL) return(-1); if (attr == NULL) @@ -2769,7 +2769,7 @@ * * Returns NULL if not found, otherwise the xmlAttrPtr defining the ID */ -xmlAttrPtr +xmlAttrPtr xmlGetID(xmlDocPtr doc, const xmlChar *ID) { xmlIDTablePtr table; xmlIDPtr id; @@ -2783,7 +2783,7 @@ } table = (xmlIDTablePtr) doc->ids; - if (table == NULL) + if (table == NULL) return(NULL); id = xmlHashLookup(table, ID); @@ -2804,7 +2804,7 @@ * Refs * * * ************************************************************************/ -typedef struct xmlRemoveMemo_t +typedef struct xmlRemoveMemo_t { xmlListPtr l; xmlAttrPtr ap; @@ -2812,7 +2812,7 @@ typedef xmlRemoveMemo *xmlRemoveMemoPtr; -typedef struct xmlValidateMemo_t +typedef struct xmlValidateMemo_t { xmlValidCtxtPtr ctxt; const xmlChar *name; @@ -2895,7 +2895,7 @@ * * Returns NULL if not, otherwise the new xmlRefPtr */ -xmlRefPtr +xmlRefPtr xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlRefPtr ret; @@ -3023,7 +3023,7 @@ return(0); } else if (doc->type == XML_HTML_DOCUMENT_NODE) { /* TODO @@@ */ - return(0); + return(0); } else { xmlAttributePtr attrDecl; @@ -3060,7 +3060,7 @@ if (doc == NULL) return(-1); if (attr == NULL) return(-1); table = (xmlRefTablePtr) doc->refs; - if (table == NULL) + if (table == NULL) return(-1); if (attr == NULL) @@ -3086,7 +3086,7 @@ */ target.l = ref_list; target.ap = attr; - + /* Remove the supplied attr from our list */ xmlListWalk(ref_list, xmlWalkRemoveRef, &target); @@ -3103,11 +3103,11 @@ * @doc: pointer to the document * @ID: the ID value * - * Find the set of references for the supplied ID. + * Find the set of references for the supplied ID. * * Returns NULL if not found, otherwise node set for the ID. */ -xmlListPtr +xmlListPtr xmlGetRefs(xmlDocPtr doc, const xmlChar *ID) { xmlRefTablePtr table; @@ -3120,7 +3120,7 @@ } table = (xmlRefTablePtr) doc->refs; - if (table == NULL) + if (table == NULL) return(NULL); return (xmlHashLookup(table, ID)); @@ -3185,7 +3185,7 @@ if (dtd->doc != NULL) dict = dtd->doc->dict; - if (!create) + if (!create) return(NULL); /* * Create the Element table if needed. @@ -3798,7 +3798,7 @@ * * [ VC: Name Token ] * Values of type NMTOKEN must match the Nmtoken production; values - * of type NMTOKENS must match Nmtokens. + * of type NMTOKENS must match Nmtokens. * * returns 1 if valid or 0 otherwise */ @@ -3857,7 +3857,7 @@ if ((ent == NULL) && (doc->standalone == 1)) { doc->standalone = 0; ent = xmlGetDocEntity(doc, value); - } + } if (ent == NULL) { xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_ENTITY, @@ -3968,7 +3968,7 @@ if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(NULL); @@ -4167,7 +4167,7 @@ } } if (nbId > 1) { - + xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET, "Element %s has %d ID attribute defined in the internal subset : %s\n", attr->elem, nbId, attr->name); @@ -4230,7 +4230,7 @@ xmlElementPtr tst; CHECK_DTD; - + if (elem == NULL) return(1); #if 0 @@ -4347,7 +4347,7 @@ int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, - xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value) + xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value) { xmlAttributePtr attrDecl = NULL; int val; @@ -4360,7 +4360,7 @@ if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(0); @@ -4444,7 +4444,7 @@ nota = xmlGetDtdNotationDesc(doc->intSubset, value); if (nota == NULL) nota = xmlGetDtdNotationDesc(doc->extSubset, value); - + if (nota == NULL) { xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION, "Value \"%s\" for attribute %s of %s is not a declared Notation\n", @@ -4537,7 +4537,7 @@ if (prefix != NULL) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, "Validating namespace"); @@ -4641,7 +4641,7 @@ nota = xmlGetDtdNotationDesc(doc->intSubset, value); if (nota == NULL) nota = xmlGetDtdNotationDesc(doc->extSubset, value); - + if (nota == NULL) { if (ns->prefix != NULL) { xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION, @@ -4777,7 +4777,7 @@ NODE = xmlValidateSkipIgnorable(NODE); if ((NODE == NULL) && (CONT == NULL)) return(1); - if ((NODE == NULL) && + if ((NODE == NULL) && ((CONT->ocur == XML_ELEMENT_CONTENT_MULT) || (CONT->ocur == XML_ELEMENT_CONTENT_OPT))) { return(1); @@ -5236,7 +5236,7 @@ xmlElementContentPtr cont; const xmlChar *name; - if (elemDecl == NULL) + if ((elemDecl == NULL) || (parent == NULL)) return(-1); cont = elemDecl->content; name = elemDecl->name; @@ -5286,7 +5286,7 @@ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(cur->name, cur->ns->prefix, fn, 50); if (fullname == NULL) { @@ -5400,7 +5400,7 @@ last = tmp; } if (cur->type == XML_CDATA_SECTION_NODE) { - /* + /* * E59 spaces in CDATA does not match the * nonterminal S */ @@ -5517,7 +5517,8 @@ int ret = 1; xmlNodePtr cur, child; - if ((ctxt == NULL) || (doc == NULL) || (elem == NULL)) + if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) || + (elem->type != XML_ELEMENT_NODE)) return(0); child = elem->children; @@ -5598,7 +5599,7 @@ } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, + xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -5622,7 +5623,7 @@ } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, + xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -5651,7 +5652,7 @@ xmlElementPtr elemDecl = NULL; const xmlChar *prefix = NULL; - if ((ctxt == NULL) || (doc == NULL) || + if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) || (elem->name == NULL)) return(NULL); if (extsubset != NULL) @@ -6017,7 +6018,7 @@ return(0); /* - * If vstateNr is not zero that means continuous validation is + * If vstateNr is not zero that means continuous validation is * activated, do not try to check the content model at that level. */ if (ctxt->vstateNr == 0) { @@ -6060,7 +6061,7 @@ if ((child->ns != NULL) && (child->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(child->name, child->ns->prefix, fn, 50); if (fullname == NULL) @@ -6078,7 +6079,7 @@ } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, + xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -6101,7 +6102,7 @@ } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) { - xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, + xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -6181,7 +6182,7 @@ } } else { xmlAttrPtr attrib; - + attrib = elem->properties; while (attrib != NULL) { if (xmlStrEqual(attrib->name, attr->name)) { @@ -6196,18 +6197,18 @@ * allow to define the URI instead of the prefix :-( */ if (nameSpace == NULL) { - if (qualified < 0) + if (qualified < 0) qualified = 0; } else if (!xmlStrEqual(nameSpace->prefix, attr->prefix)) { - if (qualified < 1) + if (qualified < 1) qualified = 1; } else goto found; } else { /* * We should allow applications to define namespaces - * for their application even if the DTD doesn't + * for their application even if the DTD doesn't * carry one, otherwise, basically we would always * break. */ @@ -6280,7 +6281,7 @@ } } } -found: +found: attr = attr->nexth; } return(ret); @@ -6327,7 +6328,7 @@ if ((root->ns != NULL) && (root->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(root->name, root->ns->prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, NULL); @@ -6338,7 +6339,7 @@ xmlFree(fullname); if (ret == 1) goto name_ok; - } + } if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) && (xmlStrEqual(root->name, BAD_CAST "html"))) goto name_ok; @@ -6359,7 +6360,7 @@ * @doc: a document instance * @elem: an element instance * - * Try to validate the subtree under an element + * Try to validate the subtree under an element * * returns 1 if valid or 0 otherwise */ @@ -6379,7 +6380,8 @@ * they don't really mean anything validation wise. */ if ((elem->type == XML_XINCLUDE_START) || - (elem->type == XML_XINCLUDE_END)) + (elem->type == XML_XINCLUDE_END) || + (elem->type == XML_NAMESPACE_DECL)) return(1); CHECK_DTD; @@ -6538,7 +6540,7 @@ memo.name = name; xmlListWalk(ref_list, xmlWalkValidateList, &memo); - + } /** @@ -6550,7 +6552,7 @@ * incremental validation steps have been completed * * basically it does the following checks described by the XML Rec - * + * * Check all the IDREF/IDREFS attributes definition for validity * * returns 1 if valid or 0 otherwise @@ -6559,15 +6561,20 @@ int xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { xmlRefTablePtr table; + unsigned int save; if (ctxt == NULL) return(0); if (doc == NULL) { - xmlErrValid(ctxt, XML_DTD_NO_DOC, + xmlErrValid(ctxt, XML_DTD_NO_DOC, "xmlValidateDocumentFinal: doc == NULL\n", NULL); return(0); } + /* trick to get correct line id report */ + save = ctxt->finishDtd; + ctxt->finishDtd = 0; + /* * Check all the NOTATION/NOTATIONS attributes */ @@ -6581,6 +6588,8 @@ ctxt->doc = doc; ctxt->valid = 1; xmlHashScan(table, (xmlHashScanner) xmlValidateCheckRefCallback, ctxt); + + ctxt->finishDtd = save; return(ctxt->valid); } @@ -6675,7 +6684,7 @@ case XML_ATTRIBUTE_ENTITIES: case XML_ATTRIBUTE_NOTATION: if (cur->defaultValue != NULL) { - + ret = xmlValidateAttributeValue2(ctxt, ctxt->doc, cur->name, cur->atype, cur->defaultValue); if ((ret == 0) && (ctxt->valid == 1)) @@ -6732,9 +6741,9 @@ * subsets have been parsed * * basically it does the following checks described by the XML Rec - * - check that ENTITY and ENTITIES type attributes default or + * - check that ENTITY and ENTITIES type attributes default or * possible values matches one of the defined entities. - * - check that NOTATION type attributes default or + * - check that NOTATION type attributes default or * possible values matches one of the defined notations. * * returns 1 if valid or 0 if invalid and -1 if not well-formed @@ -6805,7 +6814,7 @@ xmlChar *sysID; if (doc->intSubset->SystemID != NULL) { sysID = xmlBuildURI(doc->intSubset->SystemID, - doc->URL); + doc->URL); if (sysID == NULL) { xmlErrValid(ctxt, XML_DTD_LOAD_ERROR, "Could not build URI for external subset \"%s\"\n", @@ -6878,17 +6887,17 @@ if (*len >= max) return(*len); switch (ctree->type) { - case XML_ELEMENT_CONTENT_PCDATA: + case XML_ELEMENT_CONTENT_PCDATA: for (i = 0; i < *len;i++) if (xmlStrEqual(BAD_CAST "#PCDATA", names[i])) return(*len); names[(*len)++] = BAD_CAST "#PCDATA"; break; - case XML_ELEMENT_CONTENT_ELEMENT: + case XML_ELEMENT_CONTENT_ELEMENT: for (i = 0; i < *len;i++) if (xmlStrEqual(ctree->name, names[i])) return(*len); names[(*len)++] = ctree->name; break; - case XML_ELEMENT_CONTENT_SEQ: + case XML_ELEMENT_CONTENT_SEQ: xmlValidGetPotentialChildren(ctree->c1, names, len, max); xmlValidGetPotentialChildren(ctree->c2, names, len, max); break; @@ -6897,7 +6906,7 @@ xmlValidGetPotentialChildren(ctree->c2, names, len, max); break; } - + return(*len); } @@ -6942,16 +6951,16 @@ const xmlChar *elements[256]; int nb_elements = 0, i; const xmlChar *name; - + xmlNode *ref_node; xmlNode *parent; xmlNode *test_node; - + xmlNode *prev_next; xmlNode *next_prev; xmlNode *parent_childs; xmlNode *parent_last; - + xmlElement *element_desc; if (prev == NULL && next == NULL) @@ -6976,7 +6985,7 @@ element_desc = xmlGetDtdElementDesc(parent->doc->extSubset, parent->name); if (element_desc == NULL) return(-1); - + /* * Do a backup of the current tree structure */ @@ -6987,16 +6996,16 @@ /* * Creates a dummy node and insert it into the tree - */ + */ test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "", NULL); test_node->parent = parent; test_node->prev = prev; test_node->next = next; name = test_node->name; - + if (prev) prev->next = test_node; else parent->children = test_node; - + if (next) next->prev = test_node; else parent->last = test_node; @@ -7006,7 +7015,7 @@ */ nb_elements = xmlValidGetPotentialChildren(element_desc->content, elements, &nb_elements, 256); - + for (i = 0;i < nb_elements;i++) { test_node->name = elements[i]; if (xmlValidateOneElement(&vctxt, parent->doc, parent)) { Index: lib/3rdparty/libxml2/xinclude.c =================================================================== --- lib/3rdparty/libxml2/xinclude.c (revision 58293) +++ lib/3rdparty/libxml2/xinclude.c (working copy) @@ -26,6 +26,7 @@ #ifdef LIBXML_XINCLUDE_ENABLED #include +#include "buf.h" #define XINCLUDE_MAX_DEPTH 40 @@ -92,7 +93,7 @@ /************************************************************************ * * - * XInclude error handler * + * XInclude error handler * * * ************************************************************************/ @@ -412,7 +413,7 @@ * xmlXIncludeParseFile: * @ctxt: the XInclude context * @URL: the URL or file path - * + * * parse a document for XInclude */ static xmlDocPtr @@ -433,7 +434,7 @@ * pass in the application data to the parser context. */ pctxt->_private = ctxt->_private; - + /* * try to ensure that new documents included are actually * built with the same dictionary as the including document. @@ -446,7 +447,7 @@ } xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); - + inputStream = xmlLoadExternalEntity(URL, NULL, pctxt); if (inputStream == NULL) { xmlFreeParserCtxt(pctxt); @@ -472,7 +473,7 @@ pctxt->myDoc = NULL; } xmlFreeParserCtxt(pctxt); - + return(ret); } @@ -480,7 +481,7 @@ * xmlXIncludeAddNode: * @ctxt: the XInclude context * @cur: the new node - * + * * Add a new node to process to an XInclude context */ static int @@ -511,7 +512,7 @@ href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); if (href == NULL) { href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */ - if (href == NULL) + if (href == NULL) return(-1); } if ((href[0] == '#') || (href[0] == 0)) @@ -655,7 +656,7 @@ * @ctxt: the XInclude context * @doc: the new document * @url: the associated URL - * + * * The XInclude recursive nature is handled at this point. */ static void @@ -684,7 +685,7 @@ /* * Copy the private user data */ - newctxt->_private = ctxt->_private; + newctxt->_private = ctxt->_private; /* * Copy the existing document set */ @@ -749,7 +750,7 @@ * @ctxt: the XInclude context * @txt: the new text node * @url: the associated URL - * + * * Add a new txtument to the list */ static void @@ -808,7 +809,7 @@ * @target: the document target * @source: the document source * @elem: the element - * + * * Make a copy of the node while preserving the XInclude semantic * of the Infoset copy */ @@ -835,7 +836,7 @@ * @target: the document target * @source: the document source * @elem: the element list - * + * * Make a copy of the node list while preserving the XInclude semantic * of the Infoset copy */ @@ -874,11 +875,11 @@ static xmlNodePtr xmlXIncludeGetNthChild(xmlNodePtr cur, int no) { int i; - if (cur == NULL) - return(cur); + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) + return(NULL); cur = cur->children; for (i = 0;i <= no;cur = cur->next) { - if (cur == NULL) + if (cur == NULL) return(cur); if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || @@ -922,11 +923,13 @@ return(NULL); start = (xmlNodePtr) range->user; - if (start == NULL) + if ((start == NULL) || (start->type == XML_NAMESPACE_DECL)) return(NULL); end = range->user2; if (end == NULL) return(xmlDocCopyNode(start, target, 1)); + if (end->type == XML_NAMESPACE_DECL) + return(NULL); cur = start; index1 = range->index; @@ -985,7 +988,7 @@ /* prune and return full set */ if (level == lastLevel) xmlAddNextSibling(last, tmp); - else + else xmlAddChild(last, tmp); return(list); } else { /* ending node not a text node */ @@ -1289,7 +1292,7 @@ if (prev != NULL) { if (ent->etype != prev->etype) goto error; - + if ((ent->SystemID != NULL) && (prev->SystemID != NULL)) { if (!xmlStrEqual(ent->SystemID, prev->SystemID)) goto error; @@ -1389,7 +1392,7 @@ * @ctxt: the XInclude context * @url: the associated URL * @nr: the xinclude node number - * + * * Load the document, and store the result in the XInclude context * * Returns 0 in case of success, -1 in case of failure @@ -1413,7 +1416,7 @@ */ uri = xmlParseURI((const char *)url); if (uri == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "invalid value URI %s\n", url); return(-1); @@ -1431,7 +1434,7 @@ xmlFreeURI(uri); if (URL == NULL) { if (ctxt->incTab != NULL) - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "invalid value URI %s\n", url); else @@ -1550,7 +1553,7 @@ ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc, doc, doc->children); } - } + } #ifdef LIBXML_XPTR_ENABLED else { /* @@ -1568,7 +1571,7 @@ xptrctxt = xmlXPtrNewContext(doc, NULL, NULL); } if (xptrctxt == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_FAILED, "could not create XPointer context\n", NULL); xmlFree(URL); @@ -1594,7 +1597,7 @@ case XPATH_POINT: case XPATH_USERS: case XPATH_XSLT_TREE: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer is not a range: #%s\n", fragment); @@ -1636,14 +1639,14 @@ continue; case XML_ATTRIBUTE_NODE: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects an attribute: #%s\n", fragment); set->nodeTab[i] = NULL; continue; case XML_NAMESPACE_DECL: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects a namespace: #%s\n", fragment); @@ -1658,7 +1661,7 @@ case XML_ENTITY_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects unexpected nodes: #%s\n", fragment); @@ -1704,7 +1707,7 @@ */ curBase = xmlBuildRelativeURI(URL, ctxt->base); if (curBase == NULL) { /* Error return */ - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "trying to build relative URI from %s\n", URL); } else { @@ -1745,7 +1748,7 @@ xmlChar *relBase; relBase = xmlBuildURI(xmlBase, base); if (relBase == NULL) { /* error */ - xmlXIncludeErr(ctxt, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "trying to rebuild base from %s\n", @@ -1782,7 +1785,7 @@ * @ctxt: the XInclude context * @url: the associated URL * @nr: the xinclude node number - * + * * Load the content, and store the result in the XInclude context * * Returns 0 in case of success, -1 in case of failure @@ -1796,6 +1799,9 @@ int i; xmlChar *encoding = NULL; xmlCharEncoding enc = (xmlCharEncoding) 0; + xmlParserCtxtPtr pctxt; + xmlParserInputPtr inputStream; + int xinclude_multibyte_fallback_used = 0; /* * Check the URL and remove any fragment identifier @@ -1826,7 +1832,7 @@ * directly through ctxt->doc. */ if (URL[0] == 0) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_TEXT_DOCUMENT, "text serialization of document not available\n", NULL); xmlFree(URL); @@ -1870,43 +1876,65 @@ /* * Load it. */ - buf = xmlParserInputBufferCreateFilename((const char *)URL, enc); + pctxt = xmlNewParserCtxt(); + inputStream = xmlLoadExternalEntity((const char*)URL, NULL, pctxt); + if(inputStream == NULL) { + xmlFreeParserCtxt(pctxt); + xmlFree(URL); + return(-1); + } + buf = inputStream->buf; if (buf == NULL) { + xmlFreeInputStream (inputStream); + xmlFreeParserCtxt(pctxt); xmlFree(URL); return(-1); } + if (buf->encoder) + xmlCharEncCloseFunc(buf->encoder); + buf->encoder = xmlGetCharEncodingHandler(enc); node = xmlNewText(NULL); /* * Scan all chars from the resource and add the to the node */ +xinclude_multibyte_fallback: while (xmlParserInputBufferRead(buf, 128) > 0) { int len; const xmlChar *content; - content = xmlBufferContent(buf->buffer); - len = xmlBufferLength(buf->buffer); + content = xmlBufContent(buf->buffer); + len = xmlBufLength(buf->buffer); for (i = 0;i < len;) { int cur; int l; cur = xmlStringCurrentChar(NULL, &content[i], &l); if (!IS_CHAR(cur)) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, - XML_XINCLUDE_INVALID_CHAR, - "%s contains invalid char\n", URL); - xmlFreeParserInputBuffer(buf); - xmlFree(URL); - return(-1); + /* Handle splitted multibyte char at buffer boundary */ + if (((len - i) < 4) && (!xinclude_multibyte_fallback_used)) { + xinclude_multibyte_fallback_used = 1; + xmlBufShrink(buf->buffer, i); + goto xinclude_multibyte_fallback; + } else { + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + XML_XINCLUDE_INVALID_CHAR, + "%s contains invalid char\n", URL); + xmlFreeParserInputBuffer(buf); + xmlFree(URL); + return(-1); + } } else { + xinclude_multibyte_fallback_used = 0; xmlNodeAddContentLen(node, &content[i], l); } i += l; } - xmlBufferShrink(buf->buffer, len); + xmlBufShrink(buf->buffer, len); } - xmlFreeParserInputBuffer(buf); + xmlFreeParserCtxt(pctxt); xmlXIncludeAddTxt(ctxt, node, URL); + xmlFreeInputStream(inputStream); loaded: /* @@ -1922,7 +1950,7 @@ * @ctxt: the XInclude context * @fallback: the fallback node * @nr: the xinclude node number - * + * * Load the content of the fallback node, and store the result * in the XInclude context * @@ -1932,8 +1960,9 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { xmlXIncludeCtxtPtr newctxt; int ret = 0; - - if ((fallback == NULL) || (ctxt == NULL)) + + if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) || + (ctxt == NULL)) return(-1); if (fallback->children != NULL) { /* @@ -2018,7 +2047,7 @@ href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); if (href == NULL) { href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */ - if (href == NULL) + if (href == NULL) return(-1); } parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); @@ -2063,7 +2092,7 @@ xmlFree(eschref); } if (URI == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "failed build URL\n", NULL); if (parse != NULL) xmlFree(parse); @@ -2096,7 +2125,7 @@ * Restore the original base before checking for fallback */ ctxt->base = oldBase; - + if (ret < 0) { xmlNodePtr children; @@ -2114,14 +2143,14 @@ ((xmlStrEqual(children->ns->href, XINCLUDE_NS)) || (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) { ret = xmlXIncludeLoadFallback(ctxt, children, nr); - if (ret == 0) + if (ret == 0) break; } children = children->next; } } if (ret < 0) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_NO_FALLBACK, "could not load %s, and no fallback was found\n", URI); @@ -2159,7 +2188,7 @@ if ((nr < 0) || (nr >= ctxt->incNr)) return(-1); cur = ctxt->incTab[nr]->ref; - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(-1); /* @@ -2190,7 +2219,7 @@ tmp = tmp->next; } if (nb_elem > 1) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_MULTIPLE_ROOT, "XInclude error: would result in multiple root nodes\n", NULL); @@ -2237,7 +2266,7 @@ } } - + return(0); } @@ -2334,7 +2363,7 @@ int ret = 0; int i, start; - if ((doc == NULL) || (tree == NULL)) + if ((doc == NULL) || (tree == NULL) || (tree->type == XML_NAMESPACE_DECL)) return(-1); if (ctxt == NULL) return(-1); @@ -2448,7 +2477,8 @@ xmlXIncludeCtxtPtr ctxt; int ret = 0; - if ((tree == NULL) || (tree->doc == NULL)) + if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL) || + (tree->doc == NULL)) return(-1); ctxt = xmlXIncludeNewContext(tree->doc); @@ -2533,7 +2563,8 @@ xmlXIncludeCtxtPtr ctxt; int ret = 0; - if ((tree == NULL) || (tree->doc == NULL)) + if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL) || + (tree->doc == NULL)) return(-1); ctxt = xmlXIncludeNewContext(tree->doc); if (ctxt == NULL) @@ -2577,7 +2608,8 @@ xmlXIncludeProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { int ret = 0; - if ((node == NULL) || (node->doc == NULL) || (ctxt == NULL)) + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) || + (node->doc == NULL) || (ctxt == NULL)) return(-1); ret = xmlXIncludeDoProcess(ctxt, node->doc, node); if ((ret >= 0) && (ctxt->nbErrors > 0)) Index: lib/3rdparty/libxml2/xlink.c =================================================================== --- lib/3rdparty/libxml2/xlink.c (revision 58293) +++ lib/3rdparty/libxml2/xlink.c (working copy) @@ -47,7 +47,7 @@ * Default setting and related functions * * * ****************************************************************/ - + static xlinkHandlerPtr xlinkDefaultHandler = NULL; static xlinkNodeDetectFunc xlinkDefaultDetect = NULL; @@ -93,7 +93,7 @@ * * Set the default xlink detection routine */ -void +void xlinkSetDefaultDetect (xlinkNodeDetectFunc func) { xlinkDefaultDetect = func; } @@ -104,7 +104,7 @@ * * ****************************************************************/ - + /** * xlinkIsLink: * @doc: the document containing the node @@ -119,7 +119,7 @@ * Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no * link detected. */ -xlinkType +xlinkType xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { xmlChar *type = NULL, *role = NULL; xlinkType ret = XLINK_TYPE_NONE; @@ -157,7 +157,7 @@ xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE); if (xlink == NULL) { /* Humm, fallback method */ - if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset")) + if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset")) ret = XLINK_TYPE_EXTENDED_SET; } else { xmlChar buf[200]; Index: lib/3rdparty/libxml2/xml2-config.1 =================================================================== --- lib/3rdparty/libxml2/xml2-config.1 (revision 58293) +++ lib/3rdparty/libxml2/xml2-config.1 (working copy) @@ -9,7 +9,6 @@ linker flags that should be used to compile and link programs that use \fIGNOME-XML\fP. .SH OPTIONS -.l \fIxml-config\fP accepts the following options: .TP 8 .B \-\-version Index: lib/3rdparty/libxml2/xml2-config.in =================================================================== --- lib/3rdparty/libxml2/xml2-config.in (revision 58293) +++ lib/3rdparty/libxml2/xml2-config.in (working copy) @@ -86,12 +86,12 @@ then if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ] then - echo @XML_LIBS@ + echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@ else - echo @XML_LIBDIR@ @XML_LIBS@ + echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ fi else - echo @XML_LIBDIR@ @XML_LIBS@ @WIN32_EXTRA_LIBADD@ + echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@ fi ;; Index: lib/3rdparty/libxml2/xmlcatalog.c =================================================================== --- lib/3rdparty/libxml2/xmlcatalog.c (revision 58293) +++ lib/3rdparty/libxml2/xmlcatalog.c (working copy) @@ -47,16 +47,16 @@ #endif /************************************************************************ - * * - * Shell Interface * - * * + * * + * Shell Interface * + * * ************************************************************************/ /** * xmlShellReadline: * @prompt: the prompt value * * Read a string - * + * * Returns a pointer to it or NULL on EOF the caller is expected to * free the returned string. */ @@ -157,7 +157,7 @@ i++; cur++; } - } else if (*cur == '"') { + } else if (*cur == '"') { cur++; argv[i] = cur; while ((*cur != 0) && (*cur != '"')) cur++; @@ -296,15 +296,15 @@ printf("\tdebug: increase the verbosity level\n"); printf("\tquiet: decrease the verbosity level\n"); printf("\texit: quit the shell\n"); - } + } free(cmdline); /* not xmlFree here ! */ } } /************************************************************************ - * * - * Main * - * * + * * + * Main * + * * ************************************************************************/ static void usage(const char *name) { /* split into 2 printf's to avoid overly long string (gcc warning) */ @@ -507,7 +507,7 @@ exit_value = 2; noout = 0; } else { - + xmlACatalogDump(super, out); fclose(out); } @@ -544,14 +544,14 @@ } } } - + } else if (shell) { usershell(); } else { for (i++; i < argc; i++) { xmlURIPtr uri; xmlChar *ans; - + uri = xmlParseURI(argv[i]); if (uri == NULL) { ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]); Index: lib/3rdparty/libxml2/xmlIO.c =================================================================== --- lib/3rdparty/libxml2/xmlIO.c (revision 58293) +++ lib/3rdparty/libxml2/xmlIO.c (working copy) @@ -35,10 +35,12 @@ #ifdef HAVE_ZLIB_H #include #endif +#ifdef HAVE_LZMA_H +#include +#endif #if defined(WIN32) || defined(_WIN32) -//#include -#include +#include #endif #if defined(_WIN32_WCE) @@ -94,6 +96,9 @@ #endif #include +#include "buf.h" +#include "enc.h" + /* #define VERBOSE_FAILURE */ /* #define DEBUG_EXTERNAL_ENTITIES */ /* #define DEBUG_INPUT */ @@ -766,13 +771,21 @@ xmlCheckFilename (const char *path) { #ifdef HAVE_STAT - struct stat stat_buffer; + struct stat stat_buffer; #endif - if (path == NULL) - return(0); + if (path == NULL) + return(0); #ifdef HAVE_STAT #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + /* + * On Windows stat and wstat do not work with long pathname, + * which start with '\\?\' + */ + if ((path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && + (path[3] == '\\') ) + return 1; + if (xmlWrapStat(path, &stat_buffer) == -1) return 0; #else @@ -988,7 +1001,7 @@ #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) fd = xmlWrapOpen(path, 1); #else - fd = fopen(path, "wb"); + fd = fopen(path, "wb"); #endif /* WIN32 */ if (fd == NULL) xmlIOErr(0, path); @@ -1307,6 +1320,125 @@ } #endif /* HAVE_ZLIB_H */ +#ifdef HAVE_LZMA_H +/************************************************************************ + * * + * I/O for compressed file accesses * + * * + ************************************************************************/ +#include "xzlib.h" +/** + * xmlXzfileMatch: + * @filename: the URI for matching + * + * input from compressed file test + * + * Returns 1 if matches, 0 otherwise + */ +static int +xmlXzfileMatch (const char *filename ATTRIBUTE_UNUSED) { + return(1); +} + +/** + * xmlXzFileOpen_real: + * @filename: the URI for matching + * + * input from compressed file open + * if @filename is " " then the standard input is used + * + * Returns an I/O context or NULL in case of error + */ +static void * +xmlXzfileOpen_real (const char *filename) { + const char *path = NULL; + xzFile fd; + + if (!strcmp(filename, "-")) { + fd = __libxml2_xzdopen(dup(0), "rb"); + return((void *) fd); + } + + if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) { + path = &filename[16]; + } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { + path = &filename[7]; + } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:/", 6)) { + /* lots of generators seems to lazy to read RFC 1738 */ + path = &filename[5]; + } else + path = filename; + + if (path == NULL) + return(NULL); + if (!xmlCheckFilename(path)) + return(NULL); + + fd = __libxml2_xzopen(path, "rb"); + return((void *) fd); +} + +/** + * xmlXzfileOpen: + * @filename: the URI for matching + * + * Wrapper around xmlXzfileOpen_real that try it with an unescaped + * version of @filename, if this fails fallback to @filename + * + * Returns a handler or NULL in case or failure + */ +static void * +xmlXzfileOpen (const char *filename) { + char *unescaped; + void *retval; + + retval = xmlXzfileOpen_real(filename); + if (retval == NULL) { + unescaped = xmlURIUnescapeString(filename, 0, NULL); + if (unescaped != NULL) { + retval = xmlXzfileOpen_real(unescaped); + } + xmlFree(unescaped); + } + + return retval; +} + +/** + * xmlXzfileRead: + * @context: the I/O context + * @buffer: where to drop data + * @len: number of bytes to write + * + * Read @len bytes to @buffer from the compressed I/O channel. + * + * Returns the number of bytes written + */ +static int +xmlXzfileRead (void * context, char * buffer, int len) { + int ret; + + ret = __libxml2_xzread((xzFile) context, &buffer[0], len); + if (ret < 0) xmlIOErr(0, "xzread()"); + return(ret); +} + +/** + * xmlXzfileClose: + * @context: the I/O context + * + * Close a compressed I/O channel + */ +static int +xmlXzfileClose (void * context) { + int ret; + + ret = (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1; + if (ret < 0) xmlIOErr(0, "xzclose()"); + return(ret); +} +#endif /* HAVE_LZMA_H */ + #ifdef LIBXML_HTTP_ENABLED /************************************************************************ * * @@ -1915,8 +2047,8 @@ /* Pull the data out of the memory output buffer */ xmlOutputBufferPtr dctxt = ctxt->doc_buff; - http_content = (char *)dctxt->buffer->content; - content_lgth = dctxt->buffer->use; + http_content = (char *) xmlBufContent(dctxt->buffer); + content_lgth = xmlBufUse(dctxt->buffer); } if ( http_content == NULL ) { @@ -2182,6 +2314,10 @@ xmlRegisterInputCallbacks(xmlGzfileMatch, xmlGzfileOpen, xmlGzfileRead, xmlGzfileClose); #endif /* HAVE_ZLIB_H */ +#ifdef HAVE_LZMA_H + xmlRegisterInputCallbacks(xmlXzfileMatch, xmlXzfileOpen, + xmlXzfileRead, xmlXzfileClose); +#endif /* HAVE_ZLIB_H */ #ifdef LIBXML_HTTP_ENABLED xmlRegisterInputCallbacks(xmlIOHTTPMatch, xmlIOHTTPOpen, @@ -2279,15 +2415,15 @@ return(NULL); } memset(ret, 0, (size_t) sizeof(xmlParserInputBuffer)); - ret->buffer = xmlBufferCreateSize(2 * xmlDefaultBufferSize); + ret->buffer = xmlBufCreateSize(2 * xmlDefaultBufferSize); if (ret->buffer == NULL) { xmlFree(ret); return(NULL); } - ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT; + xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_DOUBLEIT); ret->encoder = xmlGetCharEncodingHandler(enc); if (ret->encoder != NULL) - ret->raw = xmlBufferCreateSize(2 * xmlDefaultBufferSize); + ret->raw = xmlBufCreateSize(2 * xmlDefaultBufferSize); else ret->raw = NULL; ret->readcallback = NULL; @@ -2318,19 +2454,19 @@ return(NULL); } memset(ret, 0, (size_t) sizeof(xmlOutputBuffer)); - ret->buffer = xmlBufferCreate(); + ret->buffer = xmlBufCreate(); if (ret->buffer == NULL) { xmlFree(ret); return(NULL); } /* try to avoid a performance problem with Windows realloc() */ - if (ret->buffer->alloc == XML_BUFFER_ALLOC_EXACT) - ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT; + if (xmlBufGetAllocationScheme(ret->buffer) == XML_BUFFER_ALLOC_EXACT) + xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_DOUBLEIT); ret->encoder = encoder; if (encoder != NULL) { - ret->conv = xmlBufferCreateSize(4000); + ret->conv = xmlBufCreateSize(4000); if (ret->conv == NULL) { xmlFree(ret); return(NULL); @@ -2339,7 +2475,7 @@ /* * This call is designed to initiate the encoder state */ - xmlCharEncOutFunc(encoder, ret->conv, NULL); + xmlCharEncOutput(ret, 1); } else ret->conv = NULL; ret->writecallback = NULL; @@ -2368,7 +2504,7 @@ return(NULL); } memset(ret, 0, (size_t) sizeof(xmlOutputBuffer)); - ret->buffer = xmlBufferCreate(); + ret->buffer = xmlBufCreate(); if (ret->buffer == NULL) { xmlFree(ret); return(NULL); @@ -2377,15 +2513,12 @@ /* * For conversion buffers we use the special IO handling - * We don't do that from the exported API to avoid confusing - * user's code. */ - ret->buffer->alloc = XML_BUFFER_ALLOC_IO; - ret->buffer->contentIO = ret->buffer->content; + xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_IO); ret->encoder = encoder; if (encoder != NULL) { - ret->conv = xmlBufferCreateSize(4000); + ret->conv = xmlBufCreateSize(4000); if (ret->conv == NULL) { xmlFree(ret); return(NULL); @@ -2394,7 +2527,7 @@ /* * This call is designed to initiate the encoder state */ - xmlCharEncOutFunc(encoder, ret->conv, NULL); + xmlCharEncOutput(ret, 1); } else ret->conv = NULL; ret->writecallback = NULL; @@ -2418,7 +2551,7 @@ if (in == NULL) return; if (in->raw) { - xmlBufferFree(in->raw); + xmlBufFree(in->raw); in->raw = NULL; } if (in->encoder != NULL) { @@ -2428,7 +2561,7 @@ in->closecallback(in->context); } if (in->buffer != NULL) { - xmlBufferFree(in->buffer); + xmlBufFree(in->buffer); in->buffer = NULL; } @@ -2460,14 +2593,14 @@ } written = out->written; if (out->conv) { - xmlBufferFree(out->conv); + xmlBufFree(out->conv); out->conv = NULL; } if (out->encoder != NULL) { xmlCharEncCloseFunc(out->encoder); } if (out->buffer != NULL) { - xmlBufferFree(out->buffer); + xmlBufFree(out->buffer); out->buffer = NULL; } @@ -2797,6 +2930,39 @@ return(ret); } +/** + * xmlOutputBufferGetContent: + * @out: an xmlOutputBufferPtr + * + * Gives a pointer to the data currently held in the output buffer + * + * Returns a pointer to the data or NULL in case of error + */ +const xmlChar * +xmlOutputBufferGetContent(xmlOutputBufferPtr out) { + if ((out == NULL) || (out->buffer == NULL)) + return(NULL); + + return(xmlBufContent(out->buffer)); +} + +/** + * xmlOutputBufferGetSize: + * @out: an xmlOutputBufferPtr + * + * Gives the length of the data currently held in the output buffer + * + * Returns 0 in case or error or no data is held, the size otherwise + */ +size_t +xmlOutputBufferGetSize(xmlOutputBufferPtr out) { + if ((out == NULL) || (out->buffer == NULL)) + return(0); + + return(xmlBufUse(out->buffer)); +} + + #endif /* LIBXML_OUTPUT_ENABLED */ /** @@ -2849,7 +3015,7 @@ ret->context = (void *) mem; ret->readcallback = (xmlInputReadCallback) xmlNop; ret->closecallback = NULL; - errcode = xmlBufferAdd(ret->buffer, (const xmlChar *) mem, size); + errcode = xmlBufAdd(ret->buffer, (const xmlChar *) mem, size); if (errcode != 0) { xmlFree(ret); return(NULL); @@ -2886,14 +3052,14 @@ return(NULL); } memset(ret, 0, (size_t) sizeof(xmlParserInputBuffer)); - ret->buffer = xmlBufferCreateStatic((void *)mem, (size_t) size); + ret->buffer = xmlBufCreateStatic((void *)mem, (size_t) size); if (ret->buffer == NULL) { xmlFree(ret); return(NULL); } ret->encoder = xmlGetCharEncodingHandler(enc); if (ret->encoder != NULL) - ret->raw = xmlBufferCreateSize(2 * xmlDefaultBufferSize); + ret->raw = xmlBufCreateSize(2 * xmlDefaultBufferSize); else ret->raw = NULL; ret->compressed = -1; @@ -3062,33 +3228,33 @@ * Store the data in the incoming raw buffer */ if (in->raw == NULL) { - in->raw = xmlBufferCreate(); + in->raw = xmlBufCreate(); } - ret = xmlBufferAdd(in->raw, (const xmlChar *) buf, len); + ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len); if (ret != 0) return(-1); /* * convert as much as possible to the parser reading buffer. */ - use = in->raw->use; - nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); + use = xmlBufUse(in->raw); + nbchars = xmlCharEncInput(in); if (nbchars < 0) { xmlIOErr(XML_IO_ENCODER, NULL); in->error = XML_IO_ENCODER; return(-1); } - in->rawconsumed += (use - in->raw->use); + in->rawconsumed += (use - xmlBufUse(in->raw)); } else { nbchars = len; - ret = xmlBufferAdd(in->buffer, (xmlChar *) buf, nbchars); + ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars); if (ret != 0) return(-1); } #ifdef DEBUG_INPUT xmlGenericError(xmlGenericErrorContext, "I/O: pushed %d chars, buffer %d/%d\n", - nbchars, in->buffer->use, in->buffer->size); + nbchars, xmlBufUse(in->buffer), xmlBufLength(in->buffer)); #endif return(nbchars); } @@ -3126,29 +3292,23 @@ char *buffer = NULL; int res = 0; int nbchars = 0; - int buffree; - unsigned int needSize; if ((in == NULL) || (in->error)) return(-1); if ((len <= MINLEN) && (len != 4)) len = MINLEN; - buffree = in->buffer->size - in->buffer->use; - if (buffree <= 0) { + if (xmlBufAvail(in->buffer) <= 0) { xmlIOErr(XML_IO_BUFFER_FULL, NULL); in->error = XML_IO_BUFFER_FULL; return(-1); } - needSize = in->buffer->use + len + 1; - if (needSize > in->buffer->size){ - if (!xmlBufferResize(in->buffer, needSize)){ - xmlIOErrMemory("growing input buffer"); - in->error = XML_ERR_NO_MEMORY; - return(-1); - } + if (xmlBufGrow(in->buffer, len + 1) < 0) { + xmlIOErrMemory("growing input buffer"); + in->error = XML_ERR_NO_MEMORY; + return(-1); } - buffer = (char *)&in->buffer->content[in->buffer->use]; + buffer = (char *)xmlBufEnd(in->buffer); /* * Call the read method for this I/O type. @@ -3173,32 +3333,31 @@ * Store the data in the incoming raw buffer */ if (in->raw == NULL) { - in->raw = xmlBufferCreate(); + in->raw = xmlBufCreate(); } - res = xmlBufferAdd(in->raw, (const xmlChar *) buffer, len); + res = xmlBufAdd(in->raw, (const xmlChar *) buffer, len); if (res != 0) return(-1); /* * convert as much as possible to the parser reading buffer. */ - use = in->raw->use; - nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); + use = xmlBufUse(in->raw); + nbchars = xmlCharEncInput(in); if (nbchars < 0) { xmlIOErr(XML_IO_ENCODER, NULL); in->error = XML_IO_ENCODER; return(-1); } - in->rawconsumed += (use - in->raw->use); + in->rawconsumed += (use - xmlBufUse(in->raw)); } else { nbchars = len; - in->buffer->use += nbchars; - buffer[nbchars] = 0; + xmlBufAddLen(in->buffer, nbchars); } #ifdef DEBUG_INPUT xmlGenericError(xmlGenericErrorContext, - "I/O: read %d chars, buffer %d/%d\n", - nbchars, in->buffer->use, in->buffer->size); + "I/O: read %d chars, buffer %d\n", + nbchars, xmlBufUse(in->buffer)); #endif return(nbchars); } @@ -3220,8 +3379,7 @@ if ((in == NULL) || (in->error)) return(-1); if (in->readcallback != NULL) return(xmlParserInputBufferGrow(in, len)); - else if ((in->buffer != NULL) && - (in->buffer->alloc == XML_BUFFER_ALLOC_IMMUTABLE)) + else if (xmlBufGetAllocationScheme(in->buffer) == XML_BUFFER_ALLOC_IMMUTABLE) return(0); else return(-1); @@ -3266,30 +3424,30 @@ * Store the data in the incoming raw buffer */ if (out->conv == NULL) { - out->conv = xmlBufferCreate(); + out->conv = xmlBufCreate(); } - ret = xmlBufferAdd(out->buffer, (const xmlChar *) buf, chunk); + ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk); if (ret != 0) return(-1); - if ((out->buffer->use < MINLEN) && (chunk == len)) + if ((xmlBufUse(out->buffer) < MINLEN) && (chunk == len)) goto done; /* * convert as much as possible to the parser reading buffer. */ - ret = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer); + ret = xmlCharEncOutput(out, 0); if ((ret < 0) && (ret != -3)) { xmlIOErr(XML_IO_ENCODER, NULL); out->error = XML_IO_ENCODER; return(-1); } - nbchars = out->conv->use; + nbchars = xmlBufUse(out->conv); } else { - ret = xmlBufferAdd(out->buffer, (const xmlChar *) buf, chunk); + ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk); if (ret != 0) return(-1); - nbchars = out->buffer->use; + nbchars = xmlBufUse(out->buffer); } buf += chunk; len -= chunk; @@ -3303,14 +3461,14 @@ */ if (out->encoder != NULL) { ret = out->writecallback(out->context, - (const char *)out->conv->content, nbchars); + (const char *)xmlBufContent(out->conv), nbchars); if (ret >= 0) - xmlBufferShrink(out->conv, ret); + xmlBufShrink(out->conv, ret); } else { ret = out->writecallback(out->context, - (const char *)out->buffer->content, nbchars); + (const char *)xmlBufContent(out->buffer), nbchars); if (ret >= 0) - xmlBufferShrink(out->buffer, ret); + xmlBufShrink(out->buffer, ret); } if (ret < 0) { xmlIOErr(XML_IO_WRITE, NULL); @@ -3354,7 +3512,7 @@ inend = in + (*inlen); while ((in < inend) && (out < outend)) { - if (*in == '<') { + if (*in == '<') { if (outend - out < 4) break; *out++ = '&'; *out++ = 'l'; @@ -3418,7 +3576,8 @@ if ((out == NULL) || (out->error) || (str == NULL) || (out->buffer == NULL) || - (out->buffer->alloc == XML_BUFFER_ALLOC_IMMUTABLE)) return(-1); + (xmlBufGetAllocationScheme(out->buffer) == XML_BUFFER_ALLOC_IMMUTABLE)) + return(-1); len = strlen((const char *)str); if (len < 0) return(0); if (out->error) return(-1); @@ -3431,14 +3590,14 @@ * how many bytes to consume and how many bytes to store. */ cons = len; - chunk = (out->buffer->size - out->buffer->use) - 1; + chunk = xmlBufAvail(out->buffer) - 1; /* * make sure we have enough room to save first, if this is * not the case force a flush, but make sure we stay in the loop */ if (chunk < 40) { - if (xmlBufferGrow(out->buffer, out->buffer->size + 100) < 0) + if (xmlBufGrow(out->buffer, 100) < 0) return(-1); oldwritten = -1; continue; @@ -3452,36 +3611,33 @@ * Store the data in the incoming raw buffer */ if (out->conv == NULL) { - out->conv = xmlBufferCreate(); + out->conv = xmlBufCreate(); } - ret = escaping(out->buffer->content + out->buffer->use , + ret = escaping(xmlBufEnd(out->buffer) , &chunk, str, &cons); if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */ return(-1); - out->buffer->use += chunk; - out->buffer->content[out->buffer->use] = 0; + xmlBufAddLen(out->buffer, chunk); - if ((out->buffer->use < MINLEN) && (cons == len)) + if ((xmlBufUse(out->buffer) < MINLEN) && (cons == len)) goto done; /* * convert as much as possible to the output buffer. */ - ret = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer); + ret = xmlCharEncOutput(out, 0); if ((ret < 0) && (ret != -3)) { xmlIOErr(XML_IO_ENCODER, NULL); out->error = XML_IO_ENCODER; return(-1); } - nbchars = out->conv->use; + nbchars = xmlBufUse(out->conv); } else { - ret = escaping(out->buffer->content + out->buffer->use , - &chunk, str, &cons); + ret = escaping(xmlBufEnd(out->buffer), &chunk, str, &cons); if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */ return(-1); - out->buffer->use += chunk; - out->buffer->content[out->buffer->use] = 0; - nbchars = out->buffer->use; + xmlBufAddLen(out->buffer, chunk); + nbchars = xmlBufUse(out->buffer); } str += cons; len -= cons; @@ -3495,14 +3651,14 @@ */ if (out->encoder != NULL) { ret = out->writecallback(out->context, - (const char *)out->conv->content, nbchars); + (const char *)xmlBufContent(out->conv), nbchars); if (ret >= 0) - xmlBufferShrink(out->conv, ret); + xmlBufShrink(out->conv, ret); } else { ret = out->writecallback(out->context, - (const char *)out->buffer->content, nbchars); + (const char *)xmlBufContent(out->buffer), nbchars); if (ret >= 0) - xmlBufferShrink(out->buffer, ret); + xmlBufShrink(out->buffer, ret); } if (ret < 0) { xmlIOErr(XML_IO_WRITE, NULL); @@ -3510,8 +3666,8 @@ return(ret); } out->written += ret; - } else if (out->buffer->size - out->buffer->use < MINLEN) { - xmlBufferResize(out->buffer, out->buffer->size + MINLEN); + } else if (xmlBufAvail(out->buffer) < MINLEN) { + xmlBufGrow(out->buffer, MINLEN); } written += nbchars; } while ((len > 0) && (oldwritten != written)); @@ -3571,7 +3727,7 @@ /* * convert as much as possible to the parser reading buffer. */ - nbchars = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer); + nbchars = xmlCharEncOutput(out, 0); if (nbchars < 0) { xmlIOErr(XML_IO_ENCODER, NULL); out->error = XML_IO_ENCODER; @@ -3585,14 +3741,16 @@ if ((out->conv != NULL) && (out->encoder != NULL) && (out->writecallback != NULL)) { ret = out->writecallback(out->context, - (const char *)out->conv->content, out->conv->use); + (const char *)xmlBufContent(out->conv), + xmlBufUse(out->conv)); if (ret >= 0) - xmlBufferShrink(out->conv, ret); + xmlBufShrink(out->conv, ret); } else if (out->writecallback != NULL) { ret = out->writecallback(out->context, - (const char *)out->buffer->content, out->buffer->use); + (const char *)xmlBufContent(out->buffer), + xmlBufUse(out->buffer)); if (ret >= 0) - xmlBufferShrink(out->buffer, ret); + xmlBufShrink(out->buffer, ret); } if (ret < 0) { xmlIOErr(XML_IO_FLUSH, NULL); Index: lib/3rdparty/libxml2/xmllint.c =================================================================== --- lib/3rdparty/libxml2/xmllint.c (revision 58293) +++ lib/3rdparty/libxml2/xmllint.c (working copy) @@ -130,6 +130,7 @@ #endif /* LIBXML_TREE_ENABLED */ static int recovery = 0; static int noent = 0; +static int noenc = 0; static int noblanks = 0; static int noout = 0; static int nowrap = 0; @@ -168,7 +169,7 @@ #ifdef LIBXML_PUSH_ENABLED static int push = 0; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif static int testIO = 0; @@ -208,7 +209,7 @@ #ifdef LIBXML_XPATH_ENABLED static const char *xpathquery = NULL; #endif -static int options = XML_PARSE_COMPACT; +static int options = XML_PARSE_COMPACT | XML_PARSE_BIG_LINES; static int sax = 0; static int oldxml10 = 0; @@ -519,10 +520,11 @@ * We cannot do anything because we don't have a timing function */ #ifdef HAVE_STDARG_H + va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); - fprintf(stderr, " was not timed\n", msec); + fprintf(stderr, " was not timed\n"); #else /* We don't have gettimeofday, time or stdarg.h, what crazy world is * this ?! @@ -1667,6 +1669,7 @@ (xmlSchemaValidityErrorFunc) fprintf, (xmlSchemaValidityWarningFunc) fprintf, stderr); + xmlSchemaValidateSetFilename(vctxt, filename); ret = xmlSchemaValidateStream(vctxt, buf, 0, handler, (void *)user_data); @@ -1821,7 +1824,7 @@ static void streamFile(char *filename) { xmlTextReaderPtr reader; int ret; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP int fd = -1; struct stat info; const char *base = NULL; @@ -1972,7 +1975,7 @@ patstream = NULL; } #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlFreeParserInputBuffer(input); munmap((char *) base, info.st_size); @@ -2072,7 +2075,7 @@ #ifdef LIBXML_OUTPUT_ENABLED xmlSaveCtxtPtr ctxt; - if (cur->nodesetval->nodeNr <= 0) { + if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) { fprintf(stderr, "XPath set is empty\n"); progresult = XMLLINT_ERR_XPATH; break; @@ -2137,7 +2140,7 @@ progresult = XMLLINT_ERR_MEM; return; } - ctxt->node = xmlDocGetRootElement(doc); + ctxt->node = (xmlNodePtr) doc; res = xmlXPathEval(BAD_CAST query, ctxt); xmlXPathFreeContext(ctxt); @@ -2210,7 +2213,7 @@ } } #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((html) && (memory)) { int fd; struct stat info; @@ -2325,7 +2328,7 @@ if (rectxt == NULL) xmlFreeParserCtxt(ctxt); } -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP } else if (memory) { int fd; struct stat info; @@ -2550,7 +2553,9 @@ size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_0, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2562,7 +2567,9 @@ size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_1, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2575,7 +2582,9 @@ size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_EXCLUSIVE_1_0, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2583,7 +2592,7 @@ } } else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlChar *result; int len; @@ -2604,12 +2613,14 @@ fprintf(stderr, "Failed to save\n"); progresult = XMLLINT_ERR_OUT; } else { - write(1, result, len); + if (write(1, result, len) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } } else -#endif /* HAVE_SYS_MMAN_H */ +#endif /* HAVE_MMAP */ if (compress) { xmlSaveFile(output ? output : "-", doc); } else if (oldout) { @@ -2949,6 +2960,7 @@ if (xmlHasFeature(XML_WITH_DEBUG_MEM)) fprintf(stderr, "MemDebug "); if (xmlHasFeature(XML_WITH_DEBUG_RUN)) fprintf(stderr, "RunDebug "); if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(stderr, "Zlib "); + if (xmlHasFeature(XML_WITH_LZMA)) fprintf(stderr, "Lzma "); fprintf(stderr, "\n"); } @@ -2975,6 +2987,7 @@ printf("\t--recover : output what was parsable on broken XML documents\n"); printf("\t--huge : remove any internal arbitrary parser limits\n"); printf("\t--noent : substitute entity references by their value\n"); + printf("\t--noenc : ignore any encoding specified inside the document\n"); printf("\t--noout : don't output the result tree\n"); printf("\t--path 'paths': provide a set of paths for resources\n"); printf("\t--load-trace : print trace of all external entites loaded\n"); @@ -3005,7 +3018,7 @@ #ifdef LIBXML_PUSH_ENABLED printf("\t--push : use the push mode of the parser\n"); #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : parse from memory\n"); #endif printf("\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n"); @@ -3129,6 +3142,10 @@ (!strcmp(argv[i], "--noent"))) { noent++; options |= XML_PARSE_NOENT; + } else if ((!strcmp(argv[i], "-noenc")) || + (!strcmp(argv[i], "--noenc"))) { + noenc++; + options |= XML_PARSE_IGNORE_ENC; } else if ((!strcmp(argv[i], "-nsclean")) || (!strcmp(argv[i], "--nsclean"))) { options |= XML_PARSE_NSCLEAN; @@ -3231,7 +3248,7 @@ (!strcmp(argv[i], "--push"))) push++; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) memory++; @@ -3323,8 +3340,9 @@ } else if ((!strcmp(argv[i], "-noblanks")) || (!strcmp(argv[i], "--noblanks"))) { - noblanks++; - xmlKeepBlanksDefault(0); + noblanks++; + xmlKeepBlanksDefault(0); + options |= XML_PARSE_NOBLANKS; } else if ((!strcmp(argv[i], "-maxmem")) || (!strcmp(argv[i], "--maxmem"))) { @@ -3349,11 +3367,11 @@ i++; #ifdef LIBXML_OUTPUT_ENABLED format = atoi(argv[i]); -#endif /* LIBXML_OUTPUT_ENABLED */ if (format == 1) { noblanks++; xmlKeepBlanksDefault(0); } +#endif /* LIBXML_OUTPUT_ENABLED */ } #ifdef LIBXML_READER_ENABLED else if ((!strcmp(argv[i], "-stream")) || Index: lib/3rdparty/libxml2/xmlmemory.c =================================================================== --- lib/3rdparty/libxml2/xmlmemory.c (revision 58293) +++ lib/3rdparty/libxml2/xmlmemory.c (working copy) @@ -58,7 +58,7 @@ /************************************************************************ * * - * Macros, variables and associated types * + * Macros, variables and associated types * * * ************************************************************************/ @@ -205,7 +205,8 @@ if (xmlMemTraceBlockAt == ret) { xmlGenericError(xmlGenericErrorContext, - "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size); + "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt, + (long unsigned)size); xmlMallocBreakpoint(); } @@ -273,7 +274,8 @@ if (xmlMemTraceBlockAt == ret) { xmlGenericError(xmlGenericErrorContext, - "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size); + "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt, + (long unsigned)size); xmlMallocBreakpoint(); } @@ -348,8 +350,9 @@ } if (xmlMemTraceBlockAt == ptr) { xmlGenericError(xmlGenericErrorContext, - "%p : Realloced(%ld -> %ld) Ok\n", - xmlMemTraceBlockAt, p->mh_size, size); + "%p : Realloced(%lu -> %lu) Ok\n", + xmlMemTraceBlockAt, (long unsigned)p->mh_size, + (long unsigned)size); xmlMallocBreakpoint(); } p->mh_tag = MEMTAG; Index: lib/3rdparty/libxml2/xmlmodule.c =================================================================== --- lib/3rdparty/libxml2/xmlmodule.c (revision 58293) +++ lib/3rdparty/libxml2/xmlmodule.c (working copy) @@ -30,7 +30,7 @@ /************************************************************************ * * - * module memory error handler * + * module memory error handler * * * ************************************************************************/ @@ -61,6 +61,10 @@ * @options: a set of xmlModuleOption * * 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 canot 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. * * Returns a handle for the module or NULL in case of error @@ -99,6 +103,10 @@ * @symbol: the resulting symbol address * * 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 canot guarantee that + * an UTF-8 string would work, which is why name is a const char * + * and not a const xmlChar * . * * Returns 0 if the symbol was found, or -1 in case of error */ @@ -106,7 +114,7 @@ xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol) { int rc = -1; - + if ((NULL == module) || (symbol == NULL)) { __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, @@ -290,7 +298,7 @@ #ifdef _WIN32 -//#include +#include /* * xmlModulePlatformOpen: @@ -300,7 +308,7 @@ static void * xmlModulePlatformOpen(const char *name) { - return LoadLibrary(name); + return LoadLibraryA(name); } /* @@ -326,7 +334,14 @@ static int xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) { +#ifdef _WIN32_WCE + /* + * GetProcAddressA seems only available on WinCE + */ + *symbol = GetProcAddressA(handle, name); +#else *symbol = GetProcAddress(handle, name); +#endif return (NULL == *symbol) ? -1 : 0; } Index: lib/3rdparty/libxml2/xmlreader.c =================================================================== --- lib/3rdparty/libxml2/xmlreader.c (revision 58293) +++ lib/3rdparty/libxml2/xmlreader.c (working copy) @@ -44,6 +44,8 @@ #include #endif +#include "buf.h" + #define MAX_ERR_MSG_SIZE 64000 /* @@ -135,7 +137,7 @@ int depth; /* depth of the current node */ xmlNodePtr faketext;/* fake xmlNs chld */ int preserve;/* preserve the resulting document */ - xmlBufferPtr buffer; /* used to return const xmlChar * */ + xmlBufPtr buffer; /* used to return const xmlChar * */ xmlDictPtr dict; /* the context dictionnary */ /* entity stack when traversing entities content */ @@ -152,6 +154,7 @@ /* Handling of RelaxNG validation */ xmlRelaxNGPtr rngSchemas; /* The Relax NG schemas */ xmlRelaxNGValidCtxtPtr rngValidCtxt;/* The Relax NG validation context */ + int rngPreserveCtxt; /* 1 if the context was provided by the user */ int rngValidErrors;/* The number of errors detected */ xmlNodePtr rngFullNode; /* the node if RNG not progressive */ /* Handling of Schemas validation */ @@ -806,9 +809,10 @@ */ static int xmlTextReaderPushData(xmlTextReaderPtr reader) { - xmlBufferPtr inbuf; + xmlBufPtr inbuf; int val, s; xmlTextReaderState oldstate; + int alloc; if ((reader->input == NULL) || (reader->input->buffer == NULL)) return(-1); @@ -816,17 +820,18 @@ oldstate = reader->state; reader->state = XML_TEXTREADER_NONE; inbuf = reader->input->buffer; + alloc = xmlBufGetAllocationScheme(inbuf); while (reader->state == XML_TEXTREADER_NONE) { - if (inbuf->use < reader->cur + CHUNK_SIZE) { + if (xmlBufUse(inbuf) < reader->cur + CHUNK_SIZE) { /* * Refill the buffer unless we are at the end of the stream */ if (reader->mode != XML_TEXTREADER_MODE_EOF) { val = xmlParserInputBufferRead(reader->input, 4096); if ((val == 0) && - (inbuf->alloc == XML_BUFFER_ALLOC_IMMUTABLE)) { - if (inbuf->use == reader->cur) { + (alloc == XML_BUFFER_ALLOC_IMMUTABLE)) { + if (xmlBufUse(inbuf) == reader->cur) { reader->mode = XML_TEXTREADER_MODE_EOF; reader->state = oldstate; } @@ -849,21 +854,23 @@ * parse by block of CHUNK_SIZE bytes, various tests show that * it's the best tradeoff at least on a 1.2GH Duron */ - if (inbuf->use >= reader->cur + CHUNK_SIZE) { + if (xmlBufUse(inbuf) >= reader->cur + CHUNK_SIZE) { val = xmlParseChunk(reader->ctxt, - (const char *) &inbuf->content[reader->cur], - CHUNK_SIZE, 0); + (const char *) xmlBufContent(inbuf) + reader->cur, + CHUNK_SIZE, 0); reader->cur += CHUNK_SIZE; - if ((val != 0) || (reader->ctxt->wellFormed == 0)) - return(-1); + if (val != 0) + reader->ctxt->wellFormed = 0; + if (reader->ctxt->wellFormed == 0) + break; } else { - s = inbuf->use - reader->cur; + s = xmlBufUse(inbuf) - reader->cur; val = xmlParseChunk(reader->ctxt, - (const char *) &inbuf->content[reader->cur], - s, 0); + (const char *) xmlBufContent(inbuf) + reader->cur, + s, 0); reader->cur += s; - if ((val != 0) || (reader->ctxt->wellFormed == 0)) - return(-1); + if (val != 0) + reader->ctxt->wellFormed = 0; break; } } @@ -872,10 +879,10 @@ * Discard the consumed input when needed and possible */ if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) { - if (inbuf->alloc != XML_BUFFER_ALLOC_IMMUTABLE) { + if (alloc != XML_BUFFER_ALLOC_IMMUTABLE) { if ((reader->cur >= 4096) && - (inbuf->use - reader->cur <= CHUNK_SIZE)) { - val = xmlBufferShrink(inbuf, reader->cur); + (xmlBufUse(inbuf) - reader->cur <= CHUNK_SIZE)) { + val = xmlBufShrink(inbuf, reader->cur); if (val >= 0) { reader->cur -= val; } @@ -889,17 +896,26 @@ */ else if (reader->mode == XML_TEXTREADER_MODE_EOF) { if (reader->state != XML_TEXTREADER_DONE) { - s = inbuf->use - reader->cur; + s = xmlBufUse(inbuf) - reader->cur; val = xmlParseChunk(reader->ctxt, - (const char *) &inbuf->content[reader->cur], - s, 1); - reader->cur = inbuf->use; + (const char *) xmlBufContent(inbuf) + reader->cur, + s, 1); + reader->cur = xmlBufUse(inbuf); reader->state = XML_TEXTREADER_DONE; - if ((val != 0) || (reader->ctxt->wellFormed == 0)) - return(-1); + if (val != 0) { + if (reader->ctxt->wellFormed) + reader->ctxt->wellFormed = 0; + else + return(-1); + } } } reader->state = oldstate; + if (reader->ctxt->wellFormed == 0) { + reader->mode = XML_TEXTREADER_MODE_EOF; + return(-1); + } + return(0); } @@ -1212,6 +1228,9 @@ xmlBufferPtr buffer; xmlChar *ret; + if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) + return(NULL); + buffer = xmlBufferCreate(); if (buffer == NULL) return NULL; @@ -1264,8 +1283,6 @@ return(xmlTextReaderReadTree(reader)); if (reader->ctxt == NULL) return(-1); - if (reader->ctxt->wellFormed != 1) - return(-1); #ifdef DEBUG_READER fprintf(stderr, "\nREAD "); @@ -1709,8 +1726,8 @@ * * Reads the contents of the current node, including child nodes and markup. * - * Returns a string containing the node and any XML content, or NULL if the - * current node cannot be serialized. The string must be deallocated + * Returns a string containing the node and any XML content, or NULL if the + * current node cannot be serialized. The string must be deallocated * by the caller. */ xmlChar * @@ -2055,7 +2072,7 @@ ret->entMax = 0; ret->entNr = 0; ret->input = input; - ret->buffer = xmlBufferCreateSize(100); + ret->buffer = xmlBufCreateSize(100); if (ret->buffer == NULL) { xmlFree(ret); xmlGenericError(xmlGenericErrorContext, @@ -2064,7 +2081,7 @@ } ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler)); if (ret->sax == NULL) { - xmlBufferFree(ret->buffer); + xmlBufFree(ret->buffer); xmlFree(ret); xmlGenericError(xmlGenericErrorContext, "xmlNewTextReader : malloc failed\n"); @@ -2097,12 +2114,13 @@ ret->mode = XML_TEXTREADER_MODE_INITIAL; ret->node = NULL; ret->curnode = NULL; - if (ret->input->buffer->use < 4) { + if (xmlBufUse(ret->input->buffer) < 4) { xmlParserInputBufferRead(input, 4); } - if (ret->input->buffer->use >= 4) { + if (xmlBufUse(ret->input->buffer) >= 4) { ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL, - (const char *) ret->input->buffer->content, 4, URI); + (const char *) xmlBufContent(ret->input->buffer), + 4, URI); ret->base = 0; ret->cur = 4; } else { @@ -2114,7 +2132,7 @@ if (ret->ctxt == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlNewTextReader : malloc failed\n"); - xmlBufferFree(ret->buffer); + xmlBufFree(ret->buffer); xmlFree(ret->sax); xmlFree(ret); return(NULL); @@ -2187,7 +2205,8 @@ reader->rngSchemas = NULL; } if (reader->rngValidCtxt != NULL) { - xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); + if (! reader->rngPreserveCtxt) + xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); reader->rngValidCtxt = NULL; } if (reader->xsdPlug != NULL) { @@ -2243,7 +2262,7 @@ if ((reader->input != NULL) && (reader->allocs & XML_TEXTREADER_INPUT)) xmlFreeParserInputBuffer(reader->input); if (reader->buffer != NULL) - xmlBufferFree(reader->buffer); + xmlBufFree(reader->buffer); if (reader->entTab != NULL) xmlFree(reader->entTab); if (reader->dict != NULL) @@ -3591,16 +3610,17 @@ (attr->children->next == NULL)) return(attr->children->content); else { - if (reader->buffer == NULL) - reader->buffer = xmlBufferCreateSize(100); if (reader->buffer == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlTextReaderSetup : malloc failed\n"); - return (NULL); - } - reader->buffer->use = 0; - xmlNodeBufGetContent(reader->buffer, node); - return(reader->buffer->content); + reader->buffer = xmlBufCreateSize(100); + if (reader->buffer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextReaderSetup : malloc failed\n"); + return (NULL); + } + } else + xmlBufEmpty(reader->buffer); + xmlBufGetNodeContent(reader->buffer, node); + return(xmlBufContent(reader->buffer)); } break; } @@ -4095,9 +4115,11 @@ reader->rngSchemas = NULL; } if (reader->rngValidCtxt != NULL) { - xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); + if (! reader->rngPreserveCtxt) + xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); reader->rngValidCtxt = NULL; } + reader->rngPreserveCtxt = 0; return(0); } if (reader->mode != XML_TEXTREADER_MODE_INITIAL) @@ -4107,9 +4129,11 @@ reader->rngSchemas = NULL; } if (reader->rngValidCtxt != NULL) { - xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); + if (! reader->rngPreserveCtxt) + xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); reader->rngValidCtxt = NULL; } + reader->rngPreserveCtxt = 0; reader->rngValidCtxt = xmlRelaxNGNewValidCtxt(schema); if (reader->rngValidCtxt == NULL) return(-1); @@ -4131,6 +4155,60 @@ } /** + * xmlTextReaderLocator: + * @ctx: the xmlTextReaderPtr used + * @file: returned file information + * @line: returned line information + * + * Internal locator function for the readers + * + * Returns 0 in case the Schema validation could be (des)activated and + * -1 in case of error. + */ +static int +xmlTextReaderLocator(void *ctx, const char **file, unsigned long *line) { + xmlTextReaderPtr reader; + + if ((ctx == NULL) || ((file == NULL) && (line == NULL))) + return(-1); + + if (file != NULL) + *file = NULL; + if (line != NULL) + *line = 0; + + reader = (xmlTextReaderPtr) ctx; + if ((reader->ctxt != NULL) && (reader->ctxt->input != NULL)) { + if (file != NULL) + *file = reader->ctxt->input->filename; + if (line != NULL) + *line = reader->ctxt->input->line; + return(0); + } + if (reader->node != NULL) { + long res; + int ret = 0; + + if (line != NULL) { + res = xmlGetLineNo(reader->node); + if (res > 0) + *line = (unsigned long) res; + else + ret = -1; + } + if (file != NULL) { + xmlDocPtr doc = reader->node->doc; + if ((doc != NULL) && (doc->URL != NULL)) + *file = (const char *) doc->URL; + else + ret = -1; + } + return(ret); + } + return(-1); +} + +/** * xmlTextReaderSetSchema: * @reader: the xmlTextReaderPtr used * @schema: a precompiled Schema schema @@ -4197,6 +4275,10 @@ reader->xsdValidCtxt = NULL; return(-1); } + xmlSchemaValidateSetLocator(reader->xsdValidCtxt, + xmlTextReaderLocator, + (void *) reader); + if (reader->errorFunc != NULL) { xmlSchemaSetValidErrors(reader->xsdValidCtxt, xmlTextReaderValidityErrorRelay, @@ -4214,67 +4296,91 @@ } /** - * xmlTextReaderRelaxNGValidate: + * xmlTextReaderRelaxNGValidateInternal: * @reader: the xmlTextReaderPtr used * @rng: the path to a RelaxNG schema or NULL + * @ctxt: the RelaxNG schema validation context or NULL + * @options: options (not yet used) * * Use RelaxNG to validate the document as it is processed. * Activation is only possible before the first Read(). - * if @rng is NULL, then RelaxNG validation is deactivated. + * If both @rng and @ctxt are NULL, then RelaxNG validation is deactivated. * * Returns 0 in case the RelaxNG validation could be (de)activated and - * -1 in case of error. + * -1 in case of error. */ -int -xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng) { - xmlRelaxNGParserCtxtPtr ctxt; - +static int +xmlTextReaderRelaxNGValidateInternal(xmlTextReaderPtr reader, + const char *rng, + xmlRelaxNGValidCtxtPtr ctxt, + int options ATTRIBUTE_UNUSED) +{ if (reader == NULL) - return(-1); + return(-1); - if (rng == NULL) { - if (reader->rngValidCtxt != NULL) { + if ((rng != NULL) && (ctxt != NULL)) + return (-1); + + if (((rng != NULL) || (ctxt != NULL)) && + ((reader->mode != XML_TEXTREADER_MODE_INITIAL) || + (reader->ctxt == NULL))) + return(-1); + + /* Cleanup previous validation stuff. */ + if (reader->rngValidCtxt != NULL) { + if ( !reader->rngPreserveCtxt) xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); - reader->rngValidCtxt = NULL; - } - if (reader->rngSchemas != NULL) { - xmlRelaxNGFree(reader->rngSchemas); - reader->rngSchemas = NULL; - } - return(0); + reader->rngValidCtxt = NULL; } - if (reader->mode != XML_TEXTREADER_MODE_INITIAL) - return(-1); + reader->rngPreserveCtxt = 0; if (reader->rngSchemas != NULL) { xmlRelaxNGFree(reader->rngSchemas); reader->rngSchemas = NULL; } - if (reader->rngValidCtxt != NULL) { - xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); - reader->rngValidCtxt = NULL; + + if ((rng == NULL) && (ctxt == NULL)) { + /* We just want to deactivate the validation, so get out. */ + return(0); } - ctxt = xmlRelaxNGNewParserCtxt(rng); - if (reader->errorFunc != NULL) { - xmlRelaxNGSetParserErrors(ctxt, - xmlTextReaderValidityErrorRelay, - xmlTextReaderValidityWarningRelay, - reader); + + + if (rng != NULL) { + xmlRelaxNGParserCtxtPtr pctxt; + /* Parse the schema and create validation environment. */ + + pctxt = xmlRelaxNGNewParserCtxt(rng); + if (reader->errorFunc != NULL) { + xmlRelaxNGSetParserErrors(pctxt, + xmlTextReaderValidityErrorRelay, + xmlTextReaderValidityWarningRelay, + reader); + } + if (reader->sErrorFunc != NULL) { + xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, + xmlTextReaderValidityStructuredRelay, + reader); + } + reader->rngSchemas = xmlRelaxNGParse(pctxt); + xmlRelaxNGFreeParserCtxt(pctxt); + if (reader->rngSchemas == NULL) + return(-1); + reader->rngValidCtxt = xmlRelaxNGNewValidCtxt(reader->rngSchemas); + if (reader->rngValidCtxt == NULL) { + xmlRelaxNGFree(reader->rngSchemas); + reader->rngSchemas = NULL; + return(-1); + } + } else { + /* Use the given validation context. */ + reader->rngValidCtxt = ctxt; + reader->rngPreserveCtxt = 1; } - if (reader->sErrorFunc != NULL) { - xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, - xmlTextReaderValidityStructuredRelay, - reader); - } - reader->rngSchemas = xmlRelaxNGParse(ctxt); - xmlRelaxNGFreeParserCtxt(ctxt); - if (reader->rngSchemas == NULL) - return(-1); - reader->rngValidCtxt = xmlRelaxNGNewValidCtxt(reader->rngSchemas); - if (reader->rngValidCtxt == NULL) { - xmlRelaxNGFree(reader->rngSchemas); - reader->rngSchemas = NULL; - return(-1); - } + /* + * Redirect the validation context's error channels to use + * the reader channels. + * TODO: In case the user provides the validation context we + * could make this redirection optional. + */ if (reader->errorFunc != NULL) { xmlRelaxNGSetValidErrors(reader->rngValidCtxt, xmlTextReaderValidityErrorRelay, @@ -4387,6 +4493,9 @@ return(-1); } } + xmlSchemaValidateSetLocator(reader->xsdValidCtxt, + xmlTextReaderLocator, + (void *) reader); /* * Redirect the validation context's error channels to use * the reader channels. @@ -4447,6 +4556,46 @@ { return(xmlTextReaderSchemaValidateInternal(reader, xsd, NULL, 0)); } + +/** + * xmlTextReaderRelaxNGValidateCtxt: + * @reader: the xmlTextReaderPtr used + * @ctxt: the RelaxNG schema validation context or NULL + * @options: options (not used yet) + * + * Use RelaxNG schema context to validate the document as it is processed. + * Activation is only possible before the first Read(). + * If @ctxt is NULL, then RelaxNG schema validation is deactivated. + * + * Returns 0 in case the schemas validation could be (de)activated and + * -1 in case of error. + */ +int +xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader, + xmlRelaxNGValidCtxtPtr ctxt, + int options) +{ + return(xmlTextReaderRelaxNGValidateInternal(reader, NULL, ctxt, options)); +} + +/** + * xmlTextReaderRelaxNGValidate: + * @reader: the xmlTextReaderPtr used + * @rng: the path to a RelaxNG schema or NULL + * + * Use RelaxNG schema to validate the document as it is processed. + * Activation is only possible before the first Read(). + * If @rng is NULL, then RelaxNG schema validation is deactivated. + * + * Returns 0 in case the schemas validation could be (de)activated and + * -1 in case of error. + */ +int +xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng) +{ + return(xmlTextReaderRelaxNGValidateInternal(reader, rng, NULL, 0)); +} + #endif /** @@ -4964,7 +5113,7 @@ reader->allocs |= XML_TEXTREADER_INPUT; } if (reader->buffer == NULL) - reader->buffer = xmlBufferCreateSize(100); + reader->buffer = xmlBufCreateSize(100); if (reader->buffer == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlTextReaderSetup : malloc failed\n"); @@ -5005,13 +5154,14 @@ reader->node = NULL; reader->curnode = NULL; if (input != NULL) { - if (reader->input->buffer->use < 4) { + if (xmlBufUse(reader->input->buffer) < 4) { xmlParserInputBufferRead(input, 4); } if (reader->ctxt == NULL) { - if (reader->input->buffer->use >= 4) { + if (xmlBufUse(reader->input->buffer) >= 4) { reader->ctxt = xmlCreatePushParserCtxt(reader->sax, NULL, - (const char *) reader->input->buffer->content, 4, URL); + (const char *) xmlBufContent(reader->input->buffer), + 4, URL); reader->base = 0; reader->cur = 4; } else { @@ -5040,10 +5190,7 @@ inputStream->filename = (char *) xmlCanonicPath((const xmlChar *) URL); inputStream->buf = buf; - inputStream->base = inputStream->buf->buffer->content; - inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = - &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; + xmlBufResetInput(buf->buffer, inputStream); inputPush(reader->ctxt, inputStream); reader->cur = 0; @@ -5331,8 +5478,11 @@ input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (NULL); + } reader = xmlNewTextReader(input, URL); if (reader == NULL) { xmlFreeParserInputBuffer(input); @@ -5549,10 +5699,14 @@ input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (-1); + } return (xmlTextReaderSetup(reader, input, URL, encoding, options)); } + /************************************************************************ * * * Utilities * Index: lib/3rdparty/libxml2/xmlregexp.c =================================================================== --- lib/3rdparty/libxml2/xmlregexp.c (revision 58293) +++ lib/3rdparty/libxml2/xmlregexp.c (working copy) @@ -1,7 +1,7 @@ /* * regexp.c: generic and extensible Regular Expression engine * - * Basically designed with the purpose of compiling regexps for + * Basically designed with the purpose of compiling regexps for * the variety of validation/shemas mechanisms now available in * XML related specifications these include: * - XML-1.0 DTD validation @@ -44,6 +44,9 @@ #define MAX_PUSH 10000000 +#ifdef ERROR +#undef ERROR +#endif #define ERROR(str) \ ctxt->error = XML_REGEXP_COMPILE_ERROR; \ xmlRegexpErrCompile(ctxt, str); @@ -65,15 +68,15 @@ * * macro to flag unimplemented blocks */ -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); /************************************************************************ - * * - * Datatypes and structures * - * * + * * + * Datatypes and structures * + * * ************************************************************************/ /* @@ -219,6 +222,7 @@ struct _xmlAutomataState { xmlRegStateType type; xmlRegMarkedType mark; + xmlRegMarkedType markd; xmlRegMarkedType reached; int no; int maxTrans; @@ -361,7 +365,7 @@ /************************************************************************ * * - * Regexp memory error handler * + * Regexp memory error handler * * * ************************************************************************/ /** @@ -408,9 +412,9 @@ } /************************************************************************ - * * - * Allocation/Deallocation * - * * + * * + * Allocation/Deallocation * + * * ************************************************************************/ static int xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt); @@ -931,9 +935,9 @@ } /************************************************************************ - * * - * Display of Data structures * - * * + * * + * Display of Data structures * + * * ************************************************************************/ static void @@ -1140,7 +1144,7 @@ fprintf(output, "char %c ", trans->atom->codepoint); fprintf(output, "atom %d, to %d\n", trans->atom->no, trans->to); } - + static void xmlRegPrintState(FILE *output, xmlRegStatePtr state) { int i; @@ -1154,7 +1158,7 @@ fprintf(output, "START "); if (state->type == XML_REGEXP_FINAL_STATE) fprintf(output, "FINAL "); - + fprintf(output, "%d, %d transitions:\n", state->no, state->nbTrans); for (i = 0;i < state->nbTrans; i++) { xmlRegPrintTrans(output, &(state->trans[i])); @@ -1204,12 +1208,12 @@ #endif /************************************************************************ - * * + * * * Finite Automata structures manipulations * - * * + * * ************************************************************************/ -static void +static void xmlRegAtomAddRange(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom, int neg, xmlRegAtomType type, int start, int end, xmlChar *blockName) { @@ -1249,7 +1253,7 @@ return; range->blockName = blockName; atom->ranges[atom->nbRanges++] = range; - + } static int @@ -1280,7 +1284,7 @@ return(ctxt->nbCounters++); } -static int +static int xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) { if (atom == NULL) { ERROR("atom push: atom is NULL"); @@ -1312,7 +1316,7 @@ return(0); } -static void +static void xmlRegStateAddTransTo(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr target, int from) { if (target->maxTransTo == 0) { @@ -1340,7 +1344,7 @@ target->nbTransTo++; } -static void +static void xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, xmlRegAtomPtr atom, xmlRegStatePtr target, int counter, int count) { @@ -1406,7 +1410,7 @@ printf("counted %d\n", counter); else if (atom == NULL) printf("epsilon transition\n"); - else if (atom != NULL) + else if (atom != NULL) xmlRegPrintAtom(stdout, atom); #endif @@ -1560,7 +1564,7 @@ */ xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to); #ifdef DV - } else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) && + } else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) && (atom->quant != XML_REGEXP_QUANT_ONCE)) { to = xmlRegNewState(ctxt); xmlRegStatePush(ctxt, to); @@ -1574,7 +1578,7 @@ /* * transition done to the state after end of atom. * 1. set transition from atom start to new state - * 2. set transition from atom end to this state. + * 2. set transition from atom end to this state. */ if (to == NULL) { xmlFAGenerateEpsilonTransition(ctxt, atom->start, 0); @@ -1618,7 +1622,7 @@ /* * duplicate a transition based on atom to count next * occurences after 1. We cannot loop to atom->start - * directly because we need an epsilon transition to + * directly because we need an epsilon transition to * newstate. */ /* ???? For some reason it seems we never reach that @@ -1677,7 +1681,7 @@ break; } return(0); - } + } if ((atom->min == 0) && (atom->max == 0) && (atom->quant == XML_REGEXP_QUANT_RANGE)) { /* @@ -1703,9 +1707,9 @@ else { return(-1); } - } + } end = to; - if ((atom->quant == XML_REGEXP_QUANT_MULT) || + if ((atom->quant == XML_REGEXP_QUANT_MULT) || (atom->quant == XML_REGEXP_QUANT_PLUS)) { /* * Do not pollute the target state by adding transitions from @@ -1713,7 +1717,7 @@ * So isolate with an epsilon transition. */ xmlRegStatePtr tmp; - + tmp = xmlRegNewState(ctxt); if (tmp != NULL) xmlRegStatePush(ctxt, tmp); @@ -1742,7 +1746,7 @@ atom->quant = XML_REGEXP_QUANT_ONCE; xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1); break; - case XML_REGEXP_QUANT_RANGE: + case XML_REGEXP_QUANT_RANGE: #if DV_test if (atom->min == 0) { xmlFAGenerateEpsilonTransition(ctxt, from, to); @@ -1759,7 +1763,7 @@ * xmlFAReduceEpsilonTransitions: * @ctxt: a regexp parser context * @fromnr: the from state - * @tonr: the to state + * @tonr: the to state * @counter: should that transition be associated to a counted * */ @@ -1803,7 +1807,7 @@ int newto = to->trans[transnr].to; xmlRegStateAddTrans(ctxt, from, NULL, - ctxt->states[newto], + ctxt->states[newto], -1, to->trans[transnr].count); } else { #ifdef DEBUG_REGEXP_GRAPH @@ -1825,11 +1829,11 @@ int newto = to->trans[transnr].to; if (to->trans[transnr].counter >= 0) { - xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, - ctxt->states[newto], + xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, + ctxt->states[newto], to->trans[transnr].counter, -1); } else { - xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, + xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, ctxt->states[newto], counter, -1); } } @@ -1841,7 +1845,7 @@ * xmlFAEliminateSimpleEpsilonTransitions: * @ctxt: a regexp parser context * - * Eliminating general epsilon transitions can get costly in the general + * Eliminating general epsilon transitions can get costly in the general * algorithm due to the large amount of generated new transitions and * associated comparisons. However for simple epsilon transition used just * to separate building blocks when generating the automata this can be @@ -1877,12 +1881,12 @@ #ifdef DEBUG_REGEXP_GRAPH printf("Found simple epsilon trans from start %d to %d\n", statenr, newto); -#endif +#endif } else { #ifdef DEBUG_REGEXP_GRAPH printf("Found simple epsilon trans from %d to %d\n", statenr, newto); -#endif +#endif for (i = 0;i < state->nbTransTo;i++) { tmp = ctxt->states[state->transTo[i]]; for (j = 0;j < tmp->nbTrans;j++) { @@ -1890,10 +1894,10 @@ #ifdef DEBUG_REGEXP_GRAPH printf("Changed transition %d on %d to go to %d\n", j, tmp->no, newto); -#endif +#endif tmp->trans[j].to = -1; xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom, - ctxt->states[newto], + ctxt->states[newto], tmp->trans[j].counter, tmp->trans[j].count); } @@ -1907,7 +1911,7 @@ state->type = XML_REGEXP_UNREACH_STATE; } - + } } } @@ -2109,7 +2113,7 @@ /* * just check all codepoints in the range for acceptance, * this is usually way cheaper since done only once at - * compilation than testing over and over at runtime or + * compilation than testing over and over at runtime or * pushing too many states when evaluating. */ if (((range1->neg == 0) && (range2->neg != 0)) || @@ -2586,6 +2590,8 @@ if (state == NULL) return(ret); + if (state->markd == XML_REGEXP_MARK_VISITED) + return(ret); if (ctxt->flags & AM_AUTOMATA_RNG) deep = 0; @@ -2603,8 +2609,10 @@ if (t1->atom == NULL) { if (t1->to < 0) continue; + state->markd = XML_REGEXP_MARK_VISITED; res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to], to, atom); + state->markd = 0; if (res == 0) { ret = 0; /* t1->nd = 1; */ @@ -2773,9 +2781,9 @@ } /************************************************************************ - * * + * * * Routines to check input against transition atoms * - * * + * * ************************************************************************/ static int @@ -2804,7 +2812,7 @@ case XML_REGEXP_NOTINITNAME: neg = !neg; case XML_REGEXP_INITNAME: - ret = (IS_LETTER(codepoint) || + ret = (IS_LETTER(codepoint) || (codepoint == '_') || (codepoint == ':')); break; case XML_REGEXP_NOTNAMECHAR: @@ -3052,9 +3060,9 @@ } /************************************************************************ - * * + * * * Saving and restoring state of an execution context * - * * + * * ************************************************************************/ #ifdef DEBUG_REGEXP_EXEC @@ -3165,9 +3173,9 @@ } /************************************************************************ - * * + * * * Verifier, running an input against a compiled regexp * - * * + * * ************************************************************************/ static int @@ -3199,7 +3207,7 @@ memset(exec->counts, 0, comp->nbCounters * sizeof(int)); } else exec->counts = NULL; - while ((exec->status == 0) && + while ((exec->status == 0) && (exec->state != NULL) && ((exec->inputString[exec->index] != 0) || ((exec->state != NULL) && (exec->state->type != XML_REGEXP_FINAL_STATE)))) { @@ -3453,6 +3461,8 @@ } xmlFree(exec->rollbacks); } + if (exec->state == NULL) + return(-1); if (exec->counts != NULL) xmlFree(exec->counts); if (exec->status == 0) @@ -3466,9 +3476,9 @@ } /************************************************************************ - * * + * * * Progressive interface to the verifier one atom at a time * - * * + * * ************************************************************************/ #ifdef DEBUG_ERR static void testerr(xmlRegExecCtxtPtr exec); @@ -3585,7 +3595,7 @@ #endif if (exec->inputStackMax == 0) { exec->inputStackMax = 4; - exec->inputStack = (xmlRegInputTokenPtr) + exec->inputStack = (xmlRegInputTokenPtr) xmlMalloc(exec->inputStackMax * sizeof(xmlRegInputToken)); if (exec->inputStack == NULL) { xmlRegexpErrMemory(NULL, "pushing input string"); @@ -3614,11 +3624,11 @@ /** * xmlRegStrEqualWildcard: - * @expStr: the string to be evaluated + * @expStr: the string to be evaluated * @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 seperator of + * can be used as a wildcard in @valStr; "|" is used as a seperator of * substrings in both @expStr and @valStr. * * Returns 1 if the comparison is satisfied and the number of substrings @@ -3684,7 +3694,7 @@ if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL)) return(-1); - + if (value == NULL) { /* * are we at a final state ? @@ -3705,9 +3715,9 @@ for (i = 0;i < comp->nbstrings;i++) { target = comp->compact[state * (comp->nbstrings + 1) + i + 1]; if ((target > 0) && (target <= comp->nbstates)) { - target--; /* to avoid 0 */ + target--; /* to avoid 0 */ if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) { - exec->index = target; + exec->index = target; if ((exec->callback != NULL) && (comp->transdata != NULL)) { exec->callback(exec->data, value, comp->transdata[state * comp->nbstrings + i], data); @@ -3841,7 +3851,7 @@ continue; counter = &exec->comp->counters[t->counter]; count = exec->counts[t->counter]; - if ((count < counter->max) && + if ((count < counter->max) && (t->atom != NULL) && (xmlStrEqual(value, t->atom->valuep))) { ret = 0; @@ -4199,7 +4209,7 @@ int maxval; int nb = 0; - if ((exec == NULL) || (nbval == NULL) || (nbneg == NULL) || + if ((exec == NULL) || (nbval == NULL) || (nbneg == NULL) || (values == NULL) || (*nbval <= 0)) return(-1); @@ -4305,7 +4315,7 @@ values[nb++] = (xmlChar *) atom->valuep; (*nbval)++; } - } + } } for (transno = 0; (transno < state->nbTrans) && (nb < maxval); @@ -4332,7 +4342,7 @@ values[nb++] = (xmlChar *) atom->valuep; (*nbneg)++; } - } + } } } return(0); @@ -4563,10 +4573,10 @@ } #endif /************************************************************************ - * * + * * * Parser for the Schemas Datatype Regular Expressions * * http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#regexs * - * * + * * ************************************************************************/ /** @@ -4595,7 +4605,7 @@ * * [27] charProp ::= IsCategory | IsBlock * [28] IsCategory ::= Letters | Marks | Numbers | Punctuation | - * Separators | Symbols | Others + * Separators | Symbols | Others * [29] Letters ::= 'L' [ultmo]? * [30] Marks ::= 'M' [nce]? * [31] Numbers ::= 'N' [dlo]? @@ -4610,7 +4620,7 @@ int cur; xmlRegAtomType type = (xmlRegAtomType) 0; xmlChar *blockName = NULL; - + cur = CUR; if (cur == 'L') { NEXT; @@ -4782,15 +4792,15 @@ NEXT; start = ctxt->cur; cur = CUR; - if (((cur >= 'a') && (cur <= 'z')) || - ((cur >= 'A') && (cur <= 'Z')) || - ((cur >= '0') && (cur <= '9')) || + if (((cur >= 'a') && (cur <= 'z')) || + ((cur >= 'A') && (cur <= 'Z')) || + ((cur >= '0') && (cur <= '9')) || (cur == 0x2D)) { NEXT; cur = CUR; - while (((cur >= 'a') && (cur <= 'z')) || - ((cur >= 'A') && (cur <= 'Z')) || - ((cur >= '0') && (cur <= '9')) || + while (((cur >= 'a') && (cur <= 'z')) || + ((cur >= 'A') && (cur <= 'Z')) || + ((cur >= '0') && (cur <= '9')) || (cur == 0x2D)) { NEXT; cur = CUR; @@ -4816,7 +4826,7 @@ * xmlFAParseCharClassEsc: * @ctxt: a regexp parser context * - * [23] charClassEsc ::= ( SingleCharEsc | MultiCharEsc | catEsc | complEsc ) + * [23] charClassEsc ::= ( SingleCharEsc | MultiCharEsc | catEsc | complEsc ) * [24] SingleCharEsc ::= '\' [nrt\|.?*+(){}#x2D#x5B#x5D#x5E] * [25] catEsc ::= '\p{' charProp '}' * [26] complEsc ::= '\P{' charProp '}' @@ -4913,34 +4923,34 @@ xmlRegAtomType type = XML_REGEXP_ANYSPACE; switch (cur) { - case 's': + case 's': type = XML_REGEXP_ANYSPACE; break; - case 'S': + case 'S': type = XML_REGEXP_NOTSPACE; break; - case 'i': + case 'i': type = XML_REGEXP_INITNAME; break; - case 'I': + case 'I': type = XML_REGEXP_NOTINITNAME; break; - case 'c': + case 'c': type = XML_REGEXP_NAMECHAR; break; - case 'C': + case 'C': type = XML_REGEXP_NOTNAMECHAR; break; - case 'd': + case 'd': type = XML_REGEXP_DECIMAL; break; - case 'D': + case 'D': type = XML_REGEXP_NOTDECIMAL; break; - case 'w': + case 'w': type = XML_REGEXP_REALCHAR; break; - case 'W': + case 'W': type = XML_REGEXP_NOTREALCHAR; break; } @@ -4960,7 +4970,7 @@ * xmlFAParseCharRange: * @ctxt: a regexp parser context * - * [17] charRange ::= seRange | XmlCharRef | XmlCharIncDash + * [17] charRange ::= seRange | XmlCharRef | XmlCharIncDash * [18] seRange ::= charOrEsc '-' charOrEsc * [20] charOrEsc ::= XmlChar | SingleCharEsc * [21] XmlChar ::= [^\#x2D#x5B#x5D] @@ -5075,7 +5085,7 @@ * * [13] charGroup ::= posCharGroup | negCharGroup | charClassSub * [15] negCharGroup ::= '^' posCharGroup - * [16] charClassSub ::= ( posCharGroup | negCharGroup ) '-' charClassExpr + * [16] charClassSub ::= ( posCharGroup | negCharGroup ) '-' charClassExpr * [12] charClassExpr ::= '[' charGroup ']' */ static void @@ -5323,7 +5333,7 @@ previous = ctxt->state; ret = xmlFAParsePiece(ctxt); if (ret != 0) { - if (xmlFAGenerateTransitions(ctxt, previous, + if (xmlFAGenerateTransitions(ctxt, previous, (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0) return(-1); previous = ctxt->state; @@ -5332,7 +5342,7 @@ while ((ret != 0) && (ctxt->error == 0)) { ret = xmlFAParsePiece(ctxt); if (ret != 0) { - if (xmlFAGenerateTransitions(ctxt, previous, + if (xmlFAGenerateTransitions(ctxt, previous, (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0) return(-1); previous = ctxt->state; @@ -5370,6 +5380,10 @@ end = ctxt->state; while ((CUR == '|') && (ctxt->error == 0)) { NEXT; + if (CUR == 0) { + ERROR("expecting a branch after |") + return; + } ctxt->state = start; ctxt->end = NULL; xmlFAParseBranch(ctxt, end); @@ -5381,9 +5395,9 @@ } /************************************************************************ - * * - * The basic API * - * * + * * + * The basic API * + * * ************************************************************************/ /** @@ -5570,9 +5584,9 @@ #ifdef LIBXML_AUTOMATA_ENABLED /************************************************************************ - * * - * The Automata interface * - * * + * * + * The Automata interface * + * * ************************************************************************/ /** @@ -5843,7 +5857,7 @@ * * If @to is NULL, this creates first a new target state in the automata * and then adds a transition from the @from state to the target state - * activated by a succession of input of value @token and @token2 and + * activated by a succession of input of value @token and @token2 and * whose number is between @min and @max * * Returns the target state or NULL in case of error @@ -5997,8 +6011,8 @@ * * If @to is NULL, this creates first a new target state in the automata * and then adds a transition from the @from state to the target state - * activated by a succession of input of value @token and @token2 and whose - * number is between @min and @max, moreover that transition can only be + * activated by a succession of input of value @token and @token2 and whose + * number is between @min and @max, moreover that transition can only be * crossed once. * * Returns the target state or NULL in case of error @@ -6040,7 +6054,7 @@ str[lenn + lenp + 1] = 0; atom->valuep = str; - } + } atom->data = data; atom->quant = XML_REGEXP_QUANT_ONCEONLY; atom->min = min; @@ -6063,8 +6077,8 @@ return(to); } - + /** * xmlAutomataNewOnceTrans: * @am: an automata @@ -6132,7 +6146,7 @@ */ xmlAutomataStatePtr xmlAutomataNewState(xmlAutomataPtr am) { - xmlAutomataStatePtr to; + xmlAutomataStatePtr to; if (am == NULL) return(NULL); @@ -6199,7 +6213,7 @@ * * Returns the counter number or -1 in case of error */ -int +int xmlAutomataNewCounter(xmlAutomataPtr am, int min, int max) { int ret; @@ -6271,7 +6285,7 @@ * * Returns the compiled regexp or NULL in case of error */ -xmlRegexpPtr +xmlRegexpPtr xmlAutomataCompile(xmlAutomataPtr am) { xmlRegexpPtr ret; @@ -6291,7 +6305,7 @@ * * Returns 1 if true, 0 if not, and -1 in case of error */ -int +int xmlAutomataIsDeterminist(xmlAutomataPtr am) { int ret; @@ -6344,7 +6358,7 @@ if (maxNodes <= 4096) maxNodes = 4096; - + ret = (xmlExpCtxtPtr) xmlMalloc(sizeof(xmlExpCtxt)); if (ret == NULL) return(NULL); @@ -6398,7 +6412,7 @@ /* #define DEBUG_DERIV */ /* - * TODO: + * TODO: * - Wildcards * - public API for creation * @@ -6466,7 +6480,7 @@ xmlExpHashNameComputeKey(const xmlChar *name) { unsigned short value = 0L; char ch; - + if (name != NULL) { value += 30 * (*name); while ((ch = *name++) != 0) { @@ -6485,7 +6499,7 @@ xmlExpNodePtr right) { unsigned long value; unsigned short ret; - + switch (type) { case XML_EXP_SEQ: value = left->key; @@ -6626,7 +6640,7 @@ left->exp_left->ref++; tmp = xmlExpHashGetEntry(ctxt, XML_EXP_OR, left->exp_left, tmp, NULL, 0, 0); - + xmlExpFree(ctxt, left); return(tmp); } @@ -6683,7 +6697,7 @@ return(right); } kbase = xmlExpHashComputeKey(type, left, right); - } else + } else return(NULL); key = kbase % ctxt->size; @@ -6924,7 +6938,7 @@ ************************************************************************/ static int -xmlExpGetLanguageInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, +xmlExpGetLanguageInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, const xmlChar**list, int len, int nb) { int tmp, tmp2; tail: @@ -6969,7 +6983,7 @@ * -2 if there is more than @len strings */ int -xmlExpGetLanguage(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, +xmlExpGetLanguage(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, const xmlChar**langList, int len) { if ((ctxt == NULL) || (exp == NULL) || (langList == NULL) || (len <= 0)) return(-1); @@ -6977,7 +6991,7 @@ } static int -xmlExpGetStartInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, +xmlExpGetStartInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, const xmlChar**list, int len, int nb) { int tmp, tmp2; tail: @@ -7037,7 +7051,7 @@ * -2 if there is more than @len strings */ int -xmlExpGetStart(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, +xmlExpGetStart(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, const xmlChar**tokList, int len) { if ((ctxt == NULL) || (exp == NULL) || (tokList == NULL) || (len <= 0)) return(-1); @@ -7734,7 +7748,7 @@ xmlFree((xmlChar **) tab); return(ret); } - + /** * xmlExpExpDerive: * @ctxt: the expressions context @@ -7786,7 +7800,7 @@ int xmlExpSubsume(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { xmlExpNodePtr tmp; - + if ((exp == NULL) || (ctxt == NULL) || (sub == NULL)) return(-1); @@ -7830,7 +7844,7 @@ /************************************************************************ * * - * Parsing expression * + * Parsing expression * * * ************************************************************************/ @@ -7934,7 +7948,7 @@ ret = xmlExpHashGetEntry(ctxt, XML_EXP_COUNT, ret, NULL, NULL, 0, -1); SKIP_BLANKS - } + } return(ret); } @@ -8056,7 +8070,7 @@ break; case XML_EXP_COUNT: { char rep[40]; - + c = expr->exp_left; if ((c->type == XML_EXP_SEQ) || (c->type == XML_EXP_OR)) xmlExpDumpInt(buf, c, 1); Index: lib/3rdparty/libxml2/xmlsave.c =================================================================== --- lib/3rdparty/libxml2/xmlsave.c (revision 58293) +++ lib/3rdparty/libxml2/xmlsave.c (working copy) @@ -19,6 +19,10 @@ #include +#include "buf.h" +#include "enc.h" +#include "save.h" + /************************************************************************ * * * XHTML detection * @@ -66,7 +70,7 @@ #ifdef LIBXML_OUTPUT_ENABLED -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -92,7 +96,7 @@ /************************************************************************ * * - * Output error handlers * + * Output error handlers * * * ************************************************************************/ /** @@ -210,9 +214,9 @@ int val; inend = in + (*inlen); - + while ((in < inend) && (out < outend)) { - if (*in == '<') { + if (*in == '<') { if (outend - out < 4) break; *out++ = '&'; *out++ = 'l'; @@ -248,7 +252,7 @@ /* * We assume we have UTF-8 input. */ - if (outend - out < 10) break; + if (outend - out < 11) break; if (*in < 0xC0) { xmlSaveErr(XML_SAVE_NOT_UTF8, NULL, NULL); @@ -416,7 +420,7 @@ /************************************************************************ * * - * Dumping XML tree content to a simple buffer * + * Dumping XML tree content to a simple buffer * * * ************************************************************************/ /** @@ -436,14 +440,14 @@ while (children != NULL) { switch (children->type) { case XML_TEXT_NODE: - xmlAttrSerializeTxtContent(buf->buffer, attr->doc, - attr, children->content); + xmlBufAttrSerializeTxtContent(buf->buffer, attr->doc, + attr, children->content); break; case XML_ENTITY_REF_NODE: - xmlBufferAdd(buf->buffer, BAD_CAST "&", 1); - xmlBufferAdd(buf->buffer, children->name, + xmlBufAdd(buf->buffer, BAD_CAST "&", 1); + xmlBufAdd(buf->buffer, children->name, xmlStrlen(children->name)); - xmlBufferAdd(buf->buffer, BAD_CAST ";", 1); + xmlBufAdd(buf->buffer, BAD_CAST ";", 1); break; default: /* should not happen unless we have a badly built tree */ @@ -453,9 +457,99 @@ } } +/** + * xmlBufDumpNotationTable: + * @buf: an xmlBufPtr output + * @table: A notation table + * + * This will dump the content of the notation table as an XML DTD definition + */ +void +xmlBufDumpNotationTable(xmlBufPtr buf, xmlNotationTablePtr table) { + xmlBufferPtr buffer; + + buffer = xmlBufferCreate(); + if (buffer == NULL) { + /* + * TODO set the error in buf + */ + return; + } + xmlDumpNotationTable(buffer, table); + xmlBufMergeBuffer(buf, buffer); +} + +/** + * xmlBufDumpElementDecl: + * @buf: an xmlBufPtr output + * @elem: An element table + * + * This will dump the content of the element declaration as an XML + * DTD definition + */ +void +xmlBufDumpElementDecl(xmlBufPtr buf, xmlElementPtr elem) { + xmlBufferPtr buffer; + + buffer = xmlBufferCreate(); + if (buffer == NULL) { + /* + * TODO set the error in buf + */ + return; + } + xmlDumpElementDecl(buffer, elem); + xmlBufMergeBuffer(buf, buffer); +} + +/** + * xmlBufDumpAttributeDecl: + * @buf: an xmlBufPtr output + * @attr: An attribute declaration + * + * This will dump the content of the attribute declaration as an XML + * DTD definition + */ +void +xmlBufDumpAttributeDecl(xmlBufPtr buf, xmlAttributePtr attr) { + xmlBufferPtr buffer; + + buffer = xmlBufferCreate(); + if (buffer == NULL) { + /* + * TODO set the error in buf + */ + return; + } + xmlDumpAttributeDecl(buffer, attr); + xmlBufMergeBuffer(buf, buffer); +} + +/** + * xmlBufDumpEntityDecl: + * @buf: an xmlBufPtr output + * @ent: An entity table + * + * This will dump the content of the entity table as an XML DTD definition + */ +void +xmlBufDumpEntityDecl(xmlBufPtr buf, xmlEntityPtr ent) { + xmlBufferPtr buffer; + + buffer = xmlBufferCreate(); + if (buffer == NULL) { + /* + * TODO set the error in buf + */ + return; + } + xmlDumpEntityDecl(buffer, ent); + xmlBufMergeBuffer(buf, buffer); +} + /************************************************************************ * * - * Dumping XML tree content to an I/O output buffer * + * Dumping XML tree content to an I/O output buffer * * * ************************************************************************/ @@ -469,7 +563,7 @@ (const char *)encoding); return(-1); } - buf->conv = xmlBufferCreate(); + buf->conv = xmlBufCreate(); if (buf->conv == NULL) { xmlCharEncCloseFunc(buf->encoder); xmlSaveErrMemory("creating encoding buffer"); @@ -478,7 +572,7 @@ /* * initialize the state, e.g. if outputting a BOM */ - xmlCharEncOutFunc(buf->encoder, buf->conv, NULL); + xmlCharEncOutput(buf, 1); } return(0); } @@ -487,7 +581,7 @@ xmlOutputBufferPtr buf = ctxt->buf; xmlOutputBufferFlush(buf); xmlCharEncCloseFunc(buf->encoder); - xmlBufferFree(buf->conv); + xmlBufFree(buf->conv); buf->encoder = NULL; buf->conv = NULL; return(0); @@ -553,7 +647,7 @@ } else xmlOutputBufferWrite(buf, 5, "xmlns"); xmlOutputBufferWrite(buf, 1, "="); - xmlBufferWriteQuotedString(buf->buffer, cur->href); + xmlBufWriteQuotedString(buf->buffer, cur->href); } } @@ -606,7 +700,7 @@ * xmlDtdDumpOutput: * @buf: the XML buffer output * @dtd: the pointer to the DTD - * + * * Dump the XML document DTD, if any. */ static void @@ -623,12 +717,12 @@ xmlOutputBufferWriteString(buf, (const char *)dtd->name); if (dtd->ExternalID != NULL) { xmlOutputBufferWrite(buf, 8, " PUBLIC "); - xmlBufferWriteQuotedString(buf->buffer, dtd->ExternalID); + xmlBufWriteQuotedString(buf->buffer, dtd->ExternalID); xmlOutputBufferWrite(buf, 1, " "); - xmlBufferWriteQuotedString(buf->buffer, dtd->SystemID); + xmlBufWriteQuotedString(buf->buffer, dtd->SystemID); } else if (dtd->SystemID != NULL) { xmlOutputBufferWrite(buf, 8, " SYSTEM "); - xmlBufferWriteQuotedString(buf->buffer, dtd->SystemID); + xmlBufWriteQuotedString(buf->buffer, dtd->SystemID); } if ((dtd->entities == NULL) && (dtd->elements == NULL) && (dtd->attributes == NULL) && (dtd->notations == NULL) && @@ -643,7 +737,8 @@ */ if ((dtd->notations != NULL) && ((dtd->doc == NULL) || (dtd->doc->intSubset == dtd))) { - xmlDumpNotationTable(buf->buffer, (xmlNotationTablePtr) dtd->notations); + xmlBufDumpNotationTable(buf->buffer, + (xmlNotationTablePtr) dtd->notations); } format = ctxt->format; level = ctxt->level; @@ -724,7 +819,7 @@ (cur->type == XML_COMMENT_NODE) || (cur->type == XML_PI_NODE))) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); xmlNodeDumpOutputInternal(ctxt, cur); @@ -841,15 +936,15 @@ return; } if (cur->type == XML_ELEMENT_DECL) { - xmlDumpElementDecl(buf->buffer, (xmlElementPtr) cur); + xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur); return; } if (cur->type == XML_ATTRIBUTE_DECL) { - xmlDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur); + xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur); return; } if (cur->type == XML_ENTITY_DECL) { - xmlDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur); + xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur); return; } if (cur->type == XML_TEXT_NODE) { @@ -980,7 +1075,7 @@ if (ctxt->level > 0) ctxt->level--; if ((xmlIndentTreeOutput) && (ctxt->format == 1)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); } @@ -1096,13 +1191,13 @@ */ if ((ctxt->options & XML_SAVE_NO_DECL) == 0) { xmlOutputBufferWrite(buf, 14, "version != NULL) - xmlBufferWriteQuotedString(buf->buffer, cur->version); + if (cur->version != NULL) + xmlBufWriteQuotedString(buf->buffer, cur->version); else xmlOutputBufferWrite(buf, 5, "\"1.0\""); if (encoding != NULL) { xmlOutputBufferWrite(buf, 10, " encoding="); - xmlBufferWriteQuotedString(buf->buffer, (xmlChar *) encoding); + xmlBufWriteQuotedString(buf->buffer, (xmlChar *) encoding); } switch (cur->standalone) { case 0: @@ -1260,7 +1355,7 @@ if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) && (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml"))) xml_lang = cur; - else if ((cur->ns == NULL) && + else if ((cur->ns == NULL) && ((cur->children == NULL) || (cur->children->content == NULL) || (cur->children->content[0] == 0)) && @@ -1300,7 +1395,7 @@ xmlOutputBufferWrite(buf, 11, " xml:lang=\""); xmlAttrSerializeContent(buf, lang); xmlOutputBufferWrite(buf, 1, "\""); - } else + } else if ((xml_lang != NULL) && (lang == NULL)) { xmlOutputBufferWrite(buf, 7, " lang=\""); xmlAttrSerializeContent(buf, xml_lang); @@ -1331,7 +1426,7 @@ if ((ctxt->format == 1) && (xmlIndentTreeOutput) && (cur->type == XML_ELEMENT_NODE)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); xhtmlNodeDumpOutput(ctxt, cur); @@ -1370,6 +1465,10 @@ return; if (cur->type == XML_XINCLUDE_END) return; + if (cur->type == XML_NAMESPACE_DECL) { + xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur); + return; + } if (cur->type == XML_DTD_NODE) { xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur); return; @@ -1380,15 +1479,15 @@ } buf = ctxt->buf; if (cur->type == XML_ELEMENT_DECL) { - xmlDumpElementDecl(buf->buffer, (xmlElementPtr) cur); + xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur); return; } if (cur->type == XML_ATTRIBUTE_DECL) { - xmlDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur); + xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur); return; } if (cur->type == XML_ENTITY_DECL) { - xmlDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur); + xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur); return; } if (cur->type == XML_TEXT_NODE) { @@ -1468,7 +1567,7 @@ if (format == 1) { tmp = cur->children; while (tmp != NULL) { - if ((tmp->type == XML_TEXT_NODE) || + if ((tmp->type == XML_TEXT_NODE) || (tmp->type == XML_ENTITY_REF_NODE)) { format = 0; break; @@ -1496,10 +1595,10 @@ 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") && + 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; @@ -1536,7 +1635,7 @@ xmlOutputBufferWrite(buf, 1, "\n"); if (xmlIndentTreeOutput) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level + 1 > ctxt->indent_nr ? + (ctxt->level + 1 > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level + 1), ctxt->indent); } xmlOutputBufferWriteString(buf, @@ -1571,7 +1670,7 @@ xmlOutputBufferWrite(buf, 1, "\n"); if (xmlIndentTreeOutput) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level + 1 > ctxt->indent_nr ? + (ctxt->level + 1 > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level + 1), ctxt->indent); } xmlOutputBufferWriteString(buf, @@ -1661,7 +1760,7 @@ if (cur->children != NULL) { int indent = ctxt->format; - + if (format == 1) xmlOutputBufferWrite(buf, 1, "\n"); if (ctxt->level >= 0) ctxt->level++; ctxt->format = format; @@ -1670,7 +1769,7 @@ ctxt->format = indent; if ((xmlIndentTreeOutput) && (format == 1)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); } @@ -1936,18 +2035,19 @@ * Public entry points based on buffers * * * ************************************************************************/ + /** - * xmlAttrSerializeTxtContent: - * @buf: the XML buffer output + * xmlBufAttrSerializeTxtContent: + * @buf: and xmlBufPtr output * @doc: the document * @attr: the attribute node * @string: the text content * - * Serialize text attribute values to an xml simple buffer + * Serialize text attribute values to an xmlBufPtr */ void -xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, - xmlAttrPtr attr, const xmlChar * string) +xmlBufAttrSerializeTxtContent(xmlBufPtr buf, xmlDocPtr doc, + xmlAttrPtr attr, const xmlChar * string) { xmlChar *base, *cur; @@ -1957,44 +2057,44 @@ while (*cur != 0) { if (*cur == '\n') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST " ", 5); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST " ", 5); cur++; base = cur; } else if (*cur == '\r') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST " ", 5); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST " ", 5); cur++; base = cur; } else if (*cur == '\t') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST " ", 4); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST " ", 4); cur++; base = cur; } else if (*cur == '"') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST """, 6); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST """, 6); cur++; base = cur; } else if (*cur == '<') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST "<", 4); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST "<", 4); cur++; base = cur; } else if (*cur == '>') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST ">", 4); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST ">", 4); cur++; base = cur; } else if (*cur == '&') { if (base != cur) - xmlBufferAdd(buf, base, cur - base); - xmlBufferAdd(buf, BAD_CAST "&", 5); + xmlBufAdd(buf, base, cur - base); + xmlBufAdd(buf, BAD_CAST "&", 5); cur++; base = cur; } else if ((*cur >= 0x80) && ((doc == NULL) || @@ -2002,17 +2102,17 @@ /* * We assume we have UTF-8 content. */ - unsigned char tmp[10]; + unsigned char tmp[12]; int val = 0, l = 1; if (base != cur) - xmlBufferAdd(buf, base, cur - base); + xmlBufAdd(buf, base, cur - base); if (*cur < 0xC0) { xmlSaveErr(XML_SAVE_NOT_UTF8, (xmlNodePtr) attr, NULL); if (doc != NULL) doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); xmlSerializeHexCharRef(tmp, *cur); - xmlBufferAdd(buf, (xmlChar *) tmp, -1); + xmlBufAdd(buf, (xmlChar *) tmp, -1); cur++; base = cur; continue; @@ -2042,9 +2142,9 @@ xmlSaveErr(XML_SAVE_CHAR_INVALID, (xmlNodePtr) attr, NULL); if (doc != NULL) doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); - + xmlSerializeHexCharRef(tmp, *cur); - xmlBufferAdd(buf, (xmlChar *) tmp, -1); + xmlBufAdd(buf, (xmlChar *) tmp, -1); cur++; base = cur; continue; @@ -2054,7 +2154,7 @@ * as a char ref */ xmlSerializeHexCharRef(tmp, val); - xmlBufferAdd(buf, (xmlChar *) tmp, -1); + xmlBufAdd(buf, (xmlChar *) tmp, -1); cur += l; base = cur; } else { @@ -2062,10 +2162,34 @@ } } if (base != cur) - xmlBufferAdd(buf, base, cur - base); + xmlBufAdd(buf, base, cur - base); } /** + * xmlAttrSerializeTxtContent: + * @buf: the XML buffer output + * @doc: the document + * @attr: the attribute node + * @string: the text content + * + * Serialize text attribute values to an xml simple buffer + */ +void +xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, + xmlAttrPtr attr, const xmlChar * string) +{ + xmlBufPtr buffer; + + if ((buf == NULL) || (string == NULL)) + return; + buffer = xmlBufFromBuffer(buf); + if (buffer == NULL) + return; + xmlBufAttrSerializeTxtContent(buffer, doc, attr, string); + xmlBufBackToBuffer(buffer); +} + +/** * xmlNodeDump: * @buf: the XML buffer output * @doc: the document @@ -2076,6 +2200,8 @@ * 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 + * Since this is using xmlBuffer structures it is limited to 2GB and somehow + * deprecated, use xmlBufNodeDump() instead. * * Returns the number of bytes written to the buffer or -1 in case of error */ @@ -2083,8 +2209,43 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format) { - unsigned int use; + xmlBufPtr buffer; int ret; + + if ((buf == NULL) || (cur == NULL)) + return(-1); + buffer = xmlBufFromBuffer(buf); + if (buffer == NULL) + return(-1); + ret = xmlBufNodeDump(buffer, doc, cur, level, format); + xmlBufBackToBuffer(buffer); + if (ret > INT_MAX) + return(-1); + return((int) ret); +} + +/** + * xmlBufNodeDump: + * @buf: the XML buffer output + * @doc: the document + * @cur: the current node + * @level: the imbrication level for indenting + * @format: is formatting allowed + * + * 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 + * + * Returns the number of bytes written to the buffer, in case of error 0 + * is returned or @buf stores the error + */ + +size_t +xmlBufNodeDump(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, + int format) +{ + size_t use; + int ret; xmlOutputBufferPtr outbuf; xmlInitParser(); @@ -2116,10 +2277,10 @@ outbuf->context = NULL; outbuf->written = 0; - use = buf->use; + use = xmlBufUse(buf); xmlNodeDumpOutput(outbuf, doc, cur, level, format, NULL); xmlFree(outbuf); - ret = buf->use - use; + ret = xmlBufUse(buf) - use; return (ret); } @@ -2299,11 +2460,11 @@ xmlDocContentDumpOutput(&ctxt, out_doc); xmlOutputBufferFlush(out_buff); if (out_buff->conv != NULL) { - *doc_txt_len = out_buff->conv->use; - *doc_txt_ptr = xmlStrndup(out_buff->conv->content, *doc_txt_len); + *doc_txt_len = xmlBufUse(out_buff->conv); + *doc_txt_ptr = xmlStrndup(xmlBufContent(out_buff->conv), *doc_txt_len); } else { - *doc_txt_len = out_buff->buffer->use; - *doc_txt_ptr = xmlStrndup(out_buff->buffer->content, *doc_txt_len); + *doc_txt_len = xmlBufUse(out_buff->buffer); + *doc_txt_ptr = xmlStrndup(xmlBufContent(out_buff->buffer),*doc_txt_len); } (void)xmlOutputBufferClose(out_buff); @@ -2547,7 +2708,7 @@ #ifdef HAVE_ZLIB_H if (cur->compression < 0) cur->compression = xmlGetCompressMode(); #endif - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); Index: lib/3rdparty/libxml2/xmlschemas.c =================================================================== --- lib/3rdparty/libxml2/xmlschemas.c (revision 58293) +++ lib/3rdparty/libxml2/xmlschemas.c (working copy) @@ -107,7 +107,7 @@ #endif #define UNBOUNDED (1 << 30) -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -975,6 +975,7 @@ xmlSAXHandlerPtr sax; xmlParserCtxtPtr parserCtxt; void *user_data; /* TODO: What is this for? */ + char *filename; int err; int nberrors; @@ -1028,6 +1029,10 @@ int hasKeyrefs; int createIDCNodeTables; int psviExposeIDCNodeTables; + + /* Locator for error reporting in streaming mode */ + xmlSchemaValidityLocatorFunc locFunc; + void *locCtxt; }; /** @@ -1043,9 +1048,9 @@ }; /************************************************************************ - * * - * Some predeclarations * - * * + * * + * Some predeclarations * + * * ************************************************************************/ static int xmlSchemaParseInclude(xmlSchemaParserCtxtPtr ctxt, @@ -1098,7 +1103,7 @@ /************************************************************************ * * - * Helper functions * + * Helper functions * * * ************************************************************************/ @@ -1836,7 +1841,7 @@ /************************************************************************ * * - * Error functions * + * Error functions * * * ************************************************************************/ @@ -1974,7 +1979,7 @@ /************************************************************************ * * - * Allround error functions * + * Allround error functions * * * ************************************************************************/ @@ -2078,6 +2083,20 @@ (vctxt->parserCtxt->input != NULL)) file = vctxt->parserCtxt->input->filename; } + if (vctxt->locFunc != NULL) { + if ((file == NULL) || (line == 0)) { + unsigned long l; + const char *f; + vctxt->locFunc(vctxt->locCtxt, &f, &l); + if (file == NULL) + file = f; + if (line == 0) + line = (int) l; + } + } + if ((file == NULL) && (vctxt->filename != NULL)) + file = vctxt->filename; + __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASV, error, errorLevel, file, line, @@ -3199,25 +3218,25 @@ } /************************************************************************ - * * - * Streamable error functions * - * * + * * + * Streamable error functions * + * * ************************************************************************/ /************************************************************************ - * * - * Validation helper functions * - * * + * * + * Validation helper functions * + * * ************************************************************************/ /************************************************************************ - * * - * Allocation functions * - * * + * * + * Allocation functions * + * * ************************************************************************/ /** @@ -4135,9 +4154,9 @@ } /************************************************************************ - * * - * Debug functions * - * * + * * + * Debug functions * + * * ************************************************************************/ #ifdef LIBXML_OUTPUT_ENABLED @@ -4587,7 +4606,7 @@ /************************************************************************ * * - * Utilities * + * Utilities * * * ************************************************************************/ @@ -4692,9 +4711,9 @@ } /************************************************************************ - * * - * Parsing functions * - * * + * * + * Parsing functions * + * * ************************************************************************/ #define WXS_FIND_GLOBAL_ITEM(slot) \ @@ -4966,9 +4985,9 @@ } /************************************************************************ - * * - * Parsing functions * - * * + * * + * Parsing functions * + * * ************************************************************************/ #define IS_BLANK_NODE(n) \ @@ -5743,9 +5762,9 @@ } /************************************************************************ - * * + * * * Utilities for parsing * - * * + * * ************************************************************************/ /** @@ -5939,7 +5958,7 @@ xmlFree((xmlChar *) value); value = strip; } - res = xmlAddID(NULL, attr->doc, value, attr); + res = xmlAddID(NULL, attr->doc, value, attr); if (res == NULL) { ret = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE; xmlSchemaPSimpleTypeErr(ctxt, @@ -6191,9 +6210,9 @@ } /************************************************************************ - * * + * * * Shema extraction from an Infoset * - * * + * * ************************************************************************/ static xmlSchemaTypePtr xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, @@ -8227,7 +8246,7 @@ */ attr = xmlSchemaGetPropNode(node, "xpath"); if (attr == NULL) { - xmlSchemaPMissingAttrErr(ctxt, + xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, NULL, node, "name", NULL); @@ -12353,15 +12372,15 @@ } /************************************************************************ - * * - * Validating using Schemas * - * * + * * + * Validating using Schemas * + * * ************************************************************************/ /************************************************************************ - * * - * Reading/Writing Schemas * - * * + * * + * Reading/Writing Schemas * + * * ************************************************************************/ #if 0 /* Will be enabled if it is clear what options are needed. */ @@ -12938,6 +12957,15 @@ if (tmp2 != 1) ret = 0; sub = sub->next; } + + /* + * epsilon needed to block previous trans from + * being allowed to enter back from another + * construct + */ + pctxt->state = xmlAutomataNewEpsilon(pctxt->am, + pctxt->state, NULL); + if (particle->minOccurs == 0) { xmlAutomataNewEpsilon(pctxt->am, oldstate, pctxt->state); @@ -13946,7 +13974,7 @@ */ if ((sub->negNsSet != NULL) && (super->negNsSet != NULL) && - (sub->negNsSet->value == sub->negNsSet->value)) + (sub->negNsSet->value == super->negNsSet->value)) return (0); /* * 3.1 sub must be a set whose members are either namespace names or �absent�. @@ -15156,9 +15184,10 @@ FREE_AND_NULL(str) return (XML_SCHEMAP_ST_PROPS_CORRECT_1); } - if ( (WXS_IS_LIST(type) || WXS_IS_UNION(type)) && - (WXS_IS_RESTRICTION(type) == 0) && - (! WXS_IS_ANY_SIMPLE_TYPE(baseType))) { + if ((WXS_IS_LIST(type) || WXS_IS_UNION(type)) && + (WXS_IS_RESTRICTION(type) == 0) && + ((! WXS_IS_ANY_SIMPLE_TYPE(baseType)) && + (baseType->type != XML_SCHEMA_TYPE_SIMPLE))) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, WXS_BASIC_CAST type, NULL, @@ -18475,8 +18504,8 @@ particle->children->children = (xmlSchemaTreeItemPtr) xmlSchemaAddParticle(pctxt, type->node, - ((xmlSchemaParticlePtr) type->subtypes)->minOccurs, - ((xmlSchemaParticlePtr) type->subtypes)->maxOccurs); + ((xmlSchemaParticlePtr) baseType->subtypes)->minOccurs, + ((xmlSchemaParticlePtr) baseType->subtypes)->maxOccurs); if (particle->children->children == NULL) goto exit_failure; particle = (xmlSchemaParticlePtr) @@ -20152,7 +20181,7 @@ ref->name, ref->targetNamespace); if (ause->attrDecl == NULL) { xmlSchemaPResCompAttrErr(ctxt, - XML_SCHEMAP_SRC_RESOLVE, + XML_SCHEMAP_SRC_RESOLVE, WXS_BASIC_CAST ause, ause->node, "ref", ref->name, ref->targetNamespace, XML_SCHEMA_TYPE_ATTRIBUTE, NULL); @@ -21532,16 +21561,16 @@ } /************************************************************************ - * * - * Simple type validation * - * * + * * + * Simple type validation * + * * ************************************************************************/ /************************************************************************ - * * - * DOM Validation code * - * * + * * + * DOM Validation code * + * * ************************************************************************/ /** @@ -21935,9 +21964,9 @@ } /************************************************************************ - * * + * * * Validation of identity-constraints (IDC) * - * * + * * ************************************************************************/ /** @@ -23865,9 +23894,9 @@ } /************************************************************************ - * * - * XML Reader validation code * - * * + * * + * XML Reader validation code * + * * ************************************************************************/ static xmlSchemaAttrInfoPtr @@ -24987,9 +25016,9 @@ return (vctxt->err); } if (actualType == NULL) { - VERROR(XML_SCHEMAV_CVC_TYPE_1, NULL, - "The type definition is absent"); - return (XML_SCHEMAV_CVC_TYPE_1); + VERROR(XML_SCHEMAV_CVC_TYPE_1, NULL, + "The type definition is absent"); + return (XML_SCHEMAV_CVC_TYPE_1); } if (vctxt->nbAttrInfos != 0) { int ret; @@ -25079,9 +25108,9 @@ * No actual type definition. */ if (actualType == NULL) { - VERROR(XML_SCHEMAV_CVC_TYPE_1, NULL, - "The type definition is absent"); - return (XML_SCHEMAV_CVC_TYPE_1); + VERROR(XML_SCHEMAV_CVC_TYPE_1, NULL, + "The type definition is absent"); + return (XML_SCHEMAV_CVC_TYPE_1); } /* * Remember the actual type definition. @@ -26909,15 +26938,15 @@ if (vctxt->inode->typeDef == NULL) { vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE; ret = XML_SCHEMAV_CVC_TYPE_1; - VERROR(ret, NULL, - "The type definition is absent"); + VERROR(ret, NULL, + "The type definition is absent"); goto exit; } if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) { vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE; ret = XML_SCHEMAV_CVC_TYPE_2; - VERROR(ret, NULL, - "The type definition is abstract"); + VERROR(ret, NULL, + "The type definition is abstract"); goto exit; } /* @@ -27164,9 +27193,9 @@ #endif /************************************************************************ - * * - * SAX validation handlers * - * * + * * + * SAX validation handlers * + * * ************************************************************************/ /* @@ -27417,9 +27446,9 @@ } /************************************************************************ - * * - * Validation interfaces * - * * + * * + * Validation interfaces * + * * ************************************************************************/ /** @@ -27449,8 +27478,28 @@ } /** + * xmlSchemaValidateSetFilename: + * @vctxt: the schema validation context + * @filename: the file name + * + * Workaround to provide file error reporting information when this is + * not provided by current APIs + */ +void +xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt, const char *filename) { + if (vctxt == NULL) + return; + if (vctxt->filename != NULL) + xmlFree(vctxt->filename); + if (filename != NULL) + vctxt->filename = (char *) xmlStrdup((const xmlChar *) filename); + else + vctxt->filename = NULL; +} + +/** * xmlSchemaClearValidCtxt: - * @ctxt: the schema validation context + * @vctxt: the schema validation context * * Free the resources associated to the schema validation context; * leaves some fields alive intended for reuse of the context. @@ -27551,6 +27600,11 @@ * where the user provides the dict? */ vctxt->dict = xmlDictCreate(); + + if (vctxt->filename != NULL) { + xmlFree(vctxt->filename); + vctxt->filename = NULL; + } } /** @@ -27636,6 +27690,8 @@ xmlSchemaItemListFree(ctxt->nodeQNames); if (ctxt->dict != NULL) xmlDictFree(ctxt->dict); + if (ctxt->filename != NULL) + xmlFree(ctxt->filename); xmlFree(ctxt); } @@ -28111,9 +28167,9 @@ /************************************************************************ - * * - * Function and data for SAX streaming API * - * * + * * + * Function and data for SAX streaming API * + * * ************************************************************************/ typedef struct _xmlSchemaSplitSAXData xmlSchemaSplitSAXData; typedef xmlSchemaSplitSAXData *xmlSchemaSplitSAXDataPtr; @@ -28630,6 +28686,63 @@ } /** + * xmlSchemaValidateSetLocator: + * @vctxt: a schema validation context + * @f: the locator function pointer + * @ctxt: the locator context + * + * Allows to set a locator function to the validation context, + * which will be used to provide file and line information since + * those are not provided as part of the SAX validation flow + * Setting @f to NULL disable the locator. + */ + +void +xmlSchemaValidateSetLocator(xmlSchemaValidCtxtPtr vctxt, + xmlSchemaValidityLocatorFunc f, + void *ctxt) +{ + if (vctxt == NULL) return; + vctxt->locFunc = f; + vctxt->locCtxt = ctxt; +} + +/** + * xmlSchemaValidateStreamLocator: + * @ctx: the xmlTextReaderPtr used + * @file: returned file information + * @line: returned line information + * + * Internal locator function for the readers + * + * Returns 0 in case the Schema validation could be (des)activated and + * -1 in case of error. + */ +static int +xmlSchemaValidateStreamLocator(void *ctx, const char **file, + unsigned long *line) { + xmlParserCtxtPtr ctxt; + + if ((ctx == NULL) || ((file == NULL) && (line == NULL))) + return(-1); + + if (file != NULL) + *file = NULL; + if (line != NULL) + *line = 0; + + ctxt = (xmlParserCtxtPtr) ctx; + if (ctxt->input != NULL) { + if (file != NULL) + *file = ctxt->input->filename; + if (line != NULL) + *line = ctxt->input->line; + return(0); + } + return(-1); +} + +/** * xmlSchemaValidateStream: * @ctxt: a schema validation context * @input: the input to use for reading the data @@ -28672,6 +28785,7 @@ xmlCtxtUseOptions(pctxt, options); #endif pctxt->linenumbers = 1; + xmlSchemaValidateSetLocator(ctxt, xmlSchemaValidateStreamLocator, pctxt); inputStream = xmlNewIOInputStream(pctxt, input, enc);; if (inputStream == NULL) { Index: lib/3rdparty/libxml2/xmlschemastypes.c =================================================================== --- lib/3rdparty/libxml2/xmlschemastypes.c (revision 58293) +++ lib/3rdparty/libxml2/xmlschemastypes.c (working copy) @@ -40,7 +40,7 @@ extern double xmlXPathNINF; #endif -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -75,7 +75,7 @@ typedef xmlSchemaValDuration *xmlSchemaValDurationPtr; struct _xmlSchemaValDuration { long mon; /* mon stores years also */ - long day; + long day; double sec; /* sec stores min and hour also */ }; @@ -189,7 +189,7 @@ /************************************************************************ * * - * Datatype error handlers * + * Datatype error handlers * * * ************************************************************************/ /** @@ -206,7 +206,7 @@ /************************************************************************ * * - * Base types support * + * Base types support * * * ************************************************************************/ @@ -254,7 +254,7 @@ * Initialize one primitive built-in type */ static xmlSchemaTypePtr -xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, +xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, xmlSchemaTypePtr baseType) { xmlSchemaTypePtr ret; @@ -267,31 +267,31 @@ ret->name = (const xmlChar *)name; ret->targetNamespace = XML_SCHEMAS_NAMESPACE_NAME; ret->type = XML_SCHEMA_TYPE_BASIC; - ret->baseType = baseType; + ret->baseType = baseType; ret->contentType = XML_SCHEMA_CONTENT_BASIC; /* * Primitive types. */ - switch (type) { - case XML_SCHEMAS_STRING: - case XML_SCHEMAS_DECIMAL: - case XML_SCHEMAS_DATE: - case XML_SCHEMAS_DATETIME: - case XML_SCHEMAS_TIME: - case XML_SCHEMAS_GYEAR: - case XML_SCHEMAS_GYEARMONTH: - case XML_SCHEMAS_GMONTH: - case XML_SCHEMAS_GMONTHDAY: - case XML_SCHEMAS_GDAY: - case XML_SCHEMAS_DURATION: - case XML_SCHEMAS_FLOAT: - case XML_SCHEMAS_DOUBLE: - case XML_SCHEMAS_BOOLEAN: - case XML_SCHEMAS_ANYURI: - case XML_SCHEMAS_HEXBINARY: - case XML_SCHEMAS_BASE64BINARY: - case XML_SCHEMAS_QNAME: - case XML_SCHEMAS_NOTATION: + switch (type) { + case XML_SCHEMAS_STRING: + case XML_SCHEMAS_DECIMAL: + case XML_SCHEMAS_DATE: + case XML_SCHEMAS_DATETIME: + case XML_SCHEMAS_TIME: + case XML_SCHEMAS_GYEAR: + case XML_SCHEMAS_GYEARMONTH: + case XML_SCHEMAS_GMONTH: + case XML_SCHEMAS_GMONTHDAY: + case XML_SCHEMAS_GDAY: + case XML_SCHEMAS_DURATION: + case XML_SCHEMAS_FLOAT: + case XML_SCHEMAS_DOUBLE: + case XML_SCHEMAS_BOOLEAN: + case XML_SCHEMAS_ANYURI: + case XML_SCHEMAS_HEXBINARY: + case XML_SCHEMAS_BASE64BINARY: + case XML_SCHEMAS_QNAME: + case XML_SCHEMAS_NOTATION: ret->flags |= XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE; break; default: @@ -309,7 +309,7 @@ case XML_SCHEMAS_ENTITIES: ret->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST; ret->facets = xmlSchemaNewMinLengthFacet(1); - ret->flags |= XML_SCHEMAS_TYPE_HAS_FACETS; + ret->flags |= XML_SCHEMAS_TYPE_HAS_FACETS; break; default: ret->flags |= XML_SCHEMAS_TYPE_VARIETY_ATOMIC; @@ -390,19 +390,19 @@ return; xmlSchemaTypesBank = xmlHashCreate(40); - + /* * 3.4.7 Built-in Complex Type Definition */ xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType", - XML_SCHEMAS_ANYTYPE, + XML_SCHEMAS_ANYTYPE, NULL); xmlSchemaTypeAnyTypeDef->baseType = xmlSchemaTypeAnyTypeDef; xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED; /* * Init the content type. */ - xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED; + xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED; { xmlSchemaParticlePtr particle; xmlSchemaModelGroupPtr sequence; @@ -420,7 +420,7 @@ return; } memset(sequence, 0, sizeof(xmlSchemaModelGroup)); - sequence->type = XML_SCHEMA_TYPE_SEQUENCE; + sequence->type = XML_SCHEMA_TYPE_SEQUENCE; particle->children = (xmlSchemaTreeItemPtr) sequence; /* Second particle. */ particle = xmlSchemaAddParticle(); @@ -437,9 +437,9 @@ } memset(wild, 0, sizeof(xmlSchemaWildcard)); wild->type = XML_SCHEMA_TYPE_ANY; - wild->any = 1; - wild->processContents = XML_SCHEMAS_ANY_LAX; - particle->children = (xmlSchemaTreeItemPtr) wild; + wild->any = 1; + wild->processContents = XML_SCHEMAS_ANY_LAX; + particle->children = (xmlSchemaTreeItemPtr) wild; /* * Create the attribute wildcard. */ @@ -451,10 +451,10 @@ } memset(wild, 0, sizeof(xmlSchemaWildcard)); wild->any = 1; - wild->processContents = XML_SCHEMAS_ANY_LAX; + wild->processContents = XML_SCHEMAS_ANY_LAX; xmlSchemaTypeAnyTypeDef->attributeWildcard = wild; } - xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType", + xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType", XML_SCHEMAS_ANYSIMPLETYPE, xmlSchemaTypeAnyTypeDef); /* @@ -513,7 +513,7 @@ xmlSchemaTypeAnySimpleTypeDef); xmlSchemaTypeNotationDef = xmlSchemaInitBasicType("NOTATION", XML_SCHEMAS_NOTATION, - xmlSchemaTypeAnySimpleTypeDef); + xmlSchemaTypeAnySimpleTypeDef); xmlSchemaTypeQNameDef = xmlSchemaInitBasicType("QName", XML_SCHEMAS_QNAME, xmlSchemaTypeAnySimpleTypeDef); @@ -583,7 +583,7 @@ xmlSchemaTypeNCNameDef); xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF", XML_SCHEMAS_IDREF, - xmlSchemaTypeNCNameDef); + xmlSchemaTypeNCNameDef); xmlSchemaTypeEntityDef = xmlSchemaInitBasicType("ENTITY", XML_SCHEMAS_ENTITY, xmlSchemaTypeNCNameDef); @@ -615,7 +615,7 @@ * * Cleanup the default XML Schemas type library */ -void +void xmlSchemaCleanupTypes(void) { if (xmlSchemaTypesInitialized == 0) return; @@ -629,13 +629,13 @@ /* Content type. */ particle = (xmlSchemaParticlePtr) xmlSchemaTypeAnyTypeDef->subtypes; /* Wildcard. */ - xmlSchemaFreeWildcard((xmlSchemaWildcardPtr) + xmlSchemaFreeWildcard((xmlSchemaWildcardPtr) particle->children->children->children); xmlFree((xmlSchemaParticlePtr) particle->children->children); /* Sequence model group. */ xmlFree((xmlSchemaModelGroupPtr) particle->children); xmlFree((xmlSchemaParticlePtr) particle); - xmlSchemaTypeAnyTypeDef->subtypes = NULL; + xmlSchemaTypeAnyTypeDef->subtypes = NULL; } xmlHashFree(xmlSchemaTypesBank, (xmlHashDeallocator) xmlSchemaFreeType); xmlSchemaTypesInitialized = 0; @@ -665,12 +665,12 @@ (facetType == XML_SCHEMA_FACET_WHITESPACE)) return (1); else - return (0); + return (0); case XML_SCHEMAS_STRING: case XML_SCHEMAS_NOTATION: case XML_SCHEMAS_QNAME: - case XML_SCHEMAS_ANYURI: - case XML_SCHEMAS_BASE64BINARY: + case XML_SCHEMAS_ANYURI: + case XML_SCHEMAS_BASE64BINARY: case XML_SCHEMAS_HEXBINARY: if ((facetType == XML_SCHEMA_FACET_LENGTH) || (facetType == XML_SCHEMA_FACET_MINLENGTH) || @@ -693,12 +693,12 @@ (facetType == XML_SCHEMA_FACET_MINEXCLUSIVE)) return (1); else - return (0); + return (0); case XML_SCHEMAS_TIME: - case XML_SCHEMAS_GDAY: + case XML_SCHEMAS_GDAY: case XML_SCHEMAS_GMONTH: - case XML_SCHEMAS_GMONTHDAY: - case XML_SCHEMAS_GYEAR: + case XML_SCHEMAS_GMONTHDAY: + case XML_SCHEMAS_GYEAR: case XML_SCHEMAS_GYEARMONTH: case XML_SCHEMAS_DATE: case XML_SCHEMAS_DATETIME: @@ -714,7 +714,7 @@ (facetType == XML_SCHEMA_FACET_MINEXCLUSIVE)) return (1); else - return (0); + return (0); default: break; } @@ -736,7 +736,7 @@ if (xmlSchemaTypesInitialized == 0) xmlSchemaInitTypes(); switch (type) { - + case XML_SCHEMAS_ANYSIMPLETYPE: return (xmlSchemaTypeAnySimpleTypeDef); case XML_SCHEMAS_STRING: @@ -752,7 +752,7 @@ case XML_SCHEMAS_GMONTH: return (xmlSchemaTypeGMonthDef); case XML_SCHEMAS_GMONTHDAY: - return (xmlSchemaTypeGMonthDayDef); + return (xmlSchemaTypeGMonthDayDef); case XML_SCHEMAS_GYEAR: return (xmlSchemaTypeGYearDef); case XML_SCHEMAS_GYEARMONTH: @@ -828,7 +828,7 @@ case XML_SCHEMAS_BASE64BINARY: return (xmlSchemaTypeBase64BinaryDef); case XML_SCHEMAS_ANYTYPE: - return (xmlSchemaTypeAnyTypeDef); + return (xmlSchemaTypeAnyTypeDef); default: return (NULL); } @@ -880,7 +880,7 @@ */ const xmlChar * xmlSchemaValueGetAsString(xmlSchemaValPtr val) -{ +{ if (val == NULL) return (NULL); switch (val->type) { @@ -913,7 +913,7 @@ */ int xmlSchemaValueGetAsBoolean(xmlSchemaValPtr val) -{ +{ if ((val == NULL) || (val->type != XML_SCHEMAS_BOOLEAN)) return (0); return (val->value.b); @@ -924,8 +924,8 @@ * @type: the value type * @value: the value * - * Allocate a new simple type value. The type can be - * of XML_SCHEMAS_STRING. + * Allocate a new simple type value. The type can be + * of XML_SCHEMAS_STRING. * WARNING: This one is intended to be expanded for other * string based types. We need this for anySimpleType as well. * The given value is consumed and freed with the struct. @@ -1007,11 +1007,11 @@ * * Cleanup the default XML Schemas type library */ -void +void xmlSchemaFreeValue(xmlSchemaValPtr value) { xmlSchemaValPtr prev; - while (value != NULL) { + while (value != NULL) { switch (value->type) { case XML_SCHEMAS_STRING: case XML_SCHEMAS_NORMSTRING: @@ -1025,7 +1025,7 @@ case XML_SCHEMAS_IDREF: case XML_SCHEMAS_IDREFS: case XML_SCHEMAS_ENTITY: - case XML_SCHEMAS_ENTITIES: + case XML_SCHEMAS_ENTITIES: case XML_SCHEMAS_ANYURI: case XML_SCHEMAS_ANYSIMPLETYPE: if (value->value.str != NULL) @@ -1052,7 +1052,7 @@ prev = value; value = value->next; xmlFree(prev); - } + } } /** @@ -1088,9 +1088,9 @@ if ((type == NULL) || (type->type != XML_SCHEMA_TYPE_BASIC)) return (NULL); switch (type->builtInType) { - case XML_SCHEMAS_NMTOKENS: + case XML_SCHEMAS_NMTOKENS: return (xmlSchemaTypeNmtokenDef ); - case XML_SCHEMAS_IDREFS: + case XML_SCHEMAS_IDREFS: return (xmlSchemaTypeIdrefDef); case XML_SCHEMAS_ENTITIES: return (xmlSchemaTypeEntityDef); @@ -1342,13 +1342,13 @@ */ static int _xmlSchemaParseTime (xmlSchemaValDatePtr dt, const xmlChar **str) { - const xmlChar *cur = *str; + const xmlChar *cur = *str; int ret = 0; int value = 0; PARSE_2_DIGITS(value, cur, ret); if (ret != 0) - return ret; + return ret; if (*cur != ':') return 1; if (!VALID_HOUR(value)) @@ -1614,7 +1614,7 @@ const xmlChar *rewnd = cur; cur++; - ret = _xmlSchemaParseGDay(&(dt->value.date), &cur); + ret = _xmlSchemaParseGDay(&(dt->value.date), &cur); if ((ret == 0) && ((*cur == 0) || (*cur != ':'))) { /* @@ -1852,7 +1852,7 @@ } cur++; if (collapse) - while IS_WSP_BLANK_CH(*cur) cur++; + while IS_WSP_BLANK_CH(*cur) cur++; } if (isneg) { @@ -1908,13 +1908,13 @@ */ xmlChar * xmlSchemaWhiteSpaceReplace(const xmlChar *value) { - const xmlChar *cur = value; - xmlChar *ret = NULL, *mcur; + const xmlChar *cur = value; + xmlChar *ret = NULL, *mcur; - if (value == NULL) + if (value == NULL) return(NULL); - - while ((*cur != 0) && + + while ((*cur != 0) && (((*cur) != 0xd) && ((*cur) != 0x9) && ((*cur) != 0xa))) { cur++; } @@ -1927,7 +1927,7 @@ if ( ((*mcur) == 0xd) || ((*mcur) == 0x9) || ((*mcur) == 0xa) ) *mcur = ' '; mcur++; - } while (*mcur != 0); + } while (*mcur != 0); return(ret); } @@ -2072,7 +2072,7 @@ const xmlChar *tmp, *cur = *str; int ret = 0, i = 0; - if (!((*cur >= '0') && (*cur <= '9'))) + if (!((*cur >= '0') && (*cur <= '9'))) return(-2); while (*cur == '0') { /* ignore leading zeroes */ @@ -2148,7 +2148,7 @@ if ((flags == 0) && (value != NULL)) { if ((type->builtInType != XML_SCHEMAS_STRING) && - (type->builtInType != XML_SCHEMAS_ANYTYPE) && + (type->builtInType != XML_SCHEMAS_ANYTYPE) && (type->builtInType != XML_SCHEMAS_ANYSIMPLETYPE)) { if (type->builtInType == XML_SCHEMAS_NORMSTRING) norm = xmlSchemaWhiteSpaceReplace(value); @@ -2160,7 +2160,7 @@ } switch (type->builtInType) { - case XML_SCHEMAS_UNKNOWN: + case XML_SCHEMAS_UNKNOWN: goto error; case XML_SCHEMAS_ANYTYPE: case XML_SCHEMAS_ANYSIMPLETYPE: @@ -2171,10 +2171,10 @@ *val = v; } else { goto error; - } + } } goto return0; - case XML_SCHEMAS_STRING: + case XML_SCHEMAS_STRING: if (! normOnTheFly) { const xmlChar *cur = value; @@ -2253,7 +2253,7 @@ const xmlChar *cur = value; unsigned int len, neg, integ, hasLeadingZeroes; xmlChar cval[25]; - xmlChar *cptr = cval; + xmlChar *cptr = cval; if ((cur == NULL) || (*cur == 0)) goto return1; @@ -2327,10 +2327,10 @@ v = xmlSchemaNewValue(XML_SCHEMAS_DECIMAL); if (v != NULL) { /* - * Now evaluate the significant digits of the number - */ + * Now evaluate the significant digits of the number + */ if (len != 0) { - + if (integ != ~0u) { /* * Get rid of trailing zeroes in the @@ -2604,8 +2604,8 @@ } else { cur++; } - } - } + } + } if (val != NULL) { v = xmlSchemaNewValue(XML_SCHEMAS_TOKEN); if (v != NULL) { @@ -2618,7 +2618,7 @@ goto return0; } case XML_SCHEMAS_LANGUAGE: - if (normOnTheFly) { + if (normOnTheFly) { norm = xmlSchemaCollapseString(value); if (norm != NULL) value = norm; @@ -2903,11 +2903,11 @@ } goto done; } - case XML_SCHEMAS_ANYURI:{ + case XML_SCHEMAS_ANYURI:{ if (*value != 0) { xmlURIPtr uri; xmlChar *tmpval, *cur; - if (normOnTheFly) { + if (normOnTheFly) { norm = xmlSchemaCollapseString(value); if (norm != NULL) value = norm; @@ -2996,12 +2996,12 @@ } case XML_SCHEMAS_BASE64BINARY:{ /* ISSUE: - * + * * Ignore all stray characters? (yes, currently) * Worry about long lines? (no, currently) - * + * * rfc2045.txt: - * + * * "The encoded output stream must be represented in lines of * no more than 76 characters each. All line breaks or other * characters not found in Table 1 must be ignored by decoding @@ -3412,7 +3412,7 @@ /* * First test: If x is -ve and not zero */ - if ((x->value.decimal.sign) && + if ((x->value.decimal.sign) && ((x->value.decimal.lo != 0) || (x->value.decimal.mi != 0) || (x->value.decimal.hi != 0))) { @@ -3569,8 +3569,8 @@ /* seconds */ sec = x->value.dur.sec - y->value.dur.sec; - carry = (long)sec / SECS_PER_DAY; - sec -= (double)(carry * SECS_PER_DAY); + carry = (long)(sec / SECS_PER_DAY); + sec -= ((double)carry) * SECS_PER_DAY; /* days */ day = x->value.dur.day - y->value.dur.day + carry; @@ -3653,7 +3653,7 @@ xmlSchemaValPtr ret = xmlSchemaNewValue(v->type); if (ret == NULL) return NULL; - + memcpy(ret, v, sizeof(xmlSchemaVal)); ret->next = NULL; return ret; @@ -3699,7 +3699,7 @@ if (val->value.str != NULL) cur->value.str = xmlStrdup(BAD_CAST val->value.str); break; - case XML_SCHEMAS_QNAME: + case XML_SCHEMAS_QNAME: case XML_SCHEMAS_NOTATION: cur = xmlSchemaDupVal(val); if (val->value.qname.name != NULL) @@ -3841,7 +3841,7 @@ if (tyr == 0) tyr--; /* - * Coverity detected an overrun in daysInMonth + * Coverity detected an overrun in daysInMonth * of size 12 at position 12 with index variable "((r)->mon - 1)" */ if (tmon < 0) @@ -3866,7 +3866,7 @@ r->year++; } } - + r->day = tempdays; /* @@ -3931,7 +3931,7 @@ * _xmlSchemaDateCastYMToDays: * @dt: an #xmlSchemaValPtr * - * Convert mon and year of @dt to total number of days. Take the + * Convert mon and year of @dt to total number of days. Take the * number of years since (or before) 1 AD and add the number of leap * years. This is a function because negative * years must be handled a little differently and there is no zero year. @@ -4111,7 +4111,7 @@ ret = -1; else if (sec > 0.0) ret = 1; - + } xmlSchemaFreeValue(p1); xmlSchemaFreeValue(q1); @@ -4252,7 +4252,7 @@ int invert) { int tmp; - + while ((*x != 0) && (*y != 0)) { if (IS_WSP_REPLACE_CH(*y)) { if (! IS_WSP_SPACE_CH(*x)) { @@ -4267,7 +4267,7 @@ else return(1); } - } + } } else { tmp = *x - *y; if (tmp < 0) { @@ -4321,7 +4321,7 @@ { int tmp; - /* + /* * Skip leading blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) @@ -4410,12 +4410,12 @@ { int tmp; - /* + /* * Skip leading blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) y++; - + while ((*x != 0) && (*y != 0)) { if IS_WSP_BLANK_CH(*y) { if (! IS_WSP_BLANK_CH(*x)) { @@ -4435,8 +4435,8 @@ } } x++; - y++; - /* + y++; + /* * Skip contiguous blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) @@ -4470,7 +4470,7 @@ return(-1); else return(1); - } + } if (*y != 0) { /* * Skip trailing blank chars of the collapsed string. @@ -4503,27 +4503,27 @@ const xmlChar *y) { int tmp; - + while ((*x != 0) && (*y != 0)) { if IS_WSP_BLANK_CH(*y) { if (! IS_WSP_BLANK_CH(*x)) { if ((*x - 0x20) < 0) - return(-1); + return(-1); else return(1); - } + } } else { if IS_WSP_BLANK_CH(*x) { if ((0x20 - *y) < 0) - return(-1); + return(-1); else return(1); } tmp = *x - *y; if (tmp < 0) - return(-1); + return(-1); if (tmp > 0) - return(1); + return(1); } x++; y++; @@ -4549,7 +4549,7 @@ xmlSchemaCompareNormStrings(const xmlChar *x, const xmlChar *y) { int tmp; - + while (IS_BLANK_CH(*x)) x++; while (IS_BLANK_CH(*y)) y++; while ((*x != 0) && (*y != 0)) { @@ -4742,13 +4742,13 @@ (ytype == XML_SCHEMAS_GYEARMONTH)) return (xmlSchemaCompareDates(x, y)); return (-2); - /* + /* * Note that we will support comparison of string types against * anySimpleType as well. */ case XML_SCHEMAS_ANYSIMPLETYPE: case XML_SCHEMAS_STRING: - case XML_SCHEMAS_NORMSTRING: + case XML_SCHEMAS_NORMSTRING: case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: @@ -4772,10 +4772,10 @@ /* * TODO: Compare those against QName. */ - if (ytype == XML_SCHEMAS_QNAME) { + if (ytype == XML_SCHEMAS_QNAME) { TODO if (y == NULL) - return(-2); + return(-2); return (-2); } if ((ytype == XML_SCHEMAS_ANYSIMPLETYPE) || @@ -4797,7 +4797,7 @@ /* TODO: What about x < y or x > y. */ if (xmlStrEqual(xv, yv)) return (0); - else + else return (2); } else if (yws == XML_SCHEMA_WHITESPACE_REPLACE) return (xmlSchemaComparePreserveReplaceStrings(xv, yv, 0)); @@ -4823,7 +4823,7 @@ return (xmlSchemaCompareNormStrings(xv, yv)); } else return (-2); - + } return (-2); } @@ -4894,7 +4894,7 @@ else return(-1); } - return (-2); + return (-2); case XML_SCHEMAS_IDREFS: case XML_SCHEMAS_ENTITIES: case XML_SCHEMAS_NMTOKENS: @@ -5082,7 +5082,7 @@ if (expectedLen != NULL) *expectedLen = facet->val->value.decimal.lo; return (XML_SCHEMAV_CVC_LENGTH_VALID); - } + } } else if (facet->type == XML_SCHEMA_FACET_MINLENGTH) { if (actualLen < facet->val->value.decimal.lo) { if (expectedLen != NULL) @@ -5096,12 +5096,12 @@ return (XML_SCHEMAV_CVC_MAXLENGTH_VALID); } } else - /* - * NOTE: That we can pass NULL as xmlSchemaValPtr to + /* + * NOTE: That we can pass NULL as xmlSchemaValPtr to * xmlSchemaValidateFacet, since the remaining facet types - * are: XML_SCHEMA_FACET_PATTERN, XML_SCHEMA_FACET_ENUMERATION. + * are: XML_SCHEMA_FACET_PATTERN, XML_SCHEMA_FACET_ENUMERATION. */ - return(xmlSchemaValidateFacet(NULL, facet, value, NULL)); + return(xmlSchemaValidateFacet(NULL, facet, value, NULL)); return (0); } @@ -5114,7 +5114,7 @@ * @ws: the whitespace type of the value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code @@ -5122,11 +5122,11 @@ */ static int xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, - xmlSchemaTypeType valType, + xmlSchemaValType valType, const xmlChar *value, - xmlSchemaValPtr val, + xmlSchemaValPtr val, unsigned long *length, - xmlSchemaWhitespaceValueType ws) + xmlSchemaWhitespaceValueType ws) { unsigned int len = 0; @@ -5137,7 +5137,7 @@ (facet->type != XML_SCHEMA_FACET_MAXLENGTH) && (facet->type != XML_SCHEMA_FACET_MINLENGTH)) return (-1); - + /* * TODO: length, maxLength and minLength must be of type * nonNegativeInteger only. Check if decimal is used somehow. @@ -5171,7 +5171,7 @@ if (ws == XML_SCHEMA_WHITESPACE_COLLAPSE) len = xmlSchemaNormLen(value); else - /* + /* * Should be OK for "preserve" as well. */ len = xmlUTF8Strlen(value); @@ -5183,7 +5183,7 @@ case XML_SCHEMAS_NMTOKEN: case XML_SCHEMAS_NAME: case XML_SCHEMAS_NCNAME: - case XML_SCHEMAS_ID: + case XML_SCHEMAS_ID: /* * FIXME: What exactly to do with anyURI? */ @@ -5192,11 +5192,11 @@ len = xmlSchemaNormLen(value); break; case XML_SCHEMAS_QNAME: - case XML_SCHEMAS_NOTATION: - /* + case XML_SCHEMAS_NOTATION: + /* * For QName and NOTATION, those facets are * deprecated and should be ignored. - */ + */ return (0); default: TODO @@ -5216,7 +5216,7 @@ if (len > facet->val->value.decimal.lo) return(XML_SCHEMAV_CVC_MAXLENGTH_VALID); } - + return (0); } @@ -5228,18 +5228,18 @@ * @val: the precomputed value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code * otherwise and -1 in case of an internal or API error. */ int -xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, +xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, xmlSchemaFacetPtr facet, const xmlChar *value, xmlSchemaValPtr val, - unsigned long *length) + unsigned long *length) { if (type == NULL) return(-1); @@ -5249,7 +5249,7 @@ } /** - * xmlSchemaValidateLengthFacetWhtsp: + * xmlSchemaValidateLengthFacetWhtsp: * @facet: the facet to check * @valType: the built-in type * @value: the lexical repr. of the value to be validated @@ -5257,7 +5257,7 @@ * @ws: the whitespace type of the value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code @@ -5292,7 +5292,7 @@ static int xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws) @@ -5304,7 +5304,7 @@ switch (facet->type) { case XML_SCHEMA_FACET_PATTERN: - /* + /* * NOTE that for patterns, the @value needs to be the normalized * value, *not* the lexical initial value or the canonical value. */ @@ -5405,7 +5405,7 @@ else { switch (valType) { case XML_SCHEMAS_STRING: - case XML_SCHEMAS_NORMSTRING: + case XML_SCHEMAS_NORMSTRING: if (ws == XML_SCHEMA_WHITESPACE_UNKNOWN) { /* * This is to ensure API compatibility with the old @@ -5421,13 +5421,13 @@ if (ws == XML_SCHEMA_WHITESPACE_COLLAPSE) len = xmlSchemaNormLen(value); else - /* + /* * Should be OK for "preserve" as well. */ len = xmlUTF8Strlen(value); } break; - case XML_SCHEMAS_IDREF: + case XML_SCHEMAS_IDREF: case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: @@ -5436,11 +5436,11 @@ case XML_SCHEMAS_ID: case XML_SCHEMAS_ANYURI: if (value != NULL) - len = xmlSchemaNormLen(value); - break; + len = xmlSchemaNormLen(value); + break; default: TODO - } + } } if (facet->type == XML_SCHEMA_FACET_LENGTH) { if (len != facet->val->value.decimal.lo) @@ -5550,7 +5550,7 @@ int xmlSchemaValidateFacetWhtsp(xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws) @@ -5611,13 +5611,13 @@ /* * Result is in work, and after_fraction points * just past the fractional part. - * Use scientific notation + * Use scientific notation */ integer_place = DBL_DIG + EXPONENT_DIGITS + 1; fraction_place = DBL_DIG - 1; snprintf(work, sizeof(work),"%*.*e", integer_place, fraction_place, number); - after_fraction = strchr(work + DBL_DIG, 'e'); + after_fraction = strchr(work + DBL_DIG, 'e'); /* Remove fractional trailing zeroes */ ptr = after_fraction; while (*(--ptr) == '0') @@ -5649,7 +5649,7 @@ * * WARNING: Some value types are not supported yet, resulting * in a @retValue of "???". - * + * * TODO: XML Schema 1.0 does not define canonical representations * for: duration, gYearMonth, gYear, gMonthDay, gMonth, gDay, * anyURI, QName, NOTATION. This will be fixed in XML Schema 1.1. @@ -5669,7 +5669,7 @@ if (val->value.str == NULL) *retValue = BAD_CAST xmlStrdup(BAD_CAST ""); else - *retValue = + *retValue = BAD_CAST xmlStrdup((const xmlChar *) val->value.str); break; case XML_SCHEMAS_NORMSTRING: @@ -5686,7 +5686,7 @@ case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: - case XML_SCHEMAS_NAME: + case XML_SCHEMAS_NAME: case XML_SCHEMAS_NCNAME: case XML_SCHEMAS_ID: case XML_SCHEMAS_IDREF: @@ -5695,10 +5695,10 @@ case XML_SCHEMAS_ANYURI: /* Unclear */ if (val->value.str == NULL) return (-1); - *retValue = + *retValue = BAD_CAST xmlSchemaCollapseString(BAD_CAST val->value.str); if (*retValue == NULL) - *retValue = + *retValue = BAD_CAST xmlStrdup((const xmlChar *) val->value.str); break; case XML_SCHEMAS_QNAME: @@ -5720,7 +5720,7 @@ /* * TODO: Lookout for a more simple implementation. */ - if ((val->value.decimal.total == 1) && + if ((val->value.decimal.total == 1) && (val->value.decimal.lo == 0)) { *retValue = xmlStrdup(BAD_CAST "0.0"); } else { @@ -5754,7 +5754,7 @@ else snprintf(offs, bufsize - (offs - buf), "%lu", dec.lo); - + if (dec.frac != 0) { if (dec.frac != dec.total) { int diff = dec.total - dec.frac; @@ -5767,7 +5767,7 @@ unsigned int i = 0; /* * Insert missing zeroes behind the decimal point. - */ + */ while (*(offs + i) != 0) i++; if (i < dec.total) { @@ -5904,7 +5904,7 @@ snprintf((char *) *retValue, 6, "---%02u", val->value.date.day); } - break; + break; case XML_SCHEMAS_GMONTHDAY: { /* TODO: Unclear in XML Schema 1.0 */ /* TODO: What to do with the timezone? */ @@ -5921,14 +5921,14 @@ /* TODO: What to do with the timezone? */ if (val->value.date.year < 0) snprintf(buf, 35, "-%04ld-%02u", - labs(val->value.date.year), + labs(val->value.date.year), val->value.date.mon); else snprintf(buf, 35, "%04ld-%02u", val->value.date.year, val->value.date.mon); *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); } - break; + break; case XML_SCHEMAS_TIME: { char buf[30]; @@ -5939,8 +5939,8 @@ norm = xmlSchemaDateNormalize(val, 0); if (norm == NULL) return (-1); - /* - * TODO: Check if "%.14g" is portable. + /* + * TODO: Check if "%.14g" is portable. */ snprintf(buf, 30, "%02u:%02u:%02.14gZ", @@ -5956,7 +5956,7 @@ val->value.date.sec); } *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); - } + } break; case XML_SCHEMAS_DATE: { @@ -5984,7 +5984,7 @@ val->value.date.day); } *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); - } + } break; case XML_SCHEMAS_DATETIME: { @@ -6028,8 +6028,8 @@ *retValue = BAD_CAST xmlStrdup(BAD_CAST val->value.base64.str); break; case XML_SCHEMAS_FLOAT: { - char buf[30]; - /* + char buf[30]; + /* * |m| < 16777216, -149 <= e <= 104. * TODO: Handle, NaN, INF, -INF. The format is not * yet conformant. The c type float does not cover @@ -6050,7 +6050,7 @@ snprintf(buf, 40, "%01.14e", val->value.d); *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); } - break; + break; default: *retValue = BAD_CAST xmlStrdup(BAD_CAST "???"); return (1); @@ -6109,7 +6109,7 @@ break; default: return (xmlSchemaGetCanonValue(val, retValue)); - } + } return (0); } Index: lib/3rdparty/libxml2/xmlstring.c =================================================================== --- lib/3rdparty/libxml2/xmlstring.c (revision 58293) +++ lib/3rdparty/libxml2/xmlstring.c (working copy) @@ -3,7 +3,7 @@ * * This module provides various utility functions for manipulating * the xmlChar* type. All functions named xmlStr* have been moved here - * from the parser.c file (their original home). + * from the parser.c file (their original home). * * See Copyright for the status of this software. * @@ -40,7 +40,7 @@ xmlChar * xmlStrndup(const xmlChar *cur, int len) { xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -85,7 +85,7 @@ xmlCharStrndup(const char *cur, int len) { int i; xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -170,7 +170,7 @@ * @name: the localname of the QName * @str: the second xmlChar * * - * Check if a QName is Equal to a given string + * Check if a QName is Equal to a given string * * Returns 1 if they are equal, 0 if they are different */ @@ -340,7 +340,7 @@ const xmlChar * xmlStrstr(const xmlChar *str, const xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -368,7 +368,7 @@ const xmlChar * xmlStrcasestr(const xmlChar *str, const xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -396,7 +396,7 @@ xmlChar * xmlStrsub(const xmlChar *str, int start, int len) { int i; - + if (str == NULL) return(NULL); if (start < 0) return(NULL); if (len < 0) return(NULL); @@ -519,7 +519,7 @@ const xmlChar *p = add; if (add == NULL) return(cur); - if (cur == NULL) + if (cur == NULL) return(xmlStrdup(add)); while (*p != 0) p++; /* non input consuming */ @@ -537,20 +537,20 @@ * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int XMLCDECL +int XMLCDECL xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { va_list args; int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + va_start(args, msg); ret = vsnprintf((char *) buf, len, (const char *) msg, args); va_end(args); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -565,17 +565,17 @@ * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int +int xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) { int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + ret = vsnprintf((char *) buf, len, (const char *) msg, ap); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -858,7 +858,7 @@ xmlUTF8Strndup(const xmlChar *utf, int len) { xmlChar *ret; int i; - + if ((utf == NULL) || (len < 0)) return(NULL); i = xmlUTF8Strsize(utf, len); ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar)); Index: lib/3rdparty/libxml2/xmlunicode.c =================================================================== --- lib/3rdparty/libxml2/xmlunicode.c (revision 58293) +++ lib/3rdparty/libxml2/xmlunicode.c (working copy) @@ -204,729 +204,729 @@ {"Zp", xmlUCSIsCatZp}, {"Zs", xmlUCSIsCatZs}}; -static const xmlChSRange xmlCS[] = {{0x0, 0x1f}, {0x7f, 0x9f}, - {0xad, 0xad}, {0x600, 0x603}, {0x6dd, 0x6dd}, {0x70f, 0x70f}, - {0x17b4, 0x17b5}, {0x200b, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2063}, - {0x206a, 0x206f}, {0xd800, 0xd800}, {0xdb7f, 0xdb80}, {0xdbff, 0xdc00}, +static const xmlChSRange xmlCS[] = {{0x0, 0x1f}, {0x7f, 0x9f}, + {0xad, 0xad}, {0x600, 0x603}, {0x6dd, 0x6dd}, {0x70f, 0x70f}, + {0x17b4, 0x17b5}, {0x200b, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2063}, + {0x206a, 0x206f}, {0xd800, 0xd800}, {0xdb7f, 0xdb80}, {0xdbff, 0xdc00}, {0xdfff, 0xe000}, {0xf8ff, 0xf8ff}, {0xfeff, 0xfeff}, {0xfff9, 0xfffb} }; -static const xmlChLRange xmlCL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, - {0xe0020, 0xe007f}, {0xf0000, 0xf0000}, {0xffffd, 0xffffd}, +static const xmlChLRange xmlCL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, + {0xe0020, 0xe007f}, {0xf0000, 0xf0000}, {0xffffd, 0xffffd}, {0x100000, 0x100000}, {0x10fffd, 0x10fffd} }; static xmlChRangeGroup xmlCG = {18,7,xmlCS,xmlCL}; -static const xmlChSRange xmlCfS[] = {{0xad, 0xad}, {0x600, 0x603}, - {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, {0x200b, 0x200f}, - {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, {0xfeff, 0xfeff}, +static const xmlChSRange xmlCfS[] = {{0xad, 0xad}, {0x600, 0x603}, + {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, {0x200b, 0x200f}, + {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, {0xfeff, 0xfeff}, {0xfff9, 0xfffb} }; -static const xmlChLRange xmlCfL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, +static const xmlChLRange xmlCfL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, {0xe0020, 0xe007f} }; static xmlChRangeGroup xmlCfG = {11,3,xmlCfS,xmlCfL}; -static const xmlChSRange xmlLS[] = {{0x41, 0x5a}, {0x61, 0x7a}, - {0xaa, 0xaa}, {0xb5, 0xb5}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, - {0xf8, 0x236}, {0x250, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4}, - {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x386, 0x386}, {0x388, 0x38a}, - {0x38c, 0x38c}, {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3f5}, - {0x3f7, 0x3fb}, {0x400, 0x481}, {0x48a, 0x4ce}, {0x4d0, 0x4f5}, - {0x4f8, 0x4f9}, {0x500, 0x50f}, {0x531, 0x556}, {0x559, 0x559}, - {0x561, 0x587}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, - {0x640, 0x64a}, {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, - {0x6e5, 0x6e6}, {0x6ee, 0x6ef}, {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, - {0x710, 0x710}, {0x712, 0x72f}, {0x74d, 0x74f}, {0x780, 0x7a5}, - {0x7b1, 0x7b1}, {0x904, 0x939}, {0x93d, 0x93d}, {0x950, 0x950}, - {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, - {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, - {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, - {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, - {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, - {0xa72, 0xa74}, {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, - {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, - {0xad0, 0xad0}, {0xae0, 0xae1}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, - {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb35, 0xb39}, - {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb71, 0xb71}, - {0xb83, 0xb83}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, {0xb92, 0xb95}, - {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, {0xba3, 0xba4}, - {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9}, {0xc05, 0xc0c}, - {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33}, {0xc35, 0xc39}, - {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, - {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcbd, 0xcbd}, {0xcde, 0xcde}, - {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, - {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, - {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, - {0xe32, 0xe33}, {0xe40, 0xe46}, {0xe81, 0xe82}, {0xe84, 0xe84}, - {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, - {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, - {0xeaa, 0xeab}, {0xead, 0xeb0}, {0xeb2, 0xeb3}, {0xebd, 0xebd}, - {0xec0, 0xec4}, {0xec6, 0xec6}, {0xedc, 0xedd}, {0xf00, 0xf00}, - {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, {0x1000, 0x1021}, - {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, - {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, - {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, - {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, - {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, - {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, - {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, - {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, - {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, - {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, - {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, - {0x1780, 0x17b3}, {0x17d7, 0x17d7}, {0x17dc, 0x17dc}, {0x1820, 0x1877}, - {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, - {0x1d00, 0x1d6b}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, - {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, - {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, - {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, - {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, - {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2071, 0x2071}, {0x207f, 0x207f}, - {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210a, 0x2113}, {0x2115, 0x2115}, - {0x2119, 0x211d}, {0x2124, 0x2124}, {0x2126, 0x2126}, {0x2128, 0x2128}, - {0x212a, 0x212d}, {0x212f, 0x2131}, {0x2133, 0x2139}, {0x213d, 0x213f}, - {0x2145, 0x2149}, {0x3005, 0x3006}, {0x3031, 0x3035}, {0x303b, 0x303c}, - {0x3041, 0x3096}, {0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff}, - {0x3105, 0x312c}, {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, - {0x3400, 0x3400}, {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, - {0xa000, 0xa48c}, {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, - {0xfa30, 0xfa6a}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1d}, - {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb3e, 0xfb3e}, - {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, - {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74}, - {0xfe76, 0xfefc}, {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, +static const xmlChSRange xmlLS[] = {{0x41, 0x5a}, {0x61, 0x7a}, + {0xaa, 0xaa}, {0xb5, 0xb5}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, + {0xf8, 0x236}, {0x250, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4}, + {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x386, 0x386}, {0x388, 0x38a}, + {0x38c, 0x38c}, {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3f5}, + {0x3f7, 0x3fb}, {0x400, 0x481}, {0x48a, 0x4ce}, {0x4d0, 0x4f5}, + {0x4f8, 0x4f9}, {0x500, 0x50f}, {0x531, 0x556}, {0x559, 0x559}, + {0x561, 0x587}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, + {0x640, 0x64a}, {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, + {0x6e5, 0x6e6}, {0x6ee, 0x6ef}, {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, + {0x710, 0x710}, {0x712, 0x72f}, {0x74d, 0x74f}, {0x780, 0x7a5}, + {0x7b1, 0x7b1}, {0x904, 0x939}, {0x93d, 0x93d}, {0x950, 0x950}, + {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, + {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, + {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, + {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, + {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, + {0xa72, 0xa74}, {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, + {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, + {0xad0, 0xad0}, {0xae0, 0xae1}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, + {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb35, 0xb39}, + {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb71, 0xb71}, + {0xb83, 0xb83}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, {0xb92, 0xb95}, + {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, {0xba3, 0xba4}, + {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9}, {0xc05, 0xc0c}, + {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33}, {0xc35, 0xc39}, + {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, + {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcbd, 0xcbd}, {0xcde, 0xcde}, + {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, + {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, + {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, + {0xe32, 0xe33}, {0xe40, 0xe46}, {0xe81, 0xe82}, {0xe84, 0xe84}, + {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, + {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, + {0xeaa, 0xeab}, {0xead, 0xeb0}, {0xeb2, 0xeb3}, {0xebd, 0xebd}, + {0xec0, 0xec4}, {0xec6, 0xec6}, {0xedc, 0xedd}, {0xf00, 0xf00}, + {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, {0x1000, 0x1021}, + {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, + {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, + {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, + {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, + {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, + {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, + {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, + {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, + {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, + {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, + {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, + {0x1780, 0x17b3}, {0x17d7, 0x17d7}, {0x17dc, 0x17dc}, {0x1820, 0x1877}, + {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, + {0x1d00, 0x1d6b}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, + {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, + {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, + {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, + {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, + {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2071, 0x2071}, {0x207f, 0x207f}, + {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210a, 0x2113}, {0x2115, 0x2115}, + {0x2119, 0x211d}, {0x2124, 0x2124}, {0x2126, 0x2126}, {0x2128, 0x2128}, + {0x212a, 0x212d}, {0x212f, 0x2131}, {0x2133, 0x2139}, {0x213d, 0x213f}, + {0x2145, 0x2149}, {0x3005, 0x3006}, {0x3031, 0x3035}, {0x303b, 0x303c}, + {0x3041, 0x3096}, {0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff}, + {0x3105, 0x312c}, {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, + {0x3400, 0x3400}, {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, + {0xa000, 0xa48c}, {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, + {0xfa30, 0xfa6a}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1d}, + {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb3e, 0xfb3e}, + {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, + {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74}, + {0xfe76, 0xfefc}, {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} }; -static const xmlChLRange xmlLL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, - {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, - {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, - {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10400, 0x1049d}, - {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, - {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, - {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d49e, 0x1d49f}, - {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, {0x1d4a9, 0x1d4ac}, - {0x1d4ae, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, - {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, - {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, - {0x1d552, 0x1d6a3}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da}, - {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, - {0x1d736, 0x1d74e}, {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, - {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}, +static const xmlChLRange xmlLL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, + {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, + {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, + {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10400, 0x1049d}, + {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, + {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, + {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d49e, 0x1d49f}, + {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, {0x1d4a9, 0x1d4ac}, + {0x1d4ae, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, + {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, + {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, + {0x1d552, 0x1d6a3}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da}, + {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, + {0x1d736, 0x1d74e}, {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, + {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}, {0x20000, 0x20000}, {0x2a6d6, 0x2a6d6}, {0x2f800, 0x2fa1d} }; static xmlChRangeGroup xmlLG = {279,50,xmlLS,xmlLL}; -static const xmlChSRange xmlLlS[] = {{0x61, 0x7a}, {0xaa, 0xaa}, - {0xb5, 0xb5}, {0xba, 0xba}, {0xdf, 0xf6}, {0xf8, 0xff}, {0x101, 0x101}, - {0x103, 0x103}, {0x105, 0x105}, {0x107, 0x107}, {0x109, 0x109}, - {0x10b, 0x10b}, {0x10d, 0x10d}, {0x10f, 0x10f}, {0x111, 0x111}, - {0x113, 0x113}, {0x115, 0x115}, {0x117, 0x117}, {0x119, 0x119}, - {0x11b, 0x11b}, {0x11d, 0x11d}, {0x11f, 0x11f}, {0x121, 0x121}, - {0x123, 0x123}, {0x125, 0x125}, {0x127, 0x127}, {0x129, 0x129}, - {0x12b, 0x12b}, {0x12d, 0x12d}, {0x12f, 0x12f}, {0x131, 0x131}, - {0x133, 0x133}, {0x135, 0x135}, {0x137, 0x138}, {0x13a, 0x13a}, - {0x13c, 0x13c}, {0x13e, 0x13e}, {0x140, 0x140}, {0x142, 0x142}, - {0x144, 0x144}, {0x146, 0x146}, {0x148, 0x149}, {0x14b, 0x14b}, - {0x14d, 0x14d}, {0x14f, 0x14f}, {0x151, 0x151}, {0x153, 0x153}, - {0x155, 0x155}, {0x157, 0x157}, {0x159, 0x159}, {0x15b, 0x15b}, - {0x15d, 0x15d}, {0x15f, 0x15f}, {0x161, 0x161}, {0x163, 0x163}, - {0x165, 0x165}, {0x167, 0x167}, {0x169, 0x169}, {0x16b, 0x16b}, - {0x16d, 0x16d}, {0x16f, 0x16f}, {0x171, 0x171}, {0x173, 0x173}, - {0x175, 0x175}, {0x177, 0x177}, {0x17a, 0x17a}, {0x17c, 0x17c}, - {0x17e, 0x180}, {0x183, 0x183}, {0x185, 0x185}, {0x188, 0x188}, - {0x18c, 0x18d}, {0x192, 0x192}, {0x195, 0x195}, {0x199, 0x19b}, - {0x19e, 0x19e}, {0x1a1, 0x1a1}, {0x1a3, 0x1a3}, {0x1a5, 0x1a5}, - {0x1a8, 0x1a8}, {0x1aa, 0x1ab}, {0x1ad, 0x1ad}, {0x1b0, 0x1b0}, - {0x1b4, 0x1b4}, {0x1b6, 0x1b6}, {0x1b9, 0x1ba}, {0x1bd, 0x1bf}, - {0x1c6, 0x1c6}, {0x1c9, 0x1c9}, {0x1cc, 0x1cc}, {0x1ce, 0x1ce}, - {0x1d0, 0x1d0}, {0x1d2, 0x1d2}, {0x1d4, 0x1d4}, {0x1d6, 0x1d6}, - {0x1d8, 0x1d8}, {0x1da, 0x1da}, {0x1dc, 0x1dd}, {0x1df, 0x1df}, - {0x1e1, 0x1e1}, {0x1e3, 0x1e3}, {0x1e5, 0x1e5}, {0x1e7, 0x1e7}, - {0x1e9, 0x1e9}, {0x1eb, 0x1eb}, {0x1ed, 0x1ed}, {0x1ef, 0x1f0}, - {0x1f3, 0x1f3}, {0x1f5, 0x1f5}, {0x1f9, 0x1f9}, {0x1fb, 0x1fb}, - {0x1fd, 0x1fd}, {0x1ff, 0x1ff}, {0x201, 0x201}, {0x203, 0x203}, - {0x205, 0x205}, {0x207, 0x207}, {0x209, 0x209}, {0x20b, 0x20b}, - {0x20d, 0x20d}, {0x20f, 0x20f}, {0x211, 0x211}, {0x213, 0x213}, - {0x215, 0x215}, {0x217, 0x217}, {0x219, 0x219}, {0x21b, 0x21b}, - {0x21d, 0x21d}, {0x21f, 0x21f}, {0x221, 0x221}, {0x223, 0x223}, - {0x225, 0x225}, {0x227, 0x227}, {0x229, 0x229}, {0x22b, 0x22b}, - {0x22d, 0x22d}, {0x22f, 0x22f}, {0x231, 0x231}, {0x233, 0x236}, - {0x250, 0x2af}, {0x390, 0x390}, {0x3ac, 0x3ce}, {0x3d0, 0x3d1}, - {0x3d5, 0x3d7}, {0x3d9, 0x3d9}, {0x3db, 0x3db}, {0x3dd, 0x3dd}, - {0x3df, 0x3df}, {0x3e1, 0x3e1}, {0x3e3, 0x3e3}, {0x3e5, 0x3e5}, - {0x3e7, 0x3e7}, {0x3e9, 0x3e9}, {0x3eb, 0x3eb}, {0x3ed, 0x3ed}, - {0x3ef, 0x3f3}, {0x3f5, 0x3f5}, {0x3f8, 0x3f8}, {0x3fb, 0x3fb}, - {0x430, 0x45f}, {0x461, 0x461}, {0x463, 0x463}, {0x465, 0x465}, - {0x467, 0x467}, {0x469, 0x469}, {0x46b, 0x46b}, {0x46d, 0x46d}, - {0x46f, 0x46f}, {0x471, 0x471}, {0x473, 0x473}, {0x475, 0x475}, - {0x477, 0x477}, {0x479, 0x479}, {0x47b, 0x47b}, {0x47d, 0x47d}, - {0x47f, 0x47f}, {0x481, 0x481}, {0x48b, 0x48b}, {0x48d, 0x48d}, - {0x48f, 0x48f}, {0x491, 0x491}, {0x493, 0x493}, {0x495, 0x495}, - {0x497, 0x497}, {0x499, 0x499}, {0x49b, 0x49b}, {0x49d, 0x49d}, - {0x49f, 0x49f}, {0x4a1, 0x4a1}, {0x4a3, 0x4a3}, {0x4a5, 0x4a5}, - {0x4a7, 0x4a7}, {0x4a9, 0x4a9}, {0x4ab, 0x4ab}, {0x4ad, 0x4ad}, - {0x4af, 0x4af}, {0x4b1, 0x4b1}, {0x4b3, 0x4b3}, {0x4b5, 0x4b5}, - {0x4b7, 0x4b7}, {0x4b9, 0x4b9}, {0x4bb, 0x4bb}, {0x4bd, 0x4bd}, - {0x4bf, 0x4bf}, {0x4c2, 0x4c2}, {0x4c4, 0x4c4}, {0x4c6, 0x4c6}, - {0x4c8, 0x4c8}, {0x4ca, 0x4ca}, {0x4cc, 0x4cc}, {0x4ce, 0x4ce}, - {0x4d1, 0x4d1}, {0x4d3, 0x4d3}, {0x4d5, 0x4d5}, {0x4d7, 0x4d7}, - {0x4d9, 0x4d9}, {0x4db, 0x4db}, {0x4dd, 0x4dd}, {0x4df, 0x4df}, - {0x4e1, 0x4e1}, {0x4e3, 0x4e3}, {0x4e5, 0x4e5}, {0x4e7, 0x4e7}, - {0x4e9, 0x4e9}, {0x4eb, 0x4eb}, {0x4ed, 0x4ed}, {0x4ef, 0x4ef}, - {0x4f1, 0x4f1}, {0x4f3, 0x4f3}, {0x4f5, 0x4f5}, {0x4f9, 0x4f9}, - {0x501, 0x501}, {0x503, 0x503}, {0x505, 0x505}, {0x507, 0x507}, - {0x509, 0x509}, {0x50b, 0x50b}, {0x50d, 0x50d}, {0x50f, 0x50f}, - {0x561, 0x587}, {0x1d00, 0x1d2b}, {0x1d62, 0x1d6b}, {0x1e01, 0x1e01}, - {0x1e03, 0x1e03}, {0x1e05, 0x1e05}, {0x1e07, 0x1e07}, {0x1e09, 0x1e09}, - {0x1e0b, 0x1e0b}, {0x1e0d, 0x1e0d}, {0x1e0f, 0x1e0f}, {0x1e11, 0x1e11}, - {0x1e13, 0x1e13}, {0x1e15, 0x1e15}, {0x1e17, 0x1e17}, {0x1e19, 0x1e19}, - {0x1e1b, 0x1e1b}, {0x1e1d, 0x1e1d}, {0x1e1f, 0x1e1f}, {0x1e21, 0x1e21}, - {0x1e23, 0x1e23}, {0x1e25, 0x1e25}, {0x1e27, 0x1e27}, {0x1e29, 0x1e29}, - {0x1e2b, 0x1e2b}, {0x1e2d, 0x1e2d}, {0x1e2f, 0x1e2f}, {0x1e31, 0x1e31}, - {0x1e33, 0x1e33}, {0x1e35, 0x1e35}, {0x1e37, 0x1e37}, {0x1e39, 0x1e39}, - {0x1e3b, 0x1e3b}, {0x1e3d, 0x1e3d}, {0x1e3f, 0x1e3f}, {0x1e41, 0x1e41}, - {0x1e43, 0x1e43}, {0x1e45, 0x1e45}, {0x1e47, 0x1e47}, {0x1e49, 0x1e49}, - {0x1e4b, 0x1e4b}, {0x1e4d, 0x1e4d}, {0x1e4f, 0x1e4f}, {0x1e51, 0x1e51}, - {0x1e53, 0x1e53}, {0x1e55, 0x1e55}, {0x1e57, 0x1e57}, {0x1e59, 0x1e59}, - {0x1e5b, 0x1e5b}, {0x1e5d, 0x1e5d}, {0x1e5f, 0x1e5f}, {0x1e61, 0x1e61}, - {0x1e63, 0x1e63}, {0x1e65, 0x1e65}, {0x1e67, 0x1e67}, {0x1e69, 0x1e69}, - {0x1e6b, 0x1e6b}, {0x1e6d, 0x1e6d}, {0x1e6f, 0x1e6f}, {0x1e71, 0x1e71}, - {0x1e73, 0x1e73}, {0x1e75, 0x1e75}, {0x1e77, 0x1e77}, {0x1e79, 0x1e79}, - {0x1e7b, 0x1e7b}, {0x1e7d, 0x1e7d}, {0x1e7f, 0x1e7f}, {0x1e81, 0x1e81}, - {0x1e83, 0x1e83}, {0x1e85, 0x1e85}, {0x1e87, 0x1e87}, {0x1e89, 0x1e89}, - {0x1e8b, 0x1e8b}, {0x1e8d, 0x1e8d}, {0x1e8f, 0x1e8f}, {0x1e91, 0x1e91}, - {0x1e93, 0x1e93}, {0x1e95, 0x1e9b}, {0x1ea1, 0x1ea1}, {0x1ea3, 0x1ea3}, - {0x1ea5, 0x1ea5}, {0x1ea7, 0x1ea7}, {0x1ea9, 0x1ea9}, {0x1eab, 0x1eab}, - {0x1ead, 0x1ead}, {0x1eaf, 0x1eaf}, {0x1eb1, 0x1eb1}, {0x1eb3, 0x1eb3}, - {0x1eb5, 0x1eb5}, {0x1eb7, 0x1eb7}, {0x1eb9, 0x1eb9}, {0x1ebb, 0x1ebb}, - {0x1ebd, 0x1ebd}, {0x1ebf, 0x1ebf}, {0x1ec1, 0x1ec1}, {0x1ec3, 0x1ec3}, - {0x1ec5, 0x1ec5}, {0x1ec7, 0x1ec7}, {0x1ec9, 0x1ec9}, {0x1ecb, 0x1ecb}, - {0x1ecd, 0x1ecd}, {0x1ecf, 0x1ecf}, {0x1ed1, 0x1ed1}, {0x1ed3, 0x1ed3}, - {0x1ed5, 0x1ed5}, {0x1ed7, 0x1ed7}, {0x1ed9, 0x1ed9}, {0x1edb, 0x1edb}, - {0x1edd, 0x1edd}, {0x1edf, 0x1edf}, {0x1ee1, 0x1ee1}, {0x1ee3, 0x1ee3}, - {0x1ee5, 0x1ee5}, {0x1ee7, 0x1ee7}, {0x1ee9, 0x1ee9}, {0x1eeb, 0x1eeb}, - {0x1eed, 0x1eed}, {0x1eef, 0x1eef}, {0x1ef1, 0x1ef1}, {0x1ef3, 0x1ef3}, - {0x1ef5, 0x1ef5}, {0x1ef7, 0x1ef7}, {0x1ef9, 0x1ef9}, {0x1f00, 0x1f07}, - {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, - {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, - {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fb6, 0x1fb7}, - {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fc7}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fd7}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ff7}, - {0x2071, 0x2071}, {0x207f, 0x207f}, {0x210a, 0x210a}, {0x210e, 0x210f}, - {0x2113, 0x2113}, {0x212f, 0x212f}, {0x2134, 0x2134}, {0x2139, 0x2139}, - {0x213d, 0x213d}, {0x2146, 0x2149}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, +static const xmlChSRange xmlLlS[] = {{0x61, 0x7a}, {0xaa, 0xaa}, + {0xb5, 0xb5}, {0xba, 0xba}, {0xdf, 0xf6}, {0xf8, 0xff}, {0x101, 0x101}, + {0x103, 0x103}, {0x105, 0x105}, {0x107, 0x107}, {0x109, 0x109}, + {0x10b, 0x10b}, {0x10d, 0x10d}, {0x10f, 0x10f}, {0x111, 0x111}, + {0x113, 0x113}, {0x115, 0x115}, {0x117, 0x117}, {0x119, 0x119}, + {0x11b, 0x11b}, {0x11d, 0x11d}, {0x11f, 0x11f}, {0x121, 0x121}, + {0x123, 0x123}, {0x125, 0x125}, {0x127, 0x127}, {0x129, 0x129}, + {0x12b, 0x12b}, {0x12d, 0x12d}, {0x12f, 0x12f}, {0x131, 0x131}, + {0x133, 0x133}, {0x135, 0x135}, {0x137, 0x138}, {0x13a, 0x13a}, + {0x13c, 0x13c}, {0x13e, 0x13e}, {0x140, 0x140}, {0x142, 0x142}, + {0x144, 0x144}, {0x146, 0x146}, {0x148, 0x149}, {0x14b, 0x14b}, + {0x14d, 0x14d}, {0x14f, 0x14f}, {0x151, 0x151}, {0x153, 0x153}, + {0x155, 0x155}, {0x157, 0x157}, {0x159, 0x159}, {0x15b, 0x15b}, + {0x15d, 0x15d}, {0x15f, 0x15f}, {0x161, 0x161}, {0x163, 0x163}, + {0x165, 0x165}, {0x167, 0x167}, {0x169, 0x169}, {0x16b, 0x16b}, + {0x16d, 0x16d}, {0x16f, 0x16f}, {0x171, 0x171}, {0x173, 0x173}, + {0x175, 0x175}, {0x177, 0x177}, {0x17a, 0x17a}, {0x17c, 0x17c}, + {0x17e, 0x180}, {0x183, 0x183}, {0x185, 0x185}, {0x188, 0x188}, + {0x18c, 0x18d}, {0x192, 0x192}, {0x195, 0x195}, {0x199, 0x19b}, + {0x19e, 0x19e}, {0x1a1, 0x1a1}, {0x1a3, 0x1a3}, {0x1a5, 0x1a5}, + {0x1a8, 0x1a8}, {0x1aa, 0x1ab}, {0x1ad, 0x1ad}, {0x1b0, 0x1b0}, + {0x1b4, 0x1b4}, {0x1b6, 0x1b6}, {0x1b9, 0x1ba}, {0x1bd, 0x1bf}, + {0x1c6, 0x1c6}, {0x1c9, 0x1c9}, {0x1cc, 0x1cc}, {0x1ce, 0x1ce}, + {0x1d0, 0x1d0}, {0x1d2, 0x1d2}, {0x1d4, 0x1d4}, {0x1d6, 0x1d6}, + {0x1d8, 0x1d8}, {0x1da, 0x1da}, {0x1dc, 0x1dd}, {0x1df, 0x1df}, + {0x1e1, 0x1e1}, {0x1e3, 0x1e3}, {0x1e5, 0x1e5}, {0x1e7, 0x1e7}, + {0x1e9, 0x1e9}, {0x1eb, 0x1eb}, {0x1ed, 0x1ed}, {0x1ef, 0x1f0}, + {0x1f3, 0x1f3}, {0x1f5, 0x1f5}, {0x1f9, 0x1f9}, {0x1fb, 0x1fb}, + {0x1fd, 0x1fd}, {0x1ff, 0x1ff}, {0x201, 0x201}, {0x203, 0x203}, + {0x205, 0x205}, {0x207, 0x207}, {0x209, 0x209}, {0x20b, 0x20b}, + {0x20d, 0x20d}, {0x20f, 0x20f}, {0x211, 0x211}, {0x213, 0x213}, + {0x215, 0x215}, {0x217, 0x217}, {0x219, 0x219}, {0x21b, 0x21b}, + {0x21d, 0x21d}, {0x21f, 0x21f}, {0x221, 0x221}, {0x223, 0x223}, + {0x225, 0x225}, {0x227, 0x227}, {0x229, 0x229}, {0x22b, 0x22b}, + {0x22d, 0x22d}, {0x22f, 0x22f}, {0x231, 0x231}, {0x233, 0x236}, + {0x250, 0x2af}, {0x390, 0x390}, {0x3ac, 0x3ce}, {0x3d0, 0x3d1}, + {0x3d5, 0x3d7}, {0x3d9, 0x3d9}, {0x3db, 0x3db}, {0x3dd, 0x3dd}, + {0x3df, 0x3df}, {0x3e1, 0x3e1}, {0x3e3, 0x3e3}, {0x3e5, 0x3e5}, + {0x3e7, 0x3e7}, {0x3e9, 0x3e9}, {0x3eb, 0x3eb}, {0x3ed, 0x3ed}, + {0x3ef, 0x3f3}, {0x3f5, 0x3f5}, {0x3f8, 0x3f8}, {0x3fb, 0x3fb}, + {0x430, 0x45f}, {0x461, 0x461}, {0x463, 0x463}, {0x465, 0x465}, + {0x467, 0x467}, {0x469, 0x469}, {0x46b, 0x46b}, {0x46d, 0x46d}, + {0x46f, 0x46f}, {0x471, 0x471}, {0x473, 0x473}, {0x475, 0x475}, + {0x477, 0x477}, {0x479, 0x479}, {0x47b, 0x47b}, {0x47d, 0x47d}, + {0x47f, 0x47f}, {0x481, 0x481}, {0x48b, 0x48b}, {0x48d, 0x48d}, + {0x48f, 0x48f}, {0x491, 0x491}, {0x493, 0x493}, {0x495, 0x495}, + {0x497, 0x497}, {0x499, 0x499}, {0x49b, 0x49b}, {0x49d, 0x49d}, + {0x49f, 0x49f}, {0x4a1, 0x4a1}, {0x4a3, 0x4a3}, {0x4a5, 0x4a5}, + {0x4a7, 0x4a7}, {0x4a9, 0x4a9}, {0x4ab, 0x4ab}, {0x4ad, 0x4ad}, + {0x4af, 0x4af}, {0x4b1, 0x4b1}, {0x4b3, 0x4b3}, {0x4b5, 0x4b5}, + {0x4b7, 0x4b7}, {0x4b9, 0x4b9}, {0x4bb, 0x4bb}, {0x4bd, 0x4bd}, + {0x4bf, 0x4bf}, {0x4c2, 0x4c2}, {0x4c4, 0x4c4}, {0x4c6, 0x4c6}, + {0x4c8, 0x4c8}, {0x4ca, 0x4ca}, {0x4cc, 0x4cc}, {0x4ce, 0x4ce}, + {0x4d1, 0x4d1}, {0x4d3, 0x4d3}, {0x4d5, 0x4d5}, {0x4d7, 0x4d7}, + {0x4d9, 0x4d9}, {0x4db, 0x4db}, {0x4dd, 0x4dd}, {0x4df, 0x4df}, + {0x4e1, 0x4e1}, {0x4e3, 0x4e3}, {0x4e5, 0x4e5}, {0x4e7, 0x4e7}, + {0x4e9, 0x4e9}, {0x4eb, 0x4eb}, {0x4ed, 0x4ed}, {0x4ef, 0x4ef}, + {0x4f1, 0x4f1}, {0x4f3, 0x4f3}, {0x4f5, 0x4f5}, {0x4f9, 0x4f9}, + {0x501, 0x501}, {0x503, 0x503}, {0x505, 0x505}, {0x507, 0x507}, + {0x509, 0x509}, {0x50b, 0x50b}, {0x50d, 0x50d}, {0x50f, 0x50f}, + {0x561, 0x587}, {0x1d00, 0x1d2b}, {0x1d62, 0x1d6b}, {0x1e01, 0x1e01}, + {0x1e03, 0x1e03}, {0x1e05, 0x1e05}, {0x1e07, 0x1e07}, {0x1e09, 0x1e09}, + {0x1e0b, 0x1e0b}, {0x1e0d, 0x1e0d}, {0x1e0f, 0x1e0f}, {0x1e11, 0x1e11}, + {0x1e13, 0x1e13}, {0x1e15, 0x1e15}, {0x1e17, 0x1e17}, {0x1e19, 0x1e19}, + {0x1e1b, 0x1e1b}, {0x1e1d, 0x1e1d}, {0x1e1f, 0x1e1f}, {0x1e21, 0x1e21}, + {0x1e23, 0x1e23}, {0x1e25, 0x1e25}, {0x1e27, 0x1e27}, {0x1e29, 0x1e29}, + {0x1e2b, 0x1e2b}, {0x1e2d, 0x1e2d}, {0x1e2f, 0x1e2f}, {0x1e31, 0x1e31}, + {0x1e33, 0x1e33}, {0x1e35, 0x1e35}, {0x1e37, 0x1e37}, {0x1e39, 0x1e39}, + {0x1e3b, 0x1e3b}, {0x1e3d, 0x1e3d}, {0x1e3f, 0x1e3f}, {0x1e41, 0x1e41}, + {0x1e43, 0x1e43}, {0x1e45, 0x1e45}, {0x1e47, 0x1e47}, {0x1e49, 0x1e49}, + {0x1e4b, 0x1e4b}, {0x1e4d, 0x1e4d}, {0x1e4f, 0x1e4f}, {0x1e51, 0x1e51}, + {0x1e53, 0x1e53}, {0x1e55, 0x1e55}, {0x1e57, 0x1e57}, {0x1e59, 0x1e59}, + {0x1e5b, 0x1e5b}, {0x1e5d, 0x1e5d}, {0x1e5f, 0x1e5f}, {0x1e61, 0x1e61}, + {0x1e63, 0x1e63}, {0x1e65, 0x1e65}, {0x1e67, 0x1e67}, {0x1e69, 0x1e69}, + {0x1e6b, 0x1e6b}, {0x1e6d, 0x1e6d}, {0x1e6f, 0x1e6f}, {0x1e71, 0x1e71}, + {0x1e73, 0x1e73}, {0x1e75, 0x1e75}, {0x1e77, 0x1e77}, {0x1e79, 0x1e79}, + {0x1e7b, 0x1e7b}, {0x1e7d, 0x1e7d}, {0x1e7f, 0x1e7f}, {0x1e81, 0x1e81}, + {0x1e83, 0x1e83}, {0x1e85, 0x1e85}, {0x1e87, 0x1e87}, {0x1e89, 0x1e89}, + {0x1e8b, 0x1e8b}, {0x1e8d, 0x1e8d}, {0x1e8f, 0x1e8f}, {0x1e91, 0x1e91}, + {0x1e93, 0x1e93}, {0x1e95, 0x1e9b}, {0x1ea1, 0x1ea1}, {0x1ea3, 0x1ea3}, + {0x1ea5, 0x1ea5}, {0x1ea7, 0x1ea7}, {0x1ea9, 0x1ea9}, {0x1eab, 0x1eab}, + {0x1ead, 0x1ead}, {0x1eaf, 0x1eaf}, {0x1eb1, 0x1eb1}, {0x1eb3, 0x1eb3}, + {0x1eb5, 0x1eb5}, {0x1eb7, 0x1eb7}, {0x1eb9, 0x1eb9}, {0x1ebb, 0x1ebb}, + {0x1ebd, 0x1ebd}, {0x1ebf, 0x1ebf}, {0x1ec1, 0x1ec1}, {0x1ec3, 0x1ec3}, + {0x1ec5, 0x1ec5}, {0x1ec7, 0x1ec7}, {0x1ec9, 0x1ec9}, {0x1ecb, 0x1ecb}, + {0x1ecd, 0x1ecd}, {0x1ecf, 0x1ecf}, {0x1ed1, 0x1ed1}, {0x1ed3, 0x1ed3}, + {0x1ed5, 0x1ed5}, {0x1ed7, 0x1ed7}, {0x1ed9, 0x1ed9}, {0x1edb, 0x1edb}, + {0x1edd, 0x1edd}, {0x1edf, 0x1edf}, {0x1ee1, 0x1ee1}, {0x1ee3, 0x1ee3}, + {0x1ee5, 0x1ee5}, {0x1ee7, 0x1ee7}, {0x1ee9, 0x1ee9}, {0x1eeb, 0x1eeb}, + {0x1eed, 0x1eed}, {0x1eef, 0x1eef}, {0x1ef1, 0x1ef1}, {0x1ef3, 0x1ef3}, + {0x1ef5, 0x1ef5}, {0x1ef7, 0x1ef7}, {0x1ef9, 0x1ef9}, {0x1f00, 0x1f07}, + {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, + {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, + {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fb6, 0x1fb7}, + {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fc7}, {0x1fd0, 0x1fd3}, + {0x1fd6, 0x1fd7}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ff7}, + {0x2071, 0x2071}, {0x207f, 0x207f}, {0x210a, 0x210a}, {0x210e, 0x210f}, + {0x2113, 0x2113}, {0x212f, 0x212f}, {0x2134, 0x2134}, {0x2139, 0x2139}, + {0x213d, 0x213d}, {0x2146, 0x2149}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xff41, 0xff5a} }; -static const xmlChLRange xmlLlL[] = {{0x10428, 0x1044f}, {0x1d41a, 0x1d433}, - {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, - {0x1d4b6, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, - {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, - {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, - {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, - {0x1d68a, 0x1d6a3}, {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1}, - {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, - {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, +static const xmlChLRange xmlLlL[] = {{0x10428, 0x1044f}, {0x1d41a, 0x1d433}, + {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, + {0x1d4b6, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, + {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, + {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, + {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, + {0x1d68a, 0x1d6a3}, {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1}, + {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, + {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9} }; static xmlChRangeGroup xmlLlG = {396,28,xmlLlS,xmlLlL}; -static const xmlChSRange xmlLmS[] = {{0x2b0, 0x2c1}, {0x2c6, 0x2d1}, - {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x559, 0x559}, - {0x640, 0x640}, {0x6e5, 0x6e6}, {0xe46, 0xe46}, {0xec6, 0xec6}, - {0x17d7, 0x17d7}, {0x1843, 0x1843}, {0x1d2c, 0x1d61}, {0x3005, 0x3005}, - {0x3031, 0x3035}, {0x303b, 0x303b}, {0x309d, 0x309e}, {0x30fc, 0x30fe}, +static const xmlChSRange xmlLmS[] = {{0x2b0, 0x2c1}, {0x2c6, 0x2d1}, + {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x559, 0x559}, + {0x640, 0x640}, {0x6e5, 0x6e6}, {0xe46, 0xe46}, {0xec6, 0xec6}, + {0x17d7, 0x17d7}, {0x1843, 0x1843}, {0x1d2c, 0x1d61}, {0x3005, 0x3005}, + {0x3031, 0x3035}, {0x303b, 0x303b}, {0x309d, 0x309e}, {0x30fc, 0x30fe}, {0xff70, 0xff70}, {0xff9e, 0xff9f} }; static xmlChRangeGroup xmlLmG = {20,0,xmlLmS,NULL}; -static const xmlChSRange xmlLoS[] = {{0x1bb, 0x1bb}, {0x1c0, 0x1c3}, - {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, - {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6ee, 0x6ef}, - {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, {0x712, 0x72f}, - {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, {0x904, 0x939}, - {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, {0x985, 0x98c}, - {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, - {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, {0x9df, 0x9e1}, - {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, {0xa13, 0xa28}, - {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, {0xa38, 0xa39}, - {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, {0xa85, 0xa8d}, - {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, - {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, {0xae0, 0xae1}, - {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, {0xb2a, 0xb30}, - {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, - {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, {0xb85, 0xb8a}, - {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, - {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, - {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, - {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, - {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, - {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, - {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, - {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, - {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, - {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, - {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, - {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeb0}, - {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xedc, 0xedd}, - {0xf00, 0xf00}, {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, - {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, - {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, - {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, - {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, - {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, - {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, - {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, - {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, - {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, - {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, - {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, - {0x1780, 0x17b3}, {0x17dc, 0x17dc}, {0x1820, 0x1842}, {0x1844, 0x1877}, - {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, - {0x2135, 0x2138}, {0x3006, 0x3006}, {0x303c, 0x303c}, {0x3041, 0x3096}, - {0x309f, 0x309f}, {0x30a1, 0x30fa}, {0x30ff, 0x30ff}, {0x3105, 0x312c}, - {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, - {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, - {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, - {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, - {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, - {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, - {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, {0xff66, 0xff6f}, {0xff71, 0xff9d}, - {0xffa0, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, +static const xmlChSRange xmlLoS[] = {{0x1bb, 0x1bb}, {0x1c0, 0x1c3}, + {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, + {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6ee, 0x6ef}, + {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, {0x712, 0x72f}, + {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, {0x904, 0x939}, + {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, {0x985, 0x98c}, + {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, + {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, {0x9df, 0x9e1}, + {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, {0xa13, 0xa28}, + {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, {0xa38, 0xa39}, + {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, {0xa85, 0xa8d}, + {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, + {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, {0xae0, 0xae1}, + {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, {0xb2a, 0xb30}, + {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, + {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, + {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, + {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, + {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, + {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, + {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, + {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, + {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, + {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, + {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, + {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, + {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeb0}, + {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xedc, 0xedd}, + {0xf00, 0xf00}, {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, + {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, + {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, + {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, + {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, + {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, + {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, + {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, + {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, + {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, + {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, + {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, + {0x1780, 0x17b3}, {0x17dc, 0x17dc}, {0x1820, 0x1842}, {0x1844, 0x1877}, + {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, + {0x2135, 0x2138}, {0x3006, 0x3006}, {0x303c, 0x303c}, {0x3041, 0x3096}, + {0x309f, 0x309f}, {0x30a1, 0x30fa}, {0x30ff, 0x30ff}, {0x3105, 0x312c}, + {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, + {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, + {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, + {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, + {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, + {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, + {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, {0xff66, 0xff6f}, {0xff71, 0xff9d}, + {0xffa0, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} }; -static const xmlChLRange xmlLoL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, - {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, - {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, - {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10450, 0x1049d}, - {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, - {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, +static const xmlChLRange xmlLoL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, + {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, + {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, + {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10450, 0x1049d}, + {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, + {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, {0x20000, 0x20000}, {0x2a6d6, 0x2a6d6}, {0x2f800, 0x2fa1d} }; static xmlChRangeGroup xmlLoG = {211,20,xmlLoS,xmlLoL}; -static const xmlChSRange xmlLtS[] = {{0x1c5, 0x1c5}, {0x1c8, 0x1c8}, - {0x1cb, 0x1cb}, {0x1f2, 0x1f2}, {0x1f88, 0x1f8f}, {0x1f98, 0x1f9f}, +static const xmlChSRange xmlLtS[] = {{0x1c5, 0x1c5}, {0x1c8, 0x1c8}, + {0x1cb, 0x1cb}, {0x1f2, 0x1f2}, {0x1f88, 0x1f8f}, {0x1f98, 0x1f9f}, {0x1fa8, 0x1faf}, {0x1fbc, 0x1fbc}, {0x1fcc, 0x1fcc}, {0x1ffc, 0x1ffc} }; static xmlChRangeGroup xmlLtG = {10,0,xmlLtS,NULL}; -static const xmlChSRange xmlLuS[] = {{0x41, 0x5a}, {0xc0, 0xd6}, - {0xd8, 0xde}, {0x100, 0x100}, {0x102, 0x102}, {0x104, 0x104}, - {0x106, 0x106}, {0x108, 0x108}, {0x10a, 0x10a}, {0x10c, 0x10c}, - {0x10e, 0x10e}, {0x110, 0x110}, {0x112, 0x112}, {0x114, 0x114}, - {0x116, 0x116}, {0x118, 0x118}, {0x11a, 0x11a}, {0x11c, 0x11c}, - {0x11e, 0x11e}, {0x120, 0x120}, {0x122, 0x122}, {0x124, 0x124}, - {0x126, 0x126}, {0x128, 0x128}, {0x12a, 0x12a}, {0x12c, 0x12c}, - {0x12e, 0x12e}, {0x130, 0x130}, {0x132, 0x132}, {0x134, 0x134}, - {0x136, 0x136}, {0x139, 0x139}, {0x13b, 0x13b}, {0x13d, 0x13d}, - {0x13f, 0x13f}, {0x141, 0x141}, {0x143, 0x143}, {0x145, 0x145}, - {0x147, 0x147}, {0x14a, 0x14a}, {0x14c, 0x14c}, {0x14e, 0x14e}, - {0x150, 0x150}, {0x152, 0x152}, {0x154, 0x154}, {0x156, 0x156}, - {0x158, 0x158}, {0x15a, 0x15a}, {0x15c, 0x15c}, {0x15e, 0x15e}, - {0x160, 0x160}, {0x162, 0x162}, {0x164, 0x164}, {0x166, 0x166}, - {0x168, 0x168}, {0x16a, 0x16a}, {0x16c, 0x16c}, {0x16e, 0x16e}, - {0x170, 0x170}, {0x172, 0x172}, {0x174, 0x174}, {0x176, 0x176}, - {0x178, 0x179}, {0x17b, 0x17b}, {0x17d, 0x17d}, {0x181, 0x182}, - {0x184, 0x184}, {0x186, 0x187}, {0x189, 0x18b}, {0x18e, 0x191}, - {0x193, 0x194}, {0x196, 0x198}, {0x19c, 0x19d}, {0x19f, 0x1a0}, - {0x1a2, 0x1a2}, {0x1a4, 0x1a4}, {0x1a6, 0x1a7}, {0x1a9, 0x1a9}, - {0x1ac, 0x1ac}, {0x1ae, 0x1af}, {0x1b1, 0x1b3}, {0x1b5, 0x1b5}, - {0x1b7, 0x1b8}, {0x1bc, 0x1bc}, {0x1c4, 0x1c4}, {0x1c7, 0x1c7}, - {0x1ca, 0x1ca}, {0x1cd, 0x1cd}, {0x1cf, 0x1cf}, {0x1d1, 0x1d1}, - {0x1d3, 0x1d3}, {0x1d5, 0x1d5}, {0x1d7, 0x1d7}, {0x1d9, 0x1d9}, - {0x1db, 0x1db}, {0x1de, 0x1de}, {0x1e0, 0x1e0}, {0x1e2, 0x1e2}, - {0x1e4, 0x1e4}, {0x1e6, 0x1e6}, {0x1e8, 0x1e8}, {0x1ea, 0x1ea}, - {0x1ec, 0x1ec}, {0x1ee, 0x1ee}, {0x1f1, 0x1f1}, {0x1f4, 0x1f4}, - {0x1f6, 0x1f8}, {0x1fa, 0x1fa}, {0x1fc, 0x1fc}, {0x1fe, 0x1fe}, - {0x200, 0x200}, {0x202, 0x202}, {0x204, 0x204}, {0x206, 0x206}, - {0x208, 0x208}, {0x20a, 0x20a}, {0x20c, 0x20c}, {0x20e, 0x20e}, - {0x210, 0x210}, {0x212, 0x212}, {0x214, 0x214}, {0x216, 0x216}, - {0x218, 0x218}, {0x21a, 0x21a}, {0x21c, 0x21c}, {0x21e, 0x21e}, - {0x220, 0x220}, {0x222, 0x222}, {0x224, 0x224}, {0x226, 0x226}, - {0x228, 0x228}, {0x22a, 0x22a}, {0x22c, 0x22c}, {0x22e, 0x22e}, - {0x230, 0x230}, {0x232, 0x232}, {0x386, 0x386}, {0x388, 0x38a}, - {0x38c, 0x38c}, {0x38e, 0x38f}, {0x391, 0x3a1}, {0x3a3, 0x3ab}, - {0x3d2, 0x3d4}, {0x3d8, 0x3d8}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, - {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3e2}, {0x3e4, 0x3e4}, - {0x3e6, 0x3e6}, {0x3e8, 0x3e8}, {0x3ea, 0x3ea}, {0x3ec, 0x3ec}, - {0x3ee, 0x3ee}, {0x3f4, 0x3f4}, {0x3f7, 0x3f7}, {0x3f9, 0x3fa}, - {0x400, 0x42f}, {0x460, 0x460}, {0x462, 0x462}, {0x464, 0x464}, - {0x466, 0x466}, {0x468, 0x468}, {0x46a, 0x46a}, {0x46c, 0x46c}, - {0x46e, 0x46e}, {0x470, 0x470}, {0x472, 0x472}, {0x474, 0x474}, - {0x476, 0x476}, {0x478, 0x478}, {0x47a, 0x47a}, {0x47c, 0x47c}, - {0x47e, 0x47e}, {0x480, 0x480}, {0x48a, 0x48a}, {0x48c, 0x48c}, - {0x48e, 0x48e}, {0x490, 0x490}, {0x492, 0x492}, {0x494, 0x494}, - {0x496, 0x496}, {0x498, 0x498}, {0x49a, 0x49a}, {0x49c, 0x49c}, - {0x49e, 0x49e}, {0x4a0, 0x4a0}, {0x4a2, 0x4a2}, {0x4a4, 0x4a4}, - {0x4a6, 0x4a6}, {0x4a8, 0x4a8}, {0x4aa, 0x4aa}, {0x4ac, 0x4ac}, - {0x4ae, 0x4ae}, {0x4b0, 0x4b0}, {0x4b2, 0x4b2}, {0x4b4, 0x4b4}, - {0x4b6, 0x4b6}, {0x4b8, 0x4b8}, {0x4ba, 0x4ba}, {0x4bc, 0x4bc}, - {0x4be, 0x4be}, {0x4c0, 0x4c1}, {0x4c3, 0x4c3}, {0x4c5, 0x4c5}, - {0x4c7, 0x4c7}, {0x4c9, 0x4c9}, {0x4cb, 0x4cb}, {0x4cd, 0x4cd}, - {0x4d0, 0x4d0}, {0x4d2, 0x4d2}, {0x4d4, 0x4d4}, {0x4d6, 0x4d6}, - {0x4d8, 0x4d8}, {0x4da, 0x4da}, {0x4dc, 0x4dc}, {0x4de, 0x4de}, - {0x4e0, 0x4e0}, {0x4e2, 0x4e2}, {0x4e4, 0x4e4}, {0x4e6, 0x4e6}, - {0x4e8, 0x4e8}, {0x4ea, 0x4ea}, {0x4ec, 0x4ec}, {0x4ee, 0x4ee}, - {0x4f0, 0x4f0}, {0x4f2, 0x4f2}, {0x4f4, 0x4f4}, {0x4f8, 0x4f8}, - {0x500, 0x500}, {0x502, 0x502}, {0x504, 0x504}, {0x506, 0x506}, - {0x508, 0x508}, {0x50a, 0x50a}, {0x50c, 0x50c}, {0x50e, 0x50e}, - {0x531, 0x556}, {0x10a0, 0x10c5}, {0x1e00, 0x1e00}, {0x1e02, 0x1e02}, - {0x1e04, 0x1e04}, {0x1e06, 0x1e06}, {0x1e08, 0x1e08}, {0x1e0a, 0x1e0a}, - {0x1e0c, 0x1e0c}, {0x1e0e, 0x1e0e}, {0x1e10, 0x1e10}, {0x1e12, 0x1e12}, - {0x1e14, 0x1e14}, {0x1e16, 0x1e16}, {0x1e18, 0x1e18}, {0x1e1a, 0x1e1a}, - {0x1e1c, 0x1e1c}, {0x1e1e, 0x1e1e}, {0x1e20, 0x1e20}, {0x1e22, 0x1e22}, - {0x1e24, 0x1e24}, {0x1e26, 0x1e26}, {0x1e28, 0x1e28}, {0x1e2a, 0x1e2a}, - {0x1e2c, 0x1e2c}, {0x1e2e, 0x1e2e}, {0x1e30, 0x1e30}, {0x1e32, 0x1e32}, - {0x1e34, 0x1e34}, {0x1e36, 0x1e36}, {0x1e38, 0x1e38}, {0x1e3a, 0x1e3a}, - {0x1e3c, 0x1e3c}, {0x1e3e, 0x1e3e}, {0x1e40, 0x1e40}, {0x1e42, 0x1e42}, - {0x1e44, 0x1e44}, {0x1e46, 0x1e46}, {0x1e48, 0x1e48}, {0x1e4a, 0x1e4a}, - {0x1e4c, 0x1e4c}, {0x1e4e, 0x1e4e}, {0x1e50, 0x1e50}, {0x1e52, 0x1e52}, - {0x1e54, 0x1e54}, {0x1e56, 0x1e56}, {0x1e58, 0x1e58}, {0x1e5a, 0x1e5a}, - {0x1e5c, 0x1e5c}, {0x1e5e, 0x1e5e}, {0x1e60, 0x1e60}, {0x1e62, 0x1e62}, - {0x1e64, 0x1e64}, {0x1e66, 0x1e66}, {0x1e68, 0x1e68}, {0x1e6a, 0x1e6a}, - {0x1e6c, 0x1e6c}, {0x1e6e, 0x1e6e}, {0x1e70, 0x1e70}, {0x1e72, 0x1e72}, - {0x1e74, 0x1e74}, {0x1e76, 0x1e76}, {0x1e78, 0x1e78}, {0x1e7a, 0x1e7a}, - {0x1e7c, 0x1e7c}, {0x1e7e, 0x1e7e}, {0x1e80, 0x1e80}, {0x1e82, 0x1e82}, - {0x1e84, 0x1e84}, {0x1e86, 0x1e86}, {0x1e88, 0x1e88}, {0x1e8a, 0x1e8a}, - {0x1e8c, 0x1e8c}, {0x1e8e, 0x1e8e}, {0x1e90, 0x1e90}, {0x1e92, 0x1e92}, - {0x1e94, 0x1e94}, {0x1ea0, 0x1ea0}, {0x1ea2, 0x1ea2}, {0x1ea4, 0x1ea4}, - {0x1ea6, 0x1ea6}, {0x1ea8, 0x1ea8}, {0x1eaa, 0x1eaa}, {0x1eac, 0x1eac}, - {0x1eae, 0x1eae}, {0x1eb0, 0x1eb0}, {0x1eb2, 0x1eb2}, {0x1eb4, 0x1eb4}, - {0x1eb6, 0x1eb6}, {0x1eb8, 0x1eb8}, {0x1eba, 0x1eba}, {0x1ebc, 0x1ebc}, - {0x1ebe, 0x1ebe}, {0x1ec0, 0x1ec0}, {0x1ec2, 0x1ec2}, {0x1ec4, 0x1ec4}, - {0x1ec6, 0x1ec6}, {0x1ec8, 0x1ec8}, {0x1eca, 0x1eca}, {0x1ecc, 0x1ecc}, - {0x1ece, 0x1ece}, {0x1ed0, 0x1ed0}, {0x1ed2, 0x1ed2}, {0x1ed4, 0x1ed4}, - {0x1ed6, 0x1ed6}, {0x1ed8, 0x1ed8}, {0x1eda, 0x1eda}, {0x1edc, 0x1edc}, - {0x1ede, 0x1ede}, {0x1ee0, 0x1ee0}, {0x1ee2, 0x1ee2}, {0x1ee4, 0x1ee4}, - {0x1ee6, 0x1ee6}, {0x1ee8, 0x1ee8}, {0x1eea, 0x1eea}, {0x1eec, 0x1eec}, - {0x1eee, 0x1eee}, {0x1ef0, 0x1ef0}, {0x1ef2, 0x1ef2}, {0x1ef4, 0x1ef4}, - {0x1ef6, 0x1ef6}, {0x1ef8, 0x1ef8}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, - {0x1f28, 0x1f2f}, {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f59, 0x1f59}, - {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f5f}, {0x1f68, 0x1f6f}, - {0x1fb8, 0x1fbb}, {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, - {0x1ff8, 0x1ffb}, {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210b, 0x210d}, - {0x2110, 0x2112}, {0x2115, 0x2115}, {0x2119, 0x211d}, {0x2124, 0x2124}, - {0x2126, 0x2126}, {0x2128, 0x2128}, {0x212a, 0x212d}, {0x2130, 0x2131}, +static const xmlChSRange xmlLuS[] = {{0x41, 0x5a}, {0xc0, 0xd6}, + {0xd8, 0xde}, {0x100, 0x100}, {0x102, 0x102}, {0x104, 0x104}, + {0x106, 0x106}, {0x108, 0x108}, {0x10a, 0x10a}, {0x10c, 0x10c}, + {0x10e, 0x10e}, {0x110, 0x110}, {0x112, 0x112}, {0x114, 0x114}, + {0x116, 0x116}, {0x118, 0x118}, {0x11a, 0x11a}, {0x11c, 0x11c}, + {0x11e, 0x11e}, {0x120, 0x120}, {0x122, 0x122}, {0x124, 0x124}, + {0x126, 0x126}, {0x128, 0x128}, {0x12a, 0x12a}, {0x12c, 0x12c}, + {0x12e, 0x12e}, {0x130, 0x130}, {0x132, 0x132}, {0x134, 0x134}, + {0x136, 0x136}, {0x139, 0x139}, {0x13b, 0x13b}, {0x13d, 0x13d}, + {0x13f, 0x13f}, {0x141, 0x141}, {0x143, 0x143}, {0x145, 0x145}, + {0x147, 0x147}, {0x14a, 0x14a}, {0x14c, 0x14c}, {0x14e, 0x14e}, + {0x150, 0x150}, {0x152, 0x152}, {0x154, 0x154}, {0x156, 0x156}, + {0x158, 0x158}, {0x15a, 0x15a}, {0x15c, 0x15c}, {0x15e, 0x15e}, + {0x160, 0x160}, {0x162, 0x162}, {0x164, 0x164}, {0x166, 0x166}, + {0x168, 0x168}, {0x16a, 0x16a}, {0x16c, 0x16c}, {0x16e, 0x16e}, + {0x170, 0x170}, {0x172, 0x172}, {0x174, 0x174}, {0x176, 0x176}, + {0x178, 0x179}, {0x17b, 0x17b}, {0x17d, 0x17d}, {0x181, 0x182}, + {0x184, 0x184}, {0x186, 0x187}, {0x189, 0x18b}, {0x18e, 0x191}, + {0x193, 0x194}, {0x196, 0x198}, {0x19c, 0x19d}, {0x19f, 0x1a0}, + {0x1a2, 0x1a2}, {0x1a4, 0x1a4}, {0x1a6, 0x1a7}, {0x1a9, 0x1a9}, + {0x1ac, 0x1ac}, {0x1ae, 0x1af}, {0x1b1, 0x1b3}, {0x1b5, 0x1b5}, + {0x1b7, 0x1b8}, {0x1bc, 0x1bc}, {0x1c4, 0x1c4}, {0x1c7, 0x1c7}, + {0x1ca, 0x1ca}, {0x1cd, 0x1cd}, {0x1cf, 0x1cf}, {0x1d1, 0x1d1}, + {0x1d3, 0x1d3}, {0x1d5, 0x1d5}, {0x1d7, 0x1d7}, {0x1d9, 0x1d9}, + {0x1db, 0x1db}, {0x1de, 0x1de}, {0x1e0, 0x1e0}, {0x1e2, 0x1e2}, + {0x1e4, 0x1e4}, {0x1e6, 0x1e6}, {0x1e8, 0x1e8}, {0x1ea, 0x1ea}, + {0x1ec, 0x1ec}, {0x1ee, 0x1ee}, {0x1f1, 0x1f1}, {0x1f4, 0x1f4}, + {0x1f6, 0x1f8}, {0x1fa, 0x1fa}, {0x1fc, 0x1fc}, {0x1fe, 0x1fe}, + {0x200, 0x200}, {0x202, 0x202}, {0x204, 0x204}, {0x206, 0x206}, + {0x208, 0x208}, {0x20a, 0x20a}, {0x20c, 0x20c}, {0x20e, 0x20e}, + {0x210, 0x210}, {0x212, 0x212}, {0x214, 0x214}, {0x216, 0x216}, + {0x218, 0x218}, {0x21a, 0x21a}, {0x21c, 0x21c}, {0x21e, 0x21e}, + {0x220, 0x220}, {0x222, 0x222}, {0x224, 0x224}, {0x226, 0x226}, + {0x228, 0x228}, {0x22a, 0x22a}, {0x22c, 0x22c}, {0x22e, 0x22e}, + {0x230, 0x230}, {0x232, 0x232}, {0x386, 0x386}, {0x388, 0x38a}, + {0x38c, 0x38c}, {0x38e, 0x38f}, {0x391, 0x3a1}, {0x3a3, 0x3ab}, + {0x3d2, 0x3d4}, {0x3d8, 0x3d8}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, + {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3e2}, {0x3e4, 0x3e4}, + {0x3e6, 0x3e6}, {0x3e8, 0x3e8}, {0x3ea, 0x3ea}, {0x3ec, 0x3ec}, + {0x3ee, 0x3ee}, {0x3f4, 0x3f4}, {0x3f7, 0x3f7}, {0x3f9, 0x3fa}, + {0x400, 0x42f}, {0x460, 0x460}, {0x462, 0x462}, {0x464, 0x464}, + {0x466, 0x466}, {0x468, 0x468}, {0x46a, 0x46a}, {0x46c, 0x46c}, + {0x46e, 0x46e}, {0x470, 0x470}, {0x472, 0x472}, {0x474, 0x474}, + {0x476, 0x476}, {0x478, 0x478}, {0x47a, 0x47a}, {0x47c, 0x47c}, + {0x47e, 0x47e}, {0x480, 0x480}, {0x48a, 0x48a}, {0x48c, 0x48c}, + {0x48e, 0x48e}, {0x490, 0x490}, {0x492, 0x492}, {0x494, 0x494}, + {0x496, 0x496}, {0x498, 0x498}, {0x49a, 0x49a}, {0x49c, 0x49c}, + {0x49e, 0x49e}, {0x4a0, 0x4a0}, {0x4a2, 0x4a2}, {0x4a4, 0x4a4}, + {0x4a6, 0x4a6}, {0x4a8, 0x4a8}, {0x4aa, 0x4aa}, {0x4ac, 0x4ac}, + {0x4ae, 0x4ae}, {0x4b0, 0x4b0}, {0x4b2, 0x4b2}, {0x4b4, 0x4b4}, + {0x4b6, 0x4b6}, {0x4b8, 0x4b8}, {0x4ba, 0x4ba}, {0x4bc, 0x4bc}, + {0x4be, 0x4be}, {0x4c0, 0x4c1}, {0x4c3, 0x4c3}, {0x4c5, 0x4c5}, + {0x4c7, 0x4c7}, {0x4c9, 0x4c9}, {0x4cb, 0x4cb}, {0x4cd, 0x4cd}, + {0x4d0, 0x4d0}, {0x4d2, 0x4d2}, {0x4d4, 0x4d4}, {0x4d6, 0x4d6}, + {0x4d8, 0x4d8}, {0x4da, 0x4da}, {0x4dc, 0x4dc}, {0x4de, 0x4de}, + {0x4e0, 0x4e0}, {0x4e2, 0x4e2}, {0x4e4, 0x4e4}, {0x4e6, 0x4e6}, + {0x4e8, 0x4e8}, {0x4ea, 0x4ea}, {0x4ec, 0x4ec}, {0x4ee, 0x4ee}, + {0x4f0, 0x4f0}, {0x4f2, 0x4f2}, {0x4f4, 0x4f4}, {0x4f8, 0x4f8}, + {0x500, 0x500}, {0x502, 0x502}, {0x504, 0x504}, {0x506, 0x506}, + {0x508, 0x508}, {0x50a, 0x50a}, {0x50c, 0x50c}, {0x50e, 0x50e}, + {0x531, 0x556}, {0x10a0, 0x10c5}, {0x1e00, 0x1e00}, {0x1e02, 0x1e02}, + {0x1e04, 0x1e04}, {0x1e06, 0x1e06}, {0x1e08, 0x1e08}, {0x1e0a, 0x1e0a}, + {0x1e0c, 0x1e0c}, {0x1e0e, 0x1e0e}, {0x1e10, 0x1e10}, {0x1e12, 0x1e12}, + {0x1e14, 0x1e14}, {0x1e16, 0x1e16}, {0x1e18, 0x1e18}, {0x1e1a, 0x1e1a}, + {0x1e1c, 0x1e1c}, {0x1e1e, 0x1e1e}, {0x1e20, 0x1e20}, {0x1e22, 0x1e22}, + {0x1e24, 0x1e24}, {0x1e26, 0x1e26}, {0x1e28, 0x1e28}, {0x1e2a, 0x1e2a}, + {0x1e2c, 0x1e2c}, {0x1e2e, 0x1e2e}, {0x1e30, 0x1e30}, {0x1e32, 0x1e32}, + {0x1e34, 0x1e34}, {0x1e36, 0x1e36}, {0x1e38, 0x1e38}, {0x1e3a, 0x1e3a}, + {0x1e3c, 0x1e3c}, {0x1e3e, 0x1e3e}, {0x1e40, 0x1e40}, {0x1e42, 0x1e42}, + {0x1e44, 0x1e44}, {0x1e46, 0x1e46}, {0x1e48, 0x1e48}, {0x1e4a, 0x1e4a}, + {0x1e4c, 0x1e4c}, {0x1e4e, 0x1e4e}, {0x1e50, 0x1e50}, {0x1e52, 0x1e52}, + {0x1e54, 0x1e54}, {0x1e56, 0x1e56}, {0x1e58, 0x1e58}, {0x1e5a, 0x1e5a}, + {0x1e5c, 0x1e5c}, {0x1e5e, 0x1e5e}, {0x1e60, 0x1e60}, {0x1e62, 0x1e62}, + {0x1e64, 0x1e64}, {0x1e66, 0x1e66}, {0x1e68, 0x1e68}, {0x1e6a, 0x1e6a}, + {0x1e6c, 0x1e6c}, {0x1e6e, 0x1e6e}, {0x1e70, 0x1e70}, {0x1e72, 0x1e72}, + {0x1e74, 0x1e74}, {0x1e76, 0x1e76}, {0x1e78, 0x1e78}, {0x1e7a, 0x1e7a}, + {0x1e7c, 0x1e7c}, {0x1e7e, 0x1e7e}, {0x1e80, 0x1e80}, {0x1e82, 0x1e82}, + {0x1e84, 0x1e84}, {0x1e86, 0x1e86}, {0x1e88, 0x1e88}, {0x1e8a, 0x1e8a}, + {0x1e8c, 0x1e8c}, {0x1e8e, 0x1e8e}, {0x1e90, 0x1e90}, {0x1e92, 0x1e92}, + {0x1e94, 0x1e94}, {0x1ea0, 0x1ea0}, {0x1ea2, 0x1ea2}, {0x1ea4, 0x1ea4}, + {0x1ea6, 0x1ea6}, {0x1ea8, 0x1ea8}, {0x1eaa, 0x1eaa}, {0x1eac, 0x1eac}, + {0x1eae, 0x1eae}, {0x1eb0, 0x1eb0}, {0x1eb2, 0x1eb2}, {0x1eb4, 0x1eb4}, + {0x1eb6, 0x1eb6}, {0x1eb8, 0x1eb8}, {0x1eba, 0x1eba}, {0x1ebc, 0x1ebc}, + {0x1ebe, 0x1ebe}, {0x1ec0, 0x1ec0}, {0x1ec2, 0x1ec2}, {0x1ec4, 0x1ec4}, + {0x1ec6, 0x1ec6}, {0x1ec8, 0x1ec8}, {0x1eca, 0x1eca}, {0x1ecc, 0x1ecc}, + {0x1ece, 0x1ece}, {0x1ed0, 0x1ed0}, {0x1ed2, 0x1ed2}, {0x1ed4, 0x1ed4}, + {0x1ed6, 0x1ed6}, {0x1ed8, 0x1ed8}, {0x1eda, 0x1eda}, {0x1edc, 0x1edc}, + {0x1ede, 0x1ede}, {0x1ee0, 0x1ee0}, {0x1ee2, 0x1ee2}, {0x1ee4, 0x1ee4}, + {0x1ee6, 0x1ee6}, {0x1ee8, 0x1ee8}, {0x1eea, 0x1eea}, {0x1eec, 0x1eec}, + {0x1eee, 0x1eee}, {0x1ef0, 0x1ef0}, {0x1ef2, 0x1ef2}, {0x1ef4, 0x1ef4}, + {0x1ef6, 0x1ef6}, {0x1ef8, 0x1ef8}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, + {0x1f28, 0x1f2f}, {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f59, 0x1f59}, + {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f5f}, {0x1f68, 0x1f6f}, + {0x1fb8, 0x1fbb}, {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, + {0x1ff8, 0x1ffb}, {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210b, 0x210d}, + {0x2110, 0x2112}, {0x2115, 0x2115}, {0x2119, 0x211d}, {0x2124, 0x2124}, + {0x2126, 0x2126}, {0x2128, 0x2128}, {0x212a, 0x212d}, {0x2130, 0x2131}, {0x2133, 0x2133}, {0x213e, 0x213f}, {0x2145, 0x2145}, {0xff21, 0xff3a} }; -static const xmlChLRange xmlLuL[] = {{0x10400, 0x10427}, {0x1d400, 0x1d419}, - {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d49c, 0x1d49c}, - {0x1d49e, 0x1d49f}, {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, - {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9}, - {0x1d504, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d538, 0x1d539}, {0x1d53b, 0x1d53e}, - {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, - {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, - {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, {0x1d670, 0x1d689}, - {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, +static const xmlChLRange xmlLuL[] = {{0x10400, 0x10427}, {0x1d400, 0x1d419}, + {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d49c, 0x1d49c}, + {0x1d49e, 0x1d49f}, {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, + {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9}, + {0x1d504, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, + {0x1d516, 0x1d51c}, {0x1d538, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, + {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, + {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, {0x1d670, 0x1d689}, + {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, {0x1d756, 0x1d76e}, {0x1d790, 0x1d7a8} }; static xmlChRangeGroup xmlLuG = {390,31,xmlLuS,xmlLuL}; -static const xmlChSRange xmlMS[] = {{0x300, 0x357}, {0x35d, 0x36f}, - {0x483, 0x486}, {0x488, 0x489}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, - {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, - {0x610, 0x615}, {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, - {0x6de, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, - {0x730, 0x74a}, {0x7a6, 0x7b0}, {0x901, 0x903}, {0x93c, 0x93c}, - {0x93e, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x983}, - {0x9bc, 0x9bc}, {0x9be, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, - {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa01, 0xa03}, {0xa3c, 0xa3c}, - {0xa3e, 0xa42}, {0xa47, 0xa48}, {0xa4b, 0xa4d}, {0xa70, 0xa71}, - {0xa81, 0xa83}, {0xabc, 0xabc}, {0xabe, 0xac5}, {0xac7, 0xac9}, - {0xacb, 0xacd}, {0xae2, 0xae3}, {0xb01, 0xb03}, {0xb3c, 0xb3c}, - {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, {0xb56, 0xb57}, - {0xb82, 0xb82}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd}, - {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, {0xc46, 0xc48}, - {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, {0xcbc, 0xcbc}, - {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, - {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, - {0xd57, 0xd57}, {0xd82, 0xd83}, {0xdca, 0xdca}, {0xdcf, 0xdd4}, - {0xdd6, 0xdd6}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, {0xe31, 0xe31}, - {0xe34, 0xe3a}, {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, - {0xebb, 0xebc}, {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, - {0xf37, 0xf37}, {0xf39, 0xf39}, {0xf3e, 0xf3f}, {0xf71, 0xf84}, - {0xf86, 0xf87}, {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, - {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1056, 0x1059}, {0x1712, 0x1714}, - {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, {0x17b6, 0x17d3}, - {0x17dd, 0x17dd}, {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x192b}, - {0x1930, 0x193b}, {0x20d0, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, +static const xmlChSRange xmlMS[] = {{0x300, 0x357}, {0x35d, 0x36f}, + {0x483, 0x486}, {0x488, 0x489}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, + {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, + {0x610, 0x615}, {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, + {0x6de, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, + {0x730, 0x74a}, {0x7a6, 0x7b0}, {0x901, 0x903}, {0x93c, 0x93c}, + {0x93e, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x983}, + {0x9bc, 0x9bc}, {0x9be, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, + {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa01, 0xa03}, {0xa3c, 0xa3c}, + {0xa3e, 0xa42}, {0xa47, 0xa48}, {0xa4b, 0xa4d}, {0xa70, 0xa71}, + {0xa81, 0xa83}, {0xabc, 0xabc}, {0xabe, 0xac5}, {0xac7, 0xac9}, + {0xacb, 0xacd}, {0xae2, 0xae3}, {0xb01, 0xb03}, {0xb3c, 0xb3c}, + {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, {0xb56, 0xb57}, + {0xb82, 0xb82}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd}, + {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, {0xc46, 0xc48}, + {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, {0xcbc, 0xcbc}, + {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, + {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, + {0xd57, 0xd57}, {0xd82, 0xd83}, {0xdca, 0xdca}, {0xdcf, 0xdd4}, + {0xdd6, 0xdd6}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, {0xe31, 0xe31}, + {0xe34, 0xe3a}, {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, + {0xebb, 0xebc}, {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, + {0xf37, 0xf37}, {0xf39, 0xf39}, {0xf3e, 0xf3f}, {0xf71, 0xf84}, + {0xf86, 0xf87}, {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, + {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1056, 0x1059}, {0x1712, 0x1714}, + {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, {0x17b6, 0x17d3}, + {0x17dd, 0x17dd}, {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x192b}, + {0x1930, 0x193b}, {0x20d0, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f}, {0xfe20, 0xfe23} }; -static const xmlChLRange xmlML[] = {{0x1d165, 0x1d169}, {0x1d16d, 0x1d172}, - {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, +static const xmlChLRange xmlML[] = {{0x1d165, 0x1d169}, {0x1d16d, 0x1d172}, + {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, {0xe0100, 0xe01ef} }; static xmlChRangeGroup xmlMG = {113,6,xmlMS,xmlML}; -static const xmlChSRange xmlMcS[] = {{0x903, 0x903}, {0x93e, 0x940}, - {0x949, 0x94c}, {0x982, 0x983}, {0x9be, 0x9c0}, {0x9c7, 0x9c8}, - {0x9cb, 0x9cc}, {0x9d7, 0x9d7}, {0xa03, 0xa03}, {0xa3e, 0xa40}, - {0xa83, 0xa83}, {0xabe, 0xac0}, {0xac9, 0xac9}, {0xacb, 0xacc}, - {0xb02, 0xb03}, {0xb3e, 0xb3e}, {0xb40, 0xb40}, {0xb47, 0xb48}, - {0xb4b, 0xb4c}, {0xb57, 0xb57}, {0xbbe, 0xbbf}, {0xbc1, 0xbc2}, - {0xbc6, 0xbc8}, {0xbca, 0xbcc}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, - {0xc41, 0xc44}, {0xc82, 0xc83}, {0xcbe, 0xcbe}, {0xcc0, 0xcc4}, - {0xcc7, 0xcc8}, {0xcca, 0xccb}, {0xcd5, 0xcd6}, {0xd02, 0xd03}, - {0xd3e, 0xd40}, {0xd46, 0xd48}, {0xd4a, 0xd4c}, {0xd57, 0xd57}, - {0xd82, 0xd83}, {0xdcf, 0xdd1}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, - {0xf3e, 0xf3f}, {0xf7f, 0xf7f}, {0x102c, 0x102c}, {0x1031, 0x1031}, - {0x1038, 0x1038}, {0x1056, 0x1057}, {0x17b6, 0x17b6}, {0x17be, 0x17c5}, - {0x17c7, 0x17c8}, {0x1923, 0x1926}, {0x1929, 0x192b}, {0x1930, 0x1931}, +static const xmlChSRange xmlMcS[] = {{0x903, 0x903}, {0x93e, 0x940}, + {0x949, 0x94c}, {0x982, 0x983}, {0x9be, 0x9c0}, {0x9c7, 0x9c8}, + {0x9cb, 0x9cc}, {0x9d7, 0x9d7}, {0xa03, 0xa03}, {0xa3e, 0xa40}, + {0xa83, 0xa83}, {0xabe, 0xac0}, {0xac9, 0xac9}, {0xacb, 0xacc}, + {0xb02, 0xb03}, {0xb3e, 0xb3e}, {0xb40, 0xb40}, {0xb47, 0xb48}, + {0xb4b, 0xb4c}, {0xb57, 0xb57}, {0xbbe, 0xbbf}, {0xbc1, 0xbc2}, + {0xbc6, 0xbc8}, {0xbca, 0xbcc}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, + {0xc41, 0xc44}, {0xc82, 0xc83}, {0xcbe, 0xcbe}, {0xcc0, 0xcc4}, + {0xcc7, 0xcc8}, {0xcca, 0xccb}, {0xcd5, 0xcd6}, {0xd02, 0xd03}, + {0xd3e, 0xd40}, {0xd46, 0xd48}, {0xd4a, 0xd4c}, {0xd57, 0xd57}, + {0xd82, 0xd83}, {0xdcf, 0xdd1}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, + {0xf3e, 0xf3f}, {0xf7f, 0xf7f}, {0x102c, 0x102c}, {0x1031, 0x1031}, + {0x1038, 0x1038}, {0x1056, 0x1057}, {0x17b6, 0x17b6}, {0x17be, 0x17c5}, + {0x17c7, 0x17c8}, {0x1923, 0x1926}, {0x1929, 0x192b}, {0x1930, 0x1931}, {0x1933, 0x1938} }; static const xmlChLRange xmlMcL[] = {{0x1d165, 0x1d166}, {0x1d16d, 0x1d172} }; static xmlChRangeGroup xmlMcG = {55,2,xmlMcS,xmlMcL}; -static const xmlChSRange xmlMnS[] = {{0x300, 0x357}, {0x35d, 0x36f}, - {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, {0x5bb, 0x5bd}, - {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, {0x610, 0x615}, - {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6df, 0x6e4}, - {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, {0x730, 0x74a}, - {0x7a6, 0x7b0}, {0x901, 0x902}, {0x93c, 0x93c}, {0x941, 0x948}, - {0x94d, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x981}, - {0x9bc, 0x9bc}, {0x9c1, 0x9c4}, {0x9cd, 0x9cd}, {0x9e2, 0x9e3}, - {0xa01, 0xa02}, {0xa3c, 0xa3c}, {0xa41, 0xa42}, {0xa47, 0xa48}, - {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa82}, {0xabc, 0xabc}, - {0xac1, 0xac5}, {0xac7, 0xac8}, {0xacd, 0xacd}, {0xae2, 0xae3}, - {0xb01, 0xb01}, {0xb3c, 0xb3c}, {0xb3f, 0xb3f}, {0xb41, 0xb43}, - {0xb4d, 0xb4d}, {0xb56, 0xb56}, {0xb82, 0xb82}, {0xbc0, 0xbc0}, - {0xbcd, 0xbcd}, {0xc3e, 0xc40}, {0xc46, 0xc48}, {0xc4a, 0xc4d}, - {0xc55, 0xc56}, {0xcbc, 0xcbc}, {0xcbf, 0xcbf}, {0xcc6, 0xcc6}, - {0xccc, 0xccd}, {0xd41, 0xd43}, {0xd4d, 0xd4d}, {0xdca, 0xdca}, - {0xdd2, 0xdd4}, {0xdd6, 0xdd6}, {0xe31, 0xe31}, {0xe34, 0xe3a}, - {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, - {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, - {0xf39, 0xf39}, {0xf71, 0xf7e}, {0xf80, 0xf84}, {0xf86, 0xf87}, - {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, {0x102d, 0x1030}, - {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039}, {0x1058, 0x1059}, - {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, - {0x17b7, 0x17bd}, {0x17c6, 0x17c6}, {0x17c9, 0x17d3}, {0x17dd, 0x17dd}, - {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x1922}, {0x1927, 0x1928}, - {0x1932, 0x1932}, {0x1939, 0x193b}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, - {0x20e5, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, +static const xmlChSRange xmlMnS[] = {{0x300, 0x357}, {0x35d, 0x36f}, + {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, {0x5bb, 0x5bd}, + {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, {0x610, 0x615}, + {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6df, 0x6e4}, + {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, {0x730, 0x74a}, + {0x7a6, 0x7b0}, {0x901, 0x902}, {0x93c, 0x93c}, {0x941, 0x948}, + {0x94d, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x981}, + {0x9bc, 0x9bc}, {0x9c1, 0x9c4}, {0x9cd, 0x9cd}, {0x9e2, 0x9e3}, + {0xa01, 0xa02}, {0xa3c, 0xa3c}, {0xa41, 0xa42}, {0xa47, 0xa48}, + {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa82}, {0xabc, 0xabc}, + {0xac1, 0xac5}, {0xac7, 0xac8}, {0xacd, 0xacd}, {0xae2, 0xae3}, + {0xb01, 0xb01}, {0xb3c, 0xb3c}, {0xb3f, 0xb3f}, {0xb41, 0xb43}, + {0xb4d, 0xb4d}, {0xb56, 0xb56}, {0xb82, 0xb82}, {0xbc0, 0xbc0}, + {0xbcd, 0xbcd}, {0xc3e, 0xc40}, {0xc46, 0xc48}, {0xc4a, 0xc4d}, + {0xc55, 0xc56}, {0xcbc, 0xcbc}, {0xcbf, 0xcbf}, {0xcc6, 0xcc6}, + {0xccc, 0xccd}, {0xd41, 0xd43}, {0xd4d, 0xd4d}, {0xdca, 0xdca}, + {0xdd2, 0xdd4}, {0xdd6, 0xdd6}, {0xe31, 0xe31}, {0xe34, 0xe3a}, + {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, + {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, + {0xf39, 0xf39}, {0xf71, 0xf7e}, {0xf80, 0xf84}, {0xf86, 0xf87}, + {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, {0x102d, 0x1030}, + {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039}, {0x1058, 0x1059}, + {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, + {0x17b7, 0x17bd}, {0x17c6, 0x17c6}, {0x17c9, 0x17d3}, {0x17dd, 0x17dd}, + {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x1922}, {0x1927, 0x1928}, + {0x1932, 0x1932}, {0x1939, 0x193b}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, + {0x20e5, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f}, {0xfe20, 0xfe23} }; -static const xmlChLRange xmlMnL[] = {{0x1d167, 0x1d169}, {0x1d17b, 0x1d182}, +static const xmlChLRange xmlMnL[] = {{0x1d167, 0x1d169}, {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, {0xe0100, 0xe01ef} }; static xmlChRangeGroup xmlMnG = {108,5,xmlMnS,xmlMnL}; -static const xmlChSRange xmlNS[] = {{0x30, 0x39}, {0xb2, 0xb3}, - {0xb9, 0xb9}, {0xbc, 0xbe}, {0x660, 0x669}, {0x6f0, 0x6f9}, - {0x966, 0x96f}, {0x9e6, 0x9ef}, {0x9f4, 0x9f9}, {0xa66, 0xa6f}, - {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbf2}, {0xc66, 0xc6f}, - {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, - {0xf20, 0xf33}, {0x1040, 0x1049}, {0x1369, 0x137c}, {0x16ee, 0x16f0}, - {0x17e0, 0x17e9}, {0x17f0, 0x17f9}, {0x1810, 0x1819}, {0x1946, 0x194f}, - {0x2070, 0x2070}, {0x2074, 0x2079}, {0x2080, 0x2089}, {0x2153, 0x2183}, - {0x2460, 0x249b}, {0x24ea, 0x24ff}, {0x2776, 0x2793}, {0x3007, 0x3007}, - {0x3021, 0x3029}, {0x3038, 0x303a}, {0x3192, 0x3195}, {0x3220, 0x3229}, +static const xmlChSRange xmlNS[] = {{0x30, 0x39}, {0xb2, 0xb3}, + {0xb9, 0xb9}, {0xbc, 0xbe}, {0x660, 0x669}, {0x6f0, 0x6f9}, + {0x966, 0x96f}, {0x9e6, 0x9ef}, {0x9f4, 0x9f9}, {0xa66, 0xa6f}, + {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbf2}, {0xc66, 0xc6f}, + {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, + {0xf20, 0xf33}, {0x1040, 0x1049}, {0x1369, 0x137c}, {0x16ee, 0x16f0}, + {0x17e0, 0x17e9}, {0x17f0, 0x17f9}, {0x1810, 0x1819}, {0x1946, 0x194f}, + {0x2070, 0x2070}, {0x2074, 0x2079}, {0x2080, 0x2089}, {0x2153, 0x2183}, + {0x2460, 0x249b}, {0x24ea, 0x24ff}, {0x2776, 0x2793}, {0x3007, 0x3007}, + {0x3021, 0x3029}, {0x3038, 0x303a}, {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, {0x3280, 0x3289}, {0x32b1, 0x32bf}, {0xff10, 0xff19} }; -static const xmlChLRange xmlNL[] = {{0x10107, 0x10133}, {0x10320, 0x10323}, +static const xmlChLRange xmlNL[] = {{0x10107, 0x10133}, {0x10320, 0x10323}, {0x1034a, 0x1034a}, {0x104a0, 0x104a9}, {0x1d7ce, 0x1d7ff} }; static xmlChRangeGroup xmlNG = {42,5,xmlNS,xmlNL}; -static const xmlChSRange xmlNdS[] = {{0x30, 0x39}, {0x660, 0x669}, - {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, - {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, - {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, - {0xf20, 0xf29}, {0x1040, 0x1049}, {0x1369, 0x1371}, {0x17e0, 0x17e9}, +static const xmlChSRange xmlNdS[] = {{0x30, 0x39}, {0x660, 0x669}, + {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, + {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, + {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, + {0xf20, 0xf29}, {0x1040, 0x1049}, {0x1369, 0x1371}, {0x17e0, 0x17e9}, {0x1810, 0x1819}, {0x1946, 0x194f}, {0xff10, 0xff19} }; static const xmlChLRange xmlNdL[] = {{0x104a0, 0x104a9}, {0x1d7ce, 0x1d7ff} }; static xmlChRangeGroup xmlNdG = {21,2,xmlNdS,xmlNdL}; -static const xmlChSRange xmlNoS[] = {{0xb2, 0xb3}, {0xb9, 0xb9}, - {0xbc, 0xbe}, {0x9f4, 0x9f9}, {0xbf0, 0xbf2}, {0xf2a, 0xf33}, - {0x1372, 0x137c}, {0x17f0, 0x17f9}, {0x2070, 0x2070}, {0x2074, 0x2079}, - {0x2080, 0x2089}, {0x2153, 0x215f}, {0x2460, 0x249b}, {0x24ea, 0x24ff}, - {0x2776, 0x2793}, {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, +static const xmlChSRange xmlNoS[] = {{0xb2, 0xb3}, {0xb9, 0xb9}, + {0xbc, 0xbe}, {0x9f4, 0x9f9}, {0xbf0, 0xbf2}, {0xf2a, 0xf33}, + {0x1372, 0x137c}, {0x17f0, 0x17f9}, {0x2070, 0x2070}, {0x2074, 0x2079}, + {0x2080, 0x2089}, {0x2153, 0x215f}, {0x2460, 0x249b}, {0x24ea, 0x24ff}, + {0x2776, 0x2793}, {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, {0x3280, 0x3289}, {0x32b1, 0x32bf} }; static const xmlChLRange xmlNoL[] = {{0x10107, 0x10133}, {0x10320, 0x10323} }; static xmlChRangeGroup xmlNoG = {20,2,xmlNoS,xmlNoL}; -static const xmlChSRange xmlPS[] = {{0x21, 0x23}, {0x25, 0x2a}, - {0x2c, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, {0x5b, 0x5d}, {0x5f, 0x5f}, - {0x7b, 0x7b}, {0x7d, 0x7d}, {0xa1, 0xa1}, {0xab, 0xab}, {0xb7, 0xb7}, - {0xbb, 0xbb}, {0xbf, 0xbf}, {0x37e, 0x37e}, {0x387, 0x387}, - {0x55a, 0x55f}, {0x589, 0x58a}, {0x5be, 0x5be}, {0x5c0, 0x5c0}, - {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, {0x61b, 0x61b}, - {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, {0x700, 0x70d}, - {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, {0xe4f, 0xe4f}, - {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf3a, 0xf3d}, {0xf85, 0xf85}, - {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, - {0x169b, 0x169c}, {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, - {0x17d8, 0x17da}, {0x1800, 0x180a}, {0x1944, 0x1945}, {0x2010, 0x2027}, - {0x2030, 0x2043}, {0x2045, 0x2051}, {0x2053, 0x2054}, {0x2057, 0x2057}, - {0x207d, 0x207e}, {0x208d, 0x208e}, {0x2329, 0x232a}, {0x23b4, 0x23b6}, - {0x2768, 0x2775}, {0x27e6, 0x27eb}, {0x2983, 0x2998}, {0x29d8, 0x29db}, - {0x29fc, 0x29fd}, {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, - {0x3030, 0x3030}, {0x303d, 0x303d}, {0x30a0, 0x30a0}, {0x30fb, 0x30fb}, - {0xfd3e, 0xfd3f}, {0xfe30, 0xfe52}, {0xfe54, 0xfe61}, {0xfe63, 0xfe63}, - {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff0a}, - {0xff0c, 0xff0f}, {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3b, 0xff3d}, +static const xmlChSRange xmlPS[] = {{0x21, 0x23}, {0x25, 0x2a}, + {0x2c, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, {0x5b, 0x5d}, {0x5f, 0x5f}, + {0x7b, 0x7b}, {0x7d, 0x7d}, {0xa1, 0xa1}, {0xab, 0xab}, {0xb7, 0xb7}, + {0xbb, 0xbb}, {0xbf, 0xbf}, {0x37e, 0x37e}, {0x387, 0x387}, + {0x55a, 0x55f}, {0x589, 0x58a}, {0x5be, 0x5be}, {0x5c0, 0x5c0}, + {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, {0x61b, 0x61b}, + {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, {0x700, 0x70d}, + {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, {0xe4f, 0xe4f}, + {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf3a, 0xf3d}, {0xf85, 0xf85}, + {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, + {0x169b, 0x169c}, {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, + {0x17d8, 0x17da}, {0x1800, 0x180a}, {0x1944, 0x1945}, {0x2010, 0x2027}, + {0x2030, 0x2043}, {0x2045, 0x2051}, {0x2053, 0x2054}, {0x2057, 0x2057}, + {0x207d, 0x207e}, {0x208d, 0x208e}, {0x2329, 0x232a}, {0x23b4, 0x23b6}, + {0x2768, 0x2775}, {0x27e6, 0x27eb}, {0x2983, 0x2998}, {0x29d8, 0x29db}, + {0x29fc, 0x29fd}, {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, + {0x3030, 0x3030}, {0x303d, 0x303d}, {0x30a0, 0x30a0}, {0x30fb, 0x30fb}, + {0xfd3e, 0xfd3f}, {0xfe30, 0xfe52}, {0xfe54, 0xfe61}, {0xfe63, 0xfe63}, + {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff0a}, + {0xff0c, 0xff0f}, {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3b, 0xff3d}, {0xff3f, 0xff3f}, {0xff5b, 0xff5b}, {0xff5d, 0xff5d}, {0xff5f, 0xff65} }; static const xmlChLRange xmlPL[] = {{0x10100, 0x10101}, {0x1039f, 0x1039f} }; static xmlChRangeGroup xmlPG = {84,2,xmlPS,xmlPL}; -static const xmlChSRange xmlPdS[] = {{0x2d, 0x2d}, {0x58a, 0x58a}, - {0x1806, 0x1806}, {0x2010, 0x2015}, {0x301c, 0x301c}, {0x3030, 0x3030}, - {0x30a0, 0x30a0}, {0xfe31, 0xfe32}, {0xfe58, 0xfe58}, {0xfe63, 0xfe63}, +static const xmlChSRange xmlPdS[] = {{0x2d, 0x2d}, {0x58a, 0x58a}, + {0x1806, 0x1806}, {0x2010, 0x2015}, {0x301c, 0x301c}, {0x3030, 0x3030}, + {0x30a0, 0x30a0}, {0xfe31, 0xfe32}, {0xfe58, 0xfe58}, {0xfe63, 0xfe63}, {0xff0d, 0xff0d} }; static xmlChRangeGroup xmlPdG = {11,0,xmlPdS,NULL}; -static const xmlChSRange xmlPeS[] = {{0x29, 0x29}, {0x5d, 0x5d}, - {0x7d, 0x7d}, {0xf3b, 0xf3b}, {0xf3d, 0xf3d}, {0x169c, 0x169c}, - {0x2046, 0x2046}, {0x207e, 0x207e}, {0x208e, 0x208e}, {0x232a, 0x232a}, - {0x23b5, 0x23b5}, {0x2769, 0x2769}, {0x276b, 0x276b}, {0x276d, 0x276d}, - {0x276f, 0x276f}, {0x2771, 0x2771}, {0x2773, 0x2773}, {0x2775, 0x2775}, - {0x27e7, 0x27e7}, {0x27e9, 0x27e9}, {0x27eb, 0x27eb}, {0x2984, 0x2984}, - {0x2986, 0x2986}, {0x2988, 0x2988}, {0x298a, 0x298a}, {0x298c, 0x298c}, - {0x298e, 0x298e}, {0x2990, 0x2990}, {0x2992, 0x2992}, {0x2994, 0x2994}, - {0x2996, 0x2996}, {0x2998, 0x2998}, {0x29d9, 0x29d9}, {0x29db, 0x29db}, - {0x29fd, 0x29fd}, {0x3009, 0x3009}, {0x300b, 0x300b}, {0x300d, 0x300d}, - {0x300f, 0x300f}, {0x3011, 0x3011}, {0x3015, 0x3015}, {0x3017, 0x3017}, - {0x3019, 0x3019}, {0x301b, 0x301b}, {0x301e, 0x301f}, {0xfd3f, 0xfd3f}, - {0xfe36, 0xfe36}, {0xfe38, 0xfe38}, {0xfe3a, 0xfe3a}, {0xfe3c, 0xfe3c}, - {0xfe3e, 0xfe3e}, {0xfe40, 0xfe40}, {0xfe42, 0xfe42}, {0xfe44, 0xfe44}, - {0xfe48, 0xfe48}, {0xfe5a, 0xfe5a}, {0xfe5c, 0xfe5c}, {0xfe5e, 0xfe5e}, - {0xff09, 0xff09}, {0xff3d, 0xff3d}, {0xff5d, 0xff5d}, {0xff60, 0xff60}, +static const xmlChSRange xmlPeS[] = {{0x29, 0x29}, {0x5d, 0x5d}, + {0x7d, 0x7d}, {0xf3b, 0xf3b}, {0xf3d, 0xf3d}, {0x169c, 0x169c}, + {0x2046, 0x2046}, {0x207e, 0x207e}, {0x208e, 0x208e}, {0x232a, 0x232a}, + {0x23b5, 0x23b5}, {0x2769, 0x2769}, {0x276b, 0x276b}, {0x276d, 0x276d}, + {0x276f, 0x276f}, {0x2771, 0x2771}, {0x2773, 0x2773}, {0x2775, 0x2775}, + {0x27e7, 0x27e7}, {0x27e9, 0x27e9}, {0x27eb, 0x27eb}, {0x2984, 0x2984}, + {0x2986, 0x2986}, {0x2988, 0x2988}, {0x298a, 0x298a}, {0x298c, 0x298c}, + {0x298e, 0x298e}, {0x2990, 0x2990}, {0x2992, 0x2992}, {0x2994, 0x2994}, + {0x2996, 0x2996}, {0x2998, 0x2998}, {0x29d9, 0x29d9}, {0x29db, 0x29db}, + {0x29fd, 0x29fd}, {0x3009, 0x3009}, {0x300b, 0x300b}, {0x300d, 0x300d}, + {0x300f, 0x300f}, {0x3011, 0x3011}, {0x3015, 0x3015}, {0x3017, 0x3017}, + {0x3019, 0x3019}, {0x301b, 0x301b}, {0x301e, 0x301f}, {0xfd3f, 0xfd3f}, + {0xfe36, 0xfe36}, {0xfe38, 0xfe38}, {0xfe3a, 0xfe3a}, {0xfe3c, 0xfe3c}, + {0xfe3e, 0xfe3e}, {0xfe40, 0xfe40}, {0xfe42, 0xfe42}, {0xfe44, 0xfe44}, + {0xfe48, 0xfe48}, {0xfe5a, 0xfe5a}, {0xfe5c, 0xfe5c}, {0xfe5e, 0xfe5e}, + {0xff09, 0xff09}, {0xff3d, 0xff3d}, {0xff5d, 0xff5d}, {0xff60, 0xff60}, {0xff63, 0xff63} }; static xmlChRangeGroup xmlPeG = {63,0,xmlPeS,NULL}; -static const xmlChSRange xmlPoS[] = {{0x21, 0x23}, {0x25, 0x27}, - {0x2a, 0x2a}, {0x2c, 0x2c}, {0x2e, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, - {0x5c, 0x5c}, {0xa1, 0xa1}, {0xb7, 0xb7}, {0xbf, 0xbf}, {0x37e, 0x37e}, - {0x387, 0x387}, {0x55a, 0x55f}, {0x589, 0x589}, {0x5be, 0x5be}, - {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, - {0x61b, 0x61b}, {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, - {0x700, 0x70d}, {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, - {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf85, 0xf85}, - {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, - {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, - {0x1800, 0x1805}, {0x1807, 0x180a}, {0x1944, 0x1945}, {0x2016, 0x2017}, - {0x2020, 0x2027}, {0x2030, 0x2038}, {0x203b, 0x203e}, {0x2041, 0x2043}, - {0x2047, 0x2051}, {0x2053, 0x2053}, {0x2057, 0x2057}, {0x23b6, 0x23b6}, - {0x3001, 0x3003}, {0x303d, 0x303d}, {0xfe30, 0xfe30}, {0xfe45, 0xfe46}, - {0xfe49, 0xfe4c}, {0xfe50, 0xfe52}, {0xfe54, 0xfe57}, {0xfe5f, 0xfe61}, - {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff07}, - {0xff0a, 0xff0a}, {0xff0c, 0xff0c}, {0xff0e, 0xff0f}, {0xff1a, 0xff1b}, +static const xmlChSRange xmlPoS[] = {{0x21, 0x23}, {0x25, 0x27}, + {0x2a, 0x2a}, {0x2c, 0x2c}, {0x2e, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, + {0x5c, 0x5c}, {0xa1, 0xa1}, {0xb7, 0xb7}, {0xbf, 0xbf}, {0x37e, 0x37e}, + {0x387, 0x387}, {0x55a, 0x55f}, {0x589, 0x589}, {0x5be, 0x5be}, + {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, + {0x61b, 0x61b}, {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, + {0x700, 0x70d}, {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, + {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf85, 0xf85}, + {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, + {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, + {0x1800, 0x1805}, {0x1807, 0x180a}, {0x1944, 0x1945}, {0x2016, 0x2017}, + {0x2020, 0x2027}, {0x2030, 0x2038}, {0x203b, 0x203e}, {0x2041, 0x2043}, + {0x2047, 0x2051}, {0x2053, 0x2053}, {0x2057, 0x2057}, {0x23b6, 0x23b6}, + {0x3001, 0x3003}, {0x303d, 0x303d}, {0xfe30, 0xfe30}, {0xfe45, 0xfe46}, + {0xfe49, 0xfe4c}, {0xfe50, 0xfe52}, {0xfe54, 0xfe57}, {0xfe5f, 0xfe61}, + {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff07}, + {0xff0a, 0xff0a}, {0xff0c, 0xff0c}, {0xff0e, 0xff0f}, {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3c, 0xff3c}, {0xff61, 0xff61}, {0xff64, 0xff64} }; static const xmlChLRange xmlPoL[] = {{0x10100, 0x10101}, {0x1039f, 0x1039f} }; static xmlChRangeGroup xmlPoG = {72,2,xmlPoS,xmlPoL}; -static const xmlChSRange xmlPsS[] = {{0x28, 0x28}, {0x5b, 0x5b}, - {0x7b, 0x7b}, {0xf3a, 0xf3a}, {0xf3c, 0xf3c}, {0x169b, 0x169b}, - {0x201a, 0x201a}, {0x201e, 0x201e}, {0x2045, 0x2045}, {0x207d, 0x207d}, - {0x208d, 0x208d}, {0x2329, 0x2329}, {0x23b4, 0x23b4}, {0x2768, 0x2768}, - {0x276a, 0x276a}, {0x276c, 0x276c}, {0x276e, 0x276e}, {0x2770, 0x2770}, - {0x2772, 0x2772}, {0x2774, 0x2774}, {0x27e6, 0x27e6}, {0x27e8, 0x27e8}, - {0x27ea, 0x27ea}, {0x2983, 0x2983}, {0x2985, 0x2985}, {0x2987, 0x2987}, - {0x2989, 0x2989}, {0x298b, 0x298b}, {0x298d, 0x298d}, {0x298f, 0x298f}, - {0x2991, 0x2991}, {0x2993, 0x2993}, {0x2995, 0x2995}, {0x2997, 0x2997}, - {0x29d8, 0x29d8}, {0x29da, 0x29da}, {0x29fc, 0x29fc}, {0x3008, 0x3008}, - {0x300a, 0x300a}, {0x300c, 0x300c}, {0x300e, 0x300e}, {0x3010, 0x3010}, - {0x3014, 0x3014}, {0x3016, 0x3016}, {0x3018, 0x3018}, {0x301a, 0x301a}, - {0x301d, 0x301d}, {0xfd3e, 0xfd3e}, {0xfe35, 0xfe35}, {0xfe37, 0xfe37}, - {0xfe39, 0xfe39}, {0xfe3b, 0xfe3b}, {0xfe3d, 0xfe3d}, {0xfe3f, 0xfe3f}, - {0xfe41, 0xfe41}, {0xfe43, 0xfe43}, {0xfe47, 0xfe47}, {0xfe59, 0xfe59}, - {0xfe5b, 0xfe5b}, {0xfe5d, 0xfe5d}, {0xff08, 0xff08}, {0xff3b, 0xff3b}, +static const xmlChSRange xmlPsS[] = {{0x28, 0x28}, {0x5b, 0x5b}, + {0x7b, 0x7b}, {0xf3a, 0xf3a}, {0xf3c, 0xf3c}, {0x169b, 0x169b}, + {0x201a, 0x201a}, {0x201e, 0x201e}, {0x2045, 0x2045}, {0x207d, 0x207d}, + {0x208d, 0x208d}, {0x2329, 0x2329}, {0x23b4, 0x23b4}, {0x2768, 0x2768}, + {0x276a, 0x276a}, {0x276c, 0x276c}, {0x276e, 0x276e}, {0x2770, 0x2770}, + {0x2772, 0x2772}, {0x2774, 0x2774}, {0x27e6, 0x27e6}, {0x27e8, 0x27e8}, + {0x27ea, 0x27ea}, {0x2983, 0x2983}, {0x2985, 0x2985}, {0x2987, 0x2987}, + {0x2989, 0x2989}, {0x298b, 0x298b}, {0x298d, 0x298d}, {0x298f, 0x298f}, + {0x2991, 0x2991}, {0x2993, 0x2993}, {0x2995, 0x2995}, {0x2997, 0x2997}, + {0x29d8, 0x29d8}, {0x29da, 0x29da}, {0x29fc, 0x29fc}, {0x3008, 0x3008}, + {0x300a, 0x300a}, {0x300c, 0x300c}, {0x300e, 0x300e}, {0x3010, 0x3010}, + {0x3014, 0x3014}, {0x3016, 0x3016}, {0x3018, 0x3018}, {0x301a, 0x301a}, + {0x301d, 0x301d}, {0xfd3e, 0xfd3e}, {0xfe35, 0xfe35}, {0xfe37, 0xfe37}, + {0xfe39, 0xfe39}, {0xfe3b, 0xfe3b}, {0xfe3d, 0xfe3d}, {0xfe3f, 0xfe3f}, + {0xfe41, 0xfe41}, {0xfe43, 0xfe43}, {0xfe47, 0xfe47}, {0xfe59, 0xfe59}, + {0xfe5b, 0xfe5b}, {0xfe5d, 0xfe5d}, {0xff08, 0xff08}, {0xff3b, 0xff3b}, {0xff5b, 0xff5b}, {0xff5f, 0xff5f}, {0xff62, 0xff62} }; static xmlChRangeGroup xmlPsG = {65,0,xmlPsS,NULL}; -static const xmlChSRange xmlSS[] = {{0x24, 0x24}, {0x2b, 0x2b}, - {0x3c, 0x3e}, {0x5e, 0x5e}, {0x60, 0x60}, {0x7c, 0x7c}, {0x7e, 0x7e}, - {0xa2, 0xa9}, {0xac, 0xac}, {0xae, 0xb1}, {0xb4, 0xb4}, {0xb6, 0xb6}, - {0xb8, 0xb8}, {0xd7, 0xd7}, {0xf7, 0xf7}, {0x2c2, 0x2c5}, - {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, - {0x384, 0x385}, {0x3f6, 0x3f6}, {0x482, 0x482}, {0x60e, 0x60f}, - {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9f2, 0x9f3}, {0x9fa, 0x9fa}, - {0xaf1, 0xaf1}, {0xb70, 0xb70}, {0xbf3, 0xbfa}, {0xe3f, 0xe3f}, - {0xf01, 0xf03}, {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, - {0xf36, 0xf36}, {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, - {0xfcf, 0xfcf}, {0x17db, 0x17db}, {0x1940, 0x1940}, {0x19e0, 0x19ff}, - {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, {0x1fdd, 0x1fdf}, - {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x2044, 0x2044}, {0x2052, 0x2052}, - {0x207a, 0x207c}, {0x208a, 0x208c}, {0x20a0, 0x20b1}, {0x2100, 0x2101}, - {0x2103, 0x2106}, {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, - {0x211e, 0x2123}, {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, - {0x212e, 0x212e}, {0x2132, 0x2132}, {0x213a, 0x213b}, {0x2140, 0x2144}, - {0x214a, 0x214b}, {0x2190, 0x2328}, {0x232b, 0x23b3}, {0x23b7, 0x23d0}, - {0x2400, 0x2426}, {0x2440, 0x244a}, {0x249c, 0x24e9}, {0x2500, 0x2617}, - {0x2619, 0x267d}, {0x2680, 0x2691}, {0x26a0, 0x26a1}, {0x2701, 0x2704}, - {0x2706, 0x2709}, {0x270c, 0x2727}, {0x2729, 0x274b}, {0x274d, 0x274d}, - {0x274f, 0x2752}, {0x2756, 0x2756}, {0x2758, 0x275e}, {0x2761, 0x2767}, - {0x2794, 0x2794}, {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x27d0, 0x27e5}, - {0x27f0, 0x2982}, {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2b0d}, - {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, - {0x3004, 0x3004}, {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, - {0x303e, 0x303f}, {0x309b, 0x309c}, {0x3190, 0x3191}, {0x3196, 0x319f}, - {0x3200, 0x321e}, {0x322a, 0x3243}, {0x3250, 0x3250}, {0x3260, 0x327d}, - {0x327f, 0x327f}, {0x328a, 0x32b0}, {0x32c0, 0x32fe}, {0x3300, 0x33ff}, - {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, {0xfb29, 0xfb29}, {0xfdfc, 0xfdfd}, - {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, - {0xff0b, 0xff0b}, {0xff1c, 0xff1e}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, - {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe0, 0xffe6}, {0xffe8, 0xffee}, +static const xmlChSRange xmlSS[] = {{0x24, 0x24}, {0x2b, 0x2b}, + {0x3c, 0x3e}, {0x5e, 0x5e}, {0x60, 0x60}, {0x7c, 0x7c}, {0x7e, 0x7e}, + {0xa2, 0xa9}, {0xac, 0xac}, {0xae, 0xb1}, {0xb4, 0xb4}, {0xb6, 0xb6}, + {0xb8, 0xb8}, {0xd7, 0xd7}, {0xf7, 0xf7}, {0x2c2, 0x2c5}, + {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, + {0x384, 0x385}, {0x3f6, 0x3f6}, {0x482, 0x482}, {0x60e, 0x60f}, + {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9f2, 0x9f3}, {0x9fa, 0x9fa}, + {0xaf1, 0xaf1}, {0xb70, 0xb70}, {0xbf3, 0xbfa}, {0xe3f, 0xe3f}, + {0xf01, 0xf03}, {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, + {0xf36, 0xf36}, {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, + {0xfcf, 0xfcf}, {0x17db, 0x17db}, {0x1940, 0x1940}, {0x19e0, 0x19ff}, + {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, {0x1fdd, 0x1fdf}, + {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x2044, 0x2044}, {0x2052, 0x2052}, + {0x207a, 0x207c}, {0x208a, 0x208c}, {0x20a0, 0x20b1}, {0x2100, 0x2101}, + {0x2103, 0x2106}, {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, + {0x211e, 0x2123}, {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, + {0x212e, 0x212e}, {0x2132, 0x2132}, {0x213a, 0x213b}, {0x2140, 0x2144}, + {0x214a, 0x214b}, {0x2190, 0x2328}, {0x232b, 0x23b3}, {0x23b7, 0x23d0}, + {0x2400, 0x2426}, {0x2440, 0x244a}, {0x249c, 0x24e9}, {0x2500, 0x2617}, + {0x2619, 0x267d}, {0x2680, 0x2691}, {0x26a0, 0x26a1}, {0x2701, 0x2704}, + {0x2706, 0x2709}, {0x270c, 0x2727}, {0x2729, 0x274b}, {0x274d, 0x274d}, + {0x274f, 0x2752}, {0x2756, 0x2756}, {0x2758, 0x275e}, {0x2761, 0x2767}, + {0x2794, 0x2794}, {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x27d0, 0x27e5}, + {0x27f0, 0x2982}, {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2b0d}, + {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, + {0x3004, 0x3004}, {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, + {0x303e, 0x303f}, {0x309b, 0x309c}, {0x3190, 0x3191}, {0x3196, 0x319f}, + {0x3200, 0x321e}, {0x322a, 0x3243}, {0x3250, 0x3250}, {0x3260, 0x327d}, + {0x327f, 0x327f}, {0x328a, 0x32b0}, {0x32c0, 0x32fe}, {0x3300, 0x33ff}, + {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, {0xfb29, 0xfb29}, {0xfdfc, 0xfdfd}, + {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, + {0xff0b, 0xff0b}, {0xff1c, 0xff1e}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, + {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe0, 0xffe6}, {0xffe8, 0xffee}, {0xfffc, 0xfffd} }; -static const xmlChLRange xmlSL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, - {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, - {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, - {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356}, {0x1d6c1, 0x1d6c1}, - {0x1d6db, 0x1d6db}, {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, - {0x1d735, 0x1d735}, {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, +static const xmlChLRange xmlSL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, + {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, + {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, + {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356}, {0x1d6c1, 0x1d6c1}, + {0x1d6db, 0x1d6db}, {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, + {0x1d735, 0x1d735}, {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, {0x1d7a9, 0x1d7a9}, {0x1d7c3, 0x1d7c3} }; static xmlChRangeGroup xmlSG = {133,20,xmlSS,xmlSL}; -static const xmlChSRange xmlScS[] = {{0x24, 0x24}, {0xa2, 0xa5}, - {0x9f2, 0x9f3}, {0xaf1, 0xaf1}, {0xbf9, 0xbf9}, {0xe3f, 0xe3f}, - {0x17db, 0x17db}, {0x20a0, 0x20b1}, {0xfdfc, 0xfdfc}, {0xfe69, 0xfe69}, +static const xmlChSRange xmlScS[] = {{0x24, 0x24}, {0xa2, 0xa5}, + {0x9f2, 0x9f3}, {0xaf1, 0xaf1}, {0xbf9, 0xbf9}, {0xe3f, 0xe3f}, + {0x17db, 0x17db}, {0x20a0, 0x20b1}, {0xfdfc, 0xfdfc}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, {0xffe0, 0xffe1}, {0xffe5, 0xffe6} }; static xmlChRangeGroup xmlScG = {13,0,xmlScS,NULL}; -static const xmlChSRange xmlSkS[] = {{0x5e, 0x5e}, {0x60, 0x60}, - {0xa8, 0xa8}, {0xaf, 0xaf}, {0xb4, 0xb4}, {0xb8, 0xb8}, {0x2c2, 0x2c5}, - {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, - {0x384, 0x385}, {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, - {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x309b, 0x309c}, +static const xmlChSRange xmlSkS[] = {{0x5e, 0x5e}, {0x60, 0x60}, + {0xa8, 0xa8}, {0xaf, 0xaf}, {0xb4, 0xb4}, {0xb8, 0xb8}, {0x2c2, 0x2c5}, + {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, + {0x384, 0x385}, {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, + {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x309b, 0x309c}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, {0xffe3, 0xffe3} }; static xmlChRangeGroup xmlSkG = {22,0,xmlSkS,NULL}; -static const xmlChSRange xmlSmS[] = {{0x2b, 0x2b}, {0x3c, 0x3e}, - {0x7c, 0x7c}, {0x7e, 0x7e}, {0xac, 0xac}, {0xb1, 0xb1}, {0xd7, 0xd7}, - {0xf7, 0xf7}, {0x3f6, 0x3f6}, {0x2044, 0x2044}, {0x2052, 0x2052}, - {0x207a, 0x207c}, {0x208a, 0x208c}, {0x2140, 0x2144}, {0x214b, 0x214b}, - {0x2190, 0x2194}, {0x219a, 0x219b}, {0x21a0, 0x21a0}, {0x21a3, 0x21a3}, - {0x21a6, 0x21a6}, {0x21ae, 0x21ae}, {0x21ce, 0x21cf}, {0x21d2, 0x21d2}, - {0x21d4, 0x21d4}, {0x21f4, 0x22ff}, {0x2308, 0x230b}, {0x2320, 0x2321}, - {0x237c, 0x237c}, {0x239b, 0x23b3}, {0x25b7, 0x25b7}, {0x25c1, 0x25c1}, - {0x25f8, 0x25ff}, {0x266f, 0x266f}, {0x27d0, 0x27e5}, {0x27f0, 0x27ff}, - {0x2900, 0x2982}, {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2aff}, - {0xfb29, 0xfb29}, {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xff0b, 0xff0b}, - {0xff1c, 0xff1e}, {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe2, 0xffe2}, +static const xmlChSRange xmlSmS[] = {{0x2b, 0x2b}, {0x3c, 0x3e}, + {0x7c, 0x7c}, {0x7e, 0x7e}, {0xac, 0xac}, {0xb1, 0xb1}, {0xd7, 0xd7}, + {0xf7, 0xf7}, {0x3f6, 0x3f6}, {0x2044, 0x2044}, {0x2052, 0x2052}, + {0x207a, 0x207c}, {0x208a, 0x208c}, {0x2140, 0x2144}, {0x214b, 0x214b}, + {0x2190, 0x2194}, {0x219a, 0x219b}, {0x21a0, 0x21a0}, {0x21a3, 0x21a3}, + {0x21a6, 0x21a6}, {0x21ae, 0x21ae}, {0x21ce, 0x21cf}, {0x21d2, 0x21d2}, + {0x21d4, 0x21d4}, {0x21f4, 0x22ff}, {0x2308, 0x230b}, {0x2320, 0x2321}, + {0x237c, 0x237c}, {0x239b, 0x23b3}, {0x25b7, 0x25b7}, {0x25c1, 0x25c1}, + {0x25f8, 0x25ff}, {0x266f, 0x266f}, {0x27d0, 0x27e5}, {0x27f0, 0x27ff}, + {0x2900, 0x2982}, {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2aff}, + {0xfb29, 0xfb29}, {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xff0b, 0xff0b}, + {0xff1c, 0xff1e}, {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe2, 0xffe2}, {0xffe9, 0xffec} }; -static const xmlChLRange xmlSmL[] = {{0x1d6c1, 0x1d6c1}, {0x1d6db, 0x1d6db}, - {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, {0x1d735, 0x1d735}, - {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, +static const xmlChLRange xmlSmL[] = {{0x1d6c1, 0x1d6c1}, {0x1d6db, 0x1d6db}, + {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, {0x1d735, 0x1d735}, + {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, {0x1d7a9, 0x1d7a9}, {0x1d7c3, 0x1d7c3} }; static xmlChRangeGroup xmlSmG = {48,10,xmlSmS,xmlSmL}; -static const xmlChSRange xmlSoS[] = {{0xa6, 0xa7}, {0xa9, 0xa9}, - {0xae, 0xae}, {0xb0, 0xb0}, {0xb6, 0xb6}, {0x482, 0x482}, - {0x60e, 0x60f}, {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9fa, 0x9fa}, - {0xb70, 0xb70}, {0xbf3, 0xbf8}, {0xbfa, 0xbfa}, {0xf01, 0xf03}, - {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, - {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, - {0x1940, 0x1940}, {0x19e0, 0x19ff}, {0x2100, 0x2101}, {0x2103, 0x2106}, - {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, - {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, - {0x2132, 0x2132}, {0x213a, 0x213b}, {0x214a, 0x214a}, {0x2195, 0x2199}, - {0x219c, 0x219f}, {0x21a1, 0x21a2}, {0x21a4, 0x21a5}, {0x21a7, 0x21ad}, - {0x21af, 0x21cd}, {0x21d0, 0x21d1}, {0x21d3, 0x21d3}, {0x21d5, 0x21f3}, - {0x2300, 0x2307}, {0x230c, 0x231f}, {0x2322, 0x2328}, {0x232b, 0x237b}, - {0x237d, 0x239a}, {0x23b7, 0x23d0}, {0x2400, 0x2426}, {0x2440, 0x244a}, - {0x249c, 0x24e9}, {0x2500, 0x25b6}, {0x25b8, 0x25c0}, {0x25c2, 0x25f7}, - {0x2600, 0x2617}, {0x2619, 0x266e}, {0x2670, 0x267d}, {0x2680, 0x2691}, - {0x26a0, 0x26a1}, {0x2701, 0x2704}, {0x2706, 0x2709}, {0x270c, 0x2727}, - {0x2729, 0x274b}, {0x274d, 0x274d}, {0x274f, 0x2752}, {0x2756, 0x2756}, - {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2794, 0x2794}, {0x2798, 0x27af}, - {0x27b1, 0x27be}, {0x2800, 0x28ff}, {0x2b00, 0x2b0d}, {0x2e80, 0x2e99}, - {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, - {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, - {0x3190, 0x3191}, {0x3196, 0x319f}, {0x3200, 0x321e}, {0x322a, 0x3243}, - {0x3250, 0x3250}, {0x3260, 0x327d}, {0x327f, 0x327f}, {0x328a, 0x32b0}, - {0x32c0, 0x32fe}, {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, - {0xfdfd, 0xfdfd}, {0xffe4, 0xffe4}, {0xffe8, 0xffe8}, {0xffed, 0xffee}, +static const xmlChSRange xmlSoS[] = {{0xa6, 0xa7}, {0xa9, 0xa9}, + {0xae, 0xae}, {0xb0, 0xb0}, {0xb6, 0xb6}, {0x482, 0x482}, + {0x60e, 0x60f}, {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9fa, 0x9fa}, + {0xb70, 0xb70}, {0xbf3, 0xbf8}, {0xbfa, 0xbfa}, {0xf01, 0xf03}, + {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, + {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, + {0x1940, 0x1940}, {0x19e0, 0x19ff}, {0x2100, 0x2101}, {0x2103, 0x2106}, + {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, + {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, + {0x2132, 0x2132}, {0x213a, 0x213b}, {0x214a, 0x214a}, {0x2195, 0x2199}, + {0x219c, 0x219f}, {0x21a1, 0x21a2}, {0x21a4, 0x21a5}, {0x21a7, 0x21ad}, + {0x21af, 0x21cd}, {0x21d0, 0x21d1}, {0x21d3, 0x21d3}, {0x21d5, 0x21f3}, + {0x2300, 0x2307}, {0x230c, 0x231f}, {0x2322, 0x2328}, {0x232b, 0x237b}, + {0x237d, 0x239a}, {0x23b7, 0x23d0}, {0x2400, 0x2426}, {0x2440, 0x244a}, + {0x249c, 0x24e9}, {0x2500, 0x25b6}, {0x25b8, 0x25c0}, {0x25c2, 0x25f7}, + {0x2600, 0x2617}, {0x2619, 0x266e}, {0x2670, 0x267d}, {0x2680, 0x2691}, + {0x26a0, 0x26a1}, {0x2701, 0x2704}, {0x2706, 0x2709}, {0x270c, 0x2727}, + {0x2729, 0x274b}, {0x274d, 0x274d}, {0x274f, 0x2752}, {0x2756, 0x2756}, + {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2794, 0x2794}, {0x2798, 0x27af}, + {0x27b1, 0x27be}, {0x2800, 0x28ff}, {0x2b00, 0x2b0d}, {0x2e80, 0x2e99}, + {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, + {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, + {0x3190, 0x3191}, {0x3196, 0x319f}, {0x3200, 0x321e}, {0x322a, 0x3243}, + {0x3250, 0x3250}, {0x3260, 0x327d}, {0x327f, 0x327f}, {0x328a, 0x32b0}, + {0x32c0, 0x32fe}, {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, + {0xfdfd, 0xfdfd}, {0xffe4, 0xffe4}, {0xffe8, 0xffe8}, {0xffed, 0xffee}, {0xfffc, 0xfffd} }; -static const xmlChLRange xmlSoL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, - {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, - {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, +static const xmlChLRange xmlSoL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, + {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, + {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356} }; static xmlChRangeGroup xmlSoG = {103,10,xmlSoS,xmlSoL}; -static const xmlChSRange xmlZS[] = {{0x20, 0x20}, {0xa0, 0xa0}, - {0x1680, 0x1680}, {0x180e, 0x180e}, {0x2000, 0x200a}, {0x2028, 0x2029}, +static const xmlChSRange xmlZS[] = {{0x20, 0x20}, {0xa0, 0xa0}, + {0x1680, 0x1680}, {0x180e, 0x180e}, {0x2000, 0x200a}, {0x2028, 0x2029}, {0x202f, 0x202f}, {0x205f, 0x205f}, {0x3000, 0x3000} }; static xmlChRangeGroup xmlZG = {9,0,xmlZS,NULL}; @@ -961,7 +961,7 @@ else low = mid + 1; } - return (NULL); + return (NULL); } /** Index: lib/3rdparty/libxml2/xmlwriter.c =================================================================== --- lib/3rdparty/libxml2/xmlwriter.c (revision 58293) +++ lib/3rdparty/libxml2/xmlwriter.c (working copy) @@ -21,6 +21,10 @@ #include +#include "buf.h" +#include "enc.h" +#include "save.h" + #define B64LINELEN 72 #define B64CRLF "\r\n" @@ -548,9 +552,9 @@ writer->out->encoder = encoder; if (encoder != NULL) { if (writer->out->conv == NULL) { - writer->out->conv = xmlBufferCreateSize(4000); + writer->out->conv = xmlBufCreateSize(4000); } - xmlCharEncOutFunc(encoder, writer->out->conv, NULL); + xmlCharEncOutput(writer->out, 1); if ((writer->doc != NULL) && (writer->doc->encoding == NULL)) writer->doc->encoding = xmlStrdup((xmlChar *)writer->out->encoder->name); } else @@ -1074,10 +1078,10 @@ sum += count; if (namespaceURI != 0) { - xmlTextWriterNsStackEntry *p = (xmlTextWriterNsStackEntry *) + xmlTextWriterNsStackEntry *p = (xmlTextWriterNsStackEntry *) xmlMalloc(sizeof(xmlTextWriterNsStackEntry)); if (p == 0) { - xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY, + xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY, "xmlTextWriterStartElementNS : out of memory!\n"); return -1; } @@ -1501,8 +1505,8 @@ break; case XML_TEXTWRITER_ATTRIBUTE: buf = NULL; - xmlAttrSerializeTxtContent(writer->out->buffer, writer->doc, - NULL, content); + xmlBufAttrSerializeTxtContent(writer->out->buffer, + writer->doc, NULL, content); break; default: break; @@ -1663,7 +1667,7 @@ * Write hqx encoded data to an xmlOutputBuffer. * ::todo * - * Returns the bytes written (may be 0 because of buffering) + * Returns the bytes written (may be 0 because of buffering) * or -1 in case of error */ static int @@ -1672,8 +1676,8 @@ { int count; int sum; - static char hex[16] = - {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; + static char hex[16] = + {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int i; if ((out == NULL) || (data == NULL) || (len < 0)) { @@ -1849,7 +1853,7 @@ nsentry.uri = (xmlChar *)namespaceURI; nsentry.elem = xmlListFront(writer->nodes); - curns = (xmlTextWriterNsStackEntry *)xmlListSearch(writer->nsstack, + curns = (xmlTextWriterNsStackEntry *)xmlListSearch(writer->nsstack, (void *)&nsentry); if ((curns != NULL)) { xmlFree(buf); @@ -2496,8 +2500,8 @@ if (writer->indent) { count = xmlOutputBufferWriteString(writer->out, "\n"); - if (count < 0) - return -1; + if (count < 0) + return -1; sum += count; } @@ -4606,6 +4610,26 @@ } /** + * xmlTextWriterSetQuoteChar: + * @writer: the xmlTextWriterPtr + * @quotechar: the quote character + * + * Set the character used for quoting attributes. + * + * Returns -1 on error or 0 otherwise. + */ +int +xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar) +{ + if ((writer == NULL) || ((quotechar != '\'') && (quotechar != '"'))) + return -1; + + writer->qchar = quotechar; + + return 0; +} + +/** * xmlTextWriterWriteIndent: * @writer: the xmlTextWriterPtr * Index: lib/3rdparty/libxml2/xpath.c =================================================================== --- lib/3rdparty/libxml2/xpath.c (revision 58293) +++ lib/3rdparty/libxml2/xpath.c (working copy) @@ -55,6 +55,8 @@ #include #endif +#include "buf.h" + #ifdef LIBXML_PATTERN_ENABLED #define XPATH_STREAMING #endif @@ -64,6 +66,15 @@ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); +/** + * WITH_TIM_SORT: + * + * Use the Timsort algorithm provided in timsort.h to sort + * nodeset as this is a great improvement over the old Shell sort + * used in xmlXPathNodeSetSort() + */ +#define WITH_TIM_SORT + /* * XP_OPTIMIZED_NON_ELEM_COMPARISON: * If defined, this will use xmlXPathCmpNodesExt() instead of @@ -90,12 +101,76 @@ /* #define XP_DEBUG_OBJ_USAGE */ /* + * XPATH_MAX_STEPS: + * when compiling an XPath expression we arbitrary limit the maximum + * number of step operation in the compiled expression. 1000000 is + * an insanely large value which should never be reached under normal + * circumstances + */ +#define XPATH_MAX_STEPS 1000000 + +/* + * XPATH_MAX_STACK_DEPTH: + * when evaluating an XPath expression we arbitrary limit the maximum + * number of object allowed to be pushed on the stack. 1000000 is + * an insanely large value which should never be reached under normal + * circumstances + */ +#define XPATH_MAX_STACK_DEPTH 1000000 + +/* + * XPATH_MAX_NODESET_LENGTH: + * when evaluating an XPath expression nodesets are created and we + * arbitrary limit the maximum length of those node set. 10000000 is + * an insanely large value which should never be reached under normal + * circumstances, one would first need to construct an in memory tree + * with more than 10 millions nodes. + */ +#define XPATH_MAX_NODESET_LENGTH 10000000 + +/* * TODO: * There are a few spots where some tests are done which depend upon ascii * data. These should be enhanced for full UTF8 support (see particularly * any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT) */ +/* + * Wrapper for the Timsort argorithm from timsort.h + */ +#ifdef WITH_TIM_SORT +#define SORT_NAME libxml_domnode +#define SORT_TYPE xmlNodePtr +/** + * wrap_cmp: + * @x: a node + * @y: another node + * + * Comparison function for the Timsort implementation + * + * Returns -2 in case of error -1 if first point < second point, 0 if + * it's the same node, +1 otherwise + */ +static +int wrap_cmp( xmlNodePtr x, xmlNodePtr y ); +#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON + static int xmlXPathCmpNodesExt(xmlNodePtr, xmlNodePtr); + static int wrap_cmp( xmlNodePtr x, xmlNodePtr y ) + { + int res = xmlXPathCmpNodesExt(x, y); + return res == -2 ? res : -res; + } +#else + static int wrap_cmp( xmlNodePtr x, xmlNodePtr y ) + { + int res = xmlXPathCmpNodes(x, y); + return res == -2 ? res : -res; + } +#endif +#define SORT_CMP(x, y) (wrap_cmp(x, y)) +#include "timsort.h" +#endif /* WITH_TIM_SORT */ + #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) /************************************************************************ @@ -252,6 +327,8 @@ "Encoding error\n", "Char out of XML range\n", "Invalid or incomplete context\n", + "Stack usage errror\n", + "Forbidden variable\n", "?? Unknown error ??\n" /* Must be last in the list! */ }; #define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) / \ @@ -419,8 +496,7 @@ if (list->items == NULL) { if (initialSize <= 0) initialSize = 1; - list->items = (void **) xmlMalloc( - initialSize * sizeof(void *)); + list->items = (void **) xmlMalloc(initialSize * sizeof(void *)); if (list->items == NULL) { xmlXPathErrMemory(NULL, "xmlPointerListCreate: allocating item\n"); @@ -429,12 +505,17 @@ list->number = 0; list->size = initialSize; } else if (list->size <= list->number) { + if (list->size > 50000000) { + xmlXPathErrMemory(NULL, + "xmlPointerListAddSize: re-allocating item\n"); + return(-1); + } list->size *= 2; list->items = (void **) xmlRealloc(list->items, list->size * sizeof(void *)); if (list->items == NULL) { xmlXPathErrMemory(NULL, - "xmlPointerListCreate: re-allocating item\n"); + "xmlPointerListAddSize: re-allocating item\n"); list->size = 0; return(-1); } @@ -552,8 +633,6 @@ NODE_TYPE_PI = XML_PI_NODE } xmlXPathTypeVal; -#define XP_REWRITE_DOS_CHILD_ELEM 1 - typedef struct _xmlXPathStepOp xmlXPathStepOp; typedef xmlXPathStepOp *xmlXPathStepOpPtr; struct _xmlXPathStepOp { @@ -567,7 +646,6 @@ void *value5; void *cache; void *cacheURI; - int rewriteType; }; struct _xmlXPathCompExpr { @@ -722,6 +800,10 @@ if (comp->nbStep >= comp->maxStep) { xmlXPathStepOp *real; + if (comp->maxStep >= XPATH_MAX_STEPS) { + xmlXPathErrMemory(NULL, "adding step\n"); + return(-1); + } comp->maxStep *= 2; real = (xmlXPathStepOp *) xmlRealloc(comp->steps, comp->maxStep * sizeof(xmlXPathStepOp)); @@ -733,7 +815,6 @@ comp->steps = real; } comp->last = comp->nbStep; - comp->steps[comp->nbStep].rewriteType = 0; comp->steps[comp->nbStep].ch1 = ch1; comp->steps[comp->nbStep].ch2 = ch2; comp->steps[comp->nbStep].op = op; @@ -2051,6 +2132,11 @@ ret->type = XPATH_NODESET; ret->boolval = 0; ret->nodesetval = xmlXPathNodeSetCreate(val); + if (ret->nodesetval == NULL) { + ctxt->lastError.domain = XML_FROM_XPATH; + ctxt->lastError.code = XML_ERR_NO_MEMORY; + return(NULL); + } #ifdef XP_DEBUG_OBJ_USAGE xmlXPathDebugObjUsageRequested(ctxt, XPATH_NODESET); #endif @@ -2398,6 +2484,42 @@ ************************************************************************/ /** + * xmlXPathSetFrame: + * @ctxt: an XPath parser context + * + * Set the callee evaluation frame + * + * Returns the previous frame value to be restored once done + */ +static int +xmlXPathSetFrame(xmlXPathParserContextPtr ctxt) { + int ret; + + if (ctxt == NULL) + return(0); + ret = ctxt->valueFrame; + ctxt->valueFrame = ctxt->valueNr; + return(ret); +} + +/** + * xmlXPathPopFrame: + * @ctxt: an XPath parser context + * @frame: the previous frame value + * + * Remove the callee evaluation frame + */ +static void +xmlXPathPopFrame(xmlXPathParserContextPtr ctxt, int frame) { + if (ctxt == NULL) + return; + if (ctxt->valueNr < ctxt->valueFrame) { + xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_STACK_ERROR); + } + ctxt->valueFrame = frame; +} + +/** * valuePop: * @ctxt: an XPath evaluation context * @@ -2412,6 +2534,12 @@ if ((ctxt == NULL) || (ctxt->valueNr <= 0)) return (NULL); + + if (ctxt->valueNr <= ctxt->valueFrame) { + xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_STACK_ERROR); + return (NULL); + } + ctxt->valueNr--; if (ctxt->valueNr > 0) ctxt->value = ctxt->valueTab[ctxt->valueNr - 1]; @@ -2437,11 +2565,17 @@ if (ctxt->valueNr >= ctxt->valueMax) { xmlXPathObjectPtr *tmp; + if (ctxt->valueMax >= XPATH_MAX_STACK_DEPTH) { + xmlXPathErrMemory(NULL, "XPath stack depth limit reached\n"); + ctxt->error = XPATH_MEMORY_ERROR; + return (0); + } tmp = (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab, 2 * ctxt->valueMax * sizeof(ctxt->valueTab[0])); if (tmp == NULL) { - xmlGenericError(xmlGenericErrorContext, "realloc failed !\n"); + xmlXPathErrMemory(NULL, "pushing value\n"); + ctxt->error = XPATH_MEMORY_ERROR; return (0); } ctxt->valueMax *= 2; @@ -3276,13 +3410,19 @@ */ void xmlXPathNodeSetSort(xmlNodeSetPtr set) { +#ifndef WITH_TIM_SORT int i, j, incr, len; xmlNodePtr tmp; +#endif if (set == NULL) return; - /* Use Shell's sort to sort the node-set */ +#ifndef WITH_TIM_SORT + /* + * Use the old Shell's sort implementation to sort the node-set + * Timsort ought to be quite faster + */ len = set->nodeNr; for (incr = len / 2; incr > 0; incr /= 2) { for (i = incr; i < len; i++) { @@ -3305,6 +3445,9 @@ } } } +#else /* WITH_TIM_SORT */ + libxml_domnode_tim_sort(set->nodeTab, set->nodeNr); +#endif /* WITH_TIM_SORT */ } #define XML_NODESET_DEFAULT 10 @@ -3483,8 +3626,10 @@ * @ns: a the namespace node * * add a new namespace node to an existing NodeSet + * + * Returns 0 in case of success and -1 in case of error */ -void +int xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) { int i; @@ -3492,7 +3637,7 @@ if ((cur == NULL) || (ns == NULL) || (node == NULL) || (ns->type != XML_NAMESPACE_DECL) || (node->type != XML_ELEMENT_NODE)) - return; + return(-1); /* @@ with_ns to check whether namespace nodes should be looked at @@ */ /* @@ -3503,7 +3648,7 @@ (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) && (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) && (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix))) - return; + return(0); } /* @@ -3514,7 +3659,7 @@ sizeof(xmlNodePtr)); if (cur->nodeTab == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } memset(cur->nodeTab, 0 , XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); @@ -3522,16 +3667,21 @@ } else if (cur->nodeNr == cur->nodeMax) { xmlNodePtr *temp; - cur->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * + if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "growing nodeset hit limit\n"); + return(-1); + } + temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } + cur->nodeMax *= 2; cur->nodeTab = temp; } cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns); + return(0); } /** @@ -3540,24 +3690,21 @@ * @val: a new xmlNodePtr * * add a new xmlNodePtr to an existing NodeSet + * + * Returns 0 in case of success, and -1 in case of error */ -void +int xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { int i; - if ((cur == NULL) || (val == NULL)) return; + if ((cur == NULL) || (val == NULL)) return(-1); -#if 0 - if ((val->type == XML_ELEMENT_NODE) && (val->name[0] == ' ')) - return; /* an XSLT fake node */ -#endif - /* @@ with_ns to check whether namespace nodes should be looked at @@ */ /* * prevent duplcates */ for (i = 0;i < cur->nodeNr;i++) - if (cur->nodeTab[i] == val) return; + if (cur->nodeTab[i] == val) return(0); /* * grow the nodeTab if needed @@ -3567,7 +3714,7 @@ sizeof(xmlNodePtr)); if (cur->nodeTab == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } memset(cur->nodeTab, 0 , XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); @@ -3575,13 +3722,17 @@ } else if (cur->nodeNr == cur->nodeMax) { xmlNodePtr *temp; - cur->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * + if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "growing nodeset hit limit\n"); + return(-1); + } + temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } + cur->nodeMax *= 2; cur->nodeTab = temp; } if (val->type == XML_NAMESPACE_DECL) { @@ -3591,6 +3742,7 @@ xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else cur->nodeTab[cur->nodeNr++] = val; + return(0); } /** @@ -3600,16 +3752,13 @@ * * add a new xmlNodePtr to an existing NodeSet, optimized version * when we are sure the node is not already in the set. + * + * Returns 0 in case of success and -1 in case of failure */ -void +int xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) { - if ((cur == NULL) || (val == NULL)) return; + if ((cur == NULL) || (val == NULL)) return(-1); -#if 0 - if ((val->type == XML_ELEMENT_NODE) && (val->name[0] == ' ')) - return; /* an XSLT fake node */ -#endif - /* @@ with_ns to check whether namespace nodes should be looked at @@ */ /* * grow the nodeTab if needed @@ -3619,7 +3768,7 @@ sizeof(xmlNodePtr)); if (cur->nodeTab == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } memset(cur->nodeTab, 0 , XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); @@ -3627,14 +3776,18 @@ } else if (cur->nodeNr == cur->nodeMax) { xmlNodePtr *temp; - cur->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * + if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "growing nodeset hit limit\n"); + return(-1); + } + temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); - return; + return(-1); } cur->nodeTab = temp; + cur->nodeMax *= 2; } if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; @@ -3643,6 +3796,7 @@ xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else cur->nodeTab[cur->nodeNr++] = val; + return(0); } /** @@ -3738,14 +3892,18 @@ } else if (val1->nodeNr == val1->nodeMax) { xmlNodePtr *temp; - val1->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * + if (val1->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "merging nodeset hit limit\n"); + return(NULL); + } + temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "merging nodeset\n"); return(NULL); } val1->nodeTab = temp; + val1->nodeMax *= 2; } if (n2->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) n2; @@ -3759,69 +3917,7 @@ return(val1); } -#if 0 /* xmlXPathNodeSetMergeUnique() is currently not used anymore */ -/** - * xmlXPathNodeSetMergeUnique: - * @val1: the first NodeSet or NULL - * @val2: the second NodeSet - * - * Merges two nodesets, all nodes from @val2 are added to @val1 - * if @val1 is NULL, a new set is created and copied from @val2 - * - * Returns @val1 once extended or NULL in case of error. - */ -static xmlNodeSetPtr -xmlXPathNodeSetMergeUnique(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { - int i; - if (val2 == NULL) return(val1); - if (val1 == NULL) { - val1 = xmlXPathNodeSetCreate(NULL); - } - if (val1 == NULL) - return (NULL); - - /* @@ with_ns to check whether namespace nodes should be looked at @@ */ - - for (i = 0;i < val2->nodeNr;i++) { - /* - * grow the nodeTab if needed - */ - if (val1->nodeMax == 0) { - val1->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT * - sizeof(xmlNodePtr)); - if (val1->nodeTab == NULL) { - xmlXPathErrMemory(NULL, "merging nodeset\n"); - return(NULL); - } - memset(val1->nodeTab, 0 , - XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); - val1->nodeMax = XML_NODESET_DEFAULT; - } else if (val1->nodeNr == val1->nodeMax) { - xmlNodePtr *temp; - - val1->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * - sizeof(xmlNodePtr)); - if (temp == NULL) { - xmlXPathErrMemory(NULL, "merging nodeset\n"); - return(NULL); - } - val1->nodeTab = temp; - } - if (val2->nodeTab[i]->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr) val2->nodeTab[i]; - - val1->nodeTab[val1->nodeNr++] = - xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); - } else - val1->nodeTab[val1->nodeNr++] = val2->nodeTab[i]; - } - - return(val1); -} -#endif /* xmlXPathNodeSetMergeUnique() is currently not used anymore */ - /** * xmlXPathNodeSetMergeAndClear: * @set1: the first NodeSet or NULL @@ -3907,14 +4003,18 @@ } else if (set1->nodeNr >= set1->nodeMax) { xmlNodePtr *temp; - set1->nodeMax *= 2; + if (set1->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "merging nodeset hit limit\n"); + return(NULL); + } temp = (xmlNodePtr *) xmlRealloc( - set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); + set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "merging nodeset\n"); return(NULL); } set1->nodeTab = temp; + set1->nodeMax *= 2; } if (n2->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) n2; @@ -3991,14 +4091,18 @@ } else if (set1->nodeNr >= set1->nodeMax) { xmlNodePtr *temp; - set1->nodeMax *= 2; + if (set1->nodeMax >= XPATH_MAX_NODESET_LENGTH) { + xmlXPathErrMemory(NULL, "merging nodeset hit limit\n"); + return(NULL); + } temp = (xmlNodePtr *) xmlRealloc( - set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); + set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "merging nodeset\n"); return(NULL); } set1->nodeTab = temp; + set1->nodeMax *= 2; } set1->nodeTab[set1->nodeNr++] = n2; } @@ -4289,9 +4393,12 @@ ret = xmlXPathNewNodeSet(NULL); else { ret = xmlXPathNewNodeSet(val->nodeTab[0]); - if (ret) - for (i = 1; i < val->nodeNr; ++i) - xmlXPathNodeSetAddUnique(ret->nodesetval, val->nodeTab[i]); + if (ret) { + for (i = 1; i < val->nodeNr; ++i) { + if (xmlXPathNodeSetAddUnique(ret->nodesetval, val->nodeTab[i]) + < 0) break; + } + } } return (ret); @@ -4367,8 +4474,10 @@ for (i = 0; i < l1; i++) { cur = xmlXPathNodeSetItem(nodes1, i); - if (!xmlXPathNodeSetContains(nodes2, cur)) - xmlXPathNodeSetAddUnique(ret, cur); + if (!xmlXPathNodeSetContains(nodes2, cur)) { + if (xmlXPathNodeSetAddUnique(ret, cur) < 0) + break; + } } return(ret); } @@ -4401,8 +4510,10 @@ for (i = 0; i < l1; i++) { cur = xmlXPathNodeSetItem(nodes1, i); - if (xmlXPathNodeSetContains(nodes2, cur)) - xmlXPathNodeSetAddUnique(ret, cur); + if (xmlXPathNodeSetContains(nodes2, cur)) { + if (xmlXPathNodeSetAddUnique(ret, cur) < 0) + break; + } } return(ret); } @@ -4438,7 +4549,8 @@ strval = xmlXPathCastNodeToString(cur); if (xmlHashLookup(hash, strval) == NULL) { xmlHashAddEntry(hash, strval, strval); - xmlXPathNodeSetAddUnique(ret, cur); + if (xmlXPathNodeSetAddUnique(ret, cur) < 0) + break; } else { xmlFree(strval); } @@ -4530,7 +4642,8 @@ cur = xmlXPathNodeSetItem(nodes, i); if (cur == node) break; - xmlXPathNodeSetAddUnique(ret, cur); + if (xmlXPathNodeSetAddUnique(ret, cur) < 0) + break; } return(ret); } @@ -4634,7 +4747,8 @@ cur = xmlXPathNodeSetItem(nodes, i); if (cur == node) break; - xmlXPathNodeSetAddUnique(ret, cur); + if (xmlXPathNodeSetAddUnique(ret, cur) < 0) + break; } xmlXPathNodeSetSort(ret); /* bug 413451 */ return(ret); @@ -6154,6 +6268,7 @@ ret->valueNr = 0; ret->valueMax = 10; ret->value = NULL; + ret->valueFrame = 0; ret->context = ctxt; ret->comp = comp; @@ -7656,6 +7771,7 @@ return(NULL); } +#if 0 /** * xmlXPathNextDescendantOrSelfElemParent: * @ctxt: the XPath Parser context @@ -7683,7 +7799,7 @@ #ifdef LIBXML_DOCB_ENABLED case XML_DOCB_DOCUMENT_NODE: #endif - case XML_HTML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: return(contextNode); default: return(NULL); @@ -7731,6 +7847,7 @@ } return(NULL); } +#endif /** * xmlXPathNextDescendant: @@ -7758,6 +7875,8 @@ return(ctxt->context->node->children); } + if (cur->type == XML_NAMESPACE_DECL) + return(NULL); if (cur->children != NULL) { /* * Do not descend on entities declarations @@ -8140,6 +8259,10 @@ static int xmlXPathIsAncestor(xmlNodePtr ancestor, xmlNodePtr node) { if ((ancestor == NULL) || (node == NULL)) return(0); + if (node->type == XML_NAMESPACE_DECL) + return(0); + if (ancestor->type == XML_NAMESPACE_DECL) + return(0); /* nodes need to be in the same document */ if (ancestor->doc != node->doc) return(0); /* avoid searching if ancestor or node is the root node */ @@ -8177,7 +8300,7 @@ if (cur->type == XML_ATTRIBUTE_NODE) return(cur->parent); } - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return (NULL); if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) cur = cur->prev; @@ -8224,6 +8347,8 @@ return (NULL); ctxt->ancestor = cur->parent; } + if (cur->type == XML_NAMESPACE_DECL) + return(NULL); if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) cur = cur->prev; while (cur->prev == NULL) { @@ -8431,7 +8556,7 @@ int i = 0; tmp = cur->nodesetval->nodeTab[0]; - if (tmp != NULL) { + if ((tmp != NULL) && (tmp->type != XML_NAMESPACE_DECL)) { tmp = tmp->children; while (tmp != NULL) { tmp = tmp->next; @@ -9101,7 +9226,7 @@ xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr str; xmlXPathObjectPtr find; - xmlBufferPtr target; + xmlBufPtr target; const xmlChar *point; int offset; @@ -9111,16 +9236,16 @@ CAST_TO_STRING; str = valuePop(ctxt); - target = xmlBufferCreate(); + target = xmlBufCreate(); if (target) { point = xmlStrstr(str->stringval, find->stringval); if (point) { offset = (int)(point - str->stringval); - xmlBufferAdd(target, str->stringval, offset); + xmlBufAdd(target, str->stringval, offset); } valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, - xmlBufferContent(target))); - xmlBufferFree(target); + xmlBufContent(target))); + xmlBufFree(target); } xmlXPathReleaseObject(ctxt->context, str); xmlXPathReleaseObject(ctxt->context, find); @@ -9144,7 +9269,7 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr str; xmlXPathObjectPtr find; - xmlBufferPtr target; + xmlBufPtr target; const xmlChar *point; int offset; @@ -9154,17 +9279,17 @@ CAST_TO_STRING; str = valuePop(ctxt); - target = xmlBufferCreate(); + target = xmlBufCreate(); if (target) { point = xmlStrstr(str->stringval, find->stringval); if (point) { offset = (int)(point - str->stringval) + xmlStrlen(find->stringval); - xmlBufferAdd(target, &str->stringval[offset], + xmlBufAdd(target, &str->stringval[offset], xmlStrlen(str->stringval) - offset); } valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, - xmlBufferContent(target))); - xmlBufferFree(target); + xmlBufContent(target))); + xmlBufFree(target); } xmlXPathReleaseObject(ctxt->context, str); xmlXPathReleaseObject(ctxt->context, find); @@ -9188,7 +9313,7 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr obj = NULL; xmlChar *source = NULL; - xmlBufferPtr target; + xmlBufPtr target; xmlChar blank; if (ctxt == NULL) return; @@ -9206,7 +9331,7 @@ obj = valuePop(ctxt); source = obj->stringval; - target = xmlBufferCreate(); + target = xmlBufCreate(); if (target && source) { /* Skip leading whitespaces */ @@ -9220,16 +9345,16 @@ blank = 0x20; } else { if (blank) { - xmlBufferAdd(target, &blank, 1); + xmlBufAdd(target, &blank, 1); blank = 0; } - xmlBufferAdd(target, source, 1); + xmlBufAdd(target, source, 1); } source++; } valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, - xmlBufferContent(target))); - xmlBufferFree(target); + xmlBufContent(target))); + xmlBufFree(target); } xmlXPathReleaseObject(ctxt->context, obj); } @@ -9260,7 +9385,7 @@ xmlXPathObjectPtr str; xmlXPathObjectPtr from; xmlXPathObjectPtr to; - xmlBufferPtr target; + xmlBufPtr target; int offset, max; xmlChar ch; const xmlChar *point; @@ -9275,7 +9400,7 @@ CAST_TO_STRING; str = valuePop(ctxt); - target = xmlBufferCreate(); + target = xmlBufCreate(); if (target) { max = xmlUTF8Strlen(to->stringval); for (cptr = str->stringval; (ch=*cptr); ) { @@ -9284,10 +9409,10 @@ if (offset < max) { point = xmlUTF8Strpos(to->stringval, offset); if (point) - xmlBufferAdd(target, point, xmlUTF8Strsize(point, 1)); + xmlBufAdd(target, point, xmlUTF8Strsize(point, 1)); } } else - xmlBufferAdd(target, cptr, xmlUTF8Strsize(cptr, 1)); + xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1)); /* Step to next character in input */ cptr++; @@ -9296,6 +9421,7 @@ if ( (ch & 0xc0) != 0xc0 ) { xmlGenericError(xmlGenericErrorContext, "xmlXPathTranslateFunction: Invalid UTF8 string\n"); + /* not asserting an XPath error is probably better */ break; } /* then skip over remaining bytes for this char */ @@ -9303,6 +9429,7 @@ if ( (*cptr++ & 0xc0) != 0x80 ) { xmlGenericError(xmlGenericErrorContext, "xmlXPathTranslateFunction: Invalid UTF8 string\n"); + /* not asserting an XPath error is probably better */ break; } if (ch & 0x80) /* must have had error encountered */ @@ -9311,8 +9438,8 @@ } } valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, - xmlBufferContent(target))); - xmlBufferFree(target); + xmlBufContent(target))); + xmlBufFree(target); xmlXPathReleaseObject(ctxt->context, str); xmlXPathReleaseObject(ctxt->context, from); xmlXPathReleaseObject(ctxt->context, to); @@ -9819,7 +9946,7 @@ xmlXPathParseName(xmlXPathParserContextPtr ctxt) { const xmlChar *in; xmlChar *ret; - int count = 0; + size_t count = 0; if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL); /* @@ -9838,6 +9965,10 @@ in++; if ((*in > 0) && (*in < 0x80)) { count = in - ctxt->cur; + if (count > XML_MAX_NAME_LENGTH) { + ctxt->cur = in; + XP_ERRORNULL(XPATH_EXPR_ERROR); + } ret = xmlStrndup(ctxt->cur, count); ctxt->cur = in; return(ret); @@ -9881,6 +10012,9 @@ xmlChar *buffer; int max = len * 2; + if (len > XML_MAX_NAME_LENGTH) { + XP_ERRORNULL(XPATH_EXPR_ERROR); + } buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { XP_ERRORNULL(XPATH_MEMORY_ERROR); @@ -9892,6 +10026,9 @@ (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (len + 10 > max) { + if (max > XML_MAX_NAME_LENGTH) { + XP_ERRORNULL(XPATH_EXPR_ERROR); + } max *= 2; buffer = (xmlChar *) xmlRealloc(buffer, max * sizeof(xmlChar)); @@ -10044,7 +10181,6 @@ xmlXPathCompNumber(xmlXPathParserContextPtr ctxt) { double ret = 0.0; - double mult = 1; int ok = 0; int exponent = 0; int is_exponent_negative = 0; @@ -10245,7 +10381,7 @@ name, prefix); SKIP_BLANKS; if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) { - XP_ERROR(XPATH_UNDEF_VARIABLE_ERROR); + XP_ERROR(XPATH_FORBID_VARIABLE_ERROR); } } @@ -11609,9 +11745,13 @@ */ if (contextObj == NULL) contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); - else - xmlXPathNodeSetAddUnique(contextObj->nodesetval, - contextNode); + else { + if (xmlXPathNodeSetAddUnique(contextObj->nodesetval, + contextNode) < 0) { + ctxt->error = XPATH_MEMORY_ERROR; + goto evaluation_exit; + } + } valuePush(ctxt, contextObj); @@ -11712,6 +11852,7 @@ xmlXPathObjectPtr contextObj = NULL, exprRes = NULL; xmlNodePtr oldContextNode, contextNode = NULL; xmlXPathContextPtr xpctxt = ctxt->context; + int frame; #ifdef LIBXML_XPTR_ENABLED /* @@ -11731,6 +11872,8 @@ */ exprOp = &ctxt->comp->steps[op->ch2]; for (i = 0; i < set->nodeNr; i++) { + xmlXPathObjectPtr tmp; + if (set->nodeTab[i] == NULL) continue; @@ -11754,22 +11897,33 @@ */ if (contextObj == NULL) contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); - else - xmlXPathNodeSetAddUnique(contextObj->nodesetval, - contextNode); + else { + if (xmlXPathNodeSetAddUnique(contextObj->nodesetval, + contextNode) < 0) { + ctxt->error = XPATH_MEMORY_ERROR; + goto evaluation_exit; + } + } + frame = xmlXPathSetFrame(ctxt); valuePush(ctxt, contextObj); res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); + tmp = valuePop(ctxt); + xmlXPathPopFrame(ctxt, frame); if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) { - xmlXPathObjectPtr tmp; - /* pop the result */ - tmp = valuePop(ctxt); - xmlXPathReleaseObject(xpctxt, tmp); - /* then pop off contextObj, which will be freed later */ - valuePop(ctxt); + while (tmp != contextObj) { + /* + * Free up the result + * then pop off contextObj, which will be freed later + */ + xmlXPathReleaseObject(xpctxt, tmp); + tmp = valuePop(ctxt); + } goto evaluation_error; } + /* push the result back onto the stack */ + valuePush(ctxt, tmp); if (res) pos++; @@ -11921,22 +12075,25 @@ #define XP_TEST_HIT \ if (hasAxisRange != 0) { \ if (++pos == maxPos) { \ - addNode(seq, cur); \ - goto axis_range_end; } \ + if (addNode(seq, cur) < 0) \ + ctxt->error = XPATH_MEMORY_ERROR; \ + goto axis_range_end; } \ } else { \ - addNode(seq, cur); \ + if (addNode(seq, cur) < 0) \ + ctxt->error = XPATH_MEMORY_ERROR; \ if (breakOnFirstHit) goto first_hit; } #define XP_TEST_HIT_NS \ if (hasAxisRange != 0) { \ if (++pos == maxPos) { \ hasNsNodes = 1; \ - xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur); \ + if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \ + ctxt->error = XPATH_MEMORY_ERROR; \ goto axis_range_end; } \ } else { \ hasNsNodes = 1; \ - xmlXPathNodeSetAddNs(seq, \ - xpctxt->node, (xmlNsPtr) cur); \ + if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \ + ctxt->error = XPATH_MEMORY_ERROR; \ if (breakOnFirstHit) goto first_hit; } xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value; @@ -11956,8 +12113,6 @@ xmlNodeSetPtr contextSeq; int contextIdx; xmlNodePtr contextNode; - /* The context node for a compound traversal */ - xmlNodePtr outerContextNode; /* The final resulting node set wrt to all context nodes */ xmlNodeSetPtr outSeq; /* @@ -11973,9 +12128,7 @@ int breakOnFirstHit; xmlXPathTraversalFunction next = NULL; - /* compound axis traversal */ - xmlXPathTraversalFunctionExt outerNext = NULL; - void (*addNode) (xmlNodeSetPtr, xmlNodePtr); + int (*addNode) (xmlNodeSetPtr, xmlNodePtr); xmlXPathNodeSetMergeFunction mergeAndClear; xmlNodePtr oldContextNode; xmlXPathContextPtr xpctxt = ctxt->context; @@ -12024,13 +12177,6 @@ break; case AXIS_CHILD: last = NULL; - if (op->rewriteType == XP_REWRITE_DOS_CHILD_ELEM) { - /* - * This iterator will give us only nodes which can - * hold element nodes. - */ - outerNext = xmlXPathNextDescendantOrSelfElemParent; - } if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) && (type == NODE_TYPE_NODE)) { @@ -12160,32 +12306,13 @@ addNode = xmlXPathNodeSetAddUnique; outSeq = NULL; seq = NULL; - outerContextNode = NULL; contextNode = NULL; contextIdx = 0; - while ((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) { - if (outerNext != NULL) { - /* - * This is a compound traversal. - */ - if (contextNode == NULL) { - /* - * Set the context for the outer traversal. - */ - outerContextNode = contextSeq->nodeTab[contextIdx++]; - contextNode = outerNext(NULL, outerContextNode); - } else - contextNode = outerNext(contextNode, outerContextNode); - if (contextNode == NULL) - continue; - /* - * Set the context for the main traversal. - */ - xpctxt->node = contextNode; - } else - xpctxt->node = contextSeq->nodeTab[contextIdx++]; + while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) && + (ctxt->error == XPATH_EXPRESSION_OK)) { + xpctxt->node = contextSeq->nodeTab[contextIdx++]; if (seq == NULL) { seq = xmlXPathNodeSetCreate(NULL); @@ -12383,7 +12510,7 @@ } break; } /* switch(test) */ - } while (cur != NULL); + } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK)); goto apply_predicates; @@ -12424,13 +12551,16 @@ #endif apply_predicates: /* --------------------------------------------------- */ + if (ctxt->error != XPATH_EXPRESSION_OK) + goto error; + /* * Apply predicates. */ if ((predOp != NULL) && (seq->nodeNr > 0)) { /* * E.g. when we have a "/foo[some expression][n]". - */ + */ /* * QUESTION TODO: The old predicate evaluation took into * account location-sets. @@ -12439,7 +12569,7 @@ * All what I learned now from the evaluation semantics * does not indicate that a location-set will be processed * here, so this looks OK. - */ + */ /* * Iterate over all predicates, starting with the outermost * predicate. @@ -12932,8 +13062,10 @@ tmp = xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node); } else { - xmlXPathNodeSetAddUnique(tmp->nodesetval, - ctxt->context->node); + if (xmlXPathNodeSetAddUnique(tmp->nodesetval, + ctxt->context->node) < 0) { + ctxt->error = XPATH_MEMORY_ERROR; + } } valuePush(ctxt, tmp); if (op->ch2 != -1) @@ -13046,8 +13178,10 @@ tmp = xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node); } else { - xmlXPathNodeSetAddUnique(tmp->nodesetval, - ctxt->context->node); + if (xmlXPathNodeSetAddUnique(tmp->nodesetval, + ctxt->context->node) < 0) { + ctxt->error = XPATH_MEMORY_ERROR; + } } valuePush(ctxt, tmp); ctxt->context->contextSize = oldset->nodeNr; @@ -13065,7 +13199,8 @@ */ res = valuePop(ctxt); if (xmlXPathEvaluatePredicateResult(ctxt, res)) { - xmlXPathNodeSetAdd(newset, oldset->nodeTab[i]); + if (xmlXPathNodeSetAdd(newset, oldset->nodeTab[i]) < 0) + ctxt->error = XPATH_MEMORY_ERROR; } /* * Cleanup @@ -13357,6 +13492,7 @@ xmlGenericError(xmlGenericErrorContext, "xmlXPathCompOpEval: variable %s bound to undefined prefix %s\n", (char *) op->value4, (char *)op->value5); + ctxt->error = XPATH_UNDEF_PREFIX_ERROR; return (total); } val = xmlXPathVariableLookupNS(ctxt->context, @@ -13373,7 +13509,9 @@ xmlXPathFunction func; const xmlChar *oldFunc, *oldFuncURI; int i; + int frame; + frame = xmlXPathSetFrame(ctxt); if (op->ch1 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -13381,15 +13519,18 @@ xmlGenericError(xmlGenericErrorContext, "xmlXPathCompOpEval: parameter error\n"); ctxt->error = XPATH_INVALID_OPERAND; + xmlXPathPopFrame(ctxt, frame); return (total); } - for (i = 0; i < op->value; i++) + for (i = 0; i < op->value; i++) { if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlXPathCompOpEval: parameter error\n"); ctxt->error = XPATH_INVALID_OPERAND; + xmlXPathPopFrame(ctxt, frame); return (total); } + } if (op->cache != NULL) XML_CAST_FPTR(func) = op->cache; else { @@ -13405,6 +13546,8 @@ xmlGenericError(xmlGenericErrorContext, "xmlXPathCompOpEval: function %s bound to undefined prefix %s\n", (char *)op->value4, (char *)op->value5); + xmlXPathPopFrame(ctxt, frame); + ctxt->error = XPATH_UNDEF_PREFIX_ERROR; return (total); } func = xmlXPathFunctionLookupNS(ctxt->context, @@ -13426,6 +13569,7 @@ func(ctxt, op->value); ctxt->context->function = oldFunc; ctxt->context->functionURI = oldFuncURI; + xmlXPathPopFrame(ctxt, frame); return (total); } case XPATH_OP_ARG: @@ -13735,8 +13879,10 @@ tmp = xmlXPathCacheNewNodeSet(ctxt->context, ctxt->context->node); } else { - xmlXPathNodeSetAddUnique(tmp->nodesetval, - ctxt->context->node); + if (xmlXPathNodeSetAddUnique(tmp->nodesetval, + ctxt->context->node) < 0) { + ctxt->error = XPATH_MEMORY_ERROR; + } } valuePush(ctxt, tmp); ctxt->context->contextSize = oldset->nodeNr; @@ -13766,7 +13912,9 @@ */ res = valuePop(ctxt); if (xmlXPathEvaluatePredicateResult(ctxt, res)) { - xmlXPathNodeSetAdd(newset, oldset->nodeTab[i]); + if (xmlXPathNodeSetAdd(newset, oldset->nodeTab[i]) + < 0) + ctxt->error = XPATH_MEMORY_ERROR; } /* @@ -13982,6 +14130,7 @@ } xmlGenericError(xmlGenericErrorContext, "XPath: unknown precompiled operation %d\n", op->op); + ctxt->error = XPATH_INVALID_OPERAND; return (total); } @@ -14128,7 +14277,7 @@ if (toBool) return(1); xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, - (xmlNodePtr) ctxt->doc); + (xmlNodePtr) ctxt->doc); } else { /* Select "self::node()" */ if (toBool) @@ -14221,7 +14370,11 @@ } else if (ret == 1) { if (toBool) goto return_1; - xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur); + if (xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur) + < 0) { + ctxt->lastError.domain = XML_FROM_XPATH; + ctxt->lastError.code = XML_ERR_NO_MEMORY; + } } if ((cur->children == NULL) || (depth >= max_depth)) { ret = xmlStreamPop(patstream); @@ -14237,6 +14390,7 @@ } scan_children: + if (cur->type == XML_NAMESPACE_DECL) break; if ((cur->children != NULL) && (depth < max_depth)) { /* * Do not descend on entities declarations @@ -14329,6 +14483,7 @@ ctxt->valueNr = 0; ctxt->valueMax = 10; ctxt->value = NULL; + ctxt->valueFrame = 0; } #ifdef XPATH_STREAMING if (ctxt->comp->stream) { @@ -14556,57 +14711,63 @@ } #endif /* XPATH_STREAMING */ -static int -xmlXPathCanRewriteDosExpression(xmlChar *expr) -{ - if (expr == NULL) - return(0); - do { - if ((*expr == '/') && (*(++expr) == '/')) - return(1); - } while (*expr++); - return(0); -} static void -xmlXPathRewriteDOSExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) +xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) { /* * Try to rewrite "descendant-or-self::node()/foo" to an optimized * internal representation. */ - if (op->ch1 != -1) { - if ((op->op == XPATH_OP_COLLECT /* 11 */) && - ((xmlXPathAxisVal) op->value == AXIS_CHILD /* 4 */) && - ((xmlXPathTestVal) op->value2 == NODE_TEST_NAME /* 5 */) && - ((xmlXPathTypeVal) op->value3 == NODE_TYPE_NODE /* 0 */)) - { - /* - * This is a "child::foo" - */ - xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; - if ((prevop->op == XPATH_OP_COLLECT /* 11 */) && - (prevop->ch1 != -1) && - ((xmlXPathAxisVal) prevop->value == - AXIS_DESCENDANT_OR_SELF) && - (prevop->ch2 == -1) && - ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) && - ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE) && - (comp->steps[prevop->ch1].op == XPATH_OP_ROOT)) - { - /* - * This is a "/descendant-or-self::node()" without predicates. - * Eliminate it. - */ - op->ch1 = prevop->ch1; - op->rewriteType = XP_REWRITE_DOS_CHILD_ELEM; - } + if ((op->ch1 != -1) && + (op->op == XPATH_OP_COLLECT /* 11 */)) + { + xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; + + if ((prevop->op == XPATH_OP_COLLECT /* 11 */) && + ((xmlXPathAxisVal) prevop->value == + AXIS_DESCENDANT_OR_SELF) && + (prevop->ch2 == -1) && + ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) && + ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE)) + { + /* + * This is a "descendant-or-self::node()" without predicates. + * Try to eliminate it. + */ + + switch ((xmlXPathAxisVal) op->value) { + case AXIS_CHILD: + case AXIS_DESCENDANT: + /* + * Convert "descendant-or-self::node()/child::" or + * "descendant-or-self::node()/descendant::" to + * "descendant::" + */ + op->ch1 = prevop->ch1; + op->value = AXIS_DESCENDANT; + break; + case AXIS_SELF: + case AXIS_DESCENDANT_OR_SELF: + /* + * Convert "descendant-or-self::node()/self::" or + * "descendant-or-self::node()/descendant-or-self::" to + * to "descendant-or-self::" + */ + op->ch1 = prevop->ch1; + op->value = AXIS_DESCENDANT_OR_SELF; + break; + default: + break; + } } - if (op->ch1 != -1) - xmlXPathRewriteDOSExpression(comp, &comp->steps[op->ch1]); } + + /* Recurse */ + if (op->ch1 != -1) + xmlXPathOptimizeExpression(comp, &comp->steps[op->ch1]); if (op->ch2 != -1) - xmlXPathRewriteDOSExpression(comp, &comp->steps[op->ch2]); + xmlXPathOptimizeExpression(comp, &comp->steps[op->ch2]); } /** @@ -14664,12 +14825,8 @@ comp->string = xmlStrdup(str); comp->nb = 0; #endif - if ((comp->expr != NULL) && - (comp->nbStep > 2) && - (comp->last >= 0) && - (xmlXPathCanRewriteDosExpression(comp->expr) == 1)) - { - xmlXPathRewriteDOSExpression(comp, &comp->steps[comp->last]); + if ((comp->nbStep > 1) && (comp->last >= 0)) { + xmlXPathOptimizeExpression(comp, &comp->steps[comp->last]); } } return(comp); @@ -14846,17 +15003,12 @@ #endif { xmlXPathCompileExpr(ctxt, 1); - /* - * In this scenario the expression string will sit in ctxt->base. - */ if ((ctxt->error == XPATH_EXPRESSION_OK) && (ctxt->comp != NULL) && - (ctxt->base != NULL) && - (ctxt->comp->nbStep > 2) && - (ctxt->comp->last >= 0) && - (xmlXPathCanRewriteDosExpression((xmlChar *) ctxt->base) == 1)) + (ctxt->comp->nbStep > 1) && + (ctxt->comp->last >= 0)) { - xmlXPathRewriteDOSExpression(ctxt->comp, + xmlXPathOptimizeExpression(ctxt->comp, &ctxt->comp->steps[ctxt->comp->last]); } } @@ -15030,7 +15182,7 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr str; int escape_reserved; - xmlBufferPtr target; + xmlBufPtr target; xmlChar *cptr; xmlChar escape[4]; @@ -15041,7 +15193,7 @@ CAST_TO_STRING; str = valuePop(ctxt); - target = xmlBufferCreate(); + target = xmlBufCreate(); escape[0] = '%'; escape[3] = 0; @@ -15066,7 +15218,7 @@ *cptr == ':' || *cptr == '@' || *cptr == '&' || *cptr == '=' || *cptr == '+' || *cptr == '$' || *cptr == ','))) { - xmlBufferAdd(target, cptr, 1); + xmlBufAdd(target, cptr, 1); } else { if ((*cptr >> 4) < 10) escape[1] = '0' + (*cptr >> 4); @@ -15077,13 +15229,13 @@ else escape[2] = 'A' - 10 + (*cptr & 0xF); - xmlBufferAdd(target, &escape[0], 3); + xmlBufAdd(target, &escape[0], 3); } } } valuePush(ctxt, xmlXPathCacheNewString(ctxt->context, - xmlBufferContent(target))); - xmlBufferFree(target); + xmlBufContent(target))); + xmlBufFree(target); xmlXPathReleaseObject(ctxt->context, str); } Index: lib/3rdparty/libxml2/xpointer.c =================================================================== --- lib/3rdparty/libxml2/xpointer.c (revision 58293) +++ lib/3rdparty/libxml2/xpointer.c (working copy) @@ -7,7 +7,7 @@ * * Added support for the element() scheme described in: * W3C Proposed Recommendation 13 November 2002 - * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ * * See Copyright for the status of this software. * @@ -47,19 +47,19 @@ #endif #endif -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); -#define STRANGE \ +#define STRANGE \ xmlGenericError(xmlGenericErrorContext, \ "Internal error at %s:%d\n", \ __FILE__, __LINE__); /************************************************************************ * * - * Some factorized error routines * + * Some factorized error routines * * * ************************************************************************/ @@ -134,7 +134,7 @@ static int xmlXPtrGetArity(xmlNodePtr cur) { int i; - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(-1); cur = cur->children; for (i = 0;cur != NULL;cur = cur->next) { @@ -157,7 +157,7 @@ static int xmlXPtrGetIndex(xmlNodePtr cur) { int i; - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(-1); for (i = 1;cur != NULL;cur = cur->prev) { if ((cur->type == XML_ELEMENT_NODE) || @@ -179,11 +179,11 @@ static xmlNodePtr xmlXPtrGetNthChild(xmlNodePtr cur, int no) { int i; - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(cur); cur = cur->children; for (i = 0;i <= no;cur = cur->next) { - if (cur == NULL) + if (cur == NULL) return(cur); if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || @@ -553,7 +553,7 @@ break; case XPATH_NODESET: /* - * Empty set ... + * Empty set ... */ if (end->nodesetval->nodeNr <= 0) return(NULL); @@ -731,7 +731,7 @@ if (i >= cur->locNr) { #ifdef DEBUG - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "xmlXPtrLocationSetDel: Range wasn't found in RangeList\n"); #endif return; @@ -903,7 +903,7 @@ #define NXT(val) ctxt->cur[(val)] #define CUR_PTR ctxt->cur -#define SKIP_BLANKS \ +#define SKIP_BLANKS \ while (IS_BLANK_CH(*(ctxt->cur))) NEXT #define CURRENT (*ctxt->cur) @@ -945,7 +945,7 @@ * xmlXPtrEvalXPtrPart: * @ctxt: the XPointer Parser context * @name: the preparsed Scheme for the XPtrPart - * + * * XPtrPart ::= 'xpointer' '(' XPtrExpr ')' * | Scheme '(' SchemeSpecificExpr ')' * @@ -953,7 +953,7 @@ * * SchemeSpecificExpr ::= StringWithBalancedParens * - * StringWithBalancedParens ::= + * StringWithBalancedParens ::= * [^()]* ('(' StringWithBalancedParens ')' [^()]*)* * [VC: Parenthesis escaping] * @@ -971,7 +971,7 @@ * * Parse and evaluate an XPtrPart. Basically it generates the unescaped * string and if the scheme is 'xpointer' it will call the XPath interpreter. - * + * * TODO: there is no new scheme registration mechanism */ @@ -1007,21 +1007,14 @@ NEXT; break; } - *cur++ = CUR; } else if (CUR == '(') { level++; - *cur++ = CUR; } else if (CUR == '^') { - NEXT; - if ((CUR == ')') || (CUR == '(') || (CUR == '^')) { - *cur++ = CUR; - } else { - *cur++ = '^'; - *cur++ = CUR; - } - } else { - *cur++ = CUR; + if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) { + NEXT; + } } + *cur++ = CUR; NEXT; } *cur = 0; @@ -1104,7 +1097,7 @@ xmlFree(name); XP_ERROR(XPATH_MEMORY_ERROR); } - + xmlXPathRegisterNs(ctxt->context, prefix, URI); CUR_PTR = left; xmlFree(URI); @@ -1236,7 +1229,7 @@ while (CUR == '/') { int child = 0; NEXT; - + while ((CUR >= '0') && (CUR <= '9')) { child = child * 10 + (CUR - '0'); NEXT; @@ -1260,7 +1253,7 @@ xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) { if (ctxt->valueTab == NULL) { /* Allocate the value stack */ - ctxt->valueTab = (xmlXPathObjectPtr *) + ctxt->valueTab = (xmlXPathObjectPtr *) xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); if (ctxt->valueTab == NULL) { xmlXPtrErrMemory("allocating evaluation context"); @@ -1269,6 +1262,7 @@ ctxt->valueNr = 0; ctxt->valueMax = 10; ctxt->value = NULL; + ctxt->valueFrame = 0; } SKIP_BLANKS; if (CUR == '/') { @@ -1402,13 +1396,13 @@ /* * Evaluation may push a root nodeset which is unused */ - xmlNodeSetPtr set; + xmlNodeSetPtr set; set = tmp->nodesetval; if ((set->nodeNr != 1) || (set->nodeTab[0] != (xmlNodePtr) ctx->doc)) stack++; } else - stack++; + stack++; } xmlXPathFreeObject(tmp); } @@ -1422,7 +1416,7 @@ xmlXPathFreeObject(res); res = NULL; } - + xmlXPathFreeParserContext(ctxt); return(res); } @@ -1450,11 +1444,13 @@ return(NULL); start = (xmlNodePtr) range->user; - if (start == NULL) + if ((start == NULL) || (start->type == XML_NAMESPACE_DECL)) return(NULL); end = range->user2; if (end == NULL) return(xmlCopyNode(start, 1)); + if (end->type == XML_NAMESPACE_DECL) + return(NULL); cur = start; index1 = range->index; @@ -1484,7 +1480,7 @@ /* prune and return full set */ if (last != NULL) xmlAddNextSibling(last, tmp); - else + else xmlAddChild(parent, tmp); return(list); } else { @@ -1738,7 +1734,7 @@ * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing here() operation + * Function implementing here() operation * as described in 5.4.3 */ static void @@ -1747,7 +1743,7 @@ if (ctxt->context->here == NULL) XP_ERROR(XPTR_SYNTAX_ERROR); - + valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->here, NULL)); } @@ -1756,7 +1752,7 @@ * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing origin() operation + * Function implementing origin() operation * as described in 5.4.3 */ static void @@ -1765,7 +1761,7 @@ if (ctxt->context->origin == NULL) XP_ERROR(XPTR_SYNTAX_ERROR); - + valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->origin, NULL)); } @@ -1774,7 +1770,7 @@ * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing start-point() operation + * Function implementing start-point() operation * as described in 5.4.3 * ---------------- * location-set start-point(location-set) @@ -1866,7 +1862,7 @@ * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing end-point() operation + * Function implementing end-point() operation * as described in 5.4.3 * ---------------------------- * location-set end-point(location-set) @@ -2002,7 +1998,7 @@ case XML_NOTATION_NODE: case XML_HTML_DOCUMENT_NODE: { int indx = xmlXPtrGetIndex(node); - + node = node->parent; return(xmlXPtrNewRange(node, indx - 1, node, indx + 1)); @@ -2249,7 +2245,7 @@ cur = ctxt->cur; newset = xmlXPtrLocationSetCreate(NULL); - + for (i = 0; i < oldset->nodeNr; i++) { ctxt->cur = cur; @@ -2283,7 +2279,7 @@ res = valuePop(ctxt); xmlXPathFreeObject(res); } - + ctxt->context->node = NULL; } @@ -2303,14 +2299,14 @@ * @level: incremented/decremented to show level in tree * * Advance to the next element or text node in document order - * TODO: add a stack for entering/exiting entities + * TODO: add a stack for entering/exiting entities * * Returns -1 in case of failure, 0 otherwise */ xmlNodePtr xmlXPtrAdvanceNode(xmlNodePtr cur, int *level) { next: - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(NULL); if (cur->children != NULL) { cur = cur->children ; @@ -2368,7 +2364,7 @@ if ((node == NULL) || (indx == NULL)) return(-1); cur = *node; - if (cur == NULL) + if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) return(-1); pos = *indx; @@ -2406,7 +2402,7 @@ return(0); } /* - * We should have a text (or cdata) node ... + * We should have a text (or cdata) node ... */ len = 0; if ((cur->type != XML_ELEMENT_NODE) && @@ -2459,9 +2455,10 @@ if (string == NULL) return(-1); - if (start == NULL) + if ((start == NULL) || (start->type == XML_NAMESPACE_DECL)) return(-1); - if ((end == NULL) || (endindex == NULL)) + if ((end == NULL) || (*end == NULL) || + ((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL)) return(-1); cur = start; if (cur == NULL) @@ -2544,13 +2541,12 @@ if (string == NULL) return(-1); - if ((start == NULL) || (startindex == NULL)) + if ((start == NULL) || (*start == NULL) || + ((*start)->type == XML_NAMESPACE_DECL) || (startindex == NULL)) return(-1); if ((end == NULL) || (endindex == NULL)) return(-1); cur = *start; - if (cur == NULL) - return(-1); pos = *startindex - 1; first = string[0]; @@ -2583,7 +2579,7 @@ /* * An empty string is considered to match before each * character of the string-value and after the final - * character. + * character. */ #ifdef DEBUG_RANGES xmlGenericError(xmlGenericErrorContext, @@ -2624,14 +2620,12 @@ xmlNodePtr cur; int pos, len = 0; - if ((node == NULL) || (indx == NULL)) + if ((node == NULL) || (*node == NULL) || + ((*node)->type == XML_NAMESPACE_DECL) || (indx == NULL)) return(-1); cur = *node; pos = *indx; - if (cur == NULL) - return(-1); - if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || (cur->type == XML_HTML_DOCUMENT_NODE)) { @@ -2735,7 +2729,7 @@ * @nargs: the number of args * * Function implementing the string-range() function - * range as described in 5.4.2 + * range as described in 5.4.2 * * ------------------------------ * [Definition: For each location in the location-set argument, @@ -2899,7 +2893,7 @@ * @ctxt: the XPointer Parser context * * [8] Predicate ::= '[' PredicateExpr ']' - * [9] PredicateExpr ::= Expr + * [9] PredicateExpr ::= Expr * * Evaluate a predicate as in xmlXPathEvalPredicate() but for * a Location Set instead of a node set @@ -2948,7 +2942,7 @@ */ cur = ctxt->cur; newset = xmlXPtrLocationSetCreate(NULL); - + for (i = 0; i < oldset->locNr; i++) { ctxt->cur = cur; @@ -2984,7 +2978,7 @@ res = valuePop(ctxt); xmlXPathFreeObject(res); } - + ctxt->context->node = NULL; } Index: lib/3rdparty/libxml2/xzlib.c =================================================================== --- lib/3rdparty/libxml2/xzlib.c (revision 0) +++ lib/3rdparty/libxml2/xzlib.c (working copy) @@ -0,0 +1,755 @@ +/** + * xzlib.c: front end for the transparent suport of lzma compression + * at the I/O layer, based on an example file from lzma project + * + * See Copyright for the status of this software. + * + * Anders F Bjorklund + */ +#define IN_LIBXML +#include "libxml.h" +#ifdef HAVE_LZMA_H + +#include +#ifdef HAVE_ERRNO_H +#include +#endif + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_ZLIB_H +#include +#endif +#include + +#include "xzlib.h" +#include + +/* values for xz_state how */ +#define LOOK 0 /* look for a gzip/lzma header */ +#define COPY 1 /* copy input directly */ +#define GZIP 2 /* decompress a gzip stream */ +#define LZMA 3 /* decompress a lzma stream */ + +/* internal lzma file state data structure */ +typedef struct { + int mode; /* see lzma modes above */ + int fd; /* file descriptor */ + char *path; /* path or fd for error messages */ + uint64_t pos; /* current position in uncompressed data */ + unsigned int size; /* buffer size, zero if not allocated yet */ + unsigned int want; /* requested buffer size, default is BUFSIZ */ + unsigned char *in; /* input buffer */ + unsigned char *out; /* output buffer (double-sized when reading) */ + unsigned char *next; /* next output data to deliver or write */ + unsigned int have; /* amount of output data unused at next */ + int eof; /* true if end of input file reached */ + uint64_t start; /* where the lzma data started, for rewinding */ + uint64_t raw; /* where the raw data started, for seeking */ + int how; /* 0: get header, 1: copy, 2: decompress */ + int direct; /* true if last read direct, false if lzma */ + /* seek request */ + uint64_t skip; /* amount to skip (already rewound if backwards) */ + int seek; /* true if seek request pending */ + /* error information */ + int err; /* error code */ + char *msg; /* error message */ + /* lzma stream */ + int init; /* is the iniflate 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 HAVE_ZLIB_H + /* zlib inflate or deflate stream */ + z_stream zstrm; /* stream structure in-place (not a pointer) */ +#endif + char padding2[32]; /* padding allowing to cope with possible + extensions of above structure without + too much side effect */ +} xz_state, *xz_statep; + +static void +xz_error(xz_statep state, int err, const char *msg) +{ + /* free previously allocated message and clear */ + if (state->msg != NULL) { + if (state->err != LZMA_MEM_ERROR) + xmlFree(state->msg); + state->msg = NULL; + } + + /* set error code, and if no message, then done */ + state->err = err; + if (msg == NULL) + return; + + /* for an out of memory error, save as static string */ + if (err == LZMA_MEM_ERROR) { + state->msg = (char *) msg; + return; + } + + /* construct error message with path */ + if ((state->msg = + xmlMalloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { + state->err = LZMA_MEM_ERROR; + state->msg = (char *) "out of memory"; + return; + } + strcpy(state->msg, state->path); + strcat(state->msg, ": "); + strcat(state->msg, msg); + return; +} + +static void +xz_reset(xz_statep state) +{ + state->have = 0; /* no output data available */ + state->eof = 0; /* not at end of file */ + state->how = LOOK; /* look for gzip header */ + state->direct = 1; /* default for empty file */ + state->seek = 0; /* no seek request pending */ + 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 HAVE_ZLIB_H + state->zstrm.avail_in = 0; /* no input data yet */ +#endif +} + +static xzFile +xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED) +{ + xz_statep state; + + /* allocate xzFile structure to return */ + state = xmlMalloc(sizeof(xz_state)); + if (state == NULL) + return NULL; + state->size = 0; /* no buffers allocated yet */ + state->want = BUFSIZ; /* requested buffer size */ + state->msg = NULL; /* no error message yet */ + state->init = 0; /* initialization of zlib data */ + + /* save the path name for error messages */ + state->path = xmlMalloc(strlen(path) + 1); + if (state->path == NULL) { + xmlFree(state); + return NULL; + } + strcpy(state->path, path); + + /* open the file with the appropriate mode (or just use fd) */ + state->fd = fd != -1 ? fd : open(path, +#ifdef O_LARGEFILE + O_LARGEFILE | +#endif +#ifdef O_BINARY + O_BINARY | +#endif + O_RDONLY, 0666); + if (state->fd == -1) { + xmlFree(state->path); + xmlFree(state); + return NULL; + } + + /* save the current position for rewinding (only if reading) */ + state->start = lseek(state->fd, 0, SEEK_CUR); + if (state->start == (uint64_t) - 1) + state->start = 0; + + /* initialize stream */ + xz_reset(state); + + /* return stream */ + return (xzFile) state; +} + +xzFile +__libxml2_xzopen(const char *path, const char *mode) +{ + return xz_open(path, -1, mode); +} + +xzFile +__libxml2_xzdopen(int fd, const char *mode) +{ + char *path; /* identifier for error messages */ + xzFile xz; + + if (fd == -1 || (path = xmlMalloc(7 + 3 * sizeof(int))) == NULL) + return NULL; + sprintf(path, "", fd); /* for debugging */ + xz = xz_open(path, fd, mode); + xmlFree(path); + return xz; +} + +static int +xz_load(xz_statep state, unsigned char *buf, unsigned int len, + unsigned int *have) +{ + int ret; + + *have = 0; + do { + ret = read(state->fd, buf + *have, len - *have); + if (ret <= 0) + break; + *have += ret; + } while (*have < len); + if (ret < 0) { + xz_error(state, -1, strerror(errno)); + return -1; + } + if (ret == 0) + state->eof = 1; + return 0; +} + +static int +xz_avail(xz_statep state) +{ + lzma_stream *strm = &(state->strm); + + if (state->err != LZMA_OK) + return -1; + if (state->eof == 0) { + /* avail_in is size_t, which is not necessary sizeof(unsigned) */ + unsigned tmp = strm->avail_in; + + if (xz_load(state, state->in, state->size, &tmp) == -1) { + strm->avail_in = tmp; + return -1; + } + strm->avail_in = tmp; + strm->next_in = state->in; + } + return 0; +} + +static int +is_format_xz(xz_statep state) +{ + lzma_stream *strm = &(state->strm); + + return strm->avail_in >= 6 && memcmp(state->in, "\3757zXZ", 6) == 0; +} + +static int +is_format_lzma(xz_statep state) +{ + lzma_stream *strm = &(state->strm); + + lzma_filter filter; + lzma_options_lzma *opt; + uint32_t dict_size; + uint64_t uncompressed_size; + size_t i; + + if (strm->avail_in < 13) + return 0; + + filter.id = LZMA_FILTER_LZMA1; + if (lzma_properties_decode(&filter, NULL, state->in, 5) != LZMA_OK) + return 0; + + opt = filter.options; + dict_size = opt->dict_size; + free(opt); /* we can't use xmlFree on a string returned by zlib */ + + /* A hack to ditch tons of false positives: We allow only dictionary + * sizes that are 2^n or 2^n + 2^(n-1) or UINT32_MAX. LZMA_Alone + * created only files with 2^n, but accepts any dictionary size. + * If someone complains, this will be reconsidered. + */ + if (dict_size != UINT32_MAX) { + uint32_t d = dict_size - 1; + + d |= d >> 2; + d |= d >> 3; + d |= d >> 4; + d |= d >> 8; + d |= d >> 16; + ++d; + if (d != dict_size || dict_size == 0) + return 0; + } + + /* Another hack to ditch false positives: Assume that if the + * uncompressed size is known, it must be less than 256 GiB. + * Again, if someone complains, this will be reconsidered. + */ + uncompressed_size = 0; + for (i = 0; i < 8; ++i) + uncompressed_size |= (uint64_t) (state->in[5 + i]) << (i * 8); + + if (uncompressed_size != UINT64_MAX + && uncompressed_size > (UINT64_C(1) << 38)) + return 0; + + return 1; +} + +#ifdef HAVE_ZLIB_H + +/* Get next byte from input, or -1 if end or error. */ +#define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \ + (strm->avail_in == 0 ? -1 : \ + (strm->avail_in--, *(strm->next_in)++))) + +/* Get a four-byte little-endian integer and return 0 on success and the value + in *ret. Otherwise -1 is returned and *ret is not modified. */ +static int +gz_next4(xz_statep state, unsigned long *ret) +{ + int ch; + unsigned long val; + z_streamp strm = &(state->zstrm); + + val = NEXT(); + val += (unsigned) NEXT() << 8; + val += (unsigned long) NEXT() << 16; + ch = NEXT(); + if (ch == -1) + return -1; + val += (unsigned long) ch << 24; + *ret = val; + return 0; +} +#endif + +static int +xz_head(xz_statep state) +{ + lzma_stream *strm = &(state->strm); + lzma_stream init = LZMA_STREAM_INIT; + int flags; + unsigned len; + + /* allocate read buffers and inflate memory */ + if (state->size == 0) { + /* allocate buffers */ + state->in = xmlMalloc(state->want); + state->out = xmlMalloc(state->want << 1); + if (state->in == NULL || state->out == NULL) { + if (state->out != NULL) + xmlFree(state->out); + if (state->in != NULL) + xmlFree(state->in); + xz_error(state, LZMA_MEM_ERROR, "out of memory"); + return -1; + } + state->size = state->want; + + /* allocate decoder memory */ + state->strm = init; + state->strm.avail_in = 0; + state->strm.next_in = NULL; + if (lzma_auto_decoder(&state->strm, UINT64_MAX, 0) != LZMA_OK) { + xmlFree(state->out); + xmlFree(state->in); + state->size = 0; + xz_error(state, LZMA_MEM_ERROR, "out of memory"); + return -1; + } +#ifdef HAVE_ZLIB_H + /* allocate inflate memory */ + state->zstrm.zalloc = Z_NULL; + state->zstrm.zfree = Z_NULL; + state->zstrm.opaque = Z_NULL; + state->zstrm.avail_in = 0; + state->zstrm.next_in = Z_NULL; + if (state->init == 0) { + if (inflateInit2(&(state->zstrm), -15) != Z_OK) {/* raw inflate */ + xmlFree(state->out); + xmlFree(state->in); + state->size = 0; + xz_error(state, LZMA_MEM_ERROR, "out of memory"); + return -1; + } + state->init = 1; + } +#endif + } + + /* get some data in the input buffer */ + if (strm->avail_in == 0) { + if (xz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) + return 0; + } + + /* look for the xz magic header bytes */ + if (is_format_xz(state) || is_format_lzma(state)) { + state->how = LZMA; + state->direct = 0; + return 0; + } +#ifdef HAVE_ZLIB_H + /* look for the gzip magic header bytes 31 and 139 */ + if (strm->next_in[0] == 31) { + strm->avail_in--; + strm->next_in++; + if (strm->avail_in == 0 && xz_avail(state) == -1) + return -1; + if (strm->avail_in && strm->next_in[0] == 139) { + /* we have a gzip header, woo hoo! */ + strm->avail_in--; + strm->next_in++; + + /* skip rest of header */ + if (NEXT() != 8) { /* compression method */ + xz_error(state, LZMA_DATA_ERROR, + "unknown compression method"); + return -1; + } + flags = NEXT(); + if (flags & 0xe0) { /* reserved flag bits */ + xz_error(state, LZMA_DATA_ERROR, + "unknown header flags set"); + return -1; + } + NEXT(); /* modification time */ + NEXT(); + NEXT(); + NEXT(); + NEXT(); /* extra flags */ + NEXT(); /* operating system */ + if (flags & 4) { /* extra field */ + len = (unsigned) NEXT(); + len += (unsigned) NEXT() << 8; + while (len--) + if (NEXT() < 0) + break; + } + if (flags & 8) /* file name */ + while (NEXT() > 0) ; + if (flags & 16) /* comment */ + while (NEXT() > 0) ; + if (flags & 2) { /* header crc */ + NEXT(); + NEXT(); + } + /* an unexpected end of file is not checked for here -- it will be + * noticed on the first request for uncompressed data */ + + /* set up for decompression */ + inflateReset(&state->zstrm); + state->zstrm.adler = crc32(0L, Z_NULL, 0); + state->how = GZIP; + state->direct = 0; + return 0; + } else { + /* not a gzip file -- save first byte (31) and fall to raw i/o */ + state->out[0] = 31; + state->have = 1; + } + } +#endif + + /* doing raw i/o, save start of raw data for seeking, copy any leftover + * input to output -- this assumes that the output buffer is larger than + * the input buffer, which also assures space for gzungetc() */ + state->raw = state->pos; + state->next = state->out; + if (strm->avail_in) { + memcpy(state->next + state->have, strm->next_in, strm->avail_in); + state->have += strm->avail_in; + strm->avail_in = 0; + } + state->how = COPY; + state->direct = 1; + return 0; +} + +static int +xz_decomp(xz_statep state) +{ + int ret; + unsigned had; + unsigned long crc, len; + lzma_stream *strm = &(state->strm); + + lzma_action action = LZMA_RUN; + + /* fill output buffer up to end of deflate stream */ + had = strm->avail_out; + do { + /* get more input for inflate() */ + if (strm->avail_in == 0 && xz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) { + xz_error(state, LZMA_DATA_ERROR, "unexpected end of file"); + return -1; + } + if (state->eof) + action = LZMA_FINISH; + + /* decompress and handle errors */ +#ifdef HAVE_ZLIB_H + if (state->how == GZIP) { + state->zstrm.avail_in = (uInt) state->strm.avail_in; + state->zstrm.next_in = (Bytef *) state->strm.next_in; + state->zstrm.avail_out = (uInt) state->strm.avail_out; + state->zstrm.next_out = (Bytef *) state->strm.next_out; + ret = inflate(&state->zstrm, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) { + xz_error(state, Z_STREAM_ERROR, + "internal error: inflate stream corrupt"); + return -1; + } + if (ret == Z_MEM_ERROR) + ret = LZMA_MEM_ERROR; + if (ret == Z_DATA_ERROR) + ret = LZMA_DATA_ERROR; + if (ret == Z_STREAM_END) + ret = LZMA_STREAM_END; + state->strm.avail_in = state->zstrm.avail_in; + state->strm.next_in = state->zstrm.next_in; + state->strm.avail_out = state->zstrm.avail_out; + state->strm.next_out = state->zstrm.next_out; + } else /* state->how == LZMA */ +#endif + ret = lzma_code(strm, action); + if (ret == LZMA_MEM_ERROR) { + xz_error(state, LZMA_MEM_ERROR, "out of memory"); + return -1; + } + if (ret == LZMA_DATA_ERROR) { + xz_error(state, LZMA_DATA_ERROR, "compressed data 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 HAVE_ZLIB_H + state->zstrm.adler = + crc32(state->zstrm.adler, state->next, state->have); +#endif + + if (ret == LZMA_STREAM_END) { +#ifdef HAVE_ZLIB_H + 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"); + return -1; + } + if (crc != state->zstrm.adler) { + xz_error(state, LZMA_DATA_ERROR, "incorrect data check"); + return -1; + } + if (len != (state->zstrm.total_out & 0xffffffffL)) { + xz_error(state, LZMA_DATA_ERROR, "incorrect length check"); + return -1; + } + state->strm.avail_in = 0; + state->strm.next_in = NULL; + state->strm.avail_out = 0; + state->strm.next_out = NULL; + } else +#endif + if (strm->avail_in != 0 || !state->eof) { + xz_error(state, LZMA_DATA_ERROR, "trailing garbage"); + return -1; + } + state->how = LOOK; /* ready for next stream, once have is 0 (leave + * state->direct unchanged to remember how) */ + } + + /* good decompression */ + return 0; +} + +static int +xz_make(xz_statep state) +{ + lzma_stream *strm = &(state->strm); + + if (state->how == LOOK) { /* look for lzma / gzip header */ + if (xz_head(state) == -1) + return -1; + if (state->have) /* got some data from xz_head() */ + return 0; + } + if (state->how == COPY) { /* straight copy */ + if (xz_load(state, state->out, state->size << 1, &(state->have)) == + -1) + return -1; + state->next = state->out; + } else if (state->how == LZMA || state->how == GZIP) { /* decompress */ + strm->avail_out = state->size << 1; + strm->next_out = state->out; + if (xz_decomp(state) == -1) + return -1; + } + return 0; +} + +static int +xz_skip(xz_statep state, uint64_t len) +{ + unsigned n; + + /* skip over len bytes or reach end-of-file, whichever comes first */ + while (len) + /* skip over whatever is in output buffer */ + if (state->have) { + n = (uint64_t) state->have > len ? + (unsigned) len : state->have; + state->have -= n; + state->next += n; + state->pos += n; + len -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && state->strm.avail_in == 0) + break; + + /* need more data to skip -- load up output buffer */ + else { + /* get more output, looking for header if required */ + if (xz_make(state) == -1) + return -1; + } + return 0; +} + +int +__libxml2_xzread(xzFile file, void *buf, unsigned len) +{ + unsigned got, n; + xz_statep state; + lzma_stream *strm; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (xz_statep) file; + strm = &(state->strm); + + /* check that we're reading and that there's no error */ + if (state->err != LZMA_OK) + return -1; + + /* since an int is returned, make sure len fits in one, otherwise return + * with an error (this avoids the flaw in the interface) */ + if ((int) len < 0) { + xz_error(state, LZMA_BUF_ERROR, + "requested length does not fit in int"); + return -1; + } + + /* if len is zero, avoid unnecessary operations */ + if (len == 0) + return 0; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (xz_skip(state, state->skip) == -1) + return -1; + } + + /* get len bytes to buf, or less than len if at the end */ + got = 0; + do { + /* first just try copying data from the output buffer */ + if (state->have) { + n = state->have > len ? len : state->have; + memcpy(buf, state->next, n); + state->next += n; + state->have -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && strm->avail_in == 0) + break; + + /* need output data -- for small len or new stream load up our output + * buffer */ + else if (state->how == LOOK || len < (state->size << 1)) { + /* get more output, looking for header if required */ + if (xz_make(state) == -1) + return -1; + continue; /* no progress yet -- go back to memcpy() above */ + /* the copy above assures that we will leave with space in the + * output buffer, allowing at least one gzungetc() to succeed */ + } + + /* large len -- read directly into user buffer */ + else if (state->how == COPY) { /* read directly */ + if (xz_load(state, buf, len, &n) == -1) + return -1; + } + + /* large len -- decompress directly into user buffer */ + else { /* state->how == LZMA */ + strm->avail_out = len; + strm->next_out = buf; + if (xz_decomp(state) == -1) + return -1; + n = state->have; + state->have = 0; + } + + /* update progress */ + len -= n; + buf = (char *) buf + n; + got += n; + state->pos += n; + } while (len); + + /* return number of bytes read into user buffer (will fit in int) */ + return (int) got; +} + +int +__libxml2_xzclose(xzFile file) +{ + int ret; + xz_statep state; + + /* get internal structure */ + if (file == NULL) + return LZMA_DATA_ERROR; + state = (xz_statep) file; + + /* free memory and close file */ + if (state->size) { + lzma_end(&(state->strm)); +#ifdef HAVE_ZLIB_H + if (state->init == 1) + inflateEnd(&(state->zstrm)); + state->init = 0; +#endif + xmlFree(state->out); + xmlFree(state->in); + } + xmlFree(state->path); + ret = close(state->fd); + xmlFree(state); + return ret ? ret : LZMA_OK; +} +#endif /* HAVE_LZMA_H */ Index: lib/3rdparty/libxml2/xzlib.h =================================================================== --- lib/3rdparty/libxml2/xzlib.h (revision 0) +++ lib/3rdparty/libxml2/xzlib.h (working copy) @@ -0,0 +1,18 @@ +/** + * xzlib.h: header for the front end for the transparent suport of lzma + * compression at the I/O layer + * + * See Copyright for the status of this software. + * + * Anders F Bjorklund + */ + +#ifndef LIBXML2_XZLIB_H +#define LIBXML2_XZLIB_H +typedef void *xzFile; /* opaque lzma file descriptor */ + +xzFile __libxml2_xzopen(const char *path, const char *mode); +xzFile __libxml2_xzdopen(int fd, const char *mode); +int __libxml2_xzread(xzFile file, void *buf, unsigned len); +int __libxml2_xzclose(xzFile file); +#endif /* LIBXML2_XZLIB_H */