* Handwritten code to wrap version 3.x of the Berkeley DB library,
* written to replace a SWIG-generated file. It has since been updated
- * to compile with BerkeleyDB versions 3.2 through 4.
+ * to compile with BerkeleyDB versions 3.2 through 4..
* This module was started by Andrew Kuchling to remove the dependency
* on SWIG in a package by Gregory P. Smith <email@example.com> who
/* 40 = 4.0, 33 = 3.3; this will break if the second number is > 9 */
#define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
-#define PY_BSDDB_VERSION "4.
+#define PY_BSDDB_VERSION "4."
static char *rcs_id = "$Id$";
+ /* DB.verify acts as a DB handle destructor (like close); this was
+ * documented in BerkeleyDB 4.2 but had the undocumented effect
+ * of not being safe in prior versions while still requiring an explicit
+ * DB.close call afterwards. Lets call close for the user to emulate
+ * the safe 4.2 behaviour. */
+ self->db->close(self->db, 0);
#define ADD_INT(dict, NAME) _addIntToDict(dict, #NAME, NAME)
+ ADD_INT(d, DB_RPCCLIENT);
+ /* allow apps to be written using DB_RPCCLIENT on older BerkeleyDB */
+ _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
+#if (DBVER >= 33)
+ ADD_INT(d, DB_TIME_NOTGRANTED);
+ ADD_INT(d, DB_TXN_NOT_DURABLE);
+ ADD_INT(d, DB_TXN_WRITE_NOSYNC);
+ ADD_INT(d, DB_LOG_AUTOREMOVE);
+ ADD_INT(d, DB_DIRECT_LOG);
+ ADD_INT(d, DB_DIRECT_DB);
+ ADD_INT(d, DB_INIT_REP);
+ ADD_INT(d, DB_ENCRYPT);