changeset 1633:1d2dc6c74581

mod_storage_gdbm: Add user iterator
author Kim Alvefur <zash@zash.se>
date Wed, 25 Mar 2015 17:45:17 +0100
parents 050d101af207
children 25441bd8b344
files mod_storage_gdbm/mod_storage_gdbm.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_gdbm/mod_storage_gdbm.lua	Wed Mar 25 17:44:03 2015 +0100
+++ b/mod_storage_gdbm/mod_storage_gdbm.lua	Wed Mar 25 17:45:17 2015 +0100
@@ -59,6 +59,14 @@
 	return deserialize(data);
 end
 
+local function g_keys(db, key)
+	return (key == nil and g_first or g_next)(db, key);
+end
+
+function keyval:users()
+	return g_keys, self._db, nil;
+end
+
 local archive = {};
 local archive_mt = { __index = archive, suffix = ".adb" };