]> granicus.if.org Git - libexpat/commitdiff
Changed signature of XML_GetParsingStatus(), changing the return value
authorKarl Waclawek <kwaclaw@users.sourceforge.net>
Tue, 16 Mar 2004 03:53:24 +0000 (03:53 +0000)
committerKarl Waclawek <kwaclaw@users.sourceforge.net>
Tue, 16 Mar 2004 03:53:24 +0000 (03:53 +0000)
to a parameter passed by reference (pointer). It seems that  the processing
of return values is not standardized, even when calling convention and
platform are specified. This should make Expat more usable as a shared library.

expat/lib/expat.h
expat/lib/xmlparse.c

index 169f7b08fd6c940987cc4016972b89483d438ab3..b9b83ab4a1d0183c78e6e810d01de5a664f7d9b6 100644 (file)
@@ -828,8 +828,8 @@ XMLPARSEAPI(enum XML_Status)
 XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
 
 /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
-   Must be called from within a call-back handler. Some handler call-backs
-   may still follow, because they would otherwise get lost. Examples:
+   Must be called from within a call-back handler. Some call-backs
+   may still follow because they would otherwise get lost. Examples:
    - endElementHandler() for empty elements when stopped in
      startElementHandler(), 
    - endNameSpaceDeclHandler() when stopped in endElementHandler(), 
@@ -837,7 +837,8 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
 
    Can be called from most handlers, including DTD related call-backs.
    Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
-   Possible error codes: XML_ERROR_SUSPENDED, XML_ERROR_FINISHED.
+   Possible error codes: XML_ERROR_SUSPENDED - when the parser is already
+   suspended, XML_ERROR_FINISHED - when the parser has already finished.
 
    When resumable = XML_TRUE then parsing is suspended, that is, 
    XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. 
@@ -862,8 +863,8 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable);
    Additional error code XML_ERROR_NOT_SUSPENDED possible.   
 
    *Note*:
-   This must be applied to the most deeply nested child parser instance
-   first, and to its parent parser only after the child parser has finished,
+   This must be called on the most deeply nested child parser instance
+   first, and on its parent parser only after the child parser has finished,
    to be applied recursively until the document entity's parser is restarted.
    That is, the parent parser will not resume by itself and it is up to the
    application to call XML_ResumeParser() on it at the appropriate moment.
@@ -888,8 +889,8 @@ typedef struct {
    XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
    XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
 */
-XMLPARSEAPI(XML_ParsingStatus)
-XML_GetParsingStatus(XML_Parser parser);
+XMLPARSEAPI(void)
+XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
 
 /* Creates an XML_Parser object that can parse an external general
    entity; context is a '\0'-terminated string specifying the parse
index 01c28f96860b0b233bcaff90680e61d8182981b1..d90fc652ec669d9fe27b80b3a49c96344ce00bfd 100644 (file)
@@ -1716,10 +1716,10 @@ XML_ResumeParser(XML_Parser parser)
   return result;
 }
 
-XML_ParsingStatus XMLCALL
-XML_GetParsingStatus(XML_Parser parser)
+void XMLCALL
+XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
 {
-  return parser->m_parsingStatus;
+  *status = parser->m_parsingStatus;
 }
 
 enum XML_Error XMLCALL