Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d7a42881
Commit
d7a42881
authored
Dec 13, 2005
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed dispatch -> capi to match other CAPI implementations
(e.g. cStringIO, ucnhash, etc)
parent
c3345040
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
Include/pyexpat.h
Include/pyexpat.h
+3
-3
Modules/pyexpat.c
Modules/pyexpat.c
+24
-24
No files found.
Include/pyexpat.h
View file @
d7a42881
...
...
@@ -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
;
...
...
Modules/pyexpat.c
View file @
d7a42881
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment