1 /* Constants and structures from the various Berkeley DB releases.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24 /* This file contains dummy definitions for various constants and
25 structures from the Berkeley release. We only provide those
26 definitions that are actually needed. In case of the structures,
27 we're only interested in the function pointers, since that's the
28 interface to the database. Unfortunately the structures have been
29 changed several times. */
31 /* The value for the btree database type has not been changed (yet?). */
34 /* Permission flags for all 2.x releases. */
35 #define DB2x_RDONLY 0x010000
37 /* The error values for all 2.x releases. */
38 #define DB2x_KEYEXIST ( -3)
39 #define DB2x_NOTFOUND ( -7)
41 /* For all 2.x releases up to 2.6.3 we can use the same definitions.
42 We'll refer to them as 2.4 since that's the version distributed
45 /* Access methods from version 2.4. */
46 #define DB24_FIRST 0x000020
47 #define DB24_NEXT 0x000800
48 #define DB24_NOOVERWRITE 0x001000
50 /* Permission flags from version 2.4. */
51 #define DB24_TRUNCATE 0x080000
53 /* The DB structure from version 2.4. */
57 enum { dummy24
} type
;
94 int (*close
) (void *, uint32_t);
95 int (*cursor
) (void *, void *, void **);
96 int (*del
) (void *, void *, DBT
*, uint32_t);
97 int (*fd
) (void *, int *);
98 int (*get
) (void *, void *, DBT
*, DBT
*, uint32_t);
99 int (*put
) (void *, void *, DBT
*, DBT
*, uint32_t);
100 int (*stat
) (void *, void *, void *(*)(size_t), uint32_t);
101 int (*sync
) (void *, uint32_t);
105 /* The DBC structure for the 2.4 release. */
118 int (*c_get
) (void *, DBT
*, DBT
*, uint32_t);
122 /* The 2.7 release is slighty different. */
124 /* Access methods from version 2.7. */
127 #define DB27_NOOVERWRITE 17
129 /* Permission flags from version 2.7. */
130 #define DB27_TRUNCATE 0x020000
132 /* The DB structure from version 2.7. */
136 enum { dummy27
} type
;
161 int (*am_close
) (void *);
162 int (*close
) (void *, uint32_t);
163 int (*cursor
) (void *, void *, void **, uint32_t);
164 int (*del
) (void *, void *, DBT
*, uint32_t);
165 int (*fd
) (void *, int *);
166 int (*get
) (void *, void *, DBT
*, DBT
*, uint32_t);
167 int (*join
) (void *, void **, uint32_t, void **);
168 int (*put
) (void *, void *, DBT
*, DBT
*, uint32_t);
169 int (*stat
) (void *, void *, void *(*)(size_t), uint32_t);
170 int (*sync
) (void *, uint32_t);
174 /* The DBC structure for version 2.7. */
198 int (*c_get
) (void *, DBT
*, DBT
*, uint32_t);
204 /* Version 3.0 is mostly incompatible with 2.x. */
206 /* Access methods from version 3.0. */
209 #define DB30_NOOVERWRITE 20
211 /* Error values from version 3.0. */
212 #define DB30_KEYEXIST (-30997)
213 #define DB30_NOTFOUND (-30994)
215 /* Permission flags from version 3.0. */
216 #define DB30_RDONLY 0x000010
217 #define DB30_TRUNCATE 0x020000
219 /* The DB structure from version 3.0. */
223 void (*db_feedback
) (void *, int, int);
224 void *(*db_malloc
) (size_t);
225 void *(*db_realloc
) (void *, size_t);
226 int (*dup_compare
) (const DBT
*, const DBT
*);
228 enum { dummy30
} type
;
234 void *saved_open_fhp
;
251 int (*close
) (void *, uint32_t);
252 int (*cursor
) (void *, void *, void **, uint32_t);
253 int (*del
) (void *, void *, DBT
*, uint32_t);
254 void (*err
) (void *, int, const char *, ...);
255 void (*errx
) (void *, const char *, ...);
256 int (*fd
) (void *, int *);
257 int (*get
) (void *, void *, DBT
*, DBT
*, uint32_t);
258 int (*get_byteswapped
) (void *);
259 int (*get_type
) (void *);
260 int (*join
) (void *, void **, void **, uint32_t);
261 int (*open
) (void *, const char *, const char *, int, uint32_t, int);
262 int (*put
) (void *, void *, DBT
*, DBT
*, uint32_t);
263 int (*remove
) (void *, const char *, const char *, uint32_t);
264 int (*set_cachesize
) (void *, uint32_t, uint32_t, int);
265 int (*set_dup_compare
) (void *, int (*)(const DBT
*, const DBT
*));
266 void (*set_errcall
) (void *, void (*)(const char *, char *));
267 void (*set_errfile
) (void *, void *);
268 void (*set_errpfx
) (void *, const char *);
269 void (*set_feedback
) (void *, void (*)(void *, int, int));
270 int (*set_flags
) (void *, uint32_t);
271 int (*set_lorder
) (void *, int);
272 int (*set_malloc
) (void *, void *(*)(size_t));
273 int (*set_pagesize
) (void *, uint32_t);
274 void (*set_paniccall
) (void *, void (*)(void *, int));
275 int (*set_realloc
) (void *, void *(*)(void *, size_t));
276 int (*stat
) (void *, void *, void *(*)(size_t), uint32_t);
277 int (*sync
) (void *, uint32_t);
278 int (*upgrade
) (void *, const char *, uint32_t);
280 int (*set_bt_compare
) (void *, int (*)(const DBT
*, const DBT
*));
281 int (*set_bt_maxkey
) (void *, uint32_t);
282 int (*set_bt_minkey
) (void *, uint32_t);
283 int (*set_bt_prefix
) (void *, size_t (*)(const DBT
*, const DBT
*));
285 int (*set_h_ffactor
) (void *, uint32_t);
286 int (*set_h_hash
) (void *, uint32_t (*)(const void *, uint32_t));
287 int (*set_h_nelem
) (void *, uint32_t);
289 int (*set_re_delim
) (void *, int);
290 int (*set_re_len
) (void *, uint32_t);
291 int (*set_re_pad
) (void *, int);
292 int (*set_re_source
) (void *, const char *);
298 /* The DBC structure from version 3.0. */
308 uint32_t lid
; /* Default process' locker id. */
309 uint32_t locker
; /* Locker for this operation. */
310 DBT lock_dbt
; /* DBT referencing lock. */
324 int (*c_close
) (void *);
325 int (*c_del
) (void *, uint32_t);
326 int (*c_dup
) (void *, void **, uint32_t);
327 int (*c_get
) (void *, DBT
*, DBT
*, uint32_t);
328 int (*c_put
) (void *, DBT
*, DBT
*, uint32_t);
329 int (*c_am_close
) (void *);
330 int (*c_am_destroy
) (void *);