/**
* xmlFreeCatalogEntry:
- * @ret: a Catalog entry
+ * @payload: a Catalog entry
*
* Free the memory allocated to a Catalog entry
*/
static void
-xmlFreeCatalogEntry(xmlCatalogEntryPtr ret) {
+xmlFreeCatalogEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
+ xmlCatalogEntryPtr ret = (xmlCatalogEntryPtr) payload;
if (ret == NULL)
return;
/*
while (ret != NULL) {
next = ret->next;
- xmlFreeCatalogEntry(ret);
+ xmlFreeCatalogEntry(ret, NULL);
ret = next;
}
}
/**
* xmlFreeCatalogHashEntryList:
- * @ret: a Catalog entry list
+ * @payload: a Catalog entry list
*
* Free the memory allocated to list of Catalog entries from the
* catalog file hash.
*/
static void
-xmlFreeCatalogHashEntryList(xmlCatalogEntryPtr catal) {
+xmlFreeCatalogHashEntryList(void *payload,
+ const xmlChar *name ATTRIBUTE_UNUSED) {
+ xmlCatalogEntryPtr catal = (xmlCatalogEntryPtr) payload;
xmlCatalogEntryPtr children, next;
if (catal == NULL)
next = children->next;
children->dealloc = 0;
children->children = NULL;
- xmlFreeCatalogEntry(children);
+ xmlFreeCatalogEntry(children, NULL);
children = next;
}
catal->dealloc = 0;
- xmlFreeCatalogEntry(catal);
+ xmlFreeCatalogEntry(catal, NULL);
}
/**
if (catal->xml != NULL)
xmlFreeCatalogEntryList(catal->xml);
if (catal->sgml != NULL)
- xmlHashFree(catal->sgml,
- (xmlHashDeallocator) xmlFreeCatalogEntry);
+ xmlHashFree(catal->sgml, xmlFreeCatalogEntry);
xmlFree(catal);
}
* Serialize an SGML Catalog entry
*/
static void
-xmlCatalogDumpEntry(xmlCatalogEntryPtr entry, FILE *out) {
+xmlCatalogDumpEntry(void *payload, void *data,
+ const xmlChar *name ATTRIBUTE_UNUSED) {
+ xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload;
+ FILE *out = (FILE *) data;
if ((entry == NULL) || (out == NULL))
return;
switch (entry->type) {
* Convert one entry from the catalog
*/
static void
-xmlCatalogConvertEntry(xmlCatalogEntryPtr entry, xmlCatalogPtr catal) {
+xmlCatalogConvertEntry(void *payload, void *data,
+ const xmlChar *name ATTRIBUTE_UNUSED) {
+ xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload;
+ xmlCatalogPtr catal = (xmlCatalogPtr) data;
if ((entry == NULL) || (catal == NULL) || (catal->sgml == NULL) ||
(catal->xml == NULL))
return;
entry->type = XML_CATA_CATALOG;
break;
default:
- xmlHashRemoveEntry(catal->sgml, entry->name,
- (xmlHashDeallocator) xmlFreeCatalogEntry);
+ xmlHashRemoveEntry(catal->sgml, entry->name, xmlFreeCatalogEntry);
return;
}
/*
xmlGenericError(xmlGenericErrorContext,
"Converting SGML catalog to XML\n");
}
- xmlHashScan(catal->sgml,
- (xmlHashScanner) xmlCatalogConvertEntry,
- &catal);
+ xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal);
return(0);
}
NULL, XML_CATA_PREFER_NONE, NULL);
res = xmlHashAddEntry(catal->sgml, name, entry);
if (res < 0) {
- xmlFreeCatalogEntry(entry);
+ xmlFreeCatalogEntry(entry, NULL);
}
xmlFree(filename);
}
XML_CATA_PREFER_NONE, NULL);
res = xmlHashAddEntry(catal->sgml, sysid, entry);
if (res < 0) {
- xmlFreeCatalogEntry(entry);
+ xmlFreeCatalogEntry(entry, NULL);
}
} else {
xmlChar *filename;
if (catal->type == XML_XML_CATALOG_TYPE) {
xmlDumpXMLCatalog(out, catal->xml);
} else {
- xmlHashScan(catal->sgml,
- (xmlHashScanner) xmlCatalogDumpEntry, out);
+ xmlHashScan(catal->sgml, xmlCatalogDumpEntry, out);
}
}
#endif /* LIBXML_OUTPUT_ENABLED */
if (catal->type == XML_XML_CATALOG_TYPE) {
res = xmlDelXMLCatalog(catal->xml, value);
} else {
- res = xmlHashRemoveEntry(catal->sgml, value,
- (xmlHashDeallocator) xmlFreeCatalogEntry);
+ res = xmlHashRemoveEntry(catal->sgml, value, xmlFreeCatalogEntry);
if (res == 0)
res = 1;
}
xmlGenericError(xmlGenericErrorContext,
"Catalogs cleanup\n");
if (xmlCatalogXMLFiles != NULL)
- xmlHashFree(xmlCatalogXMLFiles,
- (xmlHashDeallocator)xmlFreeCatalogHashEntryList);
+ xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList);
xmlCatalogXMLFiles = NULL;
if (xmlDefaultCatalog != NULL)
xmlFreeCatalog(xmlDefaultCatalog);