Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:41:48

0001 /**
0002  * Summary: interfaces to the Catalog handling system
0003  * Description: the catalog module implements the support for
0004  * XML Catalogs and SGML catalogs
0005  *
0006  * SGML Open Technical Resolution TR9401:1997.
0007  * http://www.jclark.com/sp/catalog.htm
0008  *
0009  * XML Catalogs Working Draft 06 August 2001
0010  * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
0011  *
0012  * Copy: See Copyright for the status of this software.
0013  *
0014  * Author: Daniel Veillard
0015  */
0016 
0017 #ifndef __XML_CATALOG_H__
0018 #define __XML_CATALOG_H__
0019 
0020 #include <stdio.h>
0021 
0022 #include <libxml/xmlversion.h>
0023 #include <libxml/xmlstring.h>
0024 #include <libxml/tree.h>
0025 
0026 #ifdef LIBXML_CATALOG_ENABLED
0027 
0028 #ifdef __cplusplus
0029 extern "C" {
0030 #endif
0031 
0032 /**
0033  * XML_CATALOGS_NAMESPACE:
0034  *
0035  * The namespace for the XML Catalogs elements.
0036  */
0037 #define XML_CATALOGS_NAMESPACE                  \
0038     (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
0039 /**
0040  * XML_CATALOG_PI:
0041  *
0042  * The specific XML Catalog Processing Instruction name.
0043  */
0044 #define XML_CATALOG_PI                      \
0045     (const xmlChar *) "oasis-xml-catalog"
0046 
0047 /*
0048  * The API is voluntarily limited to general cataloging.
0049  */
0050 typedef enum {
0051     XML_CATA_PREFER_NONE = 0,
0052     XML_CATA_PREFER_PUBLIC = 1,
0053     XML_CATA_PREFER_SYSTEM
0054 } xmlCatalogPrefer;
0055 
0056 typedef enum {
0057     XML_CATA_ALLOW_NONE = 0,
0058     XML_CATA_ALLOW_GLOBAL = 1,
0059     XML_CATA_ALLOW_DOCUMENT = 2,
0060     XML_CATA_ALLOW_ALL = 3
0061 } xmlCatalogAllow;
0062 
0063 typedef struct _xmlCatalog xmlCatalog;
0064 typedef xmlCatalog *xmlCatalogPtr;
0065 
0066 /*
0067  * Operations on a given catalog.
0068  */
0069 XMLPUBFUN xmlCatalogPtr
0070         xmlNewCatalog       (int sgml);
0071 XMLPUBFUN xmlCatalogPtr
0072         xmlLoadACatalog     (const char *filename);
0073 XMLPUBFUN xmlCatalogPtr
0074         xmlLoadSGMLSuperCatalog (const char *filename);
0075 XMLPUBFUN int
0076         xmlConvertSGMLCatalog   (xmlCatalogPtr catal);
0077 XMLPUBFUN int
0078         xmlACatalogAdd      (xmlCatalogPtr catal,
0079                      const xmlChar *type,
0080                      const xmlChar *orig,
0081                      const xmlChar *replace);
0082 XMLPUBFUN int
0083         xmlACatalogRemove   (xmlCatalogPtr catal,
0084                      const xmlChar *value);
0085 XMLPUBFUN xmlChar *
0086         xmlACatalogResolve  (xmlCatalogPtr catal,
0087                      const xmlChar *pubID,
0088                                      const xmlChar *sysID);
0089 XMLPUBFUN xmlChar *
0090         xmlACatalogResolveSystem(xmlCatalogPtr catal,
0091                      const xmlChar *sysID);
0092 XMLPUBFUN xmlChar *
0093         xmlACatalogResolvePublic(xmlCatalogPtr catal,
0094                      const xmlChar *pubID);
0095 XMLPUBFUN xmlChar *
0096         xmlACatalogResolveURI   (xmlCatalogPtr catal,
0097                      const xmlChar *URI);
0098 #ifdef LIBXML_OUTPUT_ENABLED
0099 XMLPUBFUN void
0100         xmlACatalogDump     (xmlCatalogPtr catal,
0101                      FILE *out);
0102 #endif /* LIBXML_OUTPUT_ENABLED */
0103 XMLPUBFUN void
0104         xmlFreeCatalog      (xmlCatalogPtr catal);
0105 XMLPUBFUN int
0106         xmlCatalogIsEmpty   (xmlCatalogPtr catal);
0107 
0108 /*
0109  * Global operations.
0110  */
0111 XMLPUBFUN void
0112         xmlInitializeCatalog    (void);
0113 XMLPUBFUN int
0114         xmlLoadCatalog      (const char *filename);
0115 XMLPUBFUN void
0116         xmlLoadCatalogs     (const char *paths);
0117 XMLPUBFUN void
0118         xmlCatalogCleanup   (void);
0119 #ifdef LIBXML_OUTPUT_ENABLED
0120 XMLPUBFUN void
0121         xmlCatalogDump      (FILE *out);
0122 #endif /* LIBXML_OUTPUT_ENABLED */
0123 XMLPUBFUN xmlChar *
0124         xmlCatalogResolve   (const xmlChar *pubID,
0125                                      const xmlChar *sysID);
0126 XMLPUBFUN xmlChar *
0127         xmlCatalogResolveSystem (const xmlChar *sysID);
0128 XMLPUBFUN xmlChar *
0129         xmlCatalogResolvePublic (const xmlChar *pubID);
0130 XMLPUBFUN xmlChar *
0131         xmlCatalogResolveURI    (const xmlChar *URI);
0132 XMLPUBFUN int
0133         xmlCatalogAdd       (const xmlChar *type,
0134                      const xmlChar *orig,
0135                      const xmlChar *replace);
0136 XMLPUBFUN int
0137         xmlCatalogRemove    (const xmlChar *value);
0138 XMLPUBFUN xmlDocPtr
0139         xmlParseCatalogFile (const char *filename);
0140 XMLPUBFUN int
0141         xmlCatalogConvert   (void);
0142 
0143 /*
0144  * Strictly minimal interfaces for per-document catalogs used
0145  * by the parser.
0146  */
0147 XMLPUBFUN void
0148         xmlCatalogFreeLocal (void *catalogs);
0149 XMLPUBFUN void *
0150         xmlCatalogAddLocal  (void *catalogs,
0151                      const xmlChar *URL);
0152 XMLPUBFUN xmlChar *
0153         xmlCatalogLocalResolve  (void *catalogs,
0154                      const xmlChar *pubID,
0155                                      const xmlChar *sysID);
0156 XMLPUBFUN xmlChar *
0157         xmlCatalogLocalResolveURI(void *catalogs,
0158                      const xmlChar *URI);
0159 /*
0160  * Preference settings.
0161  */
0162 XMLPUBFUN int
0163         xmlCatalogSetDebug  (int level);
0164 XMLPUBFUN xmlCatalogPrefer
0165         xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
0166 XMLPUBFUN void
0167         xmlCatalogSetDefaults   (xmlCatalogAllow allow);
0168 XMLPUBFUN xmlCatalogAllow
0169         xmlCatalogGetDefaults   (void);
0170 
0171 
0172 /* DEPRECATED interfaces */
0173 XMLPUBFUN const xmlChar *
0174         xmlCatalogGetSystem (const xmlChar *sysID);
0175 XMLPUBFUN const xmlChar *
0176         xmlCatalogGetPublic (const xmlChar *pubID);
0177 
0178 #ifdef __cplusplus
0179 }
0180 #endif
0181 #endif /* LIBXML_CATALOG_ENABLED */
0182 #endif /* __XML_CATALOG_H__ */