From 4c726556784643a3c5860ec716e30cc1c7b99ce1 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Sun, 19 Sep 2010 13:53:29 +0400 Subject: pytdb: Add support for tdb_freelist_size() Cc: 597386@bugs.debian.org Signed-off-by: Kirill Smelkov Signed-off-by: Jelmer Vernooij --- lib/tdb/pytdb.c | 6 ++++++ lib/tdb/python/tests/simple.py | 3 +++ 2 files changed, 9 insertions(+) (limited to 'lib/tdb') 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 -- cgit