Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
160652b3
Commit
160652b3
authored
Feb 07, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to ease compilation on Windoze and removed some extraneous
variable declarations.
parent
212de808
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
lib/Components/cPickle/cStringIO.c
lib/Components/cPickle/cStringIO.c
+23
-15
No files found.
lib/Components/cPickle/cStringIO.c
View file @
160652b3
/*
/*
$Id: cStringIO.c,v 1.1
4 1997/01/24 19:56:24 chris
Exp $
$Id: cStringIO.c,v 1.1
5 1997/02/07 17:11:55 jim
Exp $
A simple fast partial StringIO replacement.
A simple fast partial StringIO replacement.
...
@@ -58,6 +58,10 @@
...
@@ -58,6 +58,10 @@
$Log: cStringIO.c,v $
$Log: cStringIO.c,v $
Revision 1.15 1997/02/07 17:11:55 jim
Added code to ease compilation on Windoze and removed some extraneous
variable declarations.
Revision 1.14 1997/01/24 19:56:24 chris
Revision 1.14 1997/01/24 19:56:24 chris
undid last change
undid last change
...
@@ -151,7 +155,7 @@ typedef struct {
...
@@ -151,7 +155,7 @@ typedef struct {
int
pos
,
string_size
,
buf_size
,
closed
;
int
pos
,
string_size
,
buf_size
,
closed
;
}
Oobject
;
}
Oobject
;
static
forward
PyTypeObject
Otype
;
static
PyTypeObject
Otype
;
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
...
@@ -164,9 +168,7 @@ typedef struct {
...
@@ -164,9 +168,7 @@ typedef struct {
PyObject
*
pbuf
;
PyObject
*
pbuf
;
}
Iobject
;
}
Iobject
;
staticforward
PyTypeObject
Itype
;
static
PyTypeObject
Itype
;
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
...
@@ -290,9 +292,7 @@ static char O_write__doc__[] =
...
@@ -290,9 +292,7 @@ static char O_write__doc__[] =
static
int
static
int
O_cwrite
(
PyObject
*
self
,
char
*
c
,
int
l
)
{
O_cwrite
(
PyObject
*
self
,
char
*
c
,
int
l
)
{
PyObject
*
s
;
int
newl
;
char
*
b
;
int
newl
,
space_needed
;
newl
=
((
Oobject
*
)
self
)
->
pos
+
l
;
newl
=
((
Oobject
*
)
self
)
->
pos
+
l
;
if
(
newl
>=
((
Oobject
*
)
self
)
->
buf_size
)
if
(
newl
>=
((
Oobject
*
)
self
)
->
buf_size
)
...
@@ -324,8 +324,8 @@ O_cwrite(PyObject *self, char *c, int l) {
...
@@ -324,8 +324,8 @@ O_cwrite(PyObject *self, char *c, int l) {
static
PyObject
*
static
PyObject
*
O_write
(
Oobject
*
self
,
PyObject
*
args
)
{
O_write
(
Oobject
*
self
,
PyObject
*
args
)
{
PyObject
*
s
;
PyObject
*
s
;
char
*
c
,
*
b
;
char
*
c
;
int
l
,
newl
,
space_needed
;
int
l
;
UNLESS
(
PyArg_Parse
(
args
,
"O"
,
&
s
))
return
NULL
;
UNLESS
(
PyArg_Parse
(
args
,
"O"
,
&
s
))
return
NULL
;
UNLESS
(
-
1
!=
(
l
=
PyString_Size
(
s
)))
return
NULL
;
UNLESS
(
-
1
!=
(
l
=
PyString_Size
(
s
)))
return
NULL
;
...
@@ -479,7 +479,8 @@ static char Otype__doc__[] =
...
@@ -479,7 +479,8 @@ static char Otype__doc__[] =
"Simple type for output to strings."
"Simple type for output to strings."
;
;
static
PyTypeObject
Otype
=
{
static
PyTypeObject
Otype_value
()
{
PyTypeObject
Otype
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
/*ob_size*/
0
,
/*ob_size*/
"StringO"
,
/*tp_name*/
"StringO"
,
/*tp_name*/
...
@@ -502,7 +503,9 @@ static PyTypeObject Otype = {
...
@@ -502,7 +503,9 @@ static PyTypeObject Otype = {
/* Space for future expansion */
/* Space for future expansion */
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
Otype__doc__
/* Documentation string */
Otype__doc__
/* Documentation string */
};
};
return
Otype
;
}
/* End of code for StringO objects */
/* End of code for StringO objects */
/* -------------------------------------------------------- */
/* -------------------------------------------------------- */
...
@@ -569,7 +572,8 @@ static char Itype__doc__[] =
...
@@ -569,7 +572,8 @@ static char Itype__doc__[] =
"Simple type for treating strings as input file streams"
"Simple type for treating strings as input file streams"
;
;
static
PyTypeObject
Itype
=
{
static
PyTypeObject
Itype_value
()
{
PyTypeObject
Itype
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
/*ob_size*/
0
,
/*ob_size*/
"StringI"
,
/*tp_name*/
"StringI"
,
/*tp_name*/
...
@@ -592,7 +596,9 @@ static PyTypeObject Itype = {
...
@@ -592,7 +596,9 @@ static PyTypeObject Itype = {
/* Space for future expansion */
/* Space for future expansion */
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
0L
,
Itype__doc__
/* Documentation string */
Itype__doc__
/* Documentation string */
};
};
return
Itype
;
}
/* End of code for StringI objects */
/* End of code for StringI objects */
/* -------------------------------------------------------- */
/* -------------------------------------------------------- */
...
@@ -636,6 +642,7 @@ void
...
@@ -636,6 +642,7 @@ void
initcStringIO
()
{
initcStringIO
()
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
/* Create the module and add the functions */
/* Create the module and add the functions */
m
=
Py_InitModule4
(
"cStringIO"
,
IO_methods
,
m
=
Py_InitModule4
(
"cStringIO"
,
IO_methods
,
cStringIO_module_documentation
,
cStringIO_module_documentation
,
...
@@ -645,13 +652,14 @@ initcStringIO() {
...
@@ -645,13 +652,14 @@ initcStringIO() {
d
=
PyModule_GetDict
(
m
);
d
=
PyModule_GetDict
(
m
);
/* Export C API */
/* Export C API */
Itype
=
Itype_value
();
Otype
=
Otype_value
();
PyDict_SetItemString
(
d
,
"cStringIO_CAPI"
,
PyCObject_FromVoidPtr
(
&
CAPI
,
NULL
));
PyDict_SetItemString
(
d
,
"cStringIO_CAPI"
,
PyCObject_FromVoidPtr
(
&
CAPI
,
NULL
));
/* Export Types */
/* Export Types */
PyDict_SetItemString
(
d
,
"InputType"
,
(
PyObject
*
)
&
Itype
);
PyDict_SetItemString
(
d
,
"InputType"
,
(
PyObject
*
)
&
Itype
);
PyDict_SetItemString
(
d
,
"OutputType"
,
(
PyObject
*
)
&
Otype
);
PyDict_SetItemString
(
d
,
"OutputType"
,
(
PyObject
*
)
&
Otype
);
/* Check for errors */
/* Check for errors */
if
(
PyErr_Occurred
())
Py_FatalError
(
"can't initialize module cStringIO"
);
if
(
PyErr_Occurred
())
Py_FatalError
(
"can't initialize module cStringIO"
);
}
}
...
...
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