version 1.1.1.2, 2013/07/22 01:22:19
|
version 1.1.1.3, 2014/06/15 19:53:30
|
Line 1
|
Line 1
|
/** |
/** |
* catalog.c: set of generic Catalog related routines | * catalog.c: set of generic Catalog related routines |
* |
* |
* Reference: SGML Open Technical Resolution TR9401:1997. |
* Reference: SGML Open Technical Resolution TR9401:1997. |
* http://www.jclark.com/sp/catalog.htm |
* http://www.jclark.com/sp/catalog.htm |
Line 41
|
Line 41
|
#include <libxml/threads.h> |
#include <libxml/threads.h> |
#include <libxml/globals.h> |
#include <libxml/globals.h> |
|
|
|
#include "buf.h" |
|
|
#define MAX_DELEGATE 50 |
#define MAX_DELEGATE 50 |
#define MAX_CATAL_DEPTH 50 |
#define MAX_CATAL_DEPTH 50 |
|
|
Line 60
|
Line 62
|
*> values "system" and "public". I have made the default be "system" to |
*> values "system" and "public". I have made the default be "system" to |
*> match yours. |
*> match yours. |
*/ |
*/ |
#define TODO \ | #define TODO \ |
xmlGenericError(xmlGenericErrorContext, \ |
xmlGenericError(xmlGenericErrorContext, \ |
"Unimplemented block at %s:%d\n", \ |
"Unimplemented block at %s:%d\n", \ |
__FILE__, __LINE__); |
__FILE__, __LINE__); |
Line 82 static char XML_XML_DEFAULT_CATALOG[256] = "file:///et
|
Line 84 static char XML_XML_DEFAULT_CATALOG[256] = "file:///et
|
#define GetModuleHandleA GetModuleHandle |
#define GetModuleHandleA GetModuleHandle |
#define GetModuleFileNameA GetModuleFileName |
#define GetModuleFileNameA GetModuleFileName |
#else |
#else |
|
#if !defined(_WINDOWS_) |
void* __stdcall GetModuleHandleA(const char*); |
void* __stdcall GetModuleHandleA(const char*); |
unsigned long __stdcall GetModuleFileNameA(void*, char*, unsigned long); |
unsigned long __stdcall GetModuleFileNameA(void*, char*, unsigned long); |
#endif |
#endif |
#endif |
#endif |
|
#endif |
|
|
static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID); |
static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID); |
static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename); |
static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename); |
Line 206 static int xmlCatalogInitialized = 0;
|
Line 210 static int xmlCatalogInitialized = 0;
|
|
|
/************************************************************************ |
/************************************************************************ |
* * |
* * |
* Catalog error handlers * | * Catalog error handlers * |
* * |
* * |
************************************************************************/ |
************************************************************************/ |
|
|
Line 259 xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr nod
|
Line 263 xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr nod
|
* @name: name of the entry |
* @name: name of the entry |
* @value: value of the entry |
* @value: value of the entry |
* @prefer: the PUBLIC vs. SYSTEM current preference value |
* @prefer: the PUBLIC vs. SYSTEM current preference value |
* @group: for members of a group, the group entry | * @group: for members of a group, the group entry |
* |
* |
* create a new Catalog entry, this type is shared both by XML and | * create a new Catalog entry, this type is shared both by XML and |
* SGML catalogs, but the acceptable types values differs. |
* SGML catalogs, but the acceptable types values differs. |
* |
* |
* Returns the xmlCatalogEntryPtr or NULL in case of error |
* Returns the xmlCatalogEntryPtr or NULL in case of error |
Line 399 xmlFreeCatalogHashEntryList(xmlCatalogEntryPtr catal)
|
Line 403 xmlFreeCatalogHashEntryList(xmlCatalogEntryPtr catal)
|
* @type: type of catalog |
* @type: type of catalog |
* @prefer: the PUBLIC vs. SYSTEM current preference value |
* @prefer: the PUBLIC vs. SYSTEM current preference value |
* |
* |
* create a new Catalog, this type is shared both by XML and | * create a new Catalog, this type is shared both by XML and |
* SGML catalogs, but the acceptable types values differs. |
* SGML catalogs, but the acceptable types values differs. |
* |
* |
* Returns the xmlCatalogPtr or NULL in case of error |
* Returns the xmlCatalogPtr or NULL in case of error |
Line 567 static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr c
|
Line 571 static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr c
|
xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE); |
xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE); |
if (xns != NULL) |
if (xns != NULL) |
xmlSetNsProp(node, xns, BAD_CAST "base", |
xmlSetNsProp(node, xns, BAD_CAST "base", |
cur->value); | cur->value); |
} |
} |
switch (cur->prefer) { |
switch (cur->prefer) { |
case XML_CATA_PREFER_NONE: |
case XML_CATA_PREFER_NONE: |
Line 685 BAD_CAST "http://www.oasis-open.org/committees/entity/
|
Line 689 BAD_CAST "http://www.oasis-open.org/committees/entity/
|
xmlAddChild((xmlNodePtr) doc, catalog); |
xmlAddChild((xmlNodePtr) doc, catalog); |
|
|
xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); |
xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); |
| |
/* |
/* |
* reserialize it |
* reserialize it |
*/ |
*/ |
Line 822 xmlCatalogUnWrapURN(const xmlChar *urn) {
|
Line 826 xmlCatalogUnWrapURN(const xmlChar *urn) {
|
if (xmlStrncmp(urn, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) |
if (xmlStrncmp(urn, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) |
return(NULL); |
return(NULL); |
urn += sizeof(XML_URN_PUBID) - 1; |
urn += sizeof(XML_URN_PUBID) - 1; |
| |
while (*urn != 0) { |
while (*urn != 0) { |
if (i > sizeof(result) - 4) |
if (i > sizeof(result) - 4) |
break; |
break; |
Line 912 xmlParseCatalogFile(const char *filename) {
|
Line 916 xmlParseCatalogFile(const char *filename) {
|
|
|
inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename); |
inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename); |
inputStream->buf = buf; |
inputStream->buf = buf; |
inputStream->base = inputStream->buf->buffer->content; | xmlBufResetInput(buf->buffer, inputStream); |
inputStream->cur = inputStream->buf->buffer->content; | |
inputStream->end = | |
&inputStream->buf->buffer->content[inputStream->buf->buffer->use]; | |
|
|
inputPush(ctxt, inputStream); |
inputPush(ctxt, inputStream); |
if ((ctxt->directory == NULL) && (directory == NULL)) |
if ((ctxt->directory == NULL) && (directory == NULL)) |
Line 938 xmlParseCatalogFile(const char *filename) {
|
Line 939 xmlParseCatalogFile(const char *filename) {
|
ctxt->myDoc = NULL; |
ctxt->myDoc = NULL; |
} |
} |
xmlFreeParserCtxt(ctxt); |
xmlFreeParserCtxt(ctxt); |
| |
return(ret); |
return(ret); |
} |
} |
|
|
Line 990 xmlLoadFileContent(const char *filename)
|
Line 991 xmlLoadFileContent(const char *filename)
|
return (NULL); |
return (NULL); |
} |
} |
#endif |
#endif |
content = xmlMallocAtomic(size + 10); | content = (xmlChar*)xmlMallocAtomic(size + 10); |
if (content == NULL) { |
if (content == NULL) { |
xmlCatalogErrMemory("allocating catalog data"); |
xmlCatalogErrMemory("allocating catalog data"); |
return (NULL); |
return (NULL); |
Line 1328 xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogP
|
Line 1329 xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogP
|
* |
* |
* Parses the catalog file to extract the XML tree and then analyze the |
* Parses the catalog file to extract the XML tree and then analyze the |
* tree to build a list of Catalog entries corresponding to this catalog |
* tree to build a list of Catalog entries corresponding to this catalog |
* | * |
* Returns the resulting Catalog entries list |
* Returns the resulting Catalog entries list |
*/ |
*/ |
static xmlCatalogEntryPtr |
static xmlCatalogEntryPtr |
Line 1396 xmlParseXMLCatalogFile(xmlCatalogPrefer prefer, const
|
Line 1397 xmlParseXMLCatalogFile(xmlCatalogPrefer prefer, const
|
* @catal: an existing but incomplete catalog entry |
* @catal: an existing but incomplete catalog entry |
* |
* |
* Fetch and parse the subcatalog referenced by an entry |
* Fetch and parse the subcatalog referenced by an entry |
* | * |
* Returns 0 in case of success, -1 otherwise |
* Returns 0 in case of success, -1 otherwise |
*/ |
*/ |
static int |
static int |
xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { |
xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { |
xmlCatalogEntryPtr doc; |
xmlCatalogEntryPtr doc; |
|
|
if (catal == NULL) | if (catal == NULL) |
return(-1); |
return(-1); |
if (catal->URL == NULL) |
if (catal->URL == NULL) |
return(-1); |
return(-1); |
Line 1495 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
Line 1496 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
xmlCatalogEntryType typ; |
xmlCatalogEntryType typ; |
int doregister = 0; |
int doregister = 0; |
|
|
if ((catal == NULL) || | if ((catal == NULL) || |
((catal->type != XML_CATA_CATALOG) && |
((catal->type != XML_CATA_CATALOG) && |
(catal->type != XML_CATA_BROKEN_CATALOG))) |
(catal->type != XML_CATA_BROKEN_CATALOG))) |
return(-1); |
return(-1); |
Line 1548 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
Line 1549 xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
NULL, catal->prefer, NULL); |
NULL, catal->prefer, NULL); |
if (doregister) { |
if (doregister) { |
catal->type = XML_CATA_CATALOG; |
catal->type = XML_CATA_CATALOG; |
cur = xmlHashLookup(xmlCatalogXMLFiles, catal->URL); | cur = (xmlCatalogEntryPtr)xmlHashLookup(xmlCatalogXMLFiles, catal->URL); |
if (cur != NULL) |
if (cur != NULL) |
cur->children = catal->children; |
cur->children = catal->children; |
} |
} |
Line 1571 xmlDelXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
Line 1572 xmlDelXMLCatalog(xmlCatalogEntryPtr catal, const xmlCh
|
xmlCatalogEntryPtr cur; |
xmlCatalogEntryPtr cur; |
int ret = 0; |
int ret = 0; |
|
|
if ((catal == NULL) || | if ((catal == NULL) || |
((catal->type != XML_CATA_CATALOG) && |
((catal->type != XML_CATA_CATALOG) && |
(catal->type != XML_CATA_BROKEN_CATALOG))) |
(catal->type != XML_CATA_BROKEN_CATALOG))) |
return(-1); |
return(-1); |
Line 1786 xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const x
|
Line 1787 xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const x
|
} |
} |
if (nbList < MAX_DELEGATE) |
if (nbList < MAX_DELEGATE) |
delegates[nbList++] = cur->URL; |
delegates[nbList++] = cur->URL; |
| |
if (cur->children == NULL) { |
if (cur->children == NULL) { |
xmlFetchXMLCatalogFile(cur); |
xmlFetchXMLCatalogFile(cur); |
} |
} |
Line 1999 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, con
|
Line 2000 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, con
|
xmlChar *ret = NULL; |
xmlChar *ret = NULL; |
xmlChar *urnID = NULL; |
xmlChar *urnID = NULL; |
xmlChar *normid; |
xmlChar *normid; |
| |
if (catal == NULL) |
if (catal == NULL) |
return(NULL); |
return(NULL); |
if ((pubID == NULL) && (sysID == NULL)) |
if ((pubID == NULL) && (sysID == NULL)) |
Line 2008 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, con
|
Line 2009 xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, con
|
normid = xmlCatalogNormalizePublic(pubID); |
normid = xmlCatalogNormalizePublic(pubID); |
if (normid != NULL) |
if (normid != NULL) |
pubID = (*normid != 0 ? normid : NULL); |
pubID = (*normid != 0 ? normid : NULL); |
| |
if (!xmlStrncmp(pubID, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) { |
if (!xmlStrncmp(pubID, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) { |
urnID = xmlCatalogUnWrapURN(pubID); |
urnID = xmlCatalogUnWrapURN(pubID); |
if (xmlDebugCatalogs) { |
if (xmlDebugCatalogs) { |
Line 2088 static xmlChar *
|
Line 2089 static xmlChar *
|
xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { |
xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { |
xmlChar *ret = NULL; |
xmlChar *ret = NULL; |
xmlChar *urnID = NULL; |
xmlChar *urnID = NULL; |
| |
if (catal == NULL) |
if (catal == NULL) |
return(NULL); |
return(NULL); |
if (URI == NULL) |
if (URI == NULL) |
Line 2148 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal,
|
Line 2149 xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal,
|
*/ |
*/ |
static const xmlChar * |
static const xmlChar * |
xmlParseSGMLCatalogComment(const xmlChar *cur) { |
xmlParseSGMLCatalogComment(const xmlChar *cur) { |
if ((cur[0] != '-') || (cur[1] != '-')) | if ((cur[0] != '-') || (cur[1] != '-')) |
return(cur); |
return(cur); |
SKIP(2); |
SKIP(2); |
while ((cur[0] != 0) && ((cur[0] != '-') || ((cur[1] != '-')))) |
while ((cur[0] != 0) && ((cur[0] != '-') || ((cur[1] != '-')))) |
Line 2683 xmlLoadACatalog(const char *filename)
|
Line 2684 xmlLoadACatalog(const char *filename)
|
|
|
|
|
first = content; |
first = content; |
| |
while ((*first != 0) && (*first != '-') && (*first != '<') && |
while ((*first != 0) && (*first != '-') && (*first != '<') && |
(!(((*first >= 'A') && (*first <= 'Z')) || |
(!(((*first >= 'A') && (*first <= 'Z')) || |
((*first >= 'a') && (*first <= 'z'))))) |
((*first >= 'a') && (*first <= 'z'))))) |
Line 2778 xmlACatalogResolveSystem(xmlCatalogPtr catal, const xm
|
Line 2779 xmlACatalogResolveSystem(xmlCatalogPtr catal, const xm
|
|
|
if ((sysID == NULL) || (catal == NULL)) |
if ((sysID == NULL) || (catal == NULL)) |
return(NULL); |
return(NULL); |
| |
if (xmlDebugCatalogs) |
if (xmlDebugCatalogs) |
xmlGenericError(xmlGenericErrorContext, |
xmlGenericError(xmlGenericErrorContext, |
"Resolve sysID %s\n", sysID); |
"Resolve sysID %s\n", sysID); |
Line 2813 xmlACatalogResolvePublic(xmlCatalogPtr catal, const xm
|
Line 2814 xmlACatalogResolvePublic(xmlCatalogPtr catal, const xm
|
|
|
if ((pubID == NULL) || (catal == NULL)) |
if ((pubID == NULL) || (catal == NULL)) |
return(NULL); |
return(NULL); |
| |
if (xmlDebugCatalogs) |
if (xmlDebugCatalogs) |
xmlGenericError(xmlGenericErrorContext, |
xmlGenericError(xmlGenericErrorContext, |
"Resolve pubID %s\n", pubID); |
"Resolve pubID %s\n", pubID); |
Line 2932 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
|
Line 2933 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
|
} else { |
} else { |
xmlHashScan(catal->sgml, |
xmlHashScan(catal->sgml, |
(xmlHashScanner) xmlCatalogDumpEntry, out); |
(xmlHashScanner) xmlCatalogDumpEntry, out); |
} | } |
} |
} |
#endif /* LIBXML_OUTPUT_ENABLED */ |
#endif /* LIBXML_OUTPUT_ENABLED */ |
|
|
Line 2940 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
|
Line 2941 xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
|
* xmlACatalogAdd: |
* xmlACatalogAdd: |
* @catal: a Catalog |
* @catal: a Catalog |
* @type: the type of record to add to the catalog |
* @type: the type of record to add to the catalog |
* @orig: the system, public or prefix to match | * @orig: the system, public or prefix to match |
* @replace: the replacement value for the match |
* @replace: the replacement value for the match |
* |
* |
* Add an entry in the catalog, it may overwrite existing but |
* Add an entry in the catalog, it may overwrite existing but |
Line 2999 xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *
|
Line 3000 xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *
|
(xmlHashDeallocator) xmlFreeCatalogEntry); |
(xmlHashDeallocator) xmlFreeCatalogEntry); |
if (res == 0) |
if (res == 0) |
res = 1; |
res = 1; |
} | } |
return(res); |
return(res); |
} |
} |
|
|
Line 3058 xmlCatalogIsEmpty(xmlCatalogPtr catal) {
|
Line 3059 xmlCatalogIsEmpty(xmlCatalogPtr catal) {
|
return(1); |
return(1); |
if (res < 0) |
if (res < 0) |
return(-1); |
return(-1); |
} | } |
return(0); |
return(0); |
} |
} |
|
|
Line 3081 xmlInitializeCatalogData(void) {
|
Line 3082 xmlInitializeCatalogData(void) {
|
if (xmlCatalogInitialized != 0) |
if (xmlCatalogInitialized != 0) |
return; |
return; |
|
|
if (getenv("XML_DEBUG_CATALOG")) | if (getenv("XML_DEBUG_CATALOG")) |
xmlDebugCatalogs = 1; |
xmlDebugCatalogs = 1; |
xmlCatalogMutex = xmlNewRMutex(); |
xmlCatalogMutex = xmlNewRMutex(); |
|
|
Line 3102 xmlInitializeCatalog(void) {
|
Line 3103 xmlInitializeCatalog(void) {
|
xmlInitializeCatalogData(); |
xmlInitializeCatalogData(); |
xmlRMutexLock(xmlCatalogMutex); |
xmlRMutexLock(xmlCatalogMutex); |
|
|
if (getenv("XML_DEBUG_CATALOG")) | if (getenv("XML_DEBUG_CATALOG")) |
xmlDebugCatalogs = 1; |
xmlDebugCatalogs = 1; |
|
|
if (xmlDefaultCatalog == NULL) { |
if (xmlDefaultCatalog == NULL) { |
Line 3125 xmlInitializeCatalog(void) {
|
Line 3126 xmlInitializeCatalog(void) {
|
unsigned long len = GetModuleFileNameA(hmodule, buf, 255); |
unsigned long len = GetModuleFileNameA(hmodule, buf, 255); |
if (len != 0) { |
if (len != 0) { |
char* p = &(buf[len]); |
char* p = &(buf[len]); |
while (*p != '\\' && p > buf) | while (*p != '\\' && p > buf) |
p--; |
p--; |
if (p != buf) { |
if (p != buf) { |
xmlChar* uri; |
xmlChar* uri; |
strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); |
strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); |
uri = xmlCanonicPath(buf); | uri = xmlCanonicPath((const xmlChar*)buf); |
if (uri != NULL) { |
if (uri != NULL) { |
strncpy(XML_XML_DEFAULT_CATALOG, uri, 255); |
strncpy(XML_XML_DEFAULT_CATALOG, uri, 255); |
xmlFree(uri); |
xmlFree(uri); |
Line 3144 xmlInitializeCatalog(void) {
|
Line 3145 xmlInitializeCatalog(void) {
|
catalogs = XML_XML_DEFAULT_CATALOG; |
catalogs = XML_XML_DEFAULT_CATALOG; |
#endif |
#endif |
|
|
catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, | catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, |
xmlCatalogDefaultPrefer); |
xmlCatalogDefaultPrefer); |
if (catal != NULL) { |
if (catal != NULL) { |
/* the XML_CATALOG_FILES envvar is allowed to contain a | /* the XML_CATALOG_FILES envvar is allowed to contain a |
space-separated list of entries. */ |
space-separated list of entries. */ |
cur = catalogs; |
cur = catalogs; |
nextent = &catal->xml; |
nextent = &catal->xml; |
while (*cur != '\0') { |
while (*cur != '\0') { |
while (xmlIsBlank_ch(*cur)) | while (xmlIsBlank_ch(*cur)) |
cur++; |
cur++; |
if (*cur != 0) { |
if (*cur != 0) { |
paths = cur; |
paths = cur; |
Line 3245 xmlLoadCatalogs(const char *pathss) {
|
Line 3246 xmlLoadCatalogs(const char *pathss) {
|
cur++; |
cur++; |
path = xmlStrndup((const xmlChar *)paths, cur - paths); |
path = xmlStrndup((const xmlChar *)paths, cur - paths); |
#ifdef _WIN32 |
#ifdef _WIN32 |
iLen = strlen(path); | iLen = strlen((const char*)path); |
for(i = 0; i < iLen; i++) { |
for(i = 0; i < iLen; i++) { |
if(path[i] == '\\') { |
if(path[i] == '\\') { |
path[i] = '/'; |
path[i] = '/'; |
Line 3277 xmlCatalogCleanup(void) {
|
Line 3278 xmlCatalogCleanup(void) {
|
xmlGenericError(xmlGenericErrorContext, |
xmlGenericError(xmlGenericErrorContext, |
"Catalogs cleanup\n"); |
"Catalogs cleanup\n"); |
if (xmlCatalogXMLFiles != NULL) |
if (xmlCatalogXMLFiles != NULL) |
xmlHashFree(xmlCatalogXMLFiles, | xmlHashFree(xmlCatalogXMLFiles, |
(xmlHashDeallocator)xmlFreeCatalogHashEntryList); |
(xmlHashDeallocator)xmlFreeCatalogHashEntryList); |
xmlCatalogXMLFiles = NULL; |
xmlCatalogXMLFiles = NULL; |
if (xmlDefaultCatalog != NULL) |
if (xmlDefaultCatalog != NULL) |
Line 3392 xmlCatalogDump(FILE *out) {
|
Line 3393 xmlCatalogDump(FILE *out) {
|
/** |
/** |
* xmlCatalogAdd: |
* xmlCatalogAdd: |
* @type: the type of record to add to the catalog |
* @type: the type of record to add to the catalog |
* @orig: the system, public or prefix to match | * @orig: the system, public or prefix to match |
* @replace: the replacement value for the match |
* @replace: the replacement value for the match |
* |
* |
* Add an entry in the catalog, it may overwrite existing but |
* Add an entry in the catalog, it may overwrite existing but |
Line 3423 xmlCatalogAdd(const xmlChar *type, const xmlChar *orig
|
Line 3424 xmlCatalogAdd(const xmlChar *type, const xmlChar *orig
|
|
|
xmlRMutexUnlock(xmlCatalogMutex); |
xmlRMutexUnlock(xmlCatalogMutex); |
return(0); |
return(0); |
} | } |
|
|
res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace); |
res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace); |
xmlRMutexUnlock(xmlCatalogMutex); |
xmlRMutexUnlock(xmlCatalogMutex); |
Line 3611 xmlCatalogFreeLocal(void *catalogs) {
|
Line 3612 xmlCatalogFreeLocal(void *catalogs) {
|
* |
* |
* Returns the updated list |
* Returns the updated list |
*/ |
*/ |
void * | void * |
xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { |
xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { |
xmlCatalogEntryPtr catal, add; |
xmlCatalogEntryPtr catal, add; |
|
|
Line 3631 xmlCatalogAddLocal(void *catalogs, const xmlChar *URL)
|
Line 3632 xmlCatalogAddLocal(void *catalogs, const xmlChar *URL)
|
return(catalogs); |
return(catalogs); |
|
|
catal = (xmlCatalogEntryPtr) catalogs; |
catal = (xmlCatalogEntryPtr) catalogs; |
if (catal == NULL) | if (catal == NULL) |
return((void *) add); |
return((void *) add); |
|
|
while (catal->next != NULL) |
while (catal->next != NULL) |
Line 3646 xmlCatalogAddLocal(void *catalogs, const xmlChar *URL)
|
Line 3647 xmlCatalogAddLocal(void *catalogs, const xmlChar *URL)
|
* @pubID: the public ID string |
* @pubID: the public ID string |
* @sysID: the system ID string |
* @sysID: the system ID string |
* |
* |
* Do a complete resolution lookup of an External Identifier using a | * Do a complete resolution lookup of an External Identifier using a |
* document's private catalog list |
* document's private catalog list |
* |
* |
* Returns the URI of the resource or NULL if not found, it must be freed |
* Returns the URI of the resource or NULL if not found, it must be freed |
Line 3691 xmlCatalogLocalResolve(void *catalogs, const xmlChar *
|
Line 3692 xmlCatalogLocalResolve(void *catalogs, const xmlChar *
|
* @catalogs: a document's list of catalogs |
* @catalogs: a document's list of catalogs |
* @URI: the URI |
* @URI: the URI |
* |
* |
* Do a complete resolution lookup of an URI using a | * Do a complete resolution lookup of an URI using a |
* document's private catalog list |
* document's private catalog list |
* |
* |
* Returns the URI of the resource or NULL if not found, it must be freed |
* Returns the URI of the resource or NULL if not found, it must be freed |
Line 3752 xmlCatalogGetSystem(const xmlChar *sysID) {
|
Line 3753 xmlCatalogGetSystem(const xmlChar *sysID) {
|
|
|
if (sysID == NULL) |
if (sysID == NULL) |
return(NULL); |
return(NULL); |
| |
/* |
/* |
* Check first the XML catalogs |
* Check first the XML catalogs |
*/ |
*/ |
Line 3796 xmlCatalogGetPublic(const xmlChar *pubID) {
|
Line 3797 xmlCatalogGetPublic(const xmlChar *pubID) {
|
|
|
if (pubID == NULL) |
if (pubID == NULL) |
return(NULL); |
return(NULL); |
| |
/* |
/* |
* Check first the XML catalogs |
* Check first the XML catalogs |
*/ |
*/ |