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