2 * Summary: interfaces to the Catalog handling system
3 * Description: the catalog module implements the support for
4 * XML Catalogs and SGML catalogs
6 * SGML Open Technical Resolution TR9401:1997.
7 * http://www.jclark.com/sp/catalog.htm
9 * XML Catalogs Working Draft 06 August 2001
10 * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
12 * Copy: See Copyright for the status of this software.
14 * Author: Daniel Veillard
17 #ifndef __XML_CATALOG_H__
18 #define __XML_CATALOG_H__
22 #include <libxml/xmlversion.h>
23 #include <libxml/xmlstring.h>
24 #include <libxml/tree.h>
26 #ifdef LIBXML_CATALOG_ENABLED
33 * XML_CATALOGS_NAMESPACE:
35 * The namespace for the XML Catalogs elements.
37 #define XML_CATALOGS_NAMESPACE \
38 (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
42 * The specific XML Catalog Processing Instuction name.
44 #define XML_CATALOG_PI \
45 (const xmlChar *) "oasis-xml-catalog"
48 * The API is voluntarily limited to general cataloging.
51 XML_CATA_PREFER_NONE = 0,
52 XML_CATA_PREFER_PUBLIC = 1,
53 XML_CATA_PREFER_SYSTEM
57 XML_CATA_ALLOW_NONE = 0,
58 XML_CATA_ALLOW_GLOBAL = 1,
59 XML_CATA_ALLOW_DOCUMENT = 2,
60 XML_CATA_ALLOW_ALL = 3
63 typedef struct _xmlCatalog xmlCatalog;
64 typedef xmlCatalog *xmlCatalogPtr;
67 * Operations on a given catalog.
69 XMLPUBFUN xmlCatalogPtr XMLCALL
70 xmlNewCatalog (int sgml);
71 XMLPUBFUN xmlCatalogPtr XMLCALL
72 xmlLoadACatalog (const char *filename);
73 XMLPUBFUN xmlCatalogPtr XMLCALL
74 xmlLoadSGMLSuperCatalog (const char *filename);
76 xmlConvertSGMLCatalog (xmlCatalogPtr catal);
78 xmlACatalogAdd (xmlCatalogPtr catal,
81 const xmlChar *replace);
83 xmlACatalogRemove (xmlCatalogPtr catal,
84 const xmlChar *value);
85 XMLPUBFUN xmlChar * XMLCALL
86 xmlACatalogResolve (xmlCatalogPtr catal,
88 const xmlChar *sysID);
89 XMLPUBFUN xmlChar * XMLCALL
90 xmlACatalogResolveSystem(xmlCatalogPtr catal,
91 const xmlChar *sysID);
92 XMLPUBFUN xmlChar * XMLCALL
93 xmlACatalogResolvePublic(xmlCatalogPtr catal,
94 const xmlChar *pubID);
95 XMLPUBFUN xmlChar * XMLCALL
96 xmlACatalogResolveURI (xmlCatalogPtr catal,
98 #ifdef LIBXML_OUTPUT_ENABLED
99 XMLPUBFUN void XMLCALL
100 xmlACatalogDump (xmlCatalogPtr catal,
102 #endif /* LIBXML_OUTPUT_ENABLED */
103 XMLPUBFUN void XMLCALL
104 xmlFreeCatalog (xmlCatalogPtr catal);
105 XMLPUBFUN int XMLCALL
106 xmlCatalogIsEmpty (xmlCatalogPtr catal);
111 XMLPUBFUN void XMLCALL
112 xmlInitializeCatalog (void);
113 XMLPUBFUN int XMLCALL
114 xmlLoadCatalog (const char *filename);
115 XMLPUBFUN void XMLCALL
116 xmlLoadCatalogs (const char *paths);
117 XMLPUBFUN void XMLCALL
118 xmlCatalogCleanup (void);
119 #ifdef LIBXML_OUTPUT_ENABLED
120 XMLPUBFUN void XMLCALL
121 xmlCatalogDump (FILE *out);
122 #endif /* LIBXML_OUTPUT_ENABLED */
123 XMLPUBFUN xmlChar * XMLCALL
124 xmlCatalogResolve (const xmlChar *pubID,
125 const xmlChar *sysID);
126 XMLPUBFUN xmlChar * XMLCALL
127 xmlCatalogResolveSystem (const xmlChar *sysID);
128 XMLPUBFUN xmlChar * XMLCALL
129 xmlCatalogResolvePublic (const xmlChar *pubID);
130 XMLPUBFUN xmlChar * XMLCALL
131 xmlCatalogResolveURI (const xmlChar *URI);
132 XMLPUBFUN int XMLCALL
133 xmlCatalogAdd (const xmlChar *type,
135 const xmlChar *replace);
136 XMLPUBFUN int XMLCALL
137 xmlCatalogRemove (const xmlChar *value);
138 XMLPUBFUN xmlDocPtr XMLCALL
139 xmlParseCatalogFile (const char *filename);
140 XMLPUBFUN int XMLCALL
141 xmlCatalogConvert (void);
144 * Strictly minimal interfaces for per-document catalogs used
147 XMLPUBFUN void XMLCALL
148 xmlCatalogFreeLocal (void *catalogs);
149 XMLPUBFUN void * XMLCALL
150 xmlCatalogAddLocal (void *catalogs,
152 XMLPUBFUN xmlChar * XMLCALL
153 xmlCatalogLocalResolve (void *catalogs,
154 const xmlChar *pubID,
155 const xmlChar *sysID);
156 XMLPUBFUN xmlChar * XMLCALL
157 xmlCatalogLocalResolveURI(void *catalogs,
160 * Preference settings.
162 XMLPUBFUN int XMLCALL
163 xmlCatalogSetDebug (int level);
164 XMLPUBFUN xmlCatalogPrefer XMLCALL
165 xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
166 XMLPUBFUN void XMLCALL
167 xmlCatalogSetDefaults (xmlCatalogAllow allow);
168 XMLPUBFUN xmlCatalogAllow XMLCALL
169 xmlCatalogGetDefaults (void);
172 /* DEPRECATED interfaces */
173 XMLPUBFUN const xmlChar * XMLCALL
174 xmlCatalogGetSystem (const xmlChar *sysID);
175 XMLPUBFUN const xmlChar * XMLCALL
176 xmlCatalogGetPublic (const xmlChar *pubID);
181 #endif /* LIBXML_CATALOG_ENABLED */
182 #endif /* __XML_CATALOG_H__ */