2 * See the file LICENSE for redistribution information.
5 * Sleepycat Software. All rights reserved.
8 * Copyright (c) 1990, 1993, 1994, 1995, 1996
9 * Keith Bostic. All rights reserved.
12 * Copyright (c) 1990, 1993, 1994
13 * The Regents of the University of California. All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. All advertising materials mentioning features or use of this software
24 * must display the following acknowledgement:
25 * This product includes software developed by the University of
26 * California, Berkeley and its contributors.
27 * 4. Neither the name of the University nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
31 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * @(#)db185_int.h 8.4 (Sleepycat) 7/27/97
50 #define R_CURSOR 1 /* del, put, seq */
51 #define __R_UNUSED 2 /* UNUSED */
52 #define R_FIRST 3 /* seq */
53 #define R_IAFTER 4 /* put (RECNO) */
54 #define R_IBEFORE 5 /* put (RECNO) */
55 #define R_LAST 6 /* seq (BTREE, RECNO) */
56 #define R_NEXT 7 /* seq */
57 #define R_NOOVERWRITE 8 /* put */
58 #define R_PREV 9 /* seq (BTREE, RECNO) */
59 #define R_SETCURSOR 10 /* put (RECNO) */
60 #define R_RECNOSYNC 11 /* sync (RECNO) */
63 void *data; /* data */
64 size_t size; /* data length */
67 /* Access method description structure. */
68 typedef struct __db185 {
69 DBTYPE type; /* Underlying db type. */
70 int (*close) __P((struct __db185 *));
71 int (*del) __P((const struct __db185 *, const DBT185 *, u_int));
73 __P((const struct __db185 *, const DBT185 *, DBT185 *, u_int));
75 __P((const struct __db185 *, DBT185 *, const DBT185 *, u_int));
77 __P((const struct __db185 *, DBT185 *, DBT185 *, u_int));
78 int (*sync) __P((const struct __db185 *, u_int));
79 void *internal; /* Access method private. */
80 int (*fd) __P((const struct __db185 *));
84 * Added to the end of the DB 1.85 DB structure, it's needed to
85 * hold the DB 2.0 cursor used for DB 1.85 sequential operations.
87 DBC *dbc; /* DB 1.85 sequential cursor. */
90 /* Structure used to pass parameters to the btree routines. */
92 #define R_DUP 0x01 /* duplicate keys */
94 u_int cachesize; /* bytes to cache */
95 int maxkeypage; /* maximum keys per page */
96 int minkeypage; /* minimum keys per page */
97 u_int psize; /* page size */
98 int (*compare) /* comparison function */
99 __P((const DBT *, const DBT *));
100 size_t (*prefix) /* prefix function */
101 __P((const DBT *, const DBT *));
102 int lorder; /* byte order */
105 /* Structure used to pass parameters to the hashing routines. */
107 u_int bsize; /* bucket size */
108 u_int ffactor; /* fill factor */
109 u_int nelem; /* number of elements */
110 u_int cachesize; /* bytes to cache */
111 u_int32_t /* hash function */
112 (*hash) __P((const void *, size_t));
113 int lorder; /* byte order */
116 /* Structure used to pass parameters to the record routines. */
118 #define R_FIXEDLEN 0x01 /* fixed-length records */
119 #define R_NOKEY 0x02 /* key not required */
120 #define R_SNAPSHOT 0x04 /* snapshot the input */
122 u_int cachesize; /* bytes to cache */
123 u_int psize; /* page size */
124 int lorder; /* byte order */
125 size_t reclen; /* record length (fixed-length records) */
126 u_char bval; /* delimiting byte (variable-length records */
127 char *bfname; /* btree file name */
130 #if defined(__cplusplus)
133 DB185 *__dbopen __P((const char *, int, int, DBTYPE, const void *));
134 DB185 *dbopen __P((const char *, int, int, DBTYPE, const void *));
135 #if defined(__cplusplus)
138 #endif /* !_DB185_H_ */