[Expat-checkins] expat/lib expat.h,1.49,1.50 libexpat.def,1.3,1.4 libexpatw.def,1.3,1.4 xmlparse.c,1.101,1.102

Karl Waclawek kwaclaw at users.sourceforge.net
Thu Jan 16 14:03:45 EST 2003


Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv20065

Modified Files:
	expat.h libexpat.def libexpatw.def xmlparse.c 
Log Message:
Patch for bug/feature request #651754.
Implemented with two API additions:
1) For element declaration handler support:
  XML_FreeContentModel
2) Exposing Expat's memory allocation functions:
  XML_MemMalloc
  XML_MemRealloc
  XML_MemFree


Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- expat.h	31 Dec 2002 17:53:21 -0000	1.49
+++ expat.h	16 Jan 2003 22:03:42 -0000	1.50
@@ -208,7 +208,7 @@
 XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
 
 
-/* Constructs a new parser using the memory management suit referred to
+/* Constructs a new parser using the memory management suite referred to
    by memsuite. If memsuite is NULL, then use the standard library memory
    suite. If namespaceSeparator is non-NULL it creates a parser with
    namespace processing as described above. The character pointed at
@@ -848,6 +848,20 @@
 #define XML_GetErrorLineNumber   XML_GetCurrentLineNumber
 #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
 #define XML_GetErrorByteIndex    XML_GetCurrentByteIndex
+
+/* Frees the content model passed to the element declaration handler */
+XMLPARSEAPI(void)
+XML_FreeContentModel(XML_Parser parser, XML_Content *model);
+
+/* Exposing the memory handling functions used in Expat */
+XMLPARSEAPI(void *)
+XML_MemMalloc(XML_Parser parser, size_t size);
+
+XMLPARSEAPI(void *)
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
+
+XMLPARSEAPI(void)
+XML_MemFree(XML_Parser parser, void *ptr);
 
 /* Frees memory used by the parser. */
 XMLPARSEAPI(void)

Index: libexpat.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpat.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libexpat.def	8 Dec 2002 14:35:33 -0000	1.3
+++ libexpat.def	16 Jan 2003 22:03:42 -0000	1.4
@@ -56,8 +56,14 @@
   XML_SetUserData @52
   XML_SetXmlDeclHandler @53
   XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
   XML_ParserReset @55
   XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
   XML_GetFeatureList @57
   XML_UseForeignDTD @58
+; added with version 1.95.6
+  XML_FreeContentModel @59
+  XML_MemMalloc @60
+  XML_MemRealloc @61
+  XML_MemFree @62

Index: libexpatw.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpatw.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libexpatw.def	8 Dec 2002 14:35:34 -0000	1.3
+++ libexpatw.def	16 Jan 2003 22:03:42 -0000	1.4
@@ -56,8 +56,14 @@
   XML_SetUserData @52
   XML_SetXmlDeclHandler @53
   XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
   XML_ParserReset @55
   XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
   XML_GetFeatureList @57
   XML_UseForeignDTD @58
+; added with version 1.95.6
+  XML_FreeContentModel @59
+  XML_MemMalloc @60
+  XML_MemRealloc @61
+  XML_MemFree @62

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- xmlparse.c	15 Jan 2003 00:51:15 -0000	1.101
+++ xmlparse.c	16 Jan 2003 22:03:42 -0000	1.102
@@ -1584,6 +1584,30 @@
 }
 
 void
+XML_FreeContentModel(XML_Parser parser, XML_Content *model)
+{
+  FREE(model);
+}
+
+void *
+XML_MemMalloc(XML_Parser parser, size_t size)
+{
+  return MALLOC(size);
+}
+
+void *
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
+{
+  return REALLOC(ptr, size);
+}
+
+void
+XML_MemFree(XML_Parser parser, void *ptr)
+{
+  FREE(ptr);
+}
+
+void
 XML_DefaultCurrent(XML_Parser parser)
 {
   if (defaultHandler) {





More information about the Expat-checkins mailing list