Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / xcvs / dist / src / myndbm.h
bloba3d807c58fc792ac392e4b09b10a15676fac340b
1 /*
2 * Copyright (C) 1994-2005 The Free Software Foundation, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifdef MY_NDBM
17 #define DBLKSIZ 4096
19 typedef struct
21 List *dbm_list; /* cached database */
22 Node *dbm_next; /* next key to return for nextkey() */
24 /* Name of the file to write to if modified is set. malloc'd. */
25 char *name;
27 /* Nonzero if the database has been modified and dbm_close needs to
28 write it out to disk. */
29 int modified;
30 } DBM;
32 typedef struct
34 char *dptr;
35 int dsize;
36 } datum;
39 * So as not to conflict with other dbm_open, etc., routines that may
40 * be included by someone's libc, all of my emulation routines are prefixed
41 * by "my" and we define the "standard" ones to be "my" ones here.
43 #define dbm_open mydbm_open
44 #define dbm_close mydbm_close
45 #define dbm_fetch mydbm_fetch
46 #define dbm_firstkey mydbm_firstkey
47 #define dbm_nextkey mydbm_nextkey
48 #define dbm_store mydbm_store
49 #define DBM_INSERT 0
50 #define DBM_REPLACE 1
52 DBM *mydbm_open (char *file, int flags, int mode);
53 void mydbm_close (DBM * db);
54 datum mydbm_fetch (DBM * db, datum key);
55 datum mydbm_firstkey (DBM * db);
56 datum mydbm_nextkey (DBM * db);
57 extern int mydbm_store (DBM *, datum, datum, int);
59 #endif /* MY_NDBM */