From: ian Date: Sun, 5 Feb 2006 14:00:47 +0000 (+0000) Subject: lookup wip; see cvs diff from 1.12 before checkin X-Git-Tag: debian/1.1.1~70 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b5088d0a8e4fce7bd69a378bb4114f45e13f7242;p=chiark-tcl.git lookup wip; see cvs diff from 1.12 before checkin --- diff --git a/cdb/writeable.c b/cdb/writeable.c index 3613a7b..14d81ad 100644 --- a/cdb/writeable.c +++ b/cdb/writeable.c @@ -92,15 +92,14 @@ static void ht_maybeupdate(HashTable *ht, const char *key, Tcl_SetHashValue(he, val_eat); } -static fixme ht_lookup(HashTable *ht, const char *key) { +static const HashValue *ht_lookup(HashTable *ht, const char *key) { Tcl_HashEntry *he; const HashValue *htv; he= Tcl_FindHashEntry(ht, key); - if (!he) return notfound; - - htv= Tcl_GetHashValue(he); + if (!he) return 0; + return Tcl_GetHashValue(he); } static int ht_forall(HashTable *ht, @@ -849,7 +848,14 @@ int cht_do_cdbwr_delete(ClientData cd, Tcl_Interp *ip, void *rw_v, /*---------- Lookups ----------*/ static int lookup(Tcl_Interp *ip, Rw *rw, const char *key, ) { - ht_lookup( + const HashValue val; + + val= ht_lookup(&rw->logincore, key); + if (!val) { + cdb_ &rw->cdb + + return notfound; + int cht_do_cdbwr_lookup(ClientData cd, Tcl_Interp *ip, void *db, const char *key, Tcl_Obj *def, Tcl_Obj **result) {