From d7a42881dba311e66f5091cbe0ec7c01f511cc2c Mon Sep 17 00:00:00 2001 From: Fredrik Lundh Date: Tue, 13 Dec 2005 20:43:04 +0000 Subject: renamed dispatch -> capi to match other CAPI implementations (e.g. cStringIO, ucnhash, etc) --- Include/pyexpat.h | 6 +++--- Modules/pyexpat.c | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Include/pyexpat.h b/Include/pyexpat.h index e54b16f..d4acb9a 100644 --- a/Include/pyexpat.h +++ b/Include/pyexpat.h @@ -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; diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index b59a51d..2da80c8 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1840,8 +1840,8 @@ MODULE_INITFUNC(void) 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 @@ MODULE_INITFUNC(void) #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 -- cgit v0.12