2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997-2009 Oracle. All rights reserved.
7 * Copyright (c) 1990, 1993, 1994, 1995, 1996
8 * Keith Bostic. All rights reserved.
11 * Copyright (c) 1990, 1993, 1994
12 * The Regents of the University of California. All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 #define R_CURSOR 1 /* del, put, seq */
46 #define __R_UNUSED 2 /* UNUSED */
47 #define R_FIRST 3 /* seq */
48 #define R_IAFTER 4 /* put (RECNO) */
49 #define R_IBEFORE 5 /* put (RECNO) */
50 #define R_LAST 6 /* seq (BTREE, RECNO) */
51 #define R_NEXT 7 /* seq */
52 #define R_NOOVERWRITE 8 /* put */
53 #define R_PREV 9 /* seq (BTREE, RECNO) */
54 #define R_SETCURSOR 10 /* put (RECNO) */
55 #define R_RECNOSYNC 11 /* sync (RECNO) */
58 void *data; /* data */
59 size_t size; /* data length */
62 /* Access method description structure. */
63 typedef struct __db185 {
64 DBTYPE type; /* Underlying db type. */
65 int (*close) __P((struct __db185 *));
66 int (*del) __P((const struct __db185 *, const DBT185 *, u_int));
68 __P((const struct __db185 *, const DBT185 *, DBT185 *, u_int));
70 __P((const struct __db185 *, DBT185 *, const DBT185 *, u_int));
72 __P((const struct __db185 *, DBT185 *, DBT185 *, u_int));
73 int (*sync) __P((const struct __db185 *, u_int));
74 DB *dbp; /* DB structure. Was void *internal. */
75 int (*fd) __P((const struct __db185 *));
79 * The following elements added to the end of the DB 1.85 DB
82 DBC *dbc; /* DB cursor. */
83 /* Various callback functions. */
84 int (*compare) __P((const DBT185 *, const DBT185 *));
85 size_t (*prefix) __P((const DBT185 *, const DBT185 *));
86 u_int32_t (*hash) __P((const void *, size_t));
89 /* Structure used to pass parameters to the btree routines. */
91 #define R_DUP 0x01 /* duplicate keys */
93 u_int32_t cachesize; /* bytes to cache */
94 u_int32_t maxkeypage; /* maximum keys per page */
95 u_int32_t minkeypage; /* minimum keys per page */
96 u_int32_t psize; /* page size */
97 int (*compare) /* comparison function */
98 __P((const DBT185 *, const DBT185 *));
99 size_t (*prefix) /* prefix function */
100 __P((const DBT185 *, const DBT185 *));
101 int lorder; /* byte order */
104 /* Structure used to pass parameters to the hashing routines. */
106 u_int32_t bsize; /* bucket size */
107 u_int32_t ffactor; /* fill factor */
108 u_int32_t nelem; /* number of elements */
109 u_int32_t cachesize; /* bytes to cache */
110 u_int32_t /* hash function */
111 (*hash) __P((const void *, size_t));
112 int lorder; /* byte order */
115 /* Structure used to pass parameters to the record routines. */
117 #define R_FIXEDLEN 0x01 /* fixed-length records */
118 #define R_NOKEY 0x02 /* key not required */
119 #define R_SNAPSHOT 0x04 /* snapshot the input */
121 u_int32_t cachesize; /* bytes to cache */
122 u_int32_t psize; /* page size */
123 int lorder; /* byte order */
124 size_t reclen; /* record length (fixed-length records) */
125 u_char bval; /* delimiting byte (variable-length records */
126 char *bfname; /* btree file name */
128 #endif /* !_DB185_INT_H_ */