Fredrik Lundh | c334504 | 2005-12-13 19:49:55 +0000 | [diff] [blame] | 1 | /* Stuff to export relevant 'expat' entry points from pyexpat to other |
| 2 | * parser modules, such as cElementTree. */ |
| 3 | |
| 4 | /* note: you must import expat.h before importing this module! */ |
| 5 | |
Fredrik Lundh | d7a4288 | 2005-12-13 20:43:04 +0000 | [diff] [blame^] | 6 | #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0" |
Fredrik Lundh | c334504 | 2005-12-13 19:49:55 +0000 | [diff] [blame] | 7 | |
Fredrik Lundh | d7a4288 | 2005-12-13 20:43:04 +0000 | [diff] [blame^] | 8 | struct PyExpat_CAPI |
Fredrik Lundh | c334504 | 2005-12-13 19:49:55 +0000 | [diff] [blame] | 9 | { |
Fredrik Lundh | d7a4288 | 2005-12-13 20:43:04 +0000 | [diff] [blame^] | 10 | int size; /* set to sizeof(struct PyExpat_CAPI) */ |
Fredrik Lundh | c334504 | 2005-12-13 19:49:55 +0000 | [diff] [blame] | 11 | int MAJOR_VERSION; /* XXX: use the ExpatVersionInfo instead? */ |
| 12 | int MINOR_VERSION; |
| 13 | int MICRO_VERSION; |
| 14 | /* pointers to selected expat functions. add new functions at |
| 15 | the end, if needed */ |
| 16 | const XML_LChar * (*ErrorString)(enum XML_Error code); |
| 17 | int (*GetCurrentColumnNumber)(XML_Parser parser); |
| 18 | int (*GetCurrentLineNumber)(XML_Parser parser); |
| 19 | enum XML_Status (*Parse)( |
| 20 | XML_Parser parser, const char *s, int len, int isFinal); |
| 21 | XML_Parser (*ParserCreate_MM)( |
| 22 | const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, |
| 23 | const XML_Char *namespaceSeparator); |
| 24 | void (*ParserFree)(XML_Parser parser); |
| 25 | void (*SetCharacterDataHandler)( |
| 26 | XML_Parser parser, XML_CharacterDataHandler handler); |
| 27 | void (*SetCommentHandler)( |
| 28 | XML_Parser parser, XML_CommentHandler handler); |
| 29 | void (*SetDefaultHandlerExpand)( |
| 30 | XML_Parser parser, XML_DefaultHandler handler); |
| 31 | void (*SetElementHandler)( |
| 32 | XML_Parser parser, XML_StartElementHandler start, |
| 33 | XML_EndElementHandler end); |
| 34 | void (*SetNamespaceDeclHandler)( |
| 35 | XML_Parser parser, XML_StartNamespaceDeclHandler start, |
| 36 | XML_EndNamespaceDeclHandler end); |
| 37 | void (*SetProcessingInstructionHandler)( |
| 38 | XML_Parser parser, XML_ProcessingInstructionHandler handler); |
| 39 | void (*SetUnknownEncodingHandler)( |
| 40 | XML_Parser parser, XML_UnknownEncodingHandler handler, |
| 41 | void *encodingHandlerData); |
| 42 | void (*SetUserData)(XML_Parser parser, void *userData); |
| 43 | /* always add new stuff to the end! */ |
| 44 | }; |
| 45 | |