#65 Suspend/Resume functionality

closed-accepted
Karl Waclawek
None
5
2004-05-04
2003-11-03
Karl Waclawek
No

This patch adds suspend/resume functionality to Expat.

The API is updated as follows:
- Added XML_STATUS_SUSPENDED to enum XML_Status
- Added function XML_StopParser()
- Added function XML_ResumeParser()
- Added more error codes and strings

The parser can be stopped (aborted) or suspended by
calling XML_StopParser() from a handler call-back.
Parsing can be resumed calling XML_ResumeParser().
For details check out the description in expat.h.

This API is subject to change, especially if it should
not be included in the Epat 2.0 release, in which case
it will have to adjust to the API changes intended for
Expat 3.0.

The attached file PatchDesc.txt contains a more
detailed overview of the patch implementation.
The attached diff file is taken against current CVS
as of the submission date of this patch.

Discussion

  • Karl Waclawek
    Karl Waclawek
    2003-11-03

    Patch file - revision 1

     
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2003-11-03

    Patch description

     
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2003-11-04

    Logged In: YES
    user_id=290026

    I attached a new patch file that includes one added API
    function: XML_GetParserState(), which exposes the parser's
    state with regards to being initialized, suspended or finished,
    returning this enum:

    enum XML_ParserState {
    XML_INITIALIZED,
    XML_PARSING,
    XML_FINISHED,
    XML_SUSPENDED
    };

    Otherwise this patch revision is the same as the previous one.

     
  • Karl Waclawek
    Karl Waclawek
    2003-11-04

    Patch file - revision 2

     
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2003-11-05

    Patch file - revision 3

     
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2003-11-05

    Logged In: YES
    user_id=290026

    Attached is patch revision 3.

    No change in internal functionality.
    Renamed fields and macros and renamed the API function
    XML_GetParserState to XML_GetParsingStatus, as it
    really does not return the parser's state.

    Also renamed enum XML_ParserState to XML_Parsing and
    introduced struct XML_ParsingStatus, which is returned by
    XML_GetParsingStatus and now also contains the finalBuffer
    flag. I did this since it makes no sense to have to keep track
    of this information externally if it is already tracked internally.

     
  • Karl Waclawek
    Karl Waclawek
    2003-11-10

    Logged In: YES
    user_id=290026

    Linking this patch to feature request #544682.
    I should also mention a reference to Fred Drake's message
    in the expat-discuss list from August 8, 2002:
    http://mail.libexpat.org/pipermail/expat-discuss/2002-
    August/000602.html.

     
  • Karl Waclawek
    Karl Waclawek
    2004-05-04

    Logged In: YES
    user_id=290026

    Closed, as this patch has been applied a while ago
    in xmlparse.c rev. 1.21.

     
  • Karl Waclawek
    Karl Waclawek
    2004-05-04

    • status: open --> closed-accepted