renamed dispatch -> capi to match other CAPI implementations

(e.g. cStringIO, ucnhash, etc)
This commit is contained in:
Fredrik Lundh 2005-12-13 20:43:04 +00:00
parent c3345040df
commit d7a42881db
2 changed files with 27 additions and 27 deletions

View File

@ -3,11 +3,11 @@
/* note: you must import expat.h before importing this module! */ /* 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 MAJOR_VERSION; /* XXX: use the ExpatVersionInfo instead? */
int MINOR_VERSION; int MINOR_VERSION;
int MICRO_VERSION; int MICRO_VERSION;

View File

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