-
Notifications
You must be signed in to change notification settings - Fork 12
/
ndbm.h
47 lines (40 loc) · 1.05 KB
/
ndbm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* This set of data base routines was ripped off from the Unix standard ones,
with a few changes: data base entries aren't (key,value) pairs, they are
simply datum's which have two imbedded longs which for the value. Also,
you can deal with multiple data bases */
#define PBLKSIZ 4096 /* Page block size */
#define DBLKSIZ 4096 /* directory block size */
#define BYTESIZ 8 /* bits per byte */
typedef struct {
long bitno;
long maxbno;
long blkno;
long hmask;
long oldpagb;
long olddirb;
char pagbuf[PBLKSIZ];
char dirbuf[DBLKSIZ];
int dirf;
int pagf;
int datf;
char *dbnm,
*dirnm,
*datnm,
*pagnm;
int dbrdonly;
} database;
database * lastdatabase;
typedef struct {
char *dptr;
int dsize;
long val1,
val2;
} datum;
datum fetch ();
datum makdatum ();
datum firstkey ();
datum nextkey ();
datum firsthash ();
long calchash ();
long hashinc ();
database *open_db ();