1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-31 13:47:30 +03:00

revert 2 parts of the patch, Daniel

This commit is contained in:
Daniel Veillard 2004-06-14 12:19:09 +00:00
parent fb382b8990
commit ab690c5e9e

View File

@ -3544,7 +3544,37 @@ xmlCatalogLocalResolveURI(void *catalogs, const xmlChar *URI) {
*/
const xmlChar *
xmlCatalogGetSystem(const xmlChar *sysID) {
return xmlCatalogResolveSystem(sysID);
xmlChar *ret;
static xmlChar result[1000];
static int msg = 0;
if (!xmlCatalogInitialized)
xmlInitializeCatalog();
if (msg == 0) {
xmlGenericError(xmlGenericErrorContext,
"Use of deprecated xmlCatalogGetSystem() call\n");
msg++;
}
if (sysID == NULL)
return(NULL);
/*
* Check first the XML catalogs
*/
if (xmlDefaultCatalog != NULL) {
ret = xmlCatalogListXMLResolve(xmlDefaultCatalog->xml, NULL, sysID);
if ((ret != NULL) && (ret != XML_CATAL_BREAK)) {
snprintf((char *) result, sizeof(result) - 1, "%s", (char *) ret);
result[sizeof(result) - 1] = 0;
return(result);
}
}
if (xmlDefaultCatalog != NULL)
return(xmlCatalogGetSGMLSystem(xmlDefaultCatalog->sgml, sysID));
return(NULL);
}
/**
@ -3558,7 +3588,37 @@ xmlCatalogGetSystem(const xmlChar *sysID) {
*/
const xmlChar *
xmlCatalogGetPublic(const xmlChar *pubID) {
return xmlCatalogResolvePublic(pubID);
xmlChar *ret;
static xmlChar result[1000];
static int msg = 0;
if (!xmlCatalogInitialized)
xmlInitializeCatalog();
if (msg == 0) {
xmlGenericError(xmlGenericErrorContext,
"Use of deprecated xmlCatalogGetPublic() call\n");
msg++;
}
if (pubID == NULL)
return(NULL);
/*
* Check first the XML catalogs
*/
if (xmlDefaultCatalog != NULL) {
ret = xmlCatalogListXMLResolve(xmlDefaultCatalog->xml, pubID, NULL);
if ((ret != NULL) && (ret != XML_CATAL_BREAK)) {
snprintf((char *) result, sizeof(result) - 1, "%s", (char *) ret);
result[sizeof(result) - 1] = 0;
return(result);
}
}
if (xmlDefaultCatalog != NULL)
return(xmlCatalogGetSGMLPublic(xmlDefaultCatalog->sgml, pubID));
return(NULL);
}
#endif /* LIBXML_CATALOG_ENABLED */