summaryrefslogtreecommitdiffstats
path: root/Modules/bsddb.h
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2010-03-22 14:22:26 (GMT)
committerJesus Cea <jcea@jcea.es>2010-03-22 14:22:26 (GMT)
commit6557aac599f1c22051ee61ba61c8c43add406e94 (patch)
treea06e09b51b3aaf03143cfcea217f14e11db8d7c5 /Modules/bsddb.h
parent31e928eb3c44d90ec951db118de4736e90532f84 (diff)
downloadcpython-6557aac599f1c22051ee61ba61c8c43add406e94.zip
cpython-6557aac599f1c22051ee61ba61c8c43add406e94.tar.gz
cpython-6557aac599f1c22051ee61ba61c8c43add406e94.tar.bz2
pybsddb 4.8.4 integration. Please, comment in issue #8156
Diffstat (limited to 'Modules/bsddb.h')
-rw-r--r--Modules/bsddb.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/Modules/bsddb.h b/Modules/bsddb.h
index 673f5fc..70c7bf8 100644
--- a/Modules/bsddb.h
+++ b/Modules/bsddb.h
@@ -70,6 +70,10 @@
* DBLock (A lock handle)
* DBSequence (Sequence)
*
+ * New datatypes:
+ *
+ * DBLogCursor (Log Cursor)
+ *
*/
/* --------------------------------------------------------------------- */
@@ -105,7 +109,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
-#define PY_BSDDB_VERSION "4.7.3"
+#define PY_BSDDB_VERSION "4.8.4"
/* Python object definitions */
@@ -122,6 +126,7 @@ struct behaviourFlags {
struct DBObject; /* Forward declaration */
struct DBCursorObject; /* Forward declaration */
+struct DBLogCursorObject; /* Forward declaration */
struct DBTxnObject; /* Forward declaration */
struct DBSequenceObject; /* Forward declaration */
@@ -134,6 +139,7 @@ typedef struct {
PyObject* event_notifyCallback;
struct DBObject *children_dbs;
struct DBTxnObject *children_txns;
+ struct DBLogCursorObject *children_logcursors;
PyObject *private_obj;
PyObject *rep_transport;
PyObject *in_weakreflist; /* List of weak references */
@@ -145,7 +151,6 @@ typedef struct DBObject {
DBEnvObject* myenvobj; /* PyObject containing the DB_ENV */
u_int32_t flags; /* saved flags from open() */
u_int32_t setflags; /* saved flags from set_flags() */
- int haveStat;
struct behaviourFlags moduleFlags;
struct DBTxnObject *txn;
struct DBCursorObject *children_cursors;
@@ -193,9 +198,20 @@ typedef struct DBTxnObject {
} DBTxnObject;
+typedef struct DBLogCursorObject {
+ PyObject_HEAD
+ DB_LOGC* logc;
+ DBEnvObject* env;
+ struct DBLogCursorObject **sibling_prev_p;
+ struct DBLogCursorObject *sibling_next;
+ PyObject *in_weakreflist; /* List of weak references */
+} DBLogCursorObject;
+
+
typedef struct {
PyObject_HEAD
DB_LOCK lock;
+ int lock_initialized; /* Signal if we actually have a lock */
PyObject *in_weakreflist; /* List of weak references */
} DBLockObject;
@@ -220,6 +236,7 @@ typedef struct DBSequenceObject {
/* To access the structure from an external module, use code like the
following (error checking missed out for clarity):
+ // If you are using Python before 3.2:
BSDDB_api* bsddb_api;
PyObject* mod;
PyObject* cobj;
@@ -231,6 +248,15 @@ typedef struct DBSequenceObject {
Py_DECREF(cobj);
Py_DECREF(mod);
+
+ // If you are using Python 3.2 or up:
+ BSDDB_api* bsddb_api;
+
+ // Use "bsddb3._pybsddb.api" if you're using
+ // the standalone pybsddb add-on.
+ bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
+
+
The structure's members must not be changed.
*/
@@ -238,6 +264,7 @@ typedef struct {
/* Type objects */
PyTypeObject* db_type;
PyTypeObject* dbcursor_type;
+ PyTypeObject* dblogcursor_type;
PyTypeObject* dbenv_type;
PyTypeObject* dbtxn_type;
PyTypeObject* dblock_type;
@@ -247,7 +274,6 @@ typedef struct {
/* Functions */
int (*makeDBError)(int err);
-
} BSDDB_api;