2 * catalog.h: interfaces of the Catalog handling system
4 * Reference: SGML Open Technical Resolution TR9401:1997.
5 * http://www.jclark.com/sp/catalog.htm
7 * XML Catalogs Working Draft 12 Jun 2001
8 * http://www.oasis-open.org/committees/entity/spec-2001-06-12.html
10 * See Copyright for the status of this software.
15 #ifndef __XML_CATALOG_H__
16 #define __XML_CATALOG_H__
20 #include <libxml/xmlversion.h>
22 #ifdef LIBXML_CATALOG_ENABLED
29 * XML_CATALOGS_NAMESPACE:
31 * The namespace for the XML Catalogs elements.
33 #define XML_CATALOGS_NAMESPACE \
34 (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
38 * The specific XML Catalog Processing Instuction name.
40 #define XML_CATALOG_PI \
41 (const xmlChar *) "oasis-xml-catalog"
44 * The API is voluntarily limited to general cataloging.
47 XML_CATA_PREFER_NONE = 0,
48 XML_CATA_PREFER_PUBLIC = 1,
49 XML_CATA_PREFER_SYSTEM
53 XML_CATA_ALLOW_NONE = 0,
54 XML_CATA_ALLOW_GLOBAL = 1,
55 XML_CATA_ALLOW_DOCUMENT = 2,
56 XML_CATA_ALLOW_ALL = 3
59 typedef struct _xmlCatalog xmlCatalog;
60 typedef xmlCatalog *xmlCatalogPtr;
63 * Operations on a given catalog.
65 xmlCatalogPtr xmlNewCatalog (int sgml);
66 xmlCatalogPtr xmlLoadACatalog (const char *filename);
67 xmlCatalogPtr xmlLoadSGMLSuperCatalog (const char *filename);
68 int xmlConvertSGMLCatalog (xmlCatalogPtr catal);
69 int xmlACatalogAdd (xmlCatalogPtr catal,
72 const xmlChar *replace);
73 int xmlACatalogRemove (xmlCatalogPtr catal,
74 const xmlChar *value);
75 xmlChar * xmlACatalogResolve (xmlCatalogPtr catal,
77 const xmlChar *sysID);
78 xmlChar * xmlACatalogResolveSystem(xmlCatalogPtr catal,
79 const xmlChar *sysID);
80 xmlChar * xmlACatalogResolvePublic(xmlCatalogPtr catal,
81 const xmlChar *pubID);
82 xmlChar * xmlACatalogResolveURI (xmlCatalogPtr catal,
84 void xmlACatalogDump (xmlCatalogPtr catal,
86 void xmlFreeCatalog (xmlCatalogPtr catal);
87 int xmlCatalogIsEmpty (xmlCatalogPtr catal);
92 void xmlInitializeCatalog (void);
93 int xmlLoadCatalog (const char *filename);
94 void xmlLoadCatalogs (const char *paths);
95 void xmlCatalogCleanup (void);
96 void xmlCatalogDump (FILE *out);
97 xmlChar * xmlCatalogResolve (const xmlChar *pubID,
98 const xmlChar *sysID);
99 xmlChar * xmlCatalogResolveSystem (const xmlChar *sysID);
100 xmlChar * xmlCatalogResolvePublic (const xmlChar *pubID);
101 xmlChar * xmlCatalogResolveURI (const xmlChar *URI);
102 int xmlCatalogAdd (const xmlChar *type,
104 const xmlChar *replace);
105 int xmlCatalogRemove (const xmlChar *value);
106 xmlDocPtr xmlParseCatalogFile (const char *filename);
107 int xmlCatalogConvert (void);
110 * Strictly minimal interfaces for per-document catalogs used
113 void xmlCatalogFreeLocal (void *catalogs);
114 void * xmlCatalogAddLocal (void *catalogs,
116 xmlChar * xmlCatalogLocalResolve (void *catalogs,
117 const xmlChar *pubID,
118 const xmlChar *sysID);
119 xmlChar * xmlCatalogLocalResolveURI(void *catalogs,
122 * Preference settings.
124 int xmlCatalogSetDebug (int level);
125 xmlCatalogPrefer xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
126 void xmlCatalogSetDefaults (xmlCatalogAllow allow);
127 xmlCatalogAllow xmlCatalogGetDefaults (void);
130 /* DEPRECATED interfaces */
131 const xmlChar * xmlCatalogGetSystem (const xmlChar *sysID);
132 const xmlChar * xmlCatalogGetPublic (const xmlChar *pubID);
137 #endif /* LIBXML_CATALOG_ENABLED */
138 #endif /* __XML_CATALOG_H__ */