[Python-checkins] commit of r41665 - in python/trunk: Include/pyexpat.h Modules/pyexpat.c

fredrik.lundh python-checkins at python.org
Tue Dec 13 21:43:05 CET 2005


Author: fredrik.lundh
Date: Tue Dec 13 21:43:04 2005
New Revision: 41665

Modified:
   python/trunk/Include/pyexpat.h
   python/trunk/Modules/pyexpat.c
Log:
renamed dispatch -> capi to match other CAPI implementations
(e.g. cStringIO, ucnhash, etc)



Modified: python/trunk/Include/pyexpat.h
==============================================================================
--- python/trunk/Include/pyexpat.h	(original)
+++ python/trunk/Include/pyexpat.h	Tue Dec 13 21:43:04 2005
@@ -3,11 +3,11 @@
 
 /* note: you must import expat.h before importing this module! */
 
-#define PyExpat_DISPATCH_MAGIC  "pyexpat.dispatch 1.0"
+#define PyExpat_CAPI_MAGIC  "pyexpat.expat_CAPI 1.0"
 
-struct PyExpat_Dispatch 
+struct PyExpat_CAPI 
 {
-    int size; /* set to sizeof(struct PyExpat_Dispatch) */
+    int size; /* set to sizeof(struct PyExpat_CAPI) */
     int MAJOR_VERSION; /* XXX: use the ExpatVersionInfo instead? */
     int MINOR_VERSION;
     int MICRO_VERSION;

Modified: python/trunk/Modules/pyexpat.c
==============================================================================
--- python/trunk/Modules/pyexpat.c	(original)
+++ python/trunk/Modules/pyexpat.c	Tue Dec 13 21:43:04 2005
@@ -1840,8 +1840,8 @@
     PyObject *modelmod_name;
     PyObject *model_module;
     PyObject *sys_modules;
-    static struct PyExpat_Dispatch dispatch;
-    PyObject* dispatch_object;
+    static struct PyExpat_CAPI capi;
+    PyObject* capi_object;
 
     if (errmod_name == NULL)
         return;
@@ -2017,31 +2017,31 @@
 #undef MYCONST
 
     /* initialize pyexpat dispatch table */
-    dispatch.size = sizeof(dispatch);
-    dispatch.MAJOR_VERSION = XML_MAJOR_VERSION;
-    dispatch.MINOR_VERSION = XML_MINOR_VERSION;
-    dispatch.MICRO_VERSION = XML_MICRO_VERSION;
-    dispatch.ErrorString = XML_ErrorString;
-    dispatch.GetCurrentColumnNumber = XML_GetCurrentColumnNumber;
-    dispatch.GetCurrentLineNumber = XML_GetCurrentLineNumber;
-    dispatch.Parse = XML_Parse;
-    dispatch.ParserCreate_MM = XML_ParserCreate_MM;
-    dispatch.ParserFree = XML_ParserFree;
-    dispatch.SetCharacterDataHandler = XML_SetCharacterDataHandler;
-    dispatch.SetCommentHandler = XML_SetCommentHandler;
-    dispatch.SetDefaultHandlerExpand = XML_SetDefaultHandlerExpand;
-    dispatch.SetElementHandler = XML_SetElementHandler;
-    dispatch.SetNamespaceDeclHandler = XML_SetNamespaceDeclHandler;
-    dispatch.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
-    dispatch.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
-    dispatch.SetUserData = XML_SetUserData;
+    capi.size = sizeof(capi);
+    capi.MAJOR_VERSION = XML_MAJOR_VERSION;
+    capi.MINOR_VERSION = XML_MINOR_VERSION;
+    capi.MICRO_VERSION = XML_MICRO_VERSION;
+    capi.ErrorString = XML_ErrorString;
+    capi.GetCurrentColumnNumber = XML_GetCurrentColumnNumber;
+    capi.GetCurrentLineNumber = XML_GetCurrentLineNumber;
+    capi.Parse = XML_Parse;
+    capi.ParserCreate_MM = XML_ParserCreate_MM;
+    capi.ParserFree = XML_ParserFree;
+    capi.SetCharacterDataHandler = XML_SetCharacterDataHandler;
+    capi.SetCommentHandler = XML_SetCommentHandler;
+    capi.SetDefaultHandlerExpand = XML_SetDefaultHandlerExpand;
+    capi.SetElementHandler = XML_SetElementHandler;
+    capi.SetNamespaceDeclHandler = XML_SetNamespaceDeclHandler;
+    capi.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
+    capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
+    capi.SetUserData = XML_SetUserData;
     
     /* export as cobject */
-    dispatch_object = PyCObject_FromVoidPtrAndDesc(
-        &dispatch, PyExpat_DISPATCH_MAGIC, NULL
+    capi_object = PyCObject_FromVoidPtrAndDesc(
+        &capi, PyExpat_CAPI_MAGIC, NULL
         );
-    if (dispatch_object)
-        PyModule_AddObject(m, "dispatch", dispatch_object);
+    if (capi_object)
+        PyModule_AddObject(m, "expat_CAPI", capi_object);
 }
 
 static void


More information about the Python-checkins mailing list