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
a6dcacbe
Commit
a6dcacbe
authored
Dec 27, 1996
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Took out some lamosities in interface, like returning self from
write.
parent
d21a3fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
41 deletions
+31
-41
lib/Components/cPickle/cStringIO.c
lib/Components/cPickle/cStringIO.c
+31
-41
No files found.
lib/Components/cPickle/cStringIO.c
View file @
a6dcacbe
/*
$Id: cStringIO.c,v 1.
8 1996/12/23 15:52:4
9 jim Exp $
$Id: cStringIO.c,v 1.
9 1996/12/27 21:40:2
9 jim Exp $
A simple fast partial StringIO replacement.
...
...
@@ -58,6 +58,10 @@
$Log: cStringIO.c,v $
Revision 1.9 1996/12/27 21:40:29 jim
Took out some lamosities in interface, like returning self from
write.
Revision 1.8 1996/12/23 15:52:49 jim
Added ifdef to check for CObject before using it.
...
...
@@ -204,7 +208,8 @@ O_seek(Oobject *self, PyObject *args)
self
->
pos
=
(
position
>
self
->
string_size
?
self
->
string_size
:
(
position
<
0
?
0
:
position
));
return
PyInt_FromLong
(
self
->
pos
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
char
O_read__doc__
[]
=
...
...
@@ -317,27 +322,12 @@ O_write(Oobject *self, PyObject *args)
int
l
,
newl
,
space_needed
;
UNLESS
(
PyArg_Parse
(
args
,
"O"
,
&
s
))
return
NULL
;
if
(
s
!=
Py_None
)
{
UNLESS
(
-
1
!=
(
l
=
PyString_Size
(
s
)))
return
NULL
;
UNLESS
(
c
=
PyString_AsString
(
s
))
return
NULL
;
UNLESS
(
-
1
!=
O_cwrite
(
self
,
c
,
l
))
return
NULL
;
}
else
{
self
->
pos
=
0
;
self
->
string_size
=
0
;
}
UNLESS
(
-
1
!=
(
l
=
PyString_Size
(
s
)))
return
NULL
;
UNLESS
(
c
=
PyString_AsString
(
s
))
return
NULL
;
UNLESS
(
-
1
!=
O_cwrite
(
self
,
c
,
l
))
return
NULL
;
Py_INCREF
(
self
);
return
(
PyObject
*
)
self
;
}
static
PyObject
*
O_repr
(
self
)
Oobject
*
self
;
{
return
PyString_FromStringAndSize
(
self
->
buf
,
self
->
string_size
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
...
...
@@ -503,27 +493,27 @@ static char Otype__doc__[] =
static
PyTypeObject
Otype
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
/*ob_size*/
"StringO"
,
/*tp_name*/
sizeof
(
Oobject
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
0
,
/*ob_size*/
"StringO"
,
/*tp_name*/
sizeof
(
Oobject
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
/* methods */
(
destructor
)
O_dealloc
,
/*tp_dealloc*/
(
printfunc
)
0
,
/*tp_print*/
(
getattrfunc
)
O_getattr
,
/*tp_getattr*/
(
setattrfunc
)
0
,
/*tp_setattr*/
(
setattrfunc
)
0
,
/*tp_setattr*/
(
cmpfunc
)
0
,
/*tp_compare*/
(
reprfunc
)
O_repr
,
/*tp_repr*/
(
reprfunc
)
0
,
/*tp_repr*/
0
,
/*tp_as_number*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
(
hashfunc
)
0
,
/*tp_hash*/
(
ternaryfunc
)
0
,
/*tp_call*/
(
reprfunc
)
0
,
/*tp_str*/
/* Space for future expansion */
0L
,
0L
,
0L
,
0L
,
Otype__doc__
/* Documentation string */
Otype__doc__
/* Documentation string */
};
/* End of code for StringO objects */
...
...
@@ -602,27 +592,27 @@ static char Itype__doc__[] =
static
PyTypeObject
Itype
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
/*ob_size*/
"StringI"
,
/*tp_name*/
sizeof
(
Iobject
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
0
,
/*ob_size*/
"StringI"
,
/*tp_name*/
sizeof
(
Iobject
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
/* methods */
(
destructor
)
I_dealloc
,
/*tp_dealloc*/
(
printfunc
)
0
,
/*tp_print*/
(
getattrfunc
)
I_getattr
,
/*tp_getattr*/
(
setattrfunc
)
0
,
/*tp_setattr*/
(
setattrfunc
)
0
,
/*tp_setattr*/
(
cmpfunc
)
0
,
/*tp_compare*/
(
reprfunc
)
0
,
/*tp_repr*/
0
,
/*tp_as_number*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
(
hashfunc
)
0
,
/*tp_hash*/
(
ternaryfunc
)
0
,
/*tp_call*/
(
reprfunc
)
0
,
/*tp_str*/
/* Space for future expansion */
0L
,
0L
,
0L
,
0L
,
Itype__doc__
/* Documentation string */
Itype__doc__
/* Documentation string */
};
/* End of code for StringI objects */
...
...
@@ -648,8 +638,8 @@ IO_StringIO(self, args)
/* List of methods defined in the module */
static
struct
PyMethodDef
IO_methods
[]
=
{
{
"StringIO"
,
(
PyCFunction
)
IO_StringIO
,
1
,
IO_StringIO__doc__
},
{
NULL
,
NULL
}
/* sentinel */
{
"StringIO"
,
(
PyCFunction
)
IO_StringIO
,
1
,
IO_StringIO__doc__
},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
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