diff --git a/lib/modules/Yabu.pmod/module.pmod b/lib/modules/Yabu.pmod/module.pmod index c686bc1ae385e5d5e272f226936d7958f7fd3005..7a10cd6752e7fb97843dd49310b81e8df4a88ad4 100644 --- a/lib/modules/Yabu.pmod/module.pmod +++ b/lib/modules/Yabu.pmod/module.pmod @@ -4,7 +4,7 @@ * associated with a unique key. */ -constant cvs_id = "$Id: module.pmod,v 1.18 2000/01/29 12:37:31 noring Exp $"; +constant cvs_id = "$Id: module.pmod,v 1.19 2000/02/15 14:28:14 noring Exp $"; #define ERR(msg) throw(({ "(Yabu) "+msg+"\n", backtrace() })) #define IO_ERR(msg) throw(({ sprintf("(Yabu) %s, %s (%d)\n",msg,strerror(errno()),errno()),backtrace() })) @@ -85,7 +85,8 @@ static private class ProcessLock { if(!rm(lock_file)) ERR("Lock removal failure (insufficient permissions?)"); - sleep(10); + + sleep(has_value(mode, "Q") ? 0.5 : 10); } ERR("Lock tryout error (insufficient permissions?)"); } @@ -609,6 +610,11 @@ class Transaction { return list_keys(); } + array _values() + { + return map(_indices(), `[]); + } + void create(object table_in, int id_in, object keep_ref_in) { table = table_in; @@ -947,6 +953,11 @@ class Table { return list_keys(); } + array _values() + { + return map(_indices(), `[]); + } + mapping(string:string|int) statistics() { LOCK(); @@ -1066,6 +1077,11 @@ class _Table { return list_keys(); } + array _values() + { + return map(_indices(), `[]); + } + void destroy() { if(table_destroyed) @@ -1201,6 +1217,11 @@ class db { return list_tables(); } + array _values() + { + return map(_indices(), `[]); + } + /* Remove maximum one level of directories and files. */ static private void level2_rm(string f) { diff --git a/lib/modules/Yabu.pmod/test.pike b/lib/modules/Yabu.pmod/test.pike index a414c45eb179da49740c9142fc5d4759eae8d686..29ffde9f5dbb1974cfbb704219aab41b7de9d954 100644 --- a/lib/modules/Yabu.pmod/test.pike +++ b/lib/modules/Yabu.pmod/test.pike @@ -42,7 +42,9 @@ int main(int argc, array argv) object transaction = table->transaction(); if(!equal(indices(table), ({ "Blixt" }))) - ERR("Table diff #1!"); + ERR("Table diff #1A!"); + if(!equal(values(table), ({ "Gordon" }))) + ERR("Table diff #1B!"); if(!equal(indices(transaction), ({ "Blixt" }))) ERR("Table diff #2!");