summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2006-06-05 01:56:15 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2006-06-05 01:56:15 (GMT)
commitdb8a80735b9ce54f26d3e6796d0ae647455ca854 (patch)
tree9eaa7b9d639c22250027e6ba91b41cc5c51ecde5 /Modules/_bsddb.c
parentd6a9eeffc5b9f7763efd47467588d4209a378b00 (diff)
downloadcpython-db8a80735b9ce54f26d3e6796d0ae647455ca854.zip
cpython-db8a80735b9ce54f26d3e6796d0ae647455ca854.tar.gz
cpython-db8a80735b9ce54f26d3e6796d0ae647455ca854.tar.bz2
* support DBEnv.lsn_reset() method on BerkeleyDB >= 4.4 [patch #1494902]
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r--Modules/_bsddb.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 3c50a39..16bdf66 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -4294,6 +4294,28 @@ DBEnv_lock_put(DBEnvObject* self, PyObject* args)
RETURN_NONE();
}
+#if (DBVER >= 44)
+static PyObject*
+DBEnv_lsn_reset(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+{
+ int err;
+ char *file;
+ u_int32_t flags = 0;
+ static char* kwnames[] = { "file", "flags", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|i:lsn_reset", kwnames,
+ &file, &flags))
+ return NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+
+ MYDB_BEGIN_ALLOW_THREADS;
+ err = self->db_env->lsn_reset(self->db_env, file, flags);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+ RETURN_NONE();
+}
+#endif /* DBVER >= 4.4 */
+
#if (DBVER >= 40)
static PyObject*
DBEnv_log_stat(DBEnvObject* self, PyObject* args)
@@ -4849,6 +4871,9 @@ static PyMethodDef DBEnv_methods[] = {
#if (DBVER >= 40)
{"log_stat", (PyCFunction)DBEnv_log_stat, METH_VARARGS},
#endif
+#if (DBVER >= 44)
+ {"lsn_reset", (PyCFunction)DBEnv_lsn_reset, METH_VARARGS|METH_KEYWORDS},
+#endif
{"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none, METH_VARARGS},
{NULL, NULL} /* sentinel */
};