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
cc117dbb
Commit
cc117dbb
authored
Dec 13, 2005
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved magic into structure (mainly to simplify the client code)
added missing API hooks
parent
d7a42881
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
Include/pyexpat.h
Include/pyexpat.h
+5
-3
Modules/pyexpat.c
Modules/pyexpat.c
+5
-5
No files found.
Include/pyexpat.h
View file @
cc117dbb
...
...
@@ -7,15 +7,17 @@
struct
PyExpat_CAPI
{
char
*
magic
;
/* set to PyExpat_CAPI_MAGIC */
int
size
;
/* set to sizeof(struct PyExpat_CAPI) */
int
MAJOR_VERSION
;
/* XXX: use the ExpatVersionInfo instead? */
int
MAJOR_VERSION
;
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_Error
(
*
GetErrorCode
)(
XML_Parser
parser
);
int
(
*
GetErrorColumnNumber
)(
XML_Parser
parser
);
int
(
*
GetErrorLineNumber
)(
XML_Parser
parser
);
enum
XML_Status
(
*
Parse
)(
XML_Parser
parser
,
const
char
*
s
,
int
len
,
int
isFinal
);
XML_Parser
(
*
ParserCreate_MM
)(
...
...
Modules/pyexpat.c
View file @
cc117dbb
...
...
@@ -2018,12 +2018,14 @@ MODULE_INITFUNC(void)
/* initialize pyexpat dispatch table */
capi
.
size
=
sizeof
(
capi
);
capi
.
magic
=
PyExpat_CAPI_MAGIC
;
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
.
GetErrorCode
=
XML_GetErrorCode
;
capi
.
GetErrorColumnNumber
=
XML_GetErrorColumnNumber
;
capi
.
GetErrorLineNumber
=
XML_GetErrorLineNumber
;
capi
.
Parse
=
XML_Parse
;
capi
.
ParserCreate_MM
=
XML_ParserCreate_MM
;
capi
.
ParserFree
=
XML_ParserFree
;
...
...
@@ -2037,9 +2039,7 @@ MODULE_INITFUNC(void)
capi
.
SetUserData
=
XML_SetUserData
;
/* export as cobject */
capi_object
=
PyCObject_FromVoidPtrAndDesc
(
&
capi
,
PyExpat_CAPI_MAGIC
,
NULL
);
capi_object
=
PyCObject_FromVoidPtr
(
&
capi
,
NULL
);
if
(
capi_object
)
PyModule_AddObject
(
m
,
"expat_CAPI"
,
capi_object
);
}
...
...
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