Lines Matching full:catalog
2 * catalog.c: set of generic Catalog related routines
5 * http://www.jclark.com/sp/catalog.htm
39 #include <libxml/catalog.h>
73 #define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
76 #define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog"
81 static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog";
158 * SGML Catalogs are stored as a simple hash table of catalog entries
159 * Catalog stack to check against overflows when building the
160 * SGML catalog
168 * XML Catalogs are stored as a tree of Catalog entries
194 * The default catalog in use by the application
199 * A mutex for modifying the shared global catalog(s)
207 * Whether the catalog support was initialized.
213 * Catalog error handlers *
234 * @catal: the Catalog entry
239 * Handle a catalog error
268 * create a new Catalog entry, this type is shared both by XML and
282 xmlCatalogErrMemory("allocating catalog entry"); in xmlNewCatalogEntry()
322 * @payload: a Catalog entry
324 * Free the memory allocated to a Catalog entry
341 "Free catalog entry %s\n", ret->name); in xmlFreeCatalogEntry()
344 "Free catalog entry %s\n", ret->value); in xmlFreeCatalogEntry()
347 "Free catalog entry\n"); in xmlFreeCatalogEntry()
361 * @ret: a Catalog entry list
363 * Free the memory allocated to a full chained list of Catalog entries
378 * @payload: a Catalog entry list
380 * Free the memory allocated to list of Catalog entries from the
381 * catalog file hash.
406 * @type: type of catalog
409 * create a new Catalog, this type is shared both by XML and
420 xmlCatalogErrMemory("allocating catalog"); in xmlCreateNewCatalog()
435 * @catal: a Catalog
437 * Free the memory allocated to a Catalog
459 * @entry: the catalog entry
462 * Serialize an SGML Catalog entry
491 fprintf(out, "CATALOG "); break; in xmlCatalogDumpEntry()
535 * @catal: top catalog entry
536 * @catalog: pointer to the xml tree
541 * Serializes a Catalog entry, called by xmlDumpXMLCatalog and recursively
544 static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr catal, xmlNodePtr catalog, in xmlDumpXMLCatalogNode() argument
549 * add all the catalog entries in xmlDumpXMLCatalogNode()
566 xmlSetProp(node, BAD_CAST "catalog", cur->value); in xmlDumpXMLCatalogNode()
567 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
592 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
598 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
604 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
610 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
615 xmlSetProp(node, BAD_CAST "catalog", cur->value); in xmlDumpXMLCatalogNode()
616 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
621 xmlSetProp(node, BAD_CAST "catalog", cur->value); in xmlDumpXMLCatalogNode()
622 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
628 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
634 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
639 xmlSetProp(node, BAD_CAST "catalog", cur->value); in xmlDumpXMLCatalogNode()
640 xmlAddChild(catalog, node); in xmlDumpXMLCatalogNode()
667 xmlNodePtr catalog; in xmlDumpXMLCatalog() local
671 * Rebuild a catalog in xmlDumpXMLCatalog()
676 dtd = xmlNewDtd(doc, BAD_CAST "catalog", in xmlDumpXMLCatalog()
677 BAD_CAST "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN", in xmlDumpXMLCatalog()
678 BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"); in xmlDumpXMLCatalog()
687 catalog = xmlNewDocNode(doc, ns, BAD_CAST "catalog", NULL); in xmlDumpXMLCatalog()
688 if (catalog == NULL) { in xmlDumpXMLCatalog()
693 catalog->nsDef = ns; in xmlDumpXMLCatalog()
694 xmlAddChild((xmlNodePtr) doc, catalog); in xmlDumpXMLCatalog()
696 xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); in xmlDumpXMLCatalog()
726 * @catal: pointer to the catalog being converted
728 * Convert one entry from the catalog
771 * Conversion successful, remove from the SGML catalog in xmlCatalogConvertEntry()
791 * @catal: the catalog
793 * Convert all the SGML catalog entries as XML ones
805 "Converting SGML catalog to XML\n"); in xmlConvertSGMLCatalog()
887 * except it bypass all catalog lookups.
1001 xmlCatalogErrMemory("allocating catalog data"); in xmlLoadFileContent()
1082 * The XML Catalog parser *
1102 * lookup the internal type associated to an XML catalog entry name
1127 else if (xmlStrEqual(name, (const xmlChar *) "catalog")) in xmlGetXMLCatalogEntryType()
1135 * @type: the type of Catalog entry
1142 * Finishes the examination of an XML tree node of a catalog and build
1143 * a Catalog entry from it.
1145 * Returns the new Catalog entry node or NULL in case of error.
1212 * @parent: the parent Catalog entry
1215 * Examines an XML tree node of a catalog and build
1216 * a Catalog entry from it adding it to its parent. The examination can
1263 BAD_CAST "catalog", prefer, cgroup); in xmlParseXMLCatalogNode()
1267 BAD_CAST "catalog", prefer, cgroup); in xmlParseXMLCatalogNode()
1279 BAD_CAST "catalog", prefer, cgroup); in xmlParseXMLCatalogNode()
1283 BAD_CAST "catalog", prefer, cgroup); in xmlParseXMLCatalogNode()
1315 * @parent: the parent Catalog entry
1318 * Examines a list of XML sibling nodes of a catalog and build
1319 * a list of Catalog entry from it adding it to the parent.
1338 * @filename: the filename for the catalog
1340 * Parses the catalog file to extract the XML tree and then analyze the
1341 * tree to build a list of Catalog entries corresponding to this catalog
1343 * Returns the resulting Catalog entries list
1359 "Failed to parse catalog %s\n", filename); in xmlParseXMLCatalogFile()
1365 "%d Parsing catalog %s\n", xmlGetThreadId(), filename); in xmlParseXMLCatalogFile()
1368 if ((cur != NULL) && (xmlStrEqual(cur->name, BAD_CAST "catalog")) && in xmlParseXMLCatalogFile()
1396 "File %s is not an XML Catalog\n", in xmlParseXMLCatalogFile()
1407 * @catal: an existing but incomplete catalog entry
1423 * lock the whole catalog for modification in xmlFetchXMLCatalogFile()
1455 * use the existing catalog, there is no recursion allowed at in xmlFetchXMLCatalogFile()
1486 * XML Catalog handling *
1492 * @catal: top of an XML catalog
1493 * @type: the type of record to add to the catalog
1497 * Add an entry in the XML catalog, it may overwrite existing but
1523 "Failed to add unknown element %s to catalog\n", type); in xmlAddXMLCatalog()
1537 "Updating element %s to catalog\n", type); in xmlAddXMLCatalog()
1553 "Adding element %s to catalog\n", type); in xmlAddXMLCatalog()
1572 * @catal: top of an XML catalog
1573 * @value: the value to remove from the catalog
1575 * Remove entries in the XML catalog where the value or the URI
1605 "Removing element %s from catalog\n", cur->name); in xmlDelXMLCatalog()
1608 "Removing element %s from catalog\n", cur->value); in xmlDelXMLCatalog()
1619 * @catal: a catalog list
1624 * list of catalog entries.
1644 "Detected recursion in catalog %s\n", in xmlCatalogXMLResolve()
1852 * @catal: a catalog list
1857 * list of catalog entries.
1881 "Detected recursion in catalog %s\n", in xmlCatalogXMLResolveURI()
1995 * @catal: a catalog list
2087 * @catal: a catalog list
2140 * The SGML Catalog parser *
2155 * Skip a comment in an SGML catalog
2177 * Parse an SGML catalog ID
2246 * Parse an SGML catalog name
2283 * Get the Catalog entry type for a given SGML Catalog name
2285 * Returns Catalog entry type
2308 else if (xmlStrEqual(name, (const xmlChar *) "CATALOG")) in xmlGetSGMLCatalogEntryType()
2317 * @catal: the SGML Catalog
2318 * @value: the content of the SGML Catalog serialization
2319 * @file: the filepath for the catalog
2320 * @super: should this be handled as a Super Catalog in which case
2323 * Parse an SGML catalog content and fill up the @catal hash table with
2382 else if (xmlStrEqual(name, (const xmlChar *) "CATALOG")) in xmlParseSGMLCatalog()
2536 * SGML Catalog handling *
2542 * @catal: an SGML catalog hash
2545 * Try to lookup the catalog local reference associated to a public ID
2579 * @catal: an SGML catalog hash
2582 * Try to lookup the catalog local reference for a system ID
2603 * @catal: the SGML catalog
2640 * Load an SGML super catalog. It won't expand CATALOG or DELEGATE
2642 * like adding and removing CATALOG or DELEGATE entries.
2644 * Returns the catalog parsed or NULL in case of error
2676 * Load the catalog and build the associated data structures.
2677 * This can be either an XML Catalog or an SGML Catalog
2678 * It will recurse in SGML CATALOG entries. On the other hand XML
2681 * Returns the catalog parsed or NULL in case of error
2730 * @catal: a catalog
2733 * Load the catalog and expand the existing catal structure.
2734 * This can be either an XML Catalog or an SGML Catalog
2778 * @catal: a Catalog
2781 * Try to lookup the catalog resource for a system ID
2813 * @catal: a Catalog
2816 * Try to lookup the catalog local reference associated to a public ID in that catalog
2848 * @catal: a Catalog
2895 * @catal: a Catalog
2931 * @catal: a Catalog
2934 * Dump the given catalog to the given file.
2951 * @catal: a Catalog
2952 * @type: the type of record to add to the catalog
2956 * Add an entry in the catalog, it may overwrite existing but
2991 * @catal: a Catalog
2994 * Remove an entry from the catalog
3017 * @sgml: should this create an SGML catalog
3019 * create a new Catalog.
3040 * @catal: should this create an SGML catalog
3042 * Check is a catalog is empty
3044 * Returns 1 if the catalog is empty, 0 if not, amd -1 in case of error.
3076 * Public interfaces manipulating the global shared default catalog *
3083 * Do the catalog initialization only of global data, doesn't try to load
3084 * any catalog actually.
3085 * this function is not thread safe, catalog initialization should
3102 * Do the catalog initialization.
3103 * this function is not thread safe, catalog initialization should
3141 strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); in xmlInitializeCatalog()
3192 * Load the catalog and makes its definitions effective for the default
3193 * external entity loader. It will recurse in SGML CATALOG entries.
3194 * this function is not thread safe, catalog initialization should
3233 * this function is not thread safe, catalog initialization should
3304 * Try to lookup the catalog resource for a system ID
3324 * Try to lookup the catalog reference associated to a public ID
3386 * Dump all the global catalog content to the given file.
3402 * @type: the type of record to add to the catalog
3406 * Add an entry in the catalog, it may overwrite existing but
3408 * If called before any other catalog routine, allows to override the
3409 * default shared catalog put in place by xmlInitializeCatalog();
3422 * Specific case where one want to override the default catalog in xmlCatalogAdd()
3426 (xmlStrEqual(type, BAD_CAST "catalog"))) { in xmlCatalogAdd()
3446 * Remove an entry from the catalog
3466 * Convert all the SGML catalog entries as XML ones
3515 "Disabling catalog usage\n"); in xmlCatalogSetDefaults()
3539 * in XML Catalog resolution. C.f. section 4.1.1 of the spec
3555 "Setting catalog preference to PUBLIC\n"); in xmlCatalogSetDefaultPrefer()
3559 "Setting catalog preference to SYSTEM\n"); in xmlCatalogSetDefaultPrefer()
3573 * Used to set the debug level for catalog operation, 0 disable
3576 * Returns the previous value of the catalog debugging level
3599 * Free up the memory associated to the catalog list
3617 * @URL: the URL to a new local catalog
3619 * Add the new entry to the catalog list
3635 "Adding document catalog %s\n", URL); in xmlCatalogAddLocal()
3659 * document's private catalog list
3704 * document's private catalog list
3742 * Try to lookup the catalog reference associated to a system ID
3786 * Try to lookup the catalog reference associated to a public ID