Lines Matching refs:catal
95 static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename);
242 xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error, in xmlCatalogErr() argument
246 __xmlRaiseError(NULL, NULL, NULL, catal, node, XML_FROM_CATALOG, in xmlCatalogErr()
386 xmlCatalogEntryPtr catal = (xmlCatalogEntryPtr) payload; in xmlFreeCatalogHashEntryList() local
389 if (catal == NULL) in xmlFreeCatalogHashEntryList()
392 children = catal->children; in xmlFreeCatalogHashEntryList()
400 catal->dealloc = 0; in xmlFreeCatalogHashEntryList()
401 xmlFreeCatalogEntry(catal, NULL); in xmlFreeCatalogHashEntryList()
440 xmlFreeCatalog(xmlCatalogPtr catal) { in xmlFreeCatalog() argument
441 if (catal == NULL) in xmlFreeCatalog()
443 if (catal->xml != NULL) in xmlFreeCatalog()
444 xmlFreeCatalogEntryList(catal->xml); in xmlFreeCatalog()
445 if (catal->sgml != NULL) in xmlFreeCatalog()
446 xmlHashFree(catal->sgml, xmlFreeCatalogEntry); in xmlFreeCatalog()
447 xmlFree(catal); in xmlFreeCatalog()
544 static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr catal, xmlNodePtr catalog, in xmlDumpXMLCatalogNode() argument
551 cur = catal; in xmlDumpXMLCatalogNode()
559 if (cur == catal) { in xmlDumpXMLCatalogNode()
662 xmlDumpXMLCatalog(FILE *out, xmlCatalogEntryPtr catal) { in xmlDumpXMLCatalog() argument
696 xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); in xmlDumpXMLCatalog()
734 xmlCatalogPtr catal = (xmlCatalogPtr) data; in xmlCatalogConvertEntry() local
735 if ((entry == NULL) || (catal == NULL) || (catal->sgml == NULL) || in xmlCatalogConvertEntry()
736 (catal->xml == NULL)) in xmlCatalogConvertEntry()
767 xmlHashRemoveEntry(catal->sgml, entry->name, xmlFreeCatalogEntry); in xmlCatalogConvertEntry()
774 xmlHashRemoveEntry(catal->sgml, entry->name, NULL); in xmlCatalogConvertEntry()
775 entry->parent = catal->xml; in xmlCatalogConvertEntry()
777 if (catal->xml->children == NULL) in xmlCatalogConvertEntry()
778 catal->xml->children = entry; in xmlCatalogConvertEntry()
782 prev = catal->xml->children; in xmlCatalogConvertEntry()
798 xmlConvertSGMLCatalog(xmlCatalogPtr catal) { in xmlConvertSGMLCatalog() argument
800 if ((catal == NULL) || (catal->type != XML_SGML_CATALOG_TYPE)) in xmlConvertSGMLCatalog()
807 xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal); in xmlConvertSGMLCatalog()
1092 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
1095 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI);
1414 xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { in xmlFetchXMLCatalogFile() argument
1417 if (catal == NULL) in xmlFetchXMLCatalogFile()
1419 if (catal->URL == NULL) in xmlFetchXMLCatalogFile()
1426 if (catal->children != NULL) { in xmlFetchXMLCatalogFile()
1434 xmlHashLookup(xmlCatalogXMLFiles, catal->URL); in xmlFetchXMLCatalogFile()
1438 "Found %s in file hash\n", catal->URL); in xmlFetchXMLCatalogFile()
1440 if (catal->type == XML_CATA_CATALOG) in xmlFetchXMLCatalogFile()
1441 catal->children = doc->children; in xmlFetchXMLCatalogFile()
1443 catal->children = doc; in xmlFetchXMLCatalogFile()
1444 catal->dealloc = 0; in xmlFetchXMLCatalogFile()
1450 "%s not found in file hash\n", catal->URL); in xmlFetchXMLCatalogFile()
1458 doc = xmlParseXMLCatalogFile(catal->prefer, catal->URL); in xmlFetchXMLCatalogFile()
1460 catal->type = XML_CATA_BROKEN_CATALOG; in xmlFetchXMLCatalogFile()
1465 if (catal->type == XML_CATA_CATALOG) in xmlFetchXMLCatalogFile()
1466 catal->children = doc->children; in xmlFetchXMLCatalogFile()
1468 catal->children = doc; in xmlFetchXMLCatalogFile()
1477 "%s added to file hash\n", catal->URL); in xmlFetchXMLCatalogFile()
1478 xmlHashAddEntry(xmlCatalogXMLFiles, catal->URL, doc); in xmlFetchXMLCatalogFile()
1503 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type, in xmlAddXMLCatalog() argument
1509 if ((catal == NULL) || in xmlAddXMLCatalog()
1510 ((catal->type != XML_CATA_CATALOG) && in xmlAddXMLCatalog()
1511 (catal->type != XML_CATA_BROKEN_CATALOG))) in xmlAddXMLCatalog()
1513 if (catal->children == NULL) { in xmlAddXMLCatalog()
1514 xmlFetchXMLCatalogFile(catal); in xmlAddXMLCatalog()
1516 if (catal->children == NULL) in xmlAddXMLCatalog()
1527 cur = catal->children; in xmlAddXMLCatalog()
1555 catal->children = xmlNewCatalogEntry(typ, orig, replace, in xmlAddXMLCatalog()
1556 NULL, catal->prefer, NULL); in xmlAddXMLCatalog()
1559 NULL, catal->prefer, NULL); in xmlAddXMLCatalog()
1561 catal->type = XML_CATA_CATALOG; in xmlAddXMLCatalog()
1562 cur = (xmlCatalogEntryPtr)xmlHashLookup(xmlCatalogXMLFiles, catal->URL); in xmlAddXMLCatalog()
1564 cur->children = catal->children; in xmlAddXMLCatalog()
1581 xmlDelXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *value) { in xmlDelXMLCatalog() argument
1585 if ((catal == NULL) || in xmlDelXMLCatalog()
1586 ((catal->type != XML_CATA_CATALOG) && in xmlDelXMLCatalog()
1587 (catal->type != XML_CATA_BROKEN_CATALOG))) in xmlDelXMLCatalog()
1591 if (catal->children == NULL) { in xmlDelXMLCatalog()
1592 xmlFetchXMLCatalogFile(catal); in xmlDelXMLCatalog()
1598 cur = catal->children; in xmlDelXMLCatalog()
1632 xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID, in xmlCatalogXMLResolve() argument
1642 if (catal->depth > MAX_CATAL_DEPTH) { in xmlCatalogXMLResolve()
1643 xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION, in xmlCatalogXMLResolve()
1645 catal->name, NULL, NULL); in xmlCatalogXMLResolve()
1648 catal->depth++; in xmlCatalogXMLResolve()
1656 cur = catal; in xmlCatalogXMLResolve()
1666 catal->depth--; in xmlCatalogXMLResolve()
1697 catal->depth--; in xmlCatalogXMLResolve()
1708 cur = catal; in xmlCatalogXMLResolve()
1732 catal->depth--; in xmlCatalogXMLResolve()
1742 catal->depth--; in xmlCatalogXMLResolve()
1750 cur = catal; in xmlCatalogXMLResolve()
1759 catal->depth--; in xmlCatalogXMLResolve()
1785 cur = catal; in xmlCatalogXMLResolve()
1811 catal->depth--; in xmlCatalogXMLResolve()
1821 catal->depth--; in xmlCatalogXMLResolve()
1826 cur = catal; in xmlCatalogXMLResolve()
1835 catal->depth--; in xmlCatalogXMLResolve()
1837 } else if (catal->depth > MAX_CATAL_DEPTH) { in xmlCatalogXMLResolve()
1846 catal->depth--; in xmlCatalogXMLResolve()
1865 xmlCatalogXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { in xmlCatalogXMLResolveURI() argument
1873 if (catal == NULL) in xmlCatalogXMLResolveURI()
1879 if (catal->depth > MAX_CATAL_DEPTH) { in xmlCatalogXMLResolveURI()
1880 xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION, in xmlCatalogXMLResolveURI()
1882 catal->name, NULL, NULL); in xmlCatalogXMLResolveURI()
1889 cur = catal; in xmlCatalogXMLResolveURI()
1938 cur = catal; in xmlCatalogXMLResolveURI()
1974 cur = catal; in xmlCatalogXMLResolveURI()
2008 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID, in xmlCatalogListXMLResolve() argument
2014 if (catal == NULL) in xmlCatalogListXMLResolve()
2033 ret = xmlCatalogListXMLResolve(catal, urnID, sysID); in xmlCatalogListXMLResolve()
2051 ret = xmlCatalogListXMLResolve(catal, urnID, NULL); in xmlCatalogListXMLResolve()
2053 ret = xmlCatalogListXMLResolve(catal, pubID, NULL); in xmlCatalogListXMLResolve()
2055 ret = xmlCatalogListXMLResolve(catal, pubID, urnID); in xmlCatalogListXMLResolve()
2063 while (catal != NULL) { in xmlCatalogListXMLResolve()
2064 if (catal->type == XML_CATA_CATALOG) { in xmlCatalogListXMLResolve()
2065 if (catal->children == NULL) { in xmlCatalogListXMLResolve()
2066 xmlFetchXMLCatalogFile(catal); in xmlCatalogListXMLResolve()
2068 if (catal->children != NULL) { in xmlCatalogListXMLResolve()
2069 ret = xmlCatalogXMLResolve(catal->children, pubID, sysID); in xmlCatalogListXMLResolve()
2072 } else if ((catal->children != NULL) && in xmlCatalogListXMLResolve()
2073 (catal->children->depth > MAX_CATAL_DEPTH)) { in xmlCatalogListXMLResolve()
2079 catal = catal->next; in xmlCatalogListXMLResolve()
2099 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { in xmlCatalogListXMLResolveURI() argument
2103 if (catal == NULL) in xmlCatalogListXMLResolveURI()
2118 ret = xmlCatalogListXMLResolve(catal, urnID, NULL); in xmlCatalogListXMLResolveURI()
2123 while (catal != NULL) { in xmlCatalogListXMLResolveURI()
2124 if (catal->type == XML_CATA_CATALOG) { in xmlCatalogListXMLResolveURI()
2125 if (catal->children == NULL) { in xmlCatalogListXMLResolveURI()
2126 xmlFetchXMLCatalogFile(catal); in xmlCatalogListXMLResolveURI()
2128 if (catal->children != NULL) { in xmlCatalogListXMLResolveURI()
2129 ret = xmlCatalogXMLResolveURI(catal->children, URI); in xmlCatalogListXMLResolveURI()
2134 catal = catal->next; in xmlCatalogListXMLResolveURI()
2330 xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value, in xmlParseSGMLCatalog() argument
2492 res = xmlHashAddEntry(catal->sgml, name, entry); in xmlParseSGMLCatalog()
2505 res = xmlHashAddEntry(catal->sgml, sysid, entry); in xmlParseSGMLCatalog()
2514 xmlExpandCatalog(catal, (const char *)filename); in xmlParseSGMLCatalog()
2551 xmlCatalogGetSGMLPublic(xmlHashTablePtr catal, const xmlChar *pubID) { in xmlCatalogGetSGMLPublic() argument
2555 if (catal == NULL) in xmlCatalogGetSGMLPublic()
2562 entry = (xmlCatalogEntryPtr) xmlHashLookup(catal, pubID); in xmlCatalogGetSGMLPublic()
2588 xmlCatalogGetSGMLSystem(xmlHashTablePtr catal, const xmlChar *sysID) { in xmlCatalogGetSGMLSystem() argument
2591 if (catal == NULL) in xmlCatalogGetSGMLSystem()
2594 entry = (xmlCatalogEntryPtr) xmlHashLookup(catal, sysID); in xmlCatalogGetSGMLSystem()
2613 xmlCatalogSGMLResolve(xmlCatalogPtr catal, const xmlChar *pubID, in xmlCatalogSGMLResolve() argument
2617 if (catal->sgml == NULL) in xmlCatalogSGMLResolve()
2621 ret = xmlCatalogGetSGMLPublic(catal->sgml, pubID); in xmlCatalogSGMLResolve()
2625 ret = xmlCatalogGetSGMLSystem(catal->sgml, sysID); in xmlCatalogSGMLResolve()
2651 xmlCatalogPtr catal; in xmlLoadSGMLSuperCatalog() local
2658 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer); in xmlLoadSGMLSuperCatalog()
2659 if (catal == NULL) { in xmlLoadSGMLSuperCatalog()
2664 ret = xmlParseSGMLCatalog(catal, content, filename, 1); in xmlLoadSGMLSuperCatalog()
2667 xmlFreeCatalog(catal); in xmlLoadSGMLSuperCatalog()
2670 return (catal); in xmlLoadSGMLSuperCatalog()
2689 xmlCatalogPtr catal; in xmlLoadACatalog() local
2705 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer); in xmlLoadACatalog()
2706 if (catal == NULL) { in xmlLoadACatalog()
2710 ret = xmlParseSGMLCatalog(catal, content, filename, 0); in xmlLoadACatalog()
2712 xmlFreeCatalog(catal); in xmlLoadACatalog()
2717 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer); in xmlLoadACatalog()
2718 if (catal == NULL) { in xmlLoadACatalog()
2722 catal->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL, in xmlLoadACatalog()
2726 return (catal); in xmlLoadACatalog()
2740 xmlExpandCatalog(xmlCatalogPtr catal, const char *filename) in xmlExpandCatalog() argument
2744 if ((catal == NULL) || (filename == NULL)) in xmlExpandCatalog()
2748 if (catal->type == XML_SGML_CATALOG_TYPE) { in xmlExpandCatalog()
2755 ret = xmlParseSGMLCatalog(catal, content, filename, 0); in xmlExpandCatalog()
2766 cur = catal->xml; in xmlExpandCatalog()
2768 catal->xml = tmp; in xmlExpandCatalog()
2788 xmlACatalogResolveSystem(xmlCatalogPtr catal, const xmlChar *sysID) { in xmlACatalogResolveSystem() argument
2791 if ((sysID == NULL) || (catal == NULL)) in xmlACatalogResolveSystem()
2798 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogResolveSystem()
2799 ret = xmlCatalogListXMLResolve(catal->xml, NULL, sysID); in xmlACatalogResolveSystem()
2805 sgml = xmlCatalogGetSGMLSystem(catal->sgml, sysID); in xmlACatalogResolveSystem()
2823 xmlACatalogResolvePublic(xmlCatalogPtr catal, const xmlChar *pubID) { in xmlACatalogResolvePublic() argument
2826 if ((pubID == NULL) || (catal == NULL)) in xmlACatalogResolvePublic()
2833 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogResolvePublic()
2834 ret = xmlCatalogListXMLResolve(catal->xml, pubID, NULL); in xmlACatalogResolvePublic()
2840 sgml = xmlCatalogGetSGMLPublic(catal->sgml, pubID); in xmlACatalogResolvePublic()
2859 xmlACatalogResolve(xmlCatalogPtr catal, const xmlChar * pubID, in xmlACatalogResolve() argument
2864 if (((pubID == NULL) && (sysID == NULL)) || (catal == NULL)) in xmlACatalogResolve()
2880 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogResolve()
2881 ret = xmlCatalogListXMLResolve(catal->xml, pubID, sysID); in xmlACatalogResolve()
2887 sgml = xmlCatalogSGMLResolve(catal, pubID, sysID); in xmlACatalogResolve()
2905 xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) { in xmlACatalogResolveURI() argument
2908 if ((URI == NULL) || (catal == NULL)) in xmlACatalogResolveURI()
2915 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogResolveURI()
2916 ret = xmlCatalogListXMLResolveURI(catal->xml, URI); in xmlACatalogResolveURI()
2922 sgml = xmlCatalogSGMLResolve(catal, NULL, URI); in xmlACatalogResolveURI()
2938 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) { in xmlACatalogDump() argument
2939 if ((out == NULL) || (catal == NULL)) in xmlACatalogDump()
2942 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogDump()
2943 xmlDumpXMLCatalog(out, catal->xml); in xmlACatalogDump()
2945 xmlHashScan(catal->sgml, xmlCatalogDumpEntry, out); in xmlACatalogDump()
2963 xmlACatalogAdd(xmlCatalogPtr catal, const xmlChar * type, in xmlACatalogAdd() argument
2968 if (catal == NULL) in xmlACatalogAdd()
2971 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogAdd()
2972 res = xmlAddXMLCatalog(catal->xml, type, orig, replace); in xmlACatalogAdd()
2982 if (catal->sgml == NULL) in xmlACatalogAdd()
2983 catal->sgml = xmlHashCreate(10); in xmlACatalogAdd()
2984 res = xmlHashAddEntry(catal->sgml, orig, entry); in xmlACatalogAdd()
3000 xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *value) { in xmlACatalogRemove() argument
3003 if ((catal == NULL) || (value == NULL)) in xmlACatalogRemove()
3006 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlACatalogRemove()
3007 res = xmlDelXMLCatalog(catal->xml, value); in xmlACatalogRemove()
3009 res = xmlHashRemoveEntry(catal->sgml, value, xmlFreeCatalogEntry); in xmlACatalogRemove()
3026 xmlCatalogPtr catal = NULL; in xmlNewCatalog() local
3029 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, in xmlNewCatalog()
3031 if ((catal != NULL) && (catal->sgml == NULL)) in xmlNewCatalog()
3032 catal->sgml = xmlHashCreate(10); in xmlNewCatalog()
3034 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, in xmlNewCatalog()
3036 return(catal); in xmlNewCatalog()
3048 xmlCatalogIsEmpty(xmlCatalogPtr catal) { in xmlCatalogIsEmpty() argument
3049 if (catal == NULL) in xmlCatalogIsEmpty()
3052 if (catal->type == XML_XML_CATALOG_TYPE) { in xmlCatalogIsEmpty()
3053 if (catal->xml == NULL) in xmlCatalogIsEmpty()
3055 if ((catal->xml->type != XML_CATA_CATALOG) && in xmlCatalogIsEmpty()
3056 (catal->xml->type != XML_CATA_BROKEN_CATALOG)) in xmlCatalogIsEmpty()
3058 if (catal->xml->children == NULL) in xmlCatalogIsEmpty()
3064 if (catal->sgml == NULL) in xmlCatalogIsEmpty()
3066 res = xmlHashSize(catal->sgml); in xmlCatalogIsEmpty()
3122 xmlCatalogPtr catal; in xmlInitializeCatalog() local
3157 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, in xmlInitializeCatalog()
3159 if (catal != NULL) { in xmlInitializeCatalog()
3163 nextent = &catal->xml; in xmlInitializeCatalog()
3181 xmlDefaultCatalog = catal; in xmlInitializeCatalog()
3204 xmlCatalogPtr catal; in xmlLoadCatalog() local
3212 catal = xmlLoadACatalog(filename); in xmlLoadCatalog()
3213 if (catal == NULL) { in xmlLoadCatalog()
3218 xmlDefaultCatalog = catal; in xmlLoadCatalog()
3603 xmlCatalogEntryPtr catal; in xmlCatalogFreeLocal() local
3608 catal = (xmlCatalogEntryPtr) catalogs; in xmlCatalogFreeLocal()
3609 if (catal != NULL) in xmlCatalogFreeLocal()
3610 xmlFreeCatalogEntryList(catal); in xmlCatalogFreeLocal()
3625 xmlCatalogEntryPtr catal, add; in xmlCatalogAddLocal() local
3642 catal = (xmlCatalogEntryPtr) catalogs; in xmlCatalogAddLocal()
3643 if (catal == NULL) in xmlCatalogAddLocal()
3646 while (catal->next != NULL) in xmlCatalogAddLocal()
3647 catal = catal->next; in xmlCatalogAddLocal()
3648 catal->next = add; in xmlCatalogAddLocal()
3667 xmlCatalogEntryPtr catal; in xmlCatalogLocalResolve() local
3689 catal = (xmlCatalogEntryPtr) catalogs; in xmlCatalogLocalResolve()
3690 if (catal == NULL) in xmlCatalogLocalResolve()
3692 ret = xmlCatalogListXMLResolve(catal, pubID, sysID); in xmlCatalogLocalResolve()
3711 xmlCatalogEntryPtr catal; in xmlCatalogLocalResolveURI() local
3724 catal = (xmlCatalogEntryPtr) catalogs; in xmlCatalogLocalResolveURI()
3725 if (catal == NULL) in xmlCatalogLocalResolveURI()
3727 ret = xmlCatalogListXMLResolveURI(catal, URI); in xmlCatalogLocalResolveURI()