summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/bsddb/dbobj.py10
-rw-r--r--Modules/_bsddb.c25
2 files changed, 33 insertions, 2 deletions
diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py
index f5bd0dc..530de4f 100644
--- a/Lib/bsddb/dbobj.py
+++ b/Lib/bsddb/dbobj.py
@@ -91,11 +91,13 @@ class DBEnv:
return apply(self._cobj.lock_stat, args, kwargs)
def log_archive(self, *args, **kwargs):
return apply(self._cobj.log_archive, args, kwargs)
+
+ def set_get_returns_none(self, *args, **kwargs):
+ return apply(self._cobj.set_get_returns_none, args, kwargs)
+
if db.version() >= (4,0):
def log_stat(self, *args, **kwargs):
return apply(self._cobj.log_stat, args, kwargs)
- def set_get_returns_none(self, *args, **kwargs):
- return apply(self._cobj.set_get_returns_none, args, kwargs)
if db.version() >= (4,1):
def dbremove(self, *args, **kwargs):
@@ -105,6 +107,10 @@ class DBEnv:
def set_encrypt(self, *args, **kwargs):
return apply(self._cobj.set_encrypt, args, kwargs)
+ if db.version() >= (4,4):
+ def lsn_reset(self, *args, **kwargs):
+ return apply(self._cobj.lsn_reset, args, kwargs)
+
class DB(DictMixin):
def __init__(self, dbenv, *args, **kwargs):
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 */
};