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
be474bc7
Commit
be474bc7
authored
Mar 24, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Brought reinit/deactivate machinery up to date.
parent
7e038b16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
12 deletions
+31
-12
lib/Components/BTree/BTree.c
lib/Components/BTree/BTree.c
+31
-12
No files found.
lib/Components/BTree/BTree.c
View file @
be474bc7
...
...
@@ -11,7 +11,7 @@
static
char
BTree_module_documentation
[]
=
""
"
\n
$Id: BTree.c,v 1.1
5 1998/02/18 22:19:50
jim Exp $"
"
\n
$Id: BTree.c,v 1.1
6 1998/03/24 15:17:44
jim Exp $"
;
#define PERSISTENT
...
...
@@ -1090,15 +1090,21 @@ bucket_items(Bucket *self, PyObject *args)
static
PyObject
*
bucket__p___reinit__
(
Bucket
*
self
,
PyObject
*
args
)
{
int
i
;
/* Note that this implementation is broken, in that it doesn't
account for subclass needs. */
for
(
i
=
self
->
len
;
--
i
>=
0
;
)
if
(
self
->
state
==
cPersistent_UPTODATE_STATE
)
{
DECREF_KEY
(
self
->
data
[
i
].
key
);
DECREF_VALUE
(
self
->
data
[
i
].
value
);
int
i
;
PyObject
*
dict
;
for
(
i
=
self
->
len
;
--
i
>=
0
;
)
{
DECREF_KEY
(
self
->
data
[
i
].
key
);
DECREF_VALUE
(
self
->
data
[
i
].
value
);
}
if
(
HasInstDict
(
self
)
&&
(
dict
=
INSTANCE_DICT
(
self
)))
PyDict_Clear
(
dict
);
self
->
len
=
0
;
self
->
state
=
cPersistent_GHOST_STATE
;
}
self
->
len
=
0
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
...
...
@@ -1148,9 +1154,15 @@ _BTree_clear(BTree *self)
static
PyObject
*
BTree__p___reinit__
(
BTree
*
self
,
PyObject
*
args
)
{
/* Note that this implementation is broken, in that it doesn't
account for subclass needs. */
if
(
_BTree_clear
(
self
)
<
0
)
return
NULL
;
if
(
self
->
state
==
cPersistent_UPTODATE_STATE
)
{
PyObject
*
dict
;
if
(
_BTree_clear
(
self
)
<
0
)
return
NULL
;
if
(
HasInstDict
(
self
)
&&
(
dict
=
INSTANCE_DICT
(
self
)))
PyDict_Clear
(
dict
);
self
->
state
=
cPersistent_GHOST_STATE
;
}
Py_INCREF
(
Py_None
);
return
Py_None
;
}
...
...
@@ -1397,6 +1409,8 @@ static struct PyMethodDef Bucket_methods[] = {
#ifdef PERSISTENT
{
"_p___reinit__"
,
(
PyCFunction
)
bucket__p___reinit__
,
METH_VARARGS
,
"_p___reinit__() -- Reinitialize from a newly created copy"
},
{
"_p_deactivate"
,
(
PyCFunction
)
bucket__p___reinit__
,
METH_VARARGS
,
"_p_deactivate() -- Reinitialize from a newly created copy"
},
#endif
{
NULL
,
NULL
}
/* sentinel */
};
...
...
@@ -1579,6 +1593,8 @@ static struct PyMethodDef BTree_methods[] = {
#ifdef PERSISTENT
{
"_p___reinit__"
,
(
PyCFunction
)
BTree__p___reinit__
,
METH_VARARGS
,
"_p___reinit__() -- Reinitialize from a newly created copy"
},
{
"_p_deactivate"
,
(
PyCFunction
)
BTree__p___reinit__
,
METH_VARARGS
,
"_p_deactivate() -- Reinitialize from a newly created copy"
},
#endif
{
NULL
,
NULL
}
/* sentinel */
};
...
...
@@ -1746,7 +1762,7 @@ initBTree()
#endif
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.1
5
$"
;
char
*
rev
=
"$Revision: 1.1
6
$"
;
UNLESS
(
PyExtensionClassCAPI
=
PyCObject_Import
(
"ExtensionClass"
,
"CAPI"
))
return
;
...
...
@@ -1800,6 +1816,9 @@ initBTree()
Revision Log:
$Log: BTree.c,v $
Revision 1.16 1998/03/24 15:17:44 jim
Brought reinit/deactivate machinery up to date.
Revision 1.15 1998/02/18 22:19:50 jim
Fixed C inheritence problem. Waaaaaaa.
...
...
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