diff --git a/ChangeLog b/ChangeLog index 611b017d..57c62f7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 29 18:05:53 CET 2003 Daniel Veillard + + * xpath.c: more fixes about unregistering objects + * include/libxml/relaxng.h: applied patch from Mark Vakoc + missing _cplusplus processing clause + Wed Oct 29 07:49:52 2003 Aleksey Sanin * include/libxml/parser.h parser.c: added xmlStrVPrintf function diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h index 25fea441..519616ad 100644 --- a/include/libxml/relaxng.h +++ b/include/libxml/relaxng.h @@ -12,6 +12,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _xmlRelaxNG xmlRelaxNG; typedef xmlRelaxNG *xmlRelaxNGPtr; @@ -152,4 +156,8 @@ XMLPUBFUN int XMLCALL xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); + +#ifdef __cplusplus +} +#endif #endif /* __XML_RELAX_NG__ */ diff --git a/xpath.c b/xpath.c index 627fa20b..1284100f 100644 --- a/xpath.c +++ b/xpath.c @@ -2709,6 +2709,8 @@ xmlXPathRegisterFuncNS(xmlXPathContextPtr ctxt, const xmlChar *name, ctxt->funcHash = xmlHashCreate(0); if (ctxt->funcHash == NULL) return(-1); + if (f == NULL) + return(xmlHashRemoveEntry2(ctxt->funcHash, name, ns_uri, NULL)); return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, (void *) f)); } @@ -2855,6 +2857,9 @@ xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name, ctxt->varHash = xmlHashCreate(0); if (ctxt->varHash == NULL) return(-1); + if (value == NULL) + return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri, + (xmlHashDeallocator)xmlXPathFreeObject)); return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri, (void *) value, (xmlHashDeallocator)xmlXPathFreeObject)); @@ -2975,7 +2980,7 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix, if (ctxt->nsHash == NULL) return(-1); if (ns_uri == NULL) - return(xmlHashRemoveEntry(ctxt->nsHash, ns_uri, + return(xmlHashRemoveEntry(ctxt->nsHash, prefix, (xmlHashDeallocator)xmlFree)); return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) xmlStrdup(ns_uri), (xmlHashDeallocator)xmlFree));