summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKirill Smelkov <kirr@landau.phys.spbu.ru>2010-09-19 13:53:29 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-09-19 10:03:00 -0700
commit4c726556784643a3c5860ec716e30cc1c7b99ce1 (patch)
tree0c2333e48634792969f9882391c9764b469c8ed9 /lib
parentb3314d6ad8de732f563f095ea538c7b95c667d73 (diff)
downloadsamba-4c726556784643a3c5860ec716e30cc1c7b99ce1.tar.gz
samba-4c726556784643a3c5860ec716e30cc1c7b99ce1.tar.bz2
samba-4c726556784643a3c5860ec716e30cc1c7b99ce1.zip
pytdb: Add support for tdb_freelist_size()
Cc: 597386@bugs.debian.org Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'lib')
-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