expat/lib xmlparse.c,1.98,1.99

"Fred L. Drake" <[email protected]>
Newsgroups gmane.text.xml.expat.cvs
Message-ID <[email protected]>
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5472

Modified Files:
	xmlparse.c 
Log Message:
When returning a status value through the public API, use
XML_STATUS_OK / XML_STATUS_ERROR.  Internal status returns are not
affected.


Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- xmlparse.c	16 Dec 2002 04:02:02 -0000	1.98
+++ xmlparse.c	30 Dec 2002 20:02:28 -0000	1.99
@@ -873,17 +873,20 @@
 int
 XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
 {
-  /* block after XML_Parse()/XML_ParseBuffer() has been called */
+  /* Block after XML_Parse()/XML_ParseBuffer() has been called.
+     XXX There's no way for the caller to determine which of the
+     XXX possible error cases caused the XML_STATUS_ERROR return.
+  */
   if (parsing)
-    return 0;
+    return XML_STATUS_ERROR;
   if (encodingName == NULL)
     protocolEncodingName = NULL;
   else {
     protocolEncodingName = poolCopyString(&tempPool, encodingName);
     if (!protocolEncodingName)
-      return 0;
+      return XML_STATUS_ERROR;
   }
-  return 1;
+  return XML_STATUS_OK;
 }
 
 XML_Parser
@@ -1116,12 +1119,12 @@
   if (p) {
     p = poolCopyString(&_dtd->pool, p);
     if (!p)
-      return 0;
+      return XML_STATUS_ERROR;
     curBase = p;
   }
   else
     curBase = NULL;
-  return 1;
+  return XML_STATUS_OK;
 }
 
 const XML_Char *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.