summaryrefslogtreecommitdiff
path: root/lib/tdb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb')
-rw-r--r--lib/tdb/pytdb.c6
-rw-r--r--lib/tdb/python/tests/simple.py3
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
index e20c79aa8f..2f0580f1d8 100644
--- a/lib/tdb/pytdb.c
+++ b/lib/tdb/pytdb.c
@@ -414,6 +414,11 @@ static PyObject *obj_get_map_size(PyTdbObject *self, void *closure)
return PyInt_FromLong(tdb_map_size(self->ctx));
}
+static PyObject *obj_get_freelist_size(PyTdbObject *self, void *closure)
+{
+ return PyInt_FromLong(tdb_freelist_size(self->ctx));
+}
+
static PyObject *obj_get_flags(PyTdbObject *self, void *closure)
{
return PyInt_FromLong(tdb_get_flags(self->ctx));
@@ -433,6 +438,7 @@ static PyObject *obj_get_seqnum(PyTdbObject *self, void *closure)
static PyGetSetDef tdb_object_getsetters[] = {
{ (char *)"hash_size", (getter)obj_get_hash_size, NULL, NULL },
{ (char *)"map_size", (getter)obj_get_map_size, NULL, NULL },
+ { (char *)"freelist_size", (getter)obj_get_freelist_size, NULL, NULL },
{ (char *)"flags", (getter)obj_get_flags, NULL, NULL },
{ (char *)"max_dead", NULL, (setter)obj_set_max_dead, NULL },
{ (char *)"filename", (getter)obj_get_filename, NULL, (char *)"The filename of this TDB file."},
diff --git a/lib/tdb/python/tests/simple.py b/lib/tdb/python/tests/simple.py
index 9ef6d2927b..7088235536 100644
--- a/lib/tdb/python/tests/simple.py
+++ b/lib/tdb/python/tests/simple.py
@@ -94,6 +94,9 @@ class SimpleTdbTests(TestCase):
def test_map_size(self):
self.tdb.map_size
+ def test_freelist_size(self):
+ self.tdb.freelist_size
+
def test_name(self):
self.tdb.filename