dbm/ndbm notes and some code.

Ozan Yigit oz at yunexus.UUCP
Sat May 13 13:04:43 AEST 1989


In article <6847 at cbmvax.UUCP> grr at cbmvax.UUCP (George Robbins) writes:

>Say what?  Where are you going to save this potentially unbounded list of
>to be deleted keys?  Surely there is a better solution???

Right !!! :-) [I said there was a workaround. I did not say "practical"]
Actually, The solution is to simply watch (using the terminology of
ndbm.h) dbm_keyptr for deletions, and backspace it when the key
to be deleted is the one pointed by dbm_keyptr. So, when the dbm_nextkey
comes along and increments it, it will find the key now occupying the spot
of the deleted key. the "delpair" routine I posted has the very same
position adjustment.

oz
-- 
use the source, luke !!     	        Usenet:    oz at nexus.yorku.ca
uh... we forgot to tell you...          ......!uunet!utai!yunexus!oz
it is unintelligible, but hey, you      Bitnet: oz@[yulibra|yuyetti]
got it, for free (!).                   Phonet: +1 416 736-5257x3976



More information about the Comp.lang.c mailing list