summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-10-29 17:07:51 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-10-29 17:07:51 +0000
commit94394cd1e494f8d669b310748f54192268185c8d (patch)
treeed35460e96c72e9b2253ca08f4199a5edae01ab7
parentb5a46da41dda383a419af6b42ea9190e40817f8a (diff)
downloadlibxml2-94394cd1e494f8d669b310748f54192268185c8d.tar.gz
more fixes about unregistering objects applied patch from Mark Vakoc
* xpath.c: more fixes about unregistering objects * include/libxml/relaxng.h: applied patch from Mark Vakoc missing _cplusplus processing clause Daniel
-rw-r--r--ChangeLog6
-rw-r--r--include/libxml/relaxng.h8
-rw-r--r--xpath.c7
3 files changed, 20 insertions, 1 deletions
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 <daniel@veillard.com>
+
+ * 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 <aleksey@aleksey.com>
* 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 <libxml/xmlversion.h>
#include <libxml/hash.h>
+#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));