18#ifdef LIBXML_CATALOG_ENABLED
43#define MAX_DELEGATE 50
44#define MAX_CATAL_DEPTH 50
47# define PATH_SEPARATOR ';'
49# define PATH_SEPARATOR ':'
63 xmlGenericError(xmlGenericErrorContext, \
64 "Unimplemented block at %s:%d\n", \
67#define XML_URN_PUBID "urn:publicid:"
68#define XML_CATAL_BREAK ((xmlChar *) -1)
69#ifndef XML_XML_DEFAULT_CATALOG
70#define XML_XML_DEFAULT_CATALOG "file://" SYSCONFDIR "/xml/catalog"
72#ifndef XML_SGML_DEFAULT_CATALOG
73#define XML_SGML_DEFAULT_CATALOG "file://" SYSCONFDIR "/sgml/catalog"
76#if defined(_WIN32) && defined(_MSC_VER)
77#undef XML_XML_DEFAULT_CATALOG
78static char XML_XML_DEFAULT_CATALOG[256] =
"file://" SYSCONFDIR "/xml/catalog";
79#if !defined(_WINDOWS_)
86static int xmlExpandCatalog(xmlCatalogPtr catal,
const char *
filename);
95 XML_CATA_REMOVED = -1,
98 XML_CATA_BROKEN_CATALOG,
99 XML_CATA_NEXT_CATALOG,
103 XML_CATA_REWRITE_SYSTEM,
104 XML_CATA_DELEGATE_PUBLIC,
105 XML_CATA_DELEGATE_SYSTEM,
107 XML_CATA_REWRITE_URI,
108 XML_CATA_DELEGATE_URI,
121} xmlCatalogEntryType;
123typedef struct _xmlCatalogEntry xmlCatalogEntry;
124typedef xmlCatalogEntry *xmlCatalogEntryPtr;
125struct _xmlCatalogEntry {
126 struct _xmlCatalogEntry *
next;
127 struct _xmlCatalogEntry *
parent;
128 struct _xmlCatalogEntry *children;
129 xmlCatalogEntryType
type;
133 xmlCatalogPrefer prefer;
136 struct _xmlCatalogEntry *
group;
140 XML_XML_CATALOG_TYPE = 1,
141 XML_SGML_CATALOG_TYPE
144#define XML_MAX_SGML_CATA_DEPTH 10
153 char *catalTab[XML_MAX_SGML_CATA_DEPTH];
161 xmlCatalogPrefer prefer;
162 xmlCatalogEntryPtr xml;
174static int xmlDebugCatalogs = 0;
175static xmlCatalogAllow xmlCatalogDefaultAllow = XML_CATA_ALLOW_ALL;
176static xmlCatalogPrefer xmlCatalogDefaultPrefer = XML_CATA_PREFER_PUBLIC;
187static xmlCatalogPtr xmlDefaultCatalog =
NULL;
200static int xmlCatalogInitialized = 0;
215xmlCatalogErrMemory(
const char *
extra)
220 "Memory allocation failed : %s\n",
extra);
233xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr
node,
int error,
239 (
const char *)
str1, (
const char *)
str2,
240 (
const char *) str3, 0, 0,
264static xmlCatalogEntryPtr
267 xmlCatalogEntryPtr
group) {
268 xmlCatalogEntryPtr
ret;
271 ret = (xmlCatalogEntryPtr)
xmlMalloc(
sizeof(xmlCatalogEntry));
273 xmlCatalogErrMemory(
"allocating catalog entry");
280 if (
type == XML_CATA_PUBLIC ||
type == XML_CATA_DELEGATE_PUBLIC) {
281 normid = xmlCatalogNormalizePublic(
name);
283 name = (*normid != 0 ? normid :
NULL);
301 ret->prefer = prefer;
309xmlFreeCatalogEntryList(xmlCatalogEntryPtr
ret);
319 xmlCatalogEntryPtr
ret = (xmlCatalogEntryPtr) payload;
326 if (
ret->dealloc == 1)
329 if (xmlDebugCatalogs) {
332 "Free catalog entry %s\n",
ret->name);
335 "Free catalog entry %s\n",
ret->value);
338 "Free catalog entry\n");
357xmlFreeCatalogEntryList(xmlCatalogEntryPtr
ret) {
358 xmlCatalogEntryPtr
next;
362 xmlFreeCatalogEntry(
ret,
NULL);
375xmlFreeCatalogHashEntryList(
void *payload,
377 xmlCatalogEntryPtr catal = (xmlCatalogEntryPtr) payload;
378 xmlCatalogEntryPtr children,
next;
383 children = catal->children;
384 while (children !=
NULL) {
385 next = children->next;
386 children->dealloc = 0;
387 children->children =
NULL;
388 xmlFreeCatalogEntry(children,
NULL);
392 xmlFreeCatalogEntry(catal,
NULL);
406xmlCreateNewCatalog(xmlCatalogType
type, xmlCatalogPrefer prefer) {
411 xmlCatalogErrMemory(
"allocating catalog");
417 ret->catalMax = XML_MAX_SGML_CATA_DEPTH;
418 ret->prefer = prefer;
419 if (
ret->type == XML_SGML_CATALOG_TYPE)
431xmlFreeCatalog(xmlCatalogPtr catal) {
434 if (catal->xml !=
NULL)
435 xmlFreeCatalogEntryList(catal->xml);
436 if (catal->sgml !=
NULL)
447#ifdef LIBXML_OUTPUT_ENABLED
456xmlCatalogDumpEntry(
void *payload,
void *
data,
458 xmlCatalogEntryPtr
entry = (xmlCatalogEntryPtr) payload;
462 switch (
entry->type) {
463 case SGML_CATA_ENTITY:
465 case SGML_CATA_PENTITY:
467 case SGML_CATA_DOCTYPE:
469 case SGML_CATA_LINKTYPE:
471 case SGML_CATA_NOTATION:
473 case SGML_CATA_PUBLIC:
475 case SGML_CATA_SYSTEM:
477 case SGML_CATA_DELEGATE:
481 case SGML_CATA_CATALOG:
483 case SGML_CATA_DOCUMENT:
485 case SGML_CATA_SGMLDECL:
490 switch (
entry->type) {
491 case SGML_CATA_ENTITY:
492 case SGML_CATA_PENTITY:
493 case SGML_CATA_DOCTYPE:
494 case SGML_CATA_LINKTYPE:
495 case SGML_CATA_NOTATION:
497 case SGML_CATA_PUBLIC:
498 case SGML_CATA_SYSTEM:
499 case SGML_CATA_SGMLDECL:
500 case SGML_CATA_DOCUMENT:
501 case SGML_CATA_CATALOG:
503 case SGML_CATA_DELEGATE:
508 switch (
entry->type) {
509 case SGML_CATA_ENTITY:
510 case SGML_CATA_PENTITY:
511 case SGML_CATA_DOCTYPE:
512 case SGML_CATA_LINKTYPE:
513 case SGML_CATA_NOTATION:
514 case SGML_CATA_PUBLIC:
515 case SGML_CATA_SYSTEM:
516 case SGML_CATA_DELEGATE:
535static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr catal, xmlNodePtr catalog,
536 xmlDocPtr doc, xmlNsPtr
ns, xmlCatalogEntryPtr cgroup) {
538 xmlCatalogEntryPtr
cur;
544 if (
cur->group == cgroup) {
546 case XML_CATA_REMOVED:
548 case XML_CATA_BROKEN_CATALOG:
549 case XML_CATA_CATALOG:
555 case XML_CATA_NEXT_CATALOG:
558 xmlAddChild(catalog,
node);
567 xns = xmlSearchNsByHref(doc,
node, XML_XML_NAMESPACE);
572 switch (
cur->prefer) {
573 case XML_CATA_PREFER_NONE:
575 case XML_CATA_PREFER_PUBLIC:
578 case XML_CATA_PREFER_SYSTEM:
583 xmlAddChild(catalog,
node);
585 case XML_CATA_PUBLIC:
589 xmlAddChild(catalog,
node);
591 case XML_CATA_SYSTEM:
595 xmlAddChild(catalog,
node);
597 case XML_CATA_REWRITE_SYSTEM:
601 xmlAddChild(catalog,
node);
603 case XML_CATA_DELEGATE_PUBLIC:
607 xmlAddChild(catalog,
node);
609 case XML_CATA_DELEGATE_SYSTEM:
613 xmlAddChild(catalog,
node);
619 xmlAddChild(catalog,
node);
621 case XML_CATA_REWRITE_URI:
625 xmlAddChild(catalog,
node);
627 case XML_CATA_DELEGATE_URI:
631 xmlAddChild(catalog,
node);
633 case SGML_CATA_SYSTEM:
634 case SGML_CATA_PUBLIC:
635 case SGML_CATA_ENTITY:
636 case SGML_CATA_PENTITY:
637 case SGML_CATA_DOCTYPE:
638 case SGML_CATA_LINKTYPE:
639 case SGML_CATA_NOTATION:
640 case SGML_CATA_DELEGATE:
642 case SGML_CATA_CATALOG:
643 case SGML_CATA_DOCUMENT:
644 case SGML_CATA_SGMLDECL:
653xmlDumpXMLCatalog(
FILE *
out, xmlCatalogEntryPtr catal) {
659 xmlOutputBufferPtr
buf;
664 doc = xmlNewDoc(
NULL);
667 dtd = xmlNewDtd(doc,
BAD_CAST "catalog",
668 BAD_CAST "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN",
669BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd");
671 xmlAddChild((xmlNodePtr) doc, (xmlNodePtr) dtd);
673 ns = xmlNewNs(
NULL, XML_CATALOGS_NAMESPACE,
NULL);
679 if (catalog ==
NULL) {
685 xmlAddChild((xmlNodePtr) doc, catalog);
687 xmlDumpXMLCatalogNode(catal, catalog, doc,
ns,
NULL);
722xmlCatalogConvertEntry(
void *payload,
void *
data,
724 xmlCatalogEntryPtr
entry = (xmlCatalogEntryPtr) payload;
725 xmlCatalogPtr catal = (xmlCatalogPtr)
data;
727 (catal->xml ==
NULL))
729 switch (
entry->type) {
730 case SGML_CATA_ENTITY:
731 entry->type = XML_CATA_PUBLIC;
733 case SGML_CATA_PENTITY:
734 entry->type = XML_CATA_PUBLIC;
736 case SGML_CATA_DOCTYPE:
737 entry->type = XML_CATA_PUBLIC;
739 case SGML_CATA_LINKTYPE:
740 entry->type = XML_CATA_PUBLIC;
742 case SGML_CATA_NOTATION:
743 entry->type = XML_CATA_PUBLIC;
745 case SGML_CATA_PUBLIC:
746 entry->type = XML_CATA_PUBLIC;
748 case SGML_CATA_SYSTEM:
749 entry->type = XML_CATA_SYSTEM;
751 case SGML_CATA_DELEGATE:
752 entry->type = XML_CATA_DELEGATE_PUBLIC;
754 case SGML_CATA_CATALOG:
755 entry->type = XML_CATA_CATALOG;
766 entry->parent = catal->xml;
768 if (catal->xml->children ==
NULL)
769 catal->xml->children =
entry;
771 xmlCatalogEntryPtr prev;
773 prev = catal->xml->children;
774 while (prev->next !=
NULL)
789xmlConvertSGMLCatalog(xmlCatalogPtr catal) {
791 if ((catal ==
NULL) || (catal->type != XML_SGML_CATALOG_TYPE))
794 if (xmlDebugCatalogs) {
796 "Converting SGML catalog to XML\n");
798 xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal);
818xmlCatalogUnWrapURN(
const xmlChar *urn) {
824 urn +=
sizeof(XML_URN_PUBID) - 1;
832 }
else if (*urn ==
':') {
836 }
else if (*urn ==
';') {
840 }
else if (*urn ==
'%') {
841 if ((urn[1] ==
'2') && (urn[2] ==
'B'))
843 else if ((urn[1] ==
'3') && (urn[2] ==
'A'))
845 else if ((urn[1] ==
'2') && (urn[2] ==
'F'))
847 else if ((urn[1] ==
'3') && (urn[2] ==
'B'))
849 else if ((urn[1] ==
'2') && (urn[2] ==
'7'))
851 else if ((urn[1] ==
'3') && (urn[2] ==
'F'))
853 else if ((urn[1] ==
'2') && (urn[2] ==
'3'))
855 else if ((urn[1] ==
'2') && (urn[2] ==
'5'))
884xmlParseCatalogFile(
const char *
filename) {
886 xmlParserCtxtPtr ctxt;
888 xmlParserInputPtr inputStream;
889 xmlParserInputBufferPtr
buf;
893 xmlCatalogErrMemory(
"allocating parser context");
904 if (inputStream ==
NULL) {
911 inputStream->buf =
buf;
915 if (ctxt->directory ==
NULL)
921 ctxt->loadsubset = 0;
927 if (ctxt->wellFormed)
931 xmlFreeDoc(ctxt->myDoc);
948xmlLoadFileContent(
const char *
filename)
989 xmlCatalogErrMemory(
"allocating catalog data");
1026xmlCatalogNormalizePublic(
const xmlChar *pubID)
1038 for (
p = pubID;*
p != 0 &&
ok;
p++) {
1041 else if (*
p == 0x20 && !white)
1052 for (
p = pubID;*
p != 0;
p++) {
1074static xmlCatalogEntryPtr
1075xmlParseXMLCatalogFile(xmlCatalogPrefer prefer,
const xmlChar *
filename);
1077xmlParseXMLCatalogNodeList(xmlNodePtr
cur, xmlCatalogPrefer prefer,
1078 xmlCatalogEntryPtr
parent, xmlCatalogEntryPtr cgroup);
1080xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal,
const xmlChar *pubID,
1083xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal,
const xmlChar *URI);
1094static xmlCatalogEntryType
1096 xmlCatalogEntryType
type = XML_CATA_NONE;
1098 type = XML_CATA_SYSTEM;
1100 type = XML_CATA_PUBLIC;
1102 type = XML_CATA_REWRITE_SYSTEM;
1104 type = XML_CATA_DELEGATE_PUBLIC;
1106 type = XML_CATA_DELEGATE_SYSTEM;
1108 type = XML_CATA_URI;
1110 type = XML_CATA_REWRITE_URI;
1112 type = XML_CATA_DELEGATE_URI;
1114 type = XML_CATA_NEXT_CATALOG;
1116 type = XML_CATA_CATALOG;
1135static xmlCatalogEntryPtr
1136xmlParseXMLCatalogOneNode(xmlNodePtr
cur, xmlCatalogEntryType
type,
1138 const xmlChar *uriAttrName, xmlCatalogPrefer prefer,
1139 xmlCatalogEntryPtr cgroup) {
1145 xmlCatalogEntryPtr
ret =
NULL;
1147 if (attrName !=
NULL) {
1148 nameValue = xmlGetProp(
cur, attrName);
1149 if (nameValue ==
NULL) {
1151 "%s entry lacks '%s'\n",
name, attrName,
NULL);
1155 uriValue = xmlGetProp(
cur, uriAttrName);
1156 if (uriValue ==
NULL) {
1158 "%s entry lacks '%s'\n",
name, uriAttrName,
NULL);
1162 if (nameValue !=
NULL)
1164 if (uriValue !=
NULL)
1172 if (xmlDebugCatalogs > 1) {
1173 if (nameValue !=
NULL)
1175 "Found %s: '%s' '%s'\n",
name, nameValue, URL);
1178 "Found %s: '%s'\n",
name, URL);
1180 ret = xmlNewCatalogEntry(
type, nameValue, uriValue, URL, prefer, cgroup);
1183 "%s entry '%s' broken ?: %s\n",
name, uriAttrName, uriValue);
1185 if (nameValue !=
NULL)
1187 if (uriValue !=
NULL)
1208xmlParseXMLCatalogNode(xmlNodePtr
cur, xmlCatalogPrefer prefer,
1209 xmlCatalogEntryPtr
parent, xmlCatalogEntryPtr cgroup)
1218 xmlCatalogPrefer pref = XML_CATA_PREFER_NONE;
1223 prefer = XML_CATA_PREFER_SYSTEM;
1225 prefer = XML_CATA_PREFER_PUBLIC;
1228 "Invalid value for prefer: '%s'\n",
1236 entry = xmlNewCatalogEntry(XML_CATA_GROUP, prop,
base,
NULL, pref, cgroup);
1239 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_PUBLIC,
1242 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_SYSTEM,
1245 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_REWRITE_SYSTEM,
1247 BAD_CAST "rewritePrefix", prefer, cgroup);
1249 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_DELEGATE_PUBLIC,
1251 BAD_CAST "catalog", prefer, cgroup);
1253 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_DELEGATE_SYSTEM,
1255 BAD_CAST "catalog", prefer, cgroup);
1257 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_URI,
1261 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_REWRITE_URI,
1263 BAD_CAST "rewritePrefix", prefer, cgroup);
1265 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_DELEGATE_URI,
1267 BAD_CAST "catalog", prefer, cgroup);
1269 entry = xmlParseXMLCatalogOneNode(
cur, XML_CATA_NEXT_CATALOG,
1271 BAD_CAST "catalog", prefer, cgroup);
1279 xmlCatalogEntryPtr prev;
1282 while (prev->next !=
NULL)
1287 if (
entry->type == XML_CATA_GROUP) {
1292 xmlParseXMLCatalogNodeList(
cur->children, prefer,
parent,
entry);
1311xmlParseXMLCatalogNodeList(xmlNodePtr
cur, xmlCatalogPrefer prefer,
1312 xmlCatalogEntryPtr
parent, xmlCatalogEntryPtr cgroup) {
1316 xmlParseXMLCatalogNode(
cur, prefer,
parent, cgroup);
1333static xmlCatalogEntryPtr
1334xmlParseXMLCatalogFile(xmlCatalogPrefer prefer,
const xmlChar *
filename) {
1343 doc = xmlParseCatalogFile((
const char *)
filename);
1345 if (xmlDebugCatalogs)
1347 "Failed to parse catalog %s\n",
filename);
1351 if (xmlDebugCatalogs)
1355 cur = xmlDocGetRootElement(doc);
1360 parent = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL,
1370 prefer = XML_CATA_PREFER_SYSTEM;
1372 prefer = XML_CATA_PREFER_PUBLIC;
1375 "Invalid value for prefer: '%s'\n",
1384 "File %s is not an XML Catalog\n",
1402xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) {
1403 xmlCatalogEntryPtr doc;
1407 if (catal->URL ==
NULL)
1414 if (catal->children !=
NULL) {
1420 if (xmlCatalogXMLFiles !=
NULL) {
1421 doc = (xmlCatalogEntryPtr)
1424 if (xmlDebugCatalogs)
1426 "Found %s in file hash\n", catal->URL);
1428 if (catal->type == XML_CATA_CATALOG)
1429 catal->children = doc->children;
1431 catal->children = doc;
1436 if (xmlDebugCatalogs)
1438 "%s not found in file hash\n", catal->URL);
1446 doc = xmlParseXMLCatalogFile(catal->prefer, catal->URL);
1448 catal->type = XML_CATA_BROKEN_CATALOG;
1453 if (catal->type == XML_CATA_CATALOG)
1454 catal->children = doc->children;
1456 catal->children = doc;
1460 if (xmlCatalogXMLFiles ==
NULL)
1462 if (xmlCatalogXMLFiles !=
NULL) {
1463 if (xmlDebugCatalogs)
1465 "%s added to file hash\n", catal->URL);
1491xmlAddXMLCatalog(xmlCatalogEntryPtr catal,
const xmlChar *
type,
1493 xmlCatalogEntryPtr
cur;
1494 xmlCatalogEntryType typ;
1497 if ((catal ==
NULL) ||
1498 ((catal->type != XML_CATA_CATALOG) &&
1499 (catal->type != XML_CATA_BROKEN_CATALOG)))
1501 if (catal->children ==
NULL) {
1502 xmlFetchXMLCatalogFile(catal);
1504 if (catal->children ==
NULL)
1507 typ = xmlGetXMLCatalogEntryType(
type);
1508 if (typ == XML_CATA_NONE) {
1509 if (xmlDebugCatalogs)
1511 "Failed to add unknown element %s to catalog\n",
type);
1515 cur = catal->children;
1521 if ((orig !=
NULL) && (
cur->type == typ) &&
1523 if (xmlDebugCatalogs)
1525 "Updating element %s to catalog\n",
type);
1539 if (xmlDebugCatalogs)
1541 "Adding element %s to catalog\n",
type);
1543 catal->children = xmlNewCatalogEntry(typ, orig,
replace,
1546 cur->next = xmlNewCatalogEntry(typ, orig,
replace,
1549 catal->type = XML_CATA_CATALOG;
1552 cur->children = catal->children;
1569xmlDelXMLCatalog(xmlCatalogEntryPtr catal,
const xmlChar *
value) {
1570 xmlCatalogEntryPtr
cur;
1573 if ((catal ==
NULL) ||
1574 ((catal->type != XML_CATA_CATALOG) &&
1575 (catal->type != XML_CATA_BROKEN_CATALOG)))
1579 if (catal->children ==
NULL) {
1580 xmlFetchXMLCatalogFile(catal);
1586 cur = catal->children;
1590 if (xmlDebugCatalogs) {
1593 "Removing element %s from catalog\n",
cur->name);
1596 "Removing element %s from catalog\n",
cur->value);
1598 cur->type = XML_CATA_REMOVED;
1620xmlCatalogXMLResolve(xmlCatalogEntryPtr catal,
const xmlChar *pubID,
1623 xmlCatalogEntryPtr
cur;
1624 int haveDelegate = 0;
1630 if (catal->depth > MAX_CATAL_DEPTH) {
1632 "Detected recursion in catalog %s\n",
1641 if (sysID !=
NULL) {
1642 xmlCatalogEntryPtr rewrite =
NULL;
1643 int lenrewrite = 0,
len;
1647 switch (
cur->type) {
1648 case XML_CATA_SYSTEM:
1650 if (xmlDebugCatalogs)
1652 "Found system match %s, using %s\n",
1658 case XML_CATA_REWRITE_SYSTEM:
1660 if ((
len > lenrewrite) &&
1666 case XML_CATA_DELEGATE_SYSTEM:
1670 case XML_CATA_NEXT_CATALOG:
1678 if (rewrite !=
NULL) {
1679 if (xmlDebugCatalogs)
1681 "Using rewriting rule %s\n", rewrite->name);
1689 const xmlChar *delegates[MAX_DELEGATE];
1698 if ((
cur->type == XML_CATA_DELEGATE_SYSTEM) &&
1700 for (
i = 0;
i < nbList;
i++)
1707 if (nbList < MAX_DELEGATE)
1708 delegates[nbList++] =
cur->URL;
1711 xmlFetchXMLCatalogFile(
cur);
1714 if (xmlDebugCatalogs)
1716 "Trying system delegate %s\n",
cur->URL);
1717 ret = xmlCatalogListXMLResolve(
1731 return(XML_CATAL_BREAK);
1737 if (pubID !=
NULL) {
1741 switch (
cur->type) {
1742 case XML_CATA_PUBLIC:
1744 if (xmlDebugCatalogs)
1746 "Found public match %s\n",
cur->name);
1751 case XML_CATA_DELEGATE_PUBLIC:
1753 (
cur->prefer == XML_CATA_PREFER_PUBLIC))
1756 case XML_CATA_NEXT_CATALOG:
1766 const xmlChar *delegates[MAX_DELEGATE];
1775 if ((
cur->type == XML_CATA_DELEGATE_PUBLIC) &&
1776 (
cur->prefer == XML_CATA_PREFER_PUBLIC) &&
1779 for (
i = 0;
i < nbList;
i++)
1786 if (nbList < MAX_DELEGATE)
1787 delegates[nbList++] =
cur->URL;
1790 xmlFetchXMLCatalogFile(
cur);
1793 if (xmlDebugCatalogs)
1795 "Trying public delegate %s\n",
cur->URL);
1796 ret = xmlCatalogListXMLResolve(
1810 return(XML_CATAL_BREAK);
1816 if (
cur->type == XML_CATA_NEXT_CATALOG) {
1818 xmlFetchXMLCatalogFile(
cur);
1821 ret = xmlCatalogListXMLResolve(
cur->children, pubID, sysID);
1825 }
else if (catal->depth > MAX_CATAL_DEPTH) {
1853xmlCatalogXMLResolveURI(xmlCatalogEntryPtr catal,
const xmlChar *URI) {
1855 xmlCatalogEntryPtr
cur;
1856 int haveDelegate = 0;
1858 xmlCatalogEntryPtr rewrite =
NULL;
1859 int lenrewrite = 0,
len;
1867 if (catal->depth > MAX_CATAL_DEPTH) {
1869 "Detected recursion in catalog %s\n",
1880 switch (
cur->type) {
1883 if (xmlDebugCatalogs)
1885 "Found URI match %s\n",
cur->name);
1889 case XML_CATA_REWRITE_URI:
1891 if ((
len > lenrewrite) &&
1897 case XML_CATA_DELEGATE_URI:
1901 case XML_CATA_NEXT_CATALOG:
1909 if (rewrite !=
NULL) {
1910 if (xmlDebugCatalogs)
1912 "Using rewriting rule %s\n", rewrite->name);
1919 const xmlChar *delegates[MAX_DELEGATE];
1928 if (((
cur->type == XML_CATA_DELEGATE_SYSTEM) ||
1929 (
cur->type == XML_CATA_DELEGATE_URI)) &&
1931 for (
i = 0;
i < nbList;
i++)
1938 if (nbList < MAX_DELEGATE)
1939 delegates[nbList++] =
cur->URL;
1942 xmlFetchXMLCatalogFile(
cur);
1945 if (xmlDebugCatalogs)
1947 "Trying URI delegate %s\n",
cur->URL);
1948 ret = xmlCatalogListXMLResolveURI(
1949 cur->children, URI);
1959 return(XML_CATAL_BREAK);
1964 if (
cur->type == XML_CATA_NEXT_CATALOG) {
1966 xmlFetchXMLCatalogFile(
cur);
1969 ret = xmlCatalogListXMLResolveURI(
cur->children, URI);
1996xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal,
const xmlChar *pubID,
2004 if ((pubID ==
NULL) && (sysID ==
NULL))
2007 normid = xmlCatalogNormalizePublic(pubID);
2009 pubID = (*normid != 0 ? normid :
NULL);
2012 urnID = xmlCatalogUnWrapURN(pubID);
2013 if (xmlDebugCatalogs) {
2016 "Public URN ID %s expanded to NULL\n", pubID);
2019 "Public URN ID expanded to %s\n", urnID);
2021 ret = xmlCatalogListXMLResolve(catal, urnID, sysID);
2029 urnID = xmlCatalogUnWrapURN(sysID);
2030 if (xmlDebugCatalogs) {
2033 "System URN ID %s expanded to NULL\n", sysID);
2036 "System URN ID expanded to %s\n", urnID);
2039 ret = xmlCatalogListXMLResolve(catal, urnID,
NULL);
2041 ret = xmlCatalogListXMLResolve(catal, pubID,
NULL);
2043 ret = xmlCatalogListXMLResolve(catal, pubID, urnID);
2051 while (catal !=
NULL) {
2052 if (catal->type == XML_CATA_CATALOG) {
2053 if (catal->children ==
NULL) {
2054 xmlFetchXMLCatalogFile(catal);
2056 if (catal->children !=
NULL) {
2057 ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
2060 }
else if (catal->children->depth > MAX_CATAL_DEPTH) {
2066 catal = catal->
next;
2086xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal,
const xmlChar *URI) {
2096 urnID = xmlCatalogUnWrapURN(URI);
2097 if (xmlDebugCatalogs) {
2100 "URN ID %s expanded to NULL\n", URI);
2103 "URN ID expanded to %s\n", urnID);
2105 ret = xmlCatalogListXMLResolve(catal, urnID,
NULL);
2110 while (catal !=
NULL) {
2111 if (catal->type == XML_CATA_CATALOG) {
2112 if (catal->children ==
NULL) {
2113 xmlFetchXMLCatalogFile(catal);
2115 if (catal->children !=
NULL) {
2116 ret = xmlCatalogXMLResolveURI(catal->children, URI);
2121 catal = catal->next;
2135#define SKIP(x) cur += x;
2137#define SKIP_BLANKS while (IS_BLANK_CH(*cur)) NEXT;
2148xmlParseSGMLCatalogComment(
const xmlChar *
cur) {
2149 if ((
cur[0] !=
'-') || (
cur[1] !=
'-'))
2152 while ((
cur[0] != 0) && ((
cur[0] !=
'-') || ((
cur[1] !=
'-'))))
2181 }
else if (
RAW ==
'\'') {
2189 xmlCatalogErrMemory(
"allocating public ID");
2193 if ((*
cur == stop) && (stop !=
' '))
2201 xmlCatalogErrMemory(
"allocating public ID");
2253 (
c ==
'.') || (
c ==
'-') ||
2254 (
c ==
'_') || (
c ==
':'))) {
2273static xmlCatalogEntryType
2275 xmlCatalogEntryType
type = XML_CATA_NONE;
2277 type = SGML_CATA_SYSTEM;
2279 type = SGML_CATA_PUBLIC;
2281 type = SGML_CATA_DELEGATE;
2283 type = SGML_CATA_ENTITY;
2285 type = SGML_CATA_DOCTYPE;
2287 type = SGML_CATA_LINKTYPE;
2289 type = SGML_CATA_NOTATION;
2291 type = SGML_CATA_SGMLDECL;
2293 type = SGML_CATA_DOCUMENT;
2295 type = SGML_CATA_CATALOG;
2297 type = SGML_CATA_BASE;
2315xmlParseSGMLCatalog(xmlCatalogPtr catal,
const xmlChar *
value,
2316 const char *
file,
int super) {
2329 if ((
cur[0] ==
'-') && (
cur[1] ==
'-')) {
2330 cur = xmlParseSGMLCatalogComment(
cur);
2338 xmlCatalogEntryType
type = XML_CATA_NONE;
2352 type = SGML_CATA_SYSTEM;
2354 type = SGML_CATA_PUBLIC;
2356 type = SGML_CATA_DELEGATE;
2358 type = SGML_CATA_ENTITY;
2360 type = SGML_CATA_DOCTYPE;
2362 type = SGML_CATA_LINKTYPE;
2364 type = SGML_CATA_NOTATION;
2366 type = SGML_CATA_SGMLDECL;
2368 type = SGML_CATA_DOCUMENT;
2370 type = SGML_CATA_CATALOG;
2372 type = SGML_CATA_BASE;
2387 case SGML_CATA_ENTITY:
2389 type = SGML_CATA_PENTITY;
2391 case SGML_CATA_PENTITY:
2392 case SGML_CATA_DOCTYPE:
2393 case SGML_CATA_LINKTYPE:
2394 case SGML_CATA_NOTATION:
2405 cur = xmlParseSGMLCatalogPubid(
cur, &sysid);
2411 case SGML_CATA_PUBLIC:
2412 case SGML_CATA_SYSTEM:
2413 case SGML_CATA_DELEGATE:
2419 if (
type != SGML_CATA_SYSTEM) {
2422 normid = xmlCatalogNormalizePublic(
name);
2423 if (normid !=
NULL) {
2439 cur = xmlParseSGMLCatalogPubid(
cur, &sysid);
2445 case SGML_CATA_BASE:
2446 case SGML_CATA_CATALOG:
2447 case SGML_CATA_DOCUMENT:
2448 case SGML_CATA_SGMLDECL:
2449 cur = xmlParseSGMLCatalogPubid(
cur, &sysid);
2464 }
else if (
type == SGML_CATA_BASE) {
2468 }
else if ((
type == SGML_CATA_PUBLIC) ||
2469 (
type == SGML_CATA_SYSTEM)) {
2474 xmlCatalogEntryPtr
entry;
2485 }
else if (
type == SGML_CATA_CATALOG) {
2487 xmlCatalogEntryPtr
entry;
2490 XML_CATA_PREFER_NONE,
NULL);
2500 xmlExpandCatalog(catal, (
const char *)
filename);
2538 xmlCatalogEntryPtr
entry;
2544 normid = xmlCatalogNormalizePublic(pubID);
2546 pubID = (*normid != 0 ? normid :
NULL);
2554 if (
entry->type == SGML_CATA_PUBLIC) {
2575 xmlCatalogEntryPtr
entry;
2583 if (
entry->type == SGML_CATA_SYSTEM)
2599xmlCatalogSGMLResolve(xmlCatalogPtr catal,
const xmlChar *pubID,
2603 if (catal->sgml ==
NULL)
2607 ret = xmlCatalogGetSGMLPublic(catal->sgml, pubID);
2611 ret = xmlCatalogGetSGMLSystem(catal->sgml, sysID);
2634xmlLoadSGMLSuperCatalog(
const char *
filename)
2637 xmlCatalogPtr catal;
2644 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2645 if (catal ==
NULL) {
2653 xmlFreeCatalog(catal);
2671xmlLoadACatalog(
const char *
filename)
2675 xmlCatalogPtr catal;
2690 if (*
first !=
'<') {
2691 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2692 if (catal ==
NULL) {
2698 xmlFreeCatalog(catal);
2703 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2704 if (catal ==
NULL) {
2708 catal->xml = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL,
2726xmlExpandCatalog(xmlCatalogPtr catal,
const char *
filename)
2734 if (catal->type == XML_SGML_CATALOG_TYPE) {
2748 xmlCatalogEntryPtr tmp,
cur;
2749 tmp = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL,
2774xmlACatalogResolveSystem(xmlCatalogPtr catal,
const xmlChar *sysID) {
2777 if ((sysID ==
NULL) || (catal ==
NULL))
2780 if (xmlDebugCatalogs)
2782 "Resolve sysID %s\n", sysID);
2784 if (catal->type == XML_XML_CATALOG_TYPE) {
2785 ret = xmlCatalogListXMLResolve(catal->xml,
NULL, sysID);
2786 if (
ret == XML_CATAL_BREAK)
2791 sgml = xmlCatalogGetSGMLSystem(catal->sgml, sysID);
2809xmlACatalogResolvePublic(xmlCatalogPtr catal,
const xmlChar *pubID) {
2812 if ((pubID ==
NULL) || (catal ==
NULL))
2815 if (xmlDebugCatalogs)
2817 "Resolve pubID %s\n", pubID);
2819 if (catal->type == XML_XML_CATALOG_TYPE) {
2820 ret = xmlCatalogListXMLResolve(catal->xml, pubID,
NULL);
2821 if (
ret == XML_CATAL_BREAK)
2826 sgml = xmlCatalogGetSGMLPublic(catal->sgml, pubID);
2845xmlACatalogResolve(xmlCatalogPtr catal,
const xmlChar * pubID,
2850 if (((pubID ==
NULL) && (sysID ==
NULL)) || (catal ==
NULL))
2853 if (xmlDebugCatalogs) {
2854 if ((pubID !=
NULL) && (sysID !=
NULL)) {
2856 "Resolve: pubID %s sysID %s\n", pubID, sysID);
2857 }
else if (pubID !=
NULL) {
2859 "Resolve: pubID %s\n", pubID);
2862 "Resolve: sysID %s\n", sysID);
2866 if (catal->type == XML_XML_CATALOG_TYPE) {
2867 ret = xmlCatalogListXMLResolve(catal->xml, pubID, sysID);
2868 if (
ret == XML_CATAL_BREAK)
2873 sgml = xmlCatalogSGMLResolve(catal, pubID, sysID);
2891xmlACatalogResolveURI(xmlCatalogPtr catal,
const xmlChar *URI) {
2894 if ((URI ==
NULL) || (catal ==
NULL))
2897 if (xmlDebugCatalogs)
2899 "Resolve URI %s\n", URI);
2901 if (catal->type == XML_XML_CATALOG_TYPE) {
2902 ret = xmlCatalogListXMLResolveURI(catal->xml, URI);
2903 if (
ret == XML_CATAL_BREAK)
2908 sgml = xmlCatalogSGMLResolve(catal,
NULL, URI);
2915#ifdef LIBXML_OUTPUT_ENABLED
2924xmlACatalogDump(xmlCatalogPtr catal,
FILE *
out) {
2928 if (catal->type == XML_XML_CATALOG_TYPE) {
2929 xmlDumpXMLCatalog(
out, catal->xml);
2949xmlACatalogAdd(xmlCatalogPtr catal,
const xmlChar *
type,
2957 if (catal->type == XML_XML_CATALOG_TYPE) {
2960 xmlCatalogEntryType cattype;
2962 cattype = xmlGetSGMLCatalogEntryType(
type);
2963 if (cattype != XML_CATA_NONE) {
2964 xmlCatalogEntryPtr
entry;
2967 XML_CATA_PREFER_NONE,
NULL);
2968 if (catal->sgml ==
NULL)
2988xmlACatalogRemove(xmlCatalogPtr catal,
const xmlChar *
value) {
2994 if (catal->type == XML_XML_CATALOG_TYPE) {
2995 res = xmlDelXMLCatalog(catal->xml,
value);
3013xmlNewCatalog(
int sgml) {
3014 xmlCatalogPtr catal =
NULL;
3017 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE,
3018 xmlCatalogDefaultPrefer);
3019 if ((catal !=
NULL) && (catal->sgml ==
NULL))
3022 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
3023 xmlCatalogDefaultPrefer);
3036xmlCatalogIsEmpty(xmlCatalogPtr catal) {
3040 if (catal->type == XML_XML_CATALOG_TYPE) {
3041 if (catal->xml ==
NULL)
3043 if ((catal->xml->type != XML_CATA_CATALOG) &&
3044 (catal->xml->type != XML_CATA_BROKEN_CATALOG))
3046 if (catal->xml->children ==
NULL)
3052 if (catal->sgml ==
NULL)
3078xmlInitializeCatalogData(
void) {
3079 if (xmlCatalogInitialized != 0)
3082 if (
getenv(
"XML_DEBUG_CATALOG"))
3083 xmlDebugCatalogs = 1;
3086 xmlCatalogInitialized = 1;
3096xmlInitializeCatalog(
void) {
3097 if (xmlCatalogInitialized != 0)
3100 xmlInitializeCatalogData();
3103 if (
getenv(
"XML_DEBUG_CATALOG"))
3104 xmlDebugCatalogs = 1;
3106 if (xmlDefaultCatalog ==
NULL) {
3107 const char *catalogs;
3110 xmlCatalogPtr catal;
3111 xmlCatalogEntryPtr *nextent;
3113 catalogs = (
const char *)
getenv(
"XML_CATALOG_FILES");
3114 if (catalogs ==
NULL)
3115#if defined(_WIN32) && defined(_MSC_VER)
3126 while (*
p !=
'\\' &&
p >
buf)
3133 strncpy(XML_XML_DEFAULT_CATALOG, (
char* )
uri, 255);
3139 catalogs = XML_XML_DEFAULT_CATALOG;
3142 catalogs = XML_XML_DEFAULT_CATALOG;
3145 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
3146 xmlCatalogDefaultPrefer);
3147 if (catal !=
NULL) {
3151 nextent = &catal->xml;
3152 while (*
cur !=
'\0') {
3161 *nextent = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL,
3163 if (*nextent !=
NULL)
3164 nextent = &((*nextent)->next);
3169 xmlDefaultCatalog = catal;
3189xmlLoadCatalog(
const char *
filename)
3192 xmlCatalogPtr catal;
3194 if (!xmlCatalogInitialized)
3195 xmlInitializeCatalogData();
3199 if (xmlDefaultCatalog ==
NULL) {
3201 if (catal ==
NULL) {
3206 xmlDefaultCatalog = catal;
3211 ret = xmlExpandCatalog(xmlDefaultCatalog,
filename);
3226xmlLoadCatalogs(
const char *pathss) {
3248 for(
i = 0;
i < iLen;
i++) {
3249 if(
path[
i] ==
'\\') {
3254 xmlLoadCatalog((
const char *)
path);
3269xmlCatalogCleanup(
void) {
3270 if (xmlCatalogInitialized == 0)
3274 if (xmlDebugCatalogs)
3276 "Catalogs cleanup\n");
3277 if (xmlCatalogXMLFiles !=
NULL)
3278 xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList);
3279 xmlCatalogXMLFiles =
NULL;
3280 if (xmlDefaultCatalog !=
NULL)
3281 xmlFreeCatalog(xmlDefaultCatalog);
3282 xmlDefaultCatalog =
NULL;
3283 xmlDebugCatalogs = 0;
3284 xmlCatalogInitialized = 0;
3299xmlCatalogResolveSystem(
const xmlChar *sysID) {
3302 if (!xmlCatalogInitialized)
3303 xmlInitializeCatalog();
3305 ret = xmlACatalogResolveSystem(xmlDefaultCatalog, sysID);
3319xmlCatalogResolvePublic(
const xmlChar *pubID) {
3322 if (!xmlCatalogInitialized)
3323 xmlInitializeCatalog();
3325 ret = xmlACatalogResolvePublic(xmlDefaultCatalog, pubID);
3343 if (!xmlCatalogInitialized)
3344 xmlInitializeCatalog();
3346 ret = xmlACatalogResolve(xmlDefaultCatalog, pubID, sysID);
3360xmlCatalogResolveURI(
const xmlChar *URI) {
3363 if (!xmlCatalogInitialized)
3364 xmlInitializeCatalog();
3366 ret = xmlACatalogResolveURI(xmlDefaultCatalog, URI);
3370#ifdef LIBXML_OUTPUT_ENABLED
3382 if (!xmlCatalogInitialized)
3383 xmlInitializeCatalog();
3385 xmlACatalogDump(xmlDefaultCatalog,
out);
3406 if (!xmlCatalogInitialized)
3407 xmlInitializeCatalogData();
3414 if ((xmlDefaultCatalog ==
NULL) &&
3416 xmlDefaultCatalog = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
3417 xmlCatalogDefaultPrefer);
3418 if (xmlDefaultCatalog !=
NULL) {
3419 xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL,
3420 orig,
NULL, xmlCatalogDefaultPrefer,
NULL);
3443 if (!xmlCatalogInitialized)
3444 xmlInitializeCatalog();
3447 res = xmlACatalogRemove(xmlDefaultCatalog,
value);
3460xmlCatalogConvert(
void) {
3463 if (!xmlCatalogInitialized)
3464 xmlInitializeCatalog();
3467 res = xmlConvertSGMLCatalog(xmlDefaultCatalog);
3487xmlCatalogGetDefaults(
void) {
3488 return(xmlCatalogDefaultAllow);
3499xmlCatalogSetDefaults(xmlCatalogAllow allow) {
3500 if (xmlDebugCatalogs) {
3502 case XML_CATA_ALLOW_NONE:
3504 "Disabling catalog usage\n");
3506 case XML_CATA_ALLOW_GLOBAL:
3508 "Allowing only global catalogs\n");
3510 case XML_CATA_ALLOW_DOCUMENT:
3512 "Allowing only catalogs from the document\n");
3514 case XML_CATA_ALLOW_ALL:
3516 "Allowing all catalogs\n");
3520 xmlCatalogDefaultAllow = allow;
3534xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer) {
3535 xmlCatalogPrefer
ret = xmlCatalogDefaultPrefer;
3537 if (prefer == XML_CATA_PREFER_NONE)
3540 if (xmlDebugCatalogs) {
3542 case XML_CATA_PREFER_PUBLIC:
3544 "Setting catalog preference to PUBLIC\n");
3546 case XML_CATA_PREFER_SYSTEM:
3548 "Setting catalog preference to SYSTEM\n");
3554 xmlCatalogDefaultPrefer = prefer;
3568xmlCatalogSetDebug(
int level) {
3569 int ret = xmlDebugCatalogs;
3572 xmlDebugCatalogs = 0;
3574 xmlDebugCatalogs =
level;
3591xmlCatalogFreeLocal(
void *catalogs) {
3592 xmlCatalogEntryPtr catal;
3594 if (!xmlCatalogInitialized)
3595 xmlInitializeCatalog();
3597 catal = (xmlCatalogEntryPtr) catalogs;
3599 xmlFreeCatalogEntryList(catal);
3613xmlCatalogAddLocal(
void *catalogs,
const xmlChar *URL) {
3614 xmlCatalogEntryPtr catal,
add;
3616 if (!xmlCatalogInitialized)
3617 xmlInitializeCatalog();
3622 if (xmlDebugCatalogs)
3624 "Adding document catalog %s\n", URL);
3626 add = xmlNewCatalogEntry(XML_CATA_CATALOG,
NULL, URL,
NULL,
3627 xmlCatalogDefaultPrefer,
NULL);
3631 catal = (xmlCatalogEntryPtr) catalogs;
3633 return((
void *)
add);
3635 while (catal->next !=
NULL)
3636 catal = catal->next;
3654xmlCatalogLocalResolve(
void *catalogs,
const xmlChar *pubID,
3656 xmlCatalogEntryPtr catal;
3659 if (!xmlCatalogInitialized)
3660 xmlInitializeCatalog();
3662 if ((pubID ==
NULL) && (sysID ==
NULL))
3665 if (xmlDebugCatalogs) {
3666 if ((pubID !=
NULL) && (sysID !=
NULL)) {
3668 "Local Resolve: pubID %s sysID %s\n", pubID, sysID);
3669 }
else if (pubID !=
NULL) {
3671 "Local Resolve: pubID %s\n", pubID);
3674 "Local Resolve: sysID %s\n", sysID);
3678 catal = (xmlCatalogEntryPtr) catalogs;
3681 ret = xmlCatalogListXMLResolve(catal, pubID, sysID);
3682 if ((
ret !=
NULL) && (
ret != XML_CATAL_BREAK))
3699xmlCatalogLocalResolveURI(
void *catalogs,
const xmlChar *URI) {
3700 xmlCatalogEntryPtr catal;
3703 if (!xmlCatalogInitialized)
3704 xmlInitializeCatalog();
3709 if (xmlDebugCatalogs)
3711 "Resolve URI %s\n", URI);
3713 catal = (xmlCatalogEntryPtr) catalogs;
3716 ret = xmlCatalogListXMLResolveURI(catal, URI);
3717 if ((
ret !=
NULL) && (
ret != XML_CATAL_BREAK))
3737xmlCatalogGetSystem(
const xmlChar *sysID) {
3742 if (!xmlCatalogInitialized)
3743 xmlInitializeCatalog();
3747 "Use of deprecated xmlCatalogGetSystem() call\n");
3757 if (xmlDefaultCatalog !=
NULL) {
3758 ret = xmlCatalogListXMLResolve(xmlDefaultCatalog->xml,
NULL, sysID);
3759 if ((
ret !=
NULL) && (
ret != XML_CATAL_BREAK)) {
3766 if (xmlDefaultCatalog !=
NULL)
3767 return(xmlCatalogGetSGMLSystem(xmlDefaultCatalog->sgml, sysID));
3781xmlCatalogGetPublic(
const xmlChar *pubID) {
3786 if (!xmlCatalogInitialized)
3787 xmlInitializeCatalog();
3791 "Use of deprecated xmlCatalogGetPublic() call\n");
3801 if (xmlDefaultCatalog !=
NULL) {
3802 ret = xmlCatalogListXMLResolve(xmlDefaultCatalog->xml, pubID,
NULL);
3803 if ((
ret !=
NULL) && (
ret != XML_CATAL_BREAK)) {
3810 if (xmlDefaultCatalog !=
NULL)
3811 return(xmlCatalogGetSGMLPublic(xmlDefaultCatalog->sgml, pubID));
int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
char *CDECL getenv(const char *name)
__msvcrt_long CDECL ftell(FILE *file)
int CDECL fclose(FILE *file)
int CDECL fseek(FILE *file, __msvcrt_long offset, int whence)
int WINAPIV fprintf(FILE *file, const char *format,...)
size_t CDECL fread(void *ptr, size_t size, size_t nmemb, FILE *file)
FILE *CDECL fopen(const char *path, const char *mode)
_ACRTIMP size_t __cdecl strlen(const char *)
void dealloc(int i, int no_throw)
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei const GLuint * paths
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
XMLPUBFUN void xmlFreeRMutex(xmlRMutexPtr tok)
XML_DEPRECATED XMLPUBFUN int xmlGetThreadId(void)
XMLPUBFUN void xmlRMutexLock(xmlRMutexPtr tok)
XMLPUBFUN xmlRMutexPtr xmlNewRMutex(void)
XMLPUBFUN void xmlRMutexUnlock(xmlRMutexPtr tok)
__forceinline bool __cdecl add(big_integer &x, uint32_t const value)
#define IS_PUBIDCHAR_CH(c)
XMLPUBFUN xmlParserInputPtr xmlNewInputStream(xmlParserCtxtPtr ctxt)
XMLPUBFUN int inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
static unsigned __int64 next
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
void * xmlGenericErrorContext
xmlReallocFunc xmlRealloc
xmlGenericErrorFunc xmlGenericError
xmlMallocFunc xmlMallocAtomic
void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key, xmlHashDeallocator dealloc)
int xmlHashSize(xmlHashTablePtr hash)
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
xmlHashTablePtr xmlHashCreate(int size)
XMLPUBFUN int xmlParseDocument(xmlParserCtxtPtr ctxt)
XMLPUBFUN void xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
XMLPUBFUN xmlParserCtxtPtr xmlNewParserCtxt(void)
XML_HIDDEN void __xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, void *ctx, void *nod, int domain, int code, xmlErrorLevel level, const char *file, int line, const char *str1, const char *str2, const char *str3, int int1, int col, const char *msg,...) LIBXML_ATTR_FORMAT(16
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
XMLPUBFUN xmlChar * xmlBuildURI(const xmlChar *URI, const xmlChar *base)
XMLPUBFUN xmlChar * xmlCanonicPath(const xmlChar *path)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
XMLPUBFUN void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in)
XMLPUBFUN char * xmlParserGetDirectory(const char *filename)
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
@ XML_CATALOG_PREFER_VALUE
@ XML_CATALOG_ENTRY_BROKEN
@ XML_CATALOG_NOT_CATALOG
@ XML_CATALOG_MISSING_ATTR
XMLPUBFUN xmlChar * xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN int xmlStrlen(const xmlChar *str)
XMLPUBFUN int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
XMLPUBFUN xmlChar * xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
#define LIBXML_ATTR_FORMAT(fmt, args)