| 1 |
/** |
| 2 |
* @file |
| 3 |
* |
| 4 |
* @brief interfaces to the Catalog handling system |
| 5 |
* |
| 6 |
* the catalog module implements the support for |
| 7 |
* XML Catalogs and SGML catalogs |
| 8 |
* |
| 9 |
* SGML Open Technical Resolution TR9401:1997. |
| 10 |
* http://www.jclark.com/sp/catalog.htm |
| 11 |
* |
| 12 |
* XML Catalogs Working Draft 06 August 2001 |
| 13 |
* http://www.oasis-open.org/committees/entity/spec-2001-08-06.html |
| 14 |
* |
| 15 |
* @copyright See Copyright for the status of this software. |
| 16 |
* |
| 17 |
* @author Daniel Veillard |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef __XML_CATALOG_H__ |
| 21 |
#define __XML_CATALOG_H__ |
| 22 |
|
| 23 |
#include <stdio.h> |
| 24 |
|
| 25 |
#include <libxml/xmlversion.h> |
| 26 |
#include <libxml/xmlstring.h> |
| 27 |
#include <libxml/tree.h> |
| 28 |
|
| 29 |
#ifdef LIBXML_CATALOG_ENABLED |
| 30 |
|
| 31 |
#ifdef __cplusplus |
| 32 |
extern "C" { |
| 33 |
#endif |
| 34 |
|
| 35 |
/** |
| 36 |
* The namespace for the XML Catalogs elements. |
| 37 |
*/ |
| 38 |
#define XML_CATALOGS_NAMESPACE \ |
| 39 |
(const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" |
| 40 |
/** |
| 41 |
* The specific XML Catalog Processing Instruction name. |
| 42 |
*/ |
| 43 |
#define XML_CATALOG_PI \ |
| 44 |
(const xmlChar *) "oasis-xml-catalog" |
| 45 |
|
| 46 |
/** @cond ignore */ |
| 47 |
|
| 48 |
/* |
| 49 |
* The API is voluntarily limited to general cataloging. |
| 50 |
*/ |
| 51 |
typedef enum { |
| 52 |
XML_CATA_PREFER_NONE = 0, |
| 53 |
XML_CATA_PREFER_PUBLIC = 1, |
| 54 |
XML_CATA_PREFER_SYSTEM |
| 55 |
} xmlCatalogPrefer; |
| 56 |
|
| 57 |
typedef enum { |
| 58 |
XML_CATA_ALLOW_NONE = 0, |
| 59 |
XML_CATA_ALLOW_GLOBAL = 1, |
| 60 |
XML_CATA_ALLOW_DOCUMENT = 2, |
| 61 |
XML_CATA_ALLOW_ALL = 3 |
| 62 |
} xmlCatalogAllow; |
| 63 |
|
| 64 |
/** @endcond */ |
| 65 |
|
| 66 |
/** XML catalog */ |
| 67 |
typedef struct _xmlCatalog xmlCatalog; |
| 68 |
typedef xmlCatalog *xmlCatalogPtr; |
| 69 |
|
| 70 |
/* |
| 71 |
* Operations on a given catalog. |
| 72 |
*/ |
| 73 |
XML_DEPRECATED |
| 74 |
XMLPUBFUN xmlCatalog * |
| 75 |
xmlNewCatalog (int sgml); |
| 76 |
XML_DEPRECATED |
| 77 |
XMLPUBFUN xmlCatalog * |
| 78 |
xmlLoadACatalog (const char *filename); |
| 79 |
#ifdef LIBXML_SGML_CATALOG_ENABLED |
| 80 |
XML_DEPRECATED |
| 81 |
XMLPUBFUN xmlCatalog * |
| 82 |
xmlLoadSGMLSuperCatalog (const char *filename); |
| 83 |
XML_DEPRECATED |
| 84 |
XMLPUBFUN int |
| 85 |
xmlConvertSGMLCatalog (xmlCatalog *catal); |
| 86 |
#endif /* LIBXML_SGML_CATALOG_ENABLED */ |
| 87 |
XML_DEPRECATED |
| 88 |
XMLPUBFUN int |
| 89 |
xmlACatalogAdd (xmlCatalog *catal, |
| 90 |
const xmlChar *type, |
| 91 |
const xmlChar *orig, |
| 92 |
const xmlChar *replace); |
| 93 |
XML_DEPRECATED |
| 94 |
XMLPUBFUN int |
| 95 |
xmlACatalogRemove (xmlCatalog *catal, |
| 96 |
const xmlChar *value); |
| 97 |
XML_DEPRECATED |
| 98 |
XMLPUBFUN xmlChar * |
| 99 |
xmlACatalogResolve (xmlCatalog *catal, |
| 100 |
const xmlChar *pubID, |
| 101 |
const xmlChar *sysID); |
| 102 |
XML_DEPRECATED |
| 103 |
XMLPUBFUN xmlChar * |
| 104 |
xmlACatalogResolveSystem(xmlCatalog *catal, |
| 105 |
const xmlChar *sysID); |
| 106 |
XML_DEPRECATED |
| 107 |
XMLPUBFUN xmlChar * |
| 108 |
xmlACatalogResolvePublic(xmlCatalog *catal, |
| 109 |
const xmlChar *pubID); |
| 110 |
XML_DEPRECATED |
| 111 |
XMLPUBFUN xmlChar * |
| 112 |
xmlACatalogResolveURI (xmlCatalog *catal, |
| 113 |
const xmlChar *URI); |
| 114 |
#ifdef LIBXML_OUTPUT_ENABLED |
| 115 |
XML_DEPRECATED |
| 116 |
XMLPUBFUN void |
| 117 |
xmlACatalogDump (xmlCatalog *catal, |
| 118 |
FILE *out); |
| 119 |
#endif /* LIBXML_OUTPUT_ENABLED */ |
| 120 |
XML_DEPRECATED |
| 121 |
XMLPUBFUN void |
| 122 |
xmlFreeCatalog (xmlCatalog *catal); |
| 123 |
XML_DEPRECATED |
| 124 |
XMLPUBFUN int |
| 125 |
xmlCatalogIsEmpty (xmlCatalog *catal); |
| 126 |
|
| 127 |
/* |
| 128 |
* Global operations. |
| 129 |
*/ |
| 130 |
XMLPUBFUN void |
| 131 |
xmlInitializeCatalog (void); |
| 132 |
XMLPUBFUN int |
| 133 |
xmlLoadCatalog (const char *filename); |
| 134 |
XMLPUBFUN void |
| 135 |
xmlLoadCatalogs (const char *paths); |
| 136 |
XMLPUBFUN void |
| 137 |
xmlCatalogCleanup (void); |
| 138 |
#ifdef LIBXML_OUTPUT_ENABLED |
| 139 |
XMLPUBFUN void |
| 140 |
xmlCatalogDump (FILE *out); |
| 141 |
XMLPUBFUN xmlDocPtr |
| 142 |
xmlCatalogDumpDoc (void); |
| 143 |
#endif /* LIBXML_OUTPUT_ENABLED */ |
| 144 |
XMLPUBFUN xmlChar * |
| 145 |
xmlCatalogResolve (const xmlChar *pubID, |
| 146 |
const xmlChar *sysID); |
| 147 |
XMLPUBFUN xmlChar * |
| 148 |
xmlCatalogResolveSystem (const xmlChar *sysID); |
| 149 |
XMLPUBFUN xmlChar * |
| 150 |
xmlCatalogResolvePublic (const xmlChar *pubID); |
| 151 |
XMLPUBFUN xmlChar * |
| 152 |
xmlCatalogResolveURI (const xmlChar *URI); |
| 153 |
XMLPUBFUN int |
| 154 |
xmlCatalogAdd (const xmlChar *type, |
| 155 |
const xmlChar *orig, |
| 156 |
const xmlChar *replace); |
| 157 |
XMLPUBFUN int |
| 158 |
xmlCatalogRemove (const xmlChar *value); |
| 159 |
XML_DEPRECATED |
| 160 |
XMLPUBFUN xmlDoc * |
| 161 |
xmlParseCatalogFile (const char *filename); |
| 162 |
#ifdef LIBXML_SGML_CATALOG_ENABLED |
| 163 |
XML_DEPRECATED |
| 164 |
XMLPUBFUN int |
| 165 |
xmlCatalogConvert (void); |
| 166 |
#endif /* LIBXML_SGML_CATALOG_ENABLED */ |
| 167 |
|
| 168 |
/* |
| 169 |
* Strictly minimal interfaces for per-document catalogs used |
| 170 |
* by the parser. |
| 171 |
*/ |
| 172 |
XMLPUBFUN void |
| 173 |
xmlCatalogFreeLocal (void *catalogs); |
| 174 |
XMLPUBFUN void * |
| 175 |
xmlCatalogAddLocal (void *catalogs, |
| 176 |
const xmlChar *URL); |
| 177 |
XMLPUBFUN xmlChar * |
| 178 |
xmlCatalogLocalResolve (void *catalogs, |
| 179 |
const xmlChar *pubID, |
| 180 |
const xmlChar *sysID); |
| 181 |
XMLPUBFUN xmlChar * |
| 182 |
xmlCatalogLocalResolveURI(void *catalogs, |
| 183 |
const xmlChar *URI); |
| 184 |
/* |
| 185 |
* Preference settings. |
| 186 |
*/ |
| 187 |
XMLPUBFUN int |
| 188 |
xmlCatalogSetDebug (int level); |
| 189 |
XML_DEPRECATED |
| 190 |
XMLPUBFUN xmlCatalogPrefer |
| 191 |
xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); |
| 192 |
XMLPUBFUN void |
| 193 |
xmlCatalogSetDefaults (xmlCatalogAllow allow); |
| 194 |
XMLPUBFUN xmlCatalogAllow |
| 195 |
xmlCatalogGetDefaults (void); |
| 196 |
|
| 197 |
|
| 198 |
/* DEPRECATED interfaces */ |
| 199 |
XML_DEPRECATED |
| 200 |
XMLPUBFUN const xmlChar * |
| 201 |
xmlCatalogGetSystem (const xmlChar *sysID); |
| 202 |
XML_DEPRECATED |
| 203 |
XMLPUBFUN const xmlChar * |
| 204 |
xmlCatalogGetPublic (const xmlChar *pubID); |
| 205 |
|
| 206 |
#ifdef __cplusplus |
| 207 |
} |
| 208 |
#endif |
| 209 |
#endif /* LIBXML_CATALOG_ENABLED */ |
| 210 |
#endif /* __XML_CATALOG_H__ */ |