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
97879473
Commit
97879473
authored
Dec 07, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checked in Guido's changes.
parent
2759e013
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
23 deletions
+17
-23
lib/Components/cPickle/cStringIO.h
lib/Components/cPickle/cStringIO.h
+10
-20
lib/Components/cPickle/copy_reg.py
lib/Components/cPickle/copy_reg.py
+7
-3
No files found.
lib/Components/cPickle/cStringIO.h
View file @
97879473
...
...
@@ -2,7 +2,7 @@
#define CSTRINGIO_INCLUDED
/*
$Id: cStringIO.h,v 1.
3 1997/06/13 19:44:02
jim Exp $
$Id: cStringIO.h,v 1.
4 1997/12/07 14:27:00
jim Exp $
cStringIO C API
...
...
@@ -69,18 +69,6 @@
This would typically be done in your init function.
$Log: cStringIO.h,v $
Revision 1.3 1997/06/13 19:44:02 jim
- changed to avoid warning of multiple declarations in 1.5 and
our 1.4.
Revision 1.2 1997/01/27 14:13:05 jim
Changed the way the C API was exported.
Revision 1.1 1997/01/02 15:18:36 chris
initial version
*/
/* Basic fuctions to manipulate cStringIO objects from C */
...
...
@@ -88,22 +76,22 @@
static
struct
PycStringIO_CAPI
{
/* Read a string. If the last argument is -1, the remainder will be read. */
int
(
*
cread
)
(
PyObject
*
,
char
**
,
int
);
int
(
*
cread
)
Py_FPROTO
((
PyObject
*
,
char
**
,
int
)
);
/* Read a line */
int
(
*
creadline
)
(
PyObject
*
,
char
**
);
int
(
*
creadline
)
Py_FPROTO
((
PyObject
*
,
char
**
)
);
/* Write a string */
int
(
*
cwrite
)
(
PyObject
*
,
char
*
,
int
);
int
(
*
cwrite
)
Py_FPROTO
((
PyObject
*
,
char
*
,
int
)
);
/* Get the cStringIO object as a Python string */
PyObject
*
(
*
cgetvalue
)
(
PyObject
*
);
PyObject
*
(
*
cgetvalue
)
Py_FPROTO
((
PyObject
*
)
);
/* Create a new output object */
PyObject
*
(
*
NewOutput
)
(
int
);
PyObject
*
(
*
NewOutput
)
Py_FPROTO
((
int
)
);
/* Create an input object from a Python string */
PyObject
*
(
*
NewInput
)
(
PyObject
*
);
PyObject
*
(
*
NewInput
)
Py_FPROTO
((
PyObject
*
)
);
/* The Python types for cStringIO input and output objects.
Note that you can do input on an output object.
...
...
@@ -119,7 +107,9 @@ static struct PycStringIO_CAPI {
((O)->ob_type==PycStringIO->OutputType)
static
void
*
xxxPyCObject_Import
(
char
*
module_name
,
char
*
name
)
xxxPyCObject_Import
(
module_name
,
name
)
char
*
module_name
;
char
*
name
;
{
PyObject
*
m
,
*
c
;
void
*
r
=
NULL
;
...
...
lib/Components/cPickle/copy_reg.py
View file @
97879473
# Helper to provide extensibility for pickle/cPickle.
dispatch_table
=
{}
safe_constructors
=
{}
def
pickle
(
ob_type
,
pickle_function
,
constructor_ob
=
None
):
dispatch_table
[
ob_type
]
=
pickle_function
if
(
constructor_ob
is
not
None
)
:
if
constructor_ob
is
not
None
:
constructor
(
constructor_ob
)
def
constructor
(
object
):
safe_constructors
[
object
]
=
1
# Example: provide pickling support for complex numbers.
def
pickle_complex
(
c
):
return
complex
,(
c
.
real
,
c
.
imag
)
return
complex
,
(
c
.
real
,
c
.
imag
)
pickle
(
type
(
1j
),
pickle_complex
,
complex
)
pickle
(
type
(
1j
),
pickle_complex
,
complex
)
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