• Fred Drake's avatar
    pyexpat code cleanup and minor refactorings: · 71b63ff3
    Fred Drake authored
    The handlers array on each parser now has the invariant that None will
    never be set as a handler; it will always be NULL or a Python-level
    value passed in for the specific handler.
    
    have_handler():  Return true if there is a Python handler for a
        particular event.
    
    get_handler_name():  Return a string object giving the name of a
        particular handler.  This caches the string object so it doesn't
        need to be created more than once.
    
    get_parse_result():  Helper to allow the Parse() and ParseFile()
        methods to share the same logic for determining the return value
        or exception state.
    
    PyUnknownEncodingHandler(), PyModule_AddIntConstant():
        Made these helpers static.  (The later is only defined for older
        versions of Python.)
    
    pyxml_UpdatePairedHandlers(), pyxml_SetStartElementHandler(),
    pyxml_SetEndElementHandler(), pyxml_SetStartNamespaceDeclHandler(),
    pyxml_SetEndNamespaceDeclHandler(), pyxml_SetStartCdataSection(),
    pyxml_SetEndCdataSection(), pyxml_SetStartDoctypeDeclHandler(),
    pyxml_SetEndDoctypeDeclHandler():
        Removed.  These are no longer needed with Expat 1.95.x.
    
    handler_info:
        Use the setter functions provided by Expat 1.95.x instead of the
        pyxml_Set*Handler() functions which have been removed.
    
    Minor code formatting changes for consistency.
    Trailing whitespace removed.
    71b63ff3
pyexpat.c 48.9 KB