[mod.sources] Submission for mod.sources

sources-request@panda.UUCP (01/11/86)

Mod.sources:  Volume 3, Issue 86
Submitted by: genrad!mit-eddie!mirror!rs (Rich Salz)


At least on the distributed 4.2 there is no lint library specification
for the DBM library.  Here's one.

--
Rich $alz	{mit-eddie, ihnp4!inmet, wjh12, cca, datacube}!mirror!rs
Mirror Systems	2067 Massachusetts Avenue  Cambridge, MA, 02140
Telephone:	6,176,610,777

# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by mirror!rs on Wed Dec  4 17:00:49 EST 1985
# Contents:  llib-ldbm
 
echo x - llib-ldbm
sed 's/^XX//' > "llib-ldbm" <<'@//E*O*F llib-ldbm//'
XX/*
XXstatic char sccsid[] = "@(#)dbm.c	4.1 (Berkeley) 6/27/83";
XX*/

XX#include	"dbm.h"
XX#include	<sys/types.h>
XX#include	<sys/stat.h>

XX/* initialize the data. */
XXlong bitno = 1;
XXlong maxbno = 1;
XXlong blkno = 1;
XXlong hmask = 1;
XXint dirf = 1;
XXint pagf = 1;
XXint dbrdonly = 1;

XX/* needed herein. */
XXstatic datum __data__;

XXdbminit(file)
XX    char *file;
XX    { return(pagbuf[0] = dirbuf[0] = *file); }

XXlong forder(key)
XX    datum key;
XX    { return(key.dsize); }

XXdatum fetch(key)
XX    datum key;
XX    { return(key); }

XXdelete(key)
XX    datum key;
XX    { blkno = key.dsize; }

XXstore(key, dat)
XX    datum key, dat;
XX    { key = dat; }

XXdatum firstkey()
XX    { return(__data__); }

XXdatum nextkey(key)
XX    datum key;
XX    { return(key); }

XXdatum firsthash(hash)
XX    long hash;
XX    { return(blkno = hash, __data__); }

XXdatum makdatum(buf, n)
XX    char buf[PBLKSIZ];
XX    { return(__data__.dptr = buf+n, __data__); }

XXcmpdatum(d1, d2)
XX    datum d1, d2;
XX    { return(d1.dsize - d2.dsize); }

XXlong hashinc(hash)
XX    long hash;
XX    { return(hash); }

XXlong calchash(item)
XX    datum item;
XX    { return(item.dsize); }
@//E*O*F llib-ldbm//
chmod u=rw,g=rw,o=rw llib-ldbm
 
exit 0