2005-12-13 15:49:55 -04:00
|
|
|
/* Stuff to export relevant 'expat' entry points from pyexpat to other
|
|
|
|
* parser modules, such as cElementTree. */
|
|
|
|
|
|
|
|
/* note: you must import expat.h before importing this module! */
|
|
|
|
|
2005-12-13 16:43:04 -04:00
|
|
|
#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
|
2010-03-24 21:54:54 -03:00
|
|
|
#define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
|
2005-12-13 15:49:55 -04:00
|
|
|
|
2005-12-13 16:43:04 -04:00
|
|
|
struct PyExpat_CAPI
|
2005-12-13 15:49:55 -04:00
|
|
|
{
|
2005-12-13 17:55:36 -04:00
|
|
|
char* magic; /* set to PyExpat_CAPI_MAGIC */
|
2005-12-13 16:43:04 -04:00
|
|
|
int size; /* set to sizeof(struct PyExpat_CAPI) */
|
2005-12-13 17:55:36 -04:00
|
|
|
int MAJOR_VERSION;
|
2005-12-13 15:49:55 -04:00
|
|
|
int MINOR_VERSION;
|
|
|
|
int MICRO_VERSION;
|
|
|
|
/* pointers to selected expat functions. add new functions at
|
|
|
|
the end, if needed */
|
|
|
|
const XML_LChar * (*ErrorString)(enum XML_Error code);
|
2005-12-13 17:55:36 -04:00
|
|
|
enum XML_Error (*GetErrorCode)(XML_Parser parser);
|
2006-06-19 20:21:25 -03:00
|
|
|
XML_Size (*GetErrorColumnNumber)(XML_Parser parser);
|
|
|
|
XML_Size (*GetErrorLineNumber)(XML_Parser parser);
|
2005-12-13 15:49:55 -04:00
|
|
|
enum XML_Status (*Parse)(
|
|
|
|
XML_Parser parser, const char *s, int len, int isFinal);
|
|
|
|
XML_Parser (*ParserCreate_MM)(
|
|
|
|
const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite,
|
|
|
|
const XML_Char *namespaceSeparator);
|
|
|
|
void (*ParserFree)(XML_Parser parser);
|
|
|
|
void (*SetCharacterDataHandler)(
|
|
|
|
XML_Parser parser, XML_CharacterDataHandler handler);
|
|
|
|
void (*SetCommentHandler)(
|
|
|
|
XML_Parser parser, XML_CommentHandler handler);
|
|
|
|
void (*SetDefaultHandlerExpand)(
|
|
|
|
XML_Parser parser, XML_DefaultHandler handler);
|
|
|
|
void (*SetElementHandler)(
|
|
|
|
XML_Parser parser, XML_StartElementHandler start,
|
|
|
|
XML_EndElementHandler end);
|
|
|
|
void (*SetNamespaceDeclHandler)(
|
|
|
|
XML_Parser parser, XML_StartNamespaceDeclHandler start,
|
|
|
|
XML_EndNamespaceDeclHandler end);
|
|
|
|
void (*SetProcessingInstructionHandler)(
|
|
|
|
XML_Parser parser, XML_ProcessingInstructionHandler handler);
|
|
|
|
void (*SetUnknownEncodingHandler)(
|
|
|
|
XML_Parser parser, XML_UnknownEncodingHandler handler,
|
|
|
|
void *encodingHandlerData);
|
|
|
|
void (*SetUserData)(XML_Parser parser, void *userData);
|
|
|
|
/* always add new stuff to the end! */
|
|
|
|
};
|
|
|
|
|