Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
8b38c474
Commit
8b38c474
authored
Feb 19, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for intSets in set operations, for now.
parent
1da6792b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
12 deletions
+59
-12
src/BTrees/BTreeModuleTemplate.c
src/BTrees/BTreeModuleTemplate.c
+8
-2
src/BTrees/IIBTree.c
src/BTrees/IIBTree.c
+2
-0
src/BTrees/IOBTree.c
src/BTrees/IOBTree.c
+2
-0
src/BTrees/SetOpTemplate.c
src/BTrees/SetOpTemplate.c
+41
-8
src/BTrees/Setup
src/BTrees/Setup
+2
-2
src/BTrees/__init__.py
src/BTrees/__init__.py
+4
-0
No files found.
src/BTrees/BTreeModuleTemplate.c
View file @
8b38c474
...
...
@@ -85,7 +85,7 @@
static
char
BTree_module_documentation
[]
=
""
"
\n
$Id: BTreeModuleTemplate.c,v 1.
3 2001/02/19 17:36:04
jim Exp $"
"
\n
$Id: BTreeModuleTemplate.c,v 1.
4 2001/02/19 18:15:10
jim Exp $"
;
#ifdef PERSISTENT
...
...
@@ -357,6 +357,12 @@ INITMODULE ()
BTreeItemsType
.
ob_type
=&
PyType_Type
;
#ifdef INTSET_H
UNLESS
(
d
=
PyImport_ImportModule
(
"intSet"
))
return
;
UNLESS
(
intSetType
=
PyObject_GetAttrString
(
d
,
"intSet"
))
return
;
Py_DECREF
(
d
);
#endif
/* Create the module and add the functions */
m
=
Py_InitModule4
(
PREFIX
"BTree"
,
module_methods
,
BTree_module_documentation
,
...
...
@@ -366,7 +372,7 @@ INITMODULE ()
d
=
PyModule_GetDict
(
m
);
PyDict_SetItemString
(
d
,
"__version__"
,
PyString_FromString
(
"$Revision: 1.
3
$"
));
PyString_FromString
(
"$Revision: 1.
4
$"
));
PyExtensionClass_Export
(
d
,
PREFIX
"Bucket"
,
BucketType
);
PyExtensionClass_Export
(
d
,
PREFIX
"BTree"
,
BTreeType
);
...
...
src/BTrees/IIBTree.c
View file @
8b38c474
...
...
@@ -9,4 +9,6 @@
#include "intkeymacros.h"
#include "intvaluemacros.h"
#include "cPersistence.h"
#include "BTree/intSet.h"
#include "BTreeModuleTemplate.c"
src/BTrees/IOBTree.c
View file @
8b38c474
...
...
@@ -8,4 +8,6 @@
#include "intkeymacros.h"
#include "objectvaluemacros.h"
#include "cPersistence.h"
#include "BTree/intSet.h"
#include "BTreeModuleTemplate.c"
src/BTrees/SetOpTemplate.c
View file @
8b38c474
...
...
@@ -87,6 +87,29 @@
Set operations
****************************************************************************/
#ifdef INTSET_H
static
int
nextIntSet
(
SetIteration
*
i
)
{
UNLESS
(
PER_USE
(
INTSET
(
i
->
set
)))
return
-
1
;
if
(
i
->
position
>=
0
)
{
if
(
i
->
position
<
INTSET
(
i
->
set
)
->
len
)
{
i
->
key
=
INTSET
(
i
->
set
)
->
data
[
i
->
position
];
i
->
position
++
;
}
else
i
->
position
=
-
1
;
}
PER_ALLOW_DEACTIVATION
(
INTSET
(
i
->
set
));
return
0
;
}
#endif
static
int
initSetIteration
(
SetIteration
*
i
,
PyObject
*
s
,
int
w
,
int
*
merge
)
{
...
...
@@ -107,6 +130,14 @@ initSetIteration(SetIteration *i, PyObject *s, int w, int *merge)
i
->
hasValue
=
1
;
}
else
if
(
ExtensionClassSubclassInstance_Check
(
s
,
&
SetType
))
{
i
->
set
=
s
;
Py_INCREF
(
s
);
i
->
next
=
nextSet
;
i
->
hasValue
=
0
;
}
else
if
(
ExtensionClassSubclassInstance_Check
(
s
,
&
BTreeType
))
{
i
->
set
=
BTree_rangeSearch
(
BTREE
(
s
),
NULL
,
'i'
);
...
...
@@ -121,14 +152,6 @@ initSetIteration(SetIteration *i, PyObject *s, int w, int *merge)
i
->
next
=
nextTreeSetItems
;
i
->
hasValue
=
1
;
}
else
if
(
ExtensionClassSubclassInstance_Check
(
s
,
&
SetType
))
{
i
->
set
=
s
;
Py_INCREF
(
s
);
i
->
next
=
nextSet
;
i
->
hasValue
=
0
;
}
else
if
(
ExtensionClassSubclassInstance_Check
(
s
,
&
TreeSetType
))
{
i
->
set
=
BTree_rangeSearch
(
BTREE
(
s
),
NULL
,
'k'
);
...
...
@@ -137,6 +160,16 @@ initSetIteration(SetIteration *i, PyObject *s, int w, int *merge)
i
->
next
=
nextTreeSetItems
;
i
->
hasValue
=
0
;
}
#ifdef INTSET_H
else
if
(
s
->
ob_type
==
(
PyTypeObject
*
)
intSetType
)
{
i
->
set
=
s
;
Py_INCREF
(
s
);
i
->
next
=
nextIntSet
;
i
->
hasValue
=
0
;
}
#endif
else
{
PyErr_SetString
(
PyExc_TypeError
,
"invalid argument"
);
...
...
src/BTrees/Setup
View file @
8b38c474
*shared*
OOBTree OOBTree.c -I../../Components/ExtensionClass -I../ZODB
OIBTree OIBTree.c -I../../Components/ExtensionClass -I../ZODB
IIBTree IIBTree.c -I../../Components/ExtensionClass -I../ZODB
IOBTree IOBTree.c -I../../Components/ExtensionClass -I../ZODB
IIBTree IIBTree.c -I../../Components/ExtensionClass -I../ZODB
-I../../Components
IOBTree IOBTree.c -I../../Components/ExtensionClass -I../ZODB
-I../../Components
src/BTrees/__init__.py
View file @
8b38c474
import
ZODB
try
:
import
intSet
except
:
pass
else
:
del
intSet
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