summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/tdb/tdb.py')
-rw-r--r--source4/lib/tdb/tdb.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/lib/tdb/tdb.py b/source4/lib/tdb/tdb.py
index d4cf9f5c6f..8566397ed3 100644
--- a/source4/lib/tdb/tdb.py
+++ b/source4/lib/tdb/tdb.py
@@ -108,6 +108,20 @@ class tdb(object):
def has_key(self, key):
return self.exists(key) != 0
+ def fetch_uint32(self, key):
+ data = self.fetch(key)
+ if data is None:
+ return None
+ import struct
+ return struct.unpack("<L", data)[0]
+
+ def fetch_int32(self, key):
+ data = self.fetch(key)
+ if data is None:
+ return None
+ import struct
+ return struct.unpack("<l", data)[0]
+
class TdbIterator:
def __init__(self, tdb):