Home | History | Annotate | Download | only in libxml2

Lines Matching refs:catal

91 static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename);
159 int catalNr; /* Number of current catal streams */
160 int catalMax; /* Max number of catal streams */
230 * @catal: the Catalog entry
238 xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error,
242 __xmlRaiseError(NULL, NULL, NULL, catal, node, XML_FROM_CATALOG,
379 xmlFreeCatalogHashEntryList(xmlCatalogEntryPtr catal) {
382 if (catal == NULL)
385 children = catal->children;
393 catal->dealloc = 0;
394 xmlFreeCatalogEntry(catal);
428 * @catal: a Catalog
433 xmlFreeCatalog(xmlCatalogPtr catal) {
434 if (catal == NULL)
436 if (catal->xml != NULL)
437 xmlFreeCatalogEntryList(catal->xml);
438 if (catal->sgml != NULL)
439 xmlHashFree(catal->sgml,
441 xmlFree(catal);
526 * @catal: top catalog entry
535 static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr catal, xmlNodePtr catalog,
542 cur = catal;
550 if (cur == catal) {
653 xmlDumpXMLCatalog(FILE *out, xmlCatalogEntryPtr catal) {
687 xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL);
717 * @catal: pointer to the catalog being converted
722 xmlCatalogConvertEntry(xmlCatalogEntryPtr entry, xmlCatalogPtr catal) {
723 if ((entry == NULL) || (catal == NULL) || (catal->sgml == NULL) ||
724 (catal->xml == NULL))
755 xmlHashRemoveEntry(catal->sgml, entry->name,
763 xmlHashRemoveEntry(catal->sgml, entry->name, NULL);
764 entry->parent = catal->xml;
766 if (catal->xml->children == NULL)
767 catal->xml->children = entry;
771 prev = catal->xml->children;
780 * @catal: the catalog
787 xmlConvertSGMLCatalog(xmlCatalogPtr catal) {
789 if ((catal == NULL) || (catal->type != XML_SGML_CATALOG_TYPE))
796 xmlHashScan(catal->sgml,
798 &catal);
1081 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
1084 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI);
1396 * @catal: an existing but incomplete catalog entry
1403 xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) {
1406 if (catal == NULL)
1408 if (catal->URL == NULL)
1410 if (catal->children != NULL)
1417 if (catal->children != NULL) {
1425 xmlHashLookup(xmlCatalogXMLFiles, catal->URL);
1429 "Found %s in file hash\n", catal->URL);
1431 if (catal->type == XML_CATA_CATALOG)
1432 catal->children = doc->children;
1434 catal->children = doc;
1435 catal->dealloc = 0;
1441 "%s not found in file hash\n", catal->URL);
1449 doc = xmlParseXMLCatalogFile(catal->prefer, catal->URL);
1451 catal->type = XML_CATA_BROKEN_CATALOG;
1456 if (catal->type == XML_CATA_CATALOG)
1457 catal->children = doc->children;
1459 catal->children = doc;
1468 "%s added to file hash\n", catal->URL);
1469 xmlHashAddEntry(xmlCatalogXMLFiles, catal->URL, doc);
1483 * @catal: top of an XML catalog
1494 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type,
1500 if ((catal == NULL) ||
1501 ((catal->type != XML_CATA_CATALOG) &&
1502 (catal->type != XML_CATA_BROKEN_CATALOG)))
1504 if (catal->children == NULL) {
1505 xmlFetchXMLCatalogFile(catal);
1507 if (catal->children == NULL)
1518 cur = catal->children;
1546 catal->children = xmlNewCatalogEntry(typ, orig, replace,
1547 NULL, catal->prefer, NULL);
1550 NULL, catal->prefer, NULL);
1552 catal->type = XML_CATA_CATALOG;
1553 cur = xmlHashLookup(xmlCatalogXMLFiles, catal->URL);
1555 cur->children = catal->children;
1563 * @catal: top of an XML catalog
1572 xmlDelXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *value) {
1576 if ((catal == NULL) ||
1577 ((catal->type != XML_CATA_CATALOG) &&
1578 (catal->type != XML_CATA_BROKEN_CATALOG)))
1582 if (catal->children == NULL) {
1583 xmlFetchXMLCatalogFile(catal);
1589 cur = catal->children;
1610 * @catal: a catalog list
1623 xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
1633 if (catal->depth > MAX_CATAL_DEPTH) {
1634 xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION,
1636 catal->name, NULL, NULL);
1639 catal->depth++;
1647 cur = catal;
1657 catal->depth--;
1688 catal->depth--;
1699 cur = catal;
1723 catal->depth--;
1733 catal->depth--;
1741 cur = catal;
1750 catal->depth--;
1776 cur = catal;
1802 catal->depth--;
1812 catal->depth--;
1817 cur = catal;
1826 catal->depth--;
1828 } else if (catal->depth > MAX_CATAL_DEPTH) {
1837 catal->depth--;
1843 * @catal: a catalog list
1856 xmlCatalogXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
1864 if (catal == NULL)
1870 if (catal->depth > MAX_CATAL_DEPTH) {
1871 xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION,
1873 catal->name, NULL, NULL);
1880 cur = catal;
1929 cur = catal;
1965 cur = catal;
1986 * @catal: a catalog list
1999 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
2005 if (catal == NULL)
2024 ret = xmlCatalogListXMLResolve(catal, urnID, sysID);
2042 ret = xmlCatalogListXMLResolve(catal, urnID, NULL);
2044 ret = xmlCatalogListXMLResolve(catal, pubID, NULL);
2046 ret = xmlCatalogListXMLResolve(catal, pubID, urnID);
2054 while (catal != NULL) {
2055 if (catal->type == XML_CATA_CATALOG) {
2056 if (catal->children == NULL) {
2057 xmlFetchXMLCatalogFile(catal);
2059 if (catal->children != NULL) {
2060 ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
2063 } else if ((catal->children != NULL) &&
2064 (catal->children->depth > MAX_CATAL_DEPTH)) {
2070 catal = catal->next;
2079 * @catal: a catalog list
2090 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
2094 if (catal == NULL)
2109 ret = xmlCatalogListXMLResolve(catal, urnID, NULL);
2114 while (catal != NULL) {
2115 if (catal->type == XML_CATA_CATALOG) {
2116 if (catal->children == NULL) {
2117 xmlFetchXMLCatalogFile(catal);
2119 if (catal->children != NULL) {
2120 ret = xmlCatalogXMLResolveURI(catal->children, URI);
2125 catal = catal->next;
2309 * @catal: the SGML Catalog
2315 * Parse an SGML catalog content and fill up the @catal hash table with
2321 xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
2482 res = xmlHashAddEntry(catal->sgml, name, entry);
2495 res = xmlHashAddEntry(catal->sgml, sysid, entry);
2504 xmlExpandCatalog(catal, (const char *)filename);
2533 * @catal: an SGML catalog hash
2541 xmlCatalogGetSGMLPublic(xmlHashTablePtr catal, const xmlChar *pubID) {
2545 if (catal == NULL)
2552 entry = (xmlCatalogEntryPtr) xmlHashLookup(catal, pubID);
2570 * @catal: an SGML catalog hash
2578 xmlCatalogGetSGMLSystem(xmlHashTablePtr catal, const xmlChar *sysID) {
2581 if (catal == NULL)
2584 entry = (xmlCatalogEntryPtr) xmlHashLookup(catal, sysID);
2594 * @catal: the SGML catalog
2603 xmlCatalogSGMLResolve(xmlCatalogPtr catal, const xmlChar *pubID,
2607 if (catal->sgml == NULL)
2611 ret = xmlCatalogGetSGMLPublic(catal->sgml, pubID);
2615 ret = xmlCatalogGetSGMLSystem(catal->sgml, sysID);
2641 xmlCatalogPtr catal;
2648 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2649 if (catal == NULL) {
2654 ret = xmlParseSGMLCatalog(catal, content, filename, 1);
2657 xmlFreeCatalog(catal);
2660 return (catal);
2679 xmlCatalogPtr catal;
2695 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2696 if (catal == NULL) {
2700 ret = xmlParseSGMLCatalog(catal, content, filename, 0);
2702 xmlFreeCatalog(catal);
2707 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer);
2708 if (catal == NULL) {
2712 catal->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
2716 return (catal);
2721 * @catal: a catalog
2724 * Load the catalog and expand the existing catal structure.
2730 xmlExpandCatalog(xmlCatalogPtr catal, const char *filename)
2734 if ((catal == NULL) || (filename == NULL))
2738 if (catal->type == XML_SGML_CATALOG_TYPE) {
2745 ret = xmlParseSGMLCatalog(catal, content, filename, 0);
2756 cur = catal->xml;
2758 catal->xml = tmp;
2769 * @catal: a Catalog
2778 xmlACatalogResolveSystem(xmlCatalogPtr catal, const xmlChar *sysID) {
2781 if ((sysID == NULL) || (catal == NULL))
2788 if (catal->type == XML_XML_CATALOG_TYPE) {
2789 ret = xmlCatalogListXMLResolve(catal->xml, NULL, sysID);
2795 sgml = xmlCatalogGetSGMLSystem(catal->sgml, sysID);
2804 * @catal: a Catalog
2813 xmlACatalogResolvePublic(xmlCatalogPtr catal, const xmlChar *pubID) {
2816 if ((pubID == NULL) || (catal == NULL))
2823 if (catal->type == XML_XML_CATALOG_TYPE) {
2824 ret = xmlCatalogListXMLResolve(catal->xml, pubID, NULL);
2830 sgml = xmlCatalogGetSGMLPublic(catal->sgml, pubID);
2839 * @catal: a Catalog
2849 xmlACatalogResolve(xmlCatalogPtr catal, const xmlChar * pubID,
2854 if (((pubID == NULL) && (sysID == NULL)) || (catal == NULL))
2870 if (catal->type == XML_XML_CATALOG_TYPE) {
2871 ret = xmlCatalogListXMLResolve(catal->xml, pubID, sysID);
2877 sgml = xmlCatalogSGMLResolve(catal, pubID, sysID);
2886 * @catal: a Catalog
2895 xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) {
2898 if ((URI == NULL) || (catal == NULL))
2905 if (catal->type == XML_XML_CATALOG_TYPE) {
2906 ret = xmlCatalogListXMLResolveURI(catal->xml, URI);
2912 sgml = xmlCatalogSGMLResolve(catal, NULL, URI);
2922 * @catal: a Catalog
2928 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
2929 if ((out == NULL) || (catal == NULL))
2932 if (catal->type == XML_XML_CATALOG_TYPE) {
2933 xmlDumpXMLCatalog(out, catal->xml);
2935 xmlHashScan(catal->sgml,
2943 * @catal: a Catalog
2954 xmlACatalogAdd(xmlCatalogPtr catal, const xmlChar * type,
2959 if (catal == NULL)
2962 if (catal->type == XML_XML_CATALOG_TYPE) {
2963 res = xmlAddXMLCatalog(catal->xml, type, orig, replace);
2973 if (catal->sgml == NULL)
2974 catal->sgml = xmlHashCreate(10);
2975 res = xmlHashAddEntry(catal->sgml, orig, entry);
2983 * @catal: a Catalog
2991 xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *value) {
2994 if ((catal == NULL) || (value == NULL))
2997 if (catal->type == XML_XML_CATALOG_TYPE) {
2998 res = xmlDelXMLCatalog(catal->xml, value);
3000 res = xmlHashRemoveEntry(catal->sgml, value,
3018 xmlCatalogPtr catal = NULL;
3021 catal = xmlCreateNewCatalog(XML_SGML_CATALOG_TYPE,
3023 if ((catal != NULL) && (catal->sgml == NULL))
3024 catal->sgml = xmlHashCreate(10);
3026 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
3028 return(catal);
3033 * @catal: should this create an SGML catalog
3040 xmlCatalogIsEmpty(xmlCatalogPtr catal) {
3041 if (catal == NULL)
3044 if (catal->type == XML_XML_CATALOG_TYPE) {
3045 if (catal->xml == NULL)
3047 if ((catal->xml->type != XML_CATA_CATALOG) &&
3048 (catal->xml->type != XML_CATA_BROKEN_CATALOG))
3050 if (catal->xml->children == NULL)
3056 if (catal->sgml == NULL)
3058 res = xmlHashSize(catal->sgml);
3114 xmlCatalogPtr catal;
3149 catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
3151 if (catal != NULL) {
3155 nextent = &catal->xml;
3173 xmlDefaultCatalog = catal;
3196 xmlCatalogPtr catal;
3204 catal = xmlLoadACatalog(filename);
3205 if (catal == NULL) {
3210 xmlDefaultCatalog = catal;
3596 xmlCatalogEntryPtr catal;
3601 catal = (xmlCatalogEntryPtr) catalogs;
3602 if (catal != NULL)
3603 xmlFreeCatalogEntryList(catal);
3618 xmlCatalogEntryPtr catal, add;
3635 catal = (xmlCatalogEntryPtr) catalogs;
3636 if (catal == NULL)
3639 while (catal->next != NULL)
3640 catal = catal->next;
3641 catal->next = add;
3660 xmlCatalogEntryPtr catal;
3682 catal = (xmlCatalogEntryPtr) catalogs;
3683 if (catal == NULL)
3685 ret = xmlCatalogListXMLResolve(catal, pubID, sysID);
3704 xmlCatalogEntryPtr catal;
3717 catal = (xmlCatalogEntryPtr) catalogs;
3718 if (catal == NULL)
3720 ret = xmlCatalogListXMLResolveURI(catal, URI);