document w (wildcard MX) and k (checkpoint interval) options
[unix-history] / usr / src / include / db.h
index 1e0e6dd..e1c81bb 100644 (file)
@@ -4,12 +4,14 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)db.h        5.2 (Berkeley) %G%
+ *     @(#)db.h        5.10 (Berkeley) %G%
  */
 
 #ifndef _DB_H_
 #define        _DB_H_
 
  */
 
 #ifndef _DB_H_
 #define        _DB_H_
 
+#include <sys/cdefs.h>
+
 /* flags for DB.put() call */
 #define        R_IBEFORE       1               /* RECNO */
 #define        R_IAFTER        2               /* RECNO */
 /* flags for DB.put() call */
 #define        R_IBEFORE       1               /* RECNO */
 #define        R_IAFTER        2               /* RECNO */
 
 /* key/data structure -- a data-base thang */
 typedef struct {
 
 /* key/data structure -- a data-base thang */
 typedef struct {
-       char *data;
+       void *data;
        int size;
 } DBT;
 
 /* access method description structure */
        int size;
 } DBT;
 
 /* access method description structure */
-typedef struct {
-       char *internal;         /* access method private; really void * */
-       int (*close)();
-       int (*delete)();
-       int (*get)();
-       int (*put)();
-       int (*seq)();
-       int (*sync)();
+typedef struct __db {
+       void *internal;         /* access method private */
+#define        DB_BTREE        1
+#define        DB_HASH         2
+#define        DB_RECNO        3
+       int type;               /* type of underlying db */
+       int (*close) __P((const struct __db *));
+       int (*del) __P((const struct __db *, const DBT *, unsigned int));
+       int (*get) __P((const struct __db *, DBT *, DBT *, unsigned int));
+       int (*put) __P((const struct __db *, const DBT *, const DBT *,
+               unsigned int));
+       int (*seq) __P((const struct __db *, DBT *, DBT *, unsigned int));
+       int (*sync) __P((const struct __db *));
 } DB;
 
 #define        BTREEMAGIC      0x053162
 } DB;
 
 #define        BTREEMAGIC      0x053162
@@ -61,7 +68,7 @@ typedef struct {
        int bsize;              /* bucket size */
        int ffactor;            /* fill factor */
        int nelem;              /* number of elements */
        int bsize;              /* bucket size */
        int ffactor;            /* fill factor */
        int nelem;              /* number of elements */
-       int ncached;            /* bytes to cache */
+       int cachesize;          /* bytes to cache */
        int (*hash)();          /* hash function */
        int lorder;             /* byte order */
 } HASHINFO;
        int (*hash)();          /* hash function */
        int lorder;             /* byte order */
 } HASHINFO;
@@ -113,17 +120,13 @@ typedef struct {
        ((char *)&(b))[1] = ((char *)&(a))[0]; \
 }
 
        ((char *)&(b))[1] = ((char *)&(a))[0]; \
 }
 
-#include <sys/cdefs.h>
 __BEGIN_DECLS
 DB     *btree_open
 __BEGIN_DECLS
 DB     *btree_open
-           __P((const char *file, int flags, int mode,
-           const BTREEINFO *private));
+           __P((const char *, int, int, const BTREEINFO *));
 DB     *hash_open
 DB     *hash_open
-           __P((const char *file, int flags, int mode,
-           const HASHINFO *private));
+           __P((const char *, int, int, const HASHINFO *));
 DB     *recno_open
 DB     *recno_open
-           __P((const char *file, int flags, int mode,
-           const RECNOINFO *private));
+           __P((const char *, int, int, const RECNOINFO *));
 __END_DECLS
 
 #endif /* !_DB_H_ */
 __END_DECLS
 
 #endif /* !_DB_H_ */