Commit | Line | Data |
---|---|---|
61455e43 | 1 | /*- |
56559b70 KB |
2 | * Copyright (c) 1990, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
bb0cfa24 | 4 | * |
61455e43 KB |
5 | * This code is derived from software contributed to Berkeley by |
6 | * Margo Seltzer. | |
7 | * | |
8 | * %sccs.include.redist.c% | |
9 | * | |
56559b70 | 10 | * @(#)ndbm.h 8.1 (Berkeley) %G% |
d1e097f8 | 11 | */ |
d1e097f8 | 12 | |
d2b7358e KB |
13 | #ifndef _NDBM_H_ |
14 | #define _NDBM_H_ | |
15 | ||
61455e43 | 16 | #include <db.h> |
d1e097f8 | 17 | |
08c3f9eb | 18 | /* Map dbm interface onto db(3). */ |
61455e43 | 19 | #define DBM_RDONLY O_RDONLY |
2a683113 | 20 | |
61455e43 KB |
21 | /* Flags to dbm_store(). */ |
22 | #define DBM_INSERT 0 | |
23 | #define DBM_REPLACE 1 | |
3b3806ff | 24 | |
08c3f9eb KB |
25 | /* |
26 | * The db(3) support for ndbm(3) always appends this suffix to the | |
27 | * file name to avoid overwriting the user's original database. | |
28 | */ | |
29 | #define DBM_SUFFIX ".db" | |
30 | ||
d1e097f8 | 31 | typedef struct { |
61455e43 KB |
32 | char *dptr; |
33 | int dsize; | |
d1e097f8 RC |
34 | } datum; |
35 | ||
61455e43 | 36 | typedef DB DBM; |
62fdd556 | 37 | #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE |
61455e43 KB |
38 | |
39 | __BEGIN_DECLS | |
40 | void dbm_close __P((DBM *)); | |
41 | int dbm_delete __P((DBM *, datum)); | |
42 | datum dbm_fetch __P((DBM *, datum)); | |
43 | datum dbm_firstkey __P((DBM *)); | |
44 | long dbm_forder __P((DBM *, datum)); | |
45 | datum dbm_nextkey __P((DBM *)); | |
46 | DBM *dbm_open __P((const char *, int, int)); | |
47 | int dbm_store __P((DBM *, datum, datum, int)); | |
62fdd556 | 48 | int dbm_dirfno __P((DBM *)); |
61455e43 | 49 | __END_DECLS |
d2b7358e KB |
50 | |
51 | #endif /* !_NDBM_H_ */ |