[Zope3-checkins] CVS: Zope3/src/zodb/btrees - BTreeItemsTemplate.c:1.1.2.1 _OIBTree.c:1.1.2.1 BTreeModuleTemplate.c:1.1.2.2 _IIBTree.c:1.1.2.2 _IOBTree.c:1.1.2.2 _OOBTree.c:1.1.2.2 _fsBTree.c:1.1.2.2 BTreeItemsTemplace.c:NONE
Barry Warsaw
barry@wooz.org
Mon, 23 Dec 2002 15:21:52 -0500
Update of /cvs-repository/Zope3/src/zodb/btrees
In directory cvs.zope.org:/tmp/cvs-serv990/src/zodb/btrees
Modified Files:
Tag: NameGeddon-branch
BTreeModuleTemplate.c _IIBTree.c _IOBTree.c _OOBTree.c
_fsBTree.c
Added Files:
Tag: NameGeddon-branch
BTreeItemsTemplate.c _OIBTree.c
Removed Files:
Tag: NameGeddon-branch
BTreeItemsTemplace.c
Log Message:
Got the build process working, including setup.py and the compilation
of the .c files.
=== Added File Zope3/src/zodb/btrees/BTreeItemsTemplate.c === (604/704 lines abridged)
/*****************************************************************************
Copyright (c) 2001, 2002 Zope Corporation and Contributors.
All Rights Reserved.
This software is subject to the provisions of the Zope Public License,
Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
FOR A PARTICULAR PURPOSE
****************************************************************************/
#define BTREEITEMSTEMPLATE_C "$Id: BTreeItemsTemplate.c,v 1.1.2.1 2002/12/23 20:21:50 bwarsaw Exp $\n"
/* A BTreeItems struct is returned from calling .items(), .keys() or
* .values() on a BTree-based data structure, and is also the result of
* taking slices of those. It represents a contiguous slice of a BTree.
*
* The start of the slice is in firstbucket, at offset first. The end of
* the slice is in lastbucket, at offset last. Both endpoints are inclusive.
* It must possible to get from firstbucket to lastbucket via following
* bucket 'next' pointers zero or more times. firstbucket, first, lastbucket,
* and last are readonly after initialization. An empty slice is represented
* by firstbucket == lastbucket == currentbucket == NULL.
*
* 'kind' determines whether this slice represents 'k'eys alone, 'v'alues
* alone, or 'i'items (key+value pairs). 'kind' is also readonly after
* initialization.
*
* The combination of currentbucket, currentoffset and pseudoindex acts as
* a search finger. Offset currentoffset in bucket currentbucket is at index
* pseudoindex, where pseudoindex==0 corresponds to offset first in bucket
* firstbucket, and pseudoindex==-1 corresponds to offset last in bucket
* lastbucket. The function BTreeItems_seek() can be used to set this combo
* correctly for any in-bounds index, and uses this combo on input to avoid
* needing to search from the start (or end) on each call. Calling
* BTreeItems_seek() with consecutive larger positions is very efficent.
* Calling it with consecutive smaller positions is more efficient than if
* a search finger weren't being used at all, but is still quadratic time
* in the number of buckets in the slice.
*/
typedef struct {
PyObject_HEAD
Bucket *firstbucket; /* First bucket */
Bucket *currentbucket; /* Current bucket (search finger) */
Bucket *lastbucket; /* Last bucket */
int currentoffset; /* Offset in currentbucket */
int pseudoindex; /* search finger index */
[-=- -=- -=- 604 lines omitted -=- -=- -=-]
Done:
PER_UNUSE(bucket);
return result;
}
static PyObject *
BTreeIter_getiter(PyObject *it)
{
Py_INCREF(it);
return it;
}
static PyTypeObject BTreeIter_Type = {
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
MOD_NAME_PREFIX "-iterator", /* tp_name */
sizeof(BTreeIter), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
(destructor)BTreeIter_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /*PyObject_GenericGetAttr,*/ /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
0, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
(getiterfunc)BTreeIter_getiter, /* tp_iter */
(iternextfunc)BTreeIter_next, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
};
=== Added File Zope3/src/zodb/btrees/_OIBTree.c ===
#define MASTER_ID "$Id: _OIBTree.c,v 1.1.2.1 2002/12/23 20:21:50 bwarsaw Exp $\n"
#define PERSISTENT
#define MOD_NAME_PREFIX "OI"
#define INITMODULE init_OIBTree
#define DEFAULT_MAX_BUCKET_SIZE 60
#define DEFAULT_MAX_BTREE_SIZE 250
#include "objectkeymacros.h"
#include "intvaluemacros.h"
#include "BTreeModuleTemplate.c"
=== Zope3/src/zodb/btrees/BTreeModuleTemplate.c 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zodb/btrees/BTreeModuleTemplate.c:1.1.2.1 Mon Dec 23 14:30:46 2002
+++ Zope3/src/zodb/btrees/BTreeModuleTemplate.c Mon Dec 23 15:21:50 2002
@@ -17,8 +17,8 @@
#include "structmember.h"
#ifdef PERSISTENT
-#include "cPersistence.h"
-#include "cPersistenceAPI.h"
+#include "persistence/persistence.h"
+#include "persistence/persistenceAPI.h"
#else
#define PER_USE_OR_RETURN(self, NULL)
#define PER_ALLOW_DEACTIVATION(self)
=== Zope3/src/zodb/btrees/_IIBTree.c 1.1.2.1 => 1.1.2.2 ===
=== Zope3/src/zodb/btrees/_IOBTree.c 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zodb/btrees/_IOBTree.c:1.1.2.1 Mon Dec 23 14:30:46 2002
+++ Zope3/src/zodb/btrees/_IOBTree.c Mon Dec 23 15:21:50 2002
@@ -3,11 +3,14 @@
#define PERSISTENT
-#define MOD_NAME_PREFIX "OI"
-#define INITMODULE init_OIBTree
+#define MOD_NAME_PREFIX "IO"
#define DEFAULT_MAX_BUCKET_SIZE 60
-#define DEFAULT_MAX_BTREE_SIZE 250
+#define DEFAULT_MAX_BTREE_SIZE 500
+#define INITMODULE init_IOBTree
-#include "objectkeymacros.h"
-#include "intvaluemacros.h"
+#include "intkeymacros.h"
+#include "objectvaluemacros.h"
+#ifndef EXCLUDE_INTSET_SUPPORT
+#include "BTree/intSet.h"
+#endif
#include "BTreeModuleTemplate.c"
=== Zope3/src/zodb/btrees/_OOBTree.c 1.1.2.1 => 1.1.2.2 ===
=== Zope3/src/zodb/btrees/_fsBTree.c 1.1.2.1 => 1.1.2.2 ===
=== Removed File Zope3/src/zodb/btrees/BTreeItemsTemplace.c ===