aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2005-12-13 19:49:55 +0000
committerFredrik Lundh <fredrik@pythonware.com>2005-12-13 19:49:55 +0000
commitc3345040df1adb502f5b62e9b3efc6f4232a952f (patch)
tree7b5a4b66d37dc7d931c2859e84ac30cd41bb7390 /Include/pyexpat.h
parentFix test not to fail on FreeBSD. Directories work also as data (diff)
downloadcpython-c3345040df1adb502f5b62e9b3efc6f4232a952f.tar.gz
cpython-c3345040df1adb502f5b62e9b3efc6f4232a952f.tar.bz2
cpython-c3345040df1adb502f5b62e9b3efc6f4232a952f.zip
added cobject-based expat dispatch mechanism to pyexpat
Diffstat (limited to 'Include/pyexpat.h')
-rw-r--r--Include/pyexpat.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/Include/pyexpat.h b/Include/pyexpat.h
new file mode 100644
index 00000000000..e54b16fbacd
--- /dev/null
+++ b/Include/pyexpat.h
@@ -0,0 +1,45 @@
+/* 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! */
+
+#define PyExpat_DISPATCH_MAGIC "pyexpat.dispatch 1.0"
+
+struct PyExpat_Dispatch
+{
+ int size; /* set to sizeof(struct PyExpat_Dispatch) */
+ int MAJOR_VERSION; /* XXX: use the ExpatVersionInfo instead? */
+ 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);
+ int (*GetCurrentColumnNumber)(XML_Parser parser);
+ int (*GetCurrentLineNumber)(XML_Parser parser);
+ 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! */
+};
+