1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 1997,2008 Oracle. All rights reserved. 5 */ 6/* 7 * Copyright (c) 1990, 1993, 1994, 1995, 1996 8 * Keith Bostic. All rights reserved. 9 */ 10/* 11 * Copyright (c) 1990, 1993, 1994 12 * The Regents of the University of California. All rights reserved. 13 * 14 * Redistribution and use in source and binary forms, with or without 15 * modification, are permitted provided that the following conditions 16 * are met: 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. 25 * 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 36 * SUCH DAMAGE. 37 * 38 * $Id: db185_int.in,v 12.7 2008/01/08 20:58:10 bostic Exp $ 39 */ 40 41#ifndef _DB185_INT_H_ 42#define _DB185_INT_H_ 43 44/* Routine flags. */ 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) */ 56 57typedef struct { 58 void *data; /* data */ 59 size_t size; /* data length */ 60} DBT185; 61 62/* Access method description structure. */ 63typedef 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)); 67 int (*get) 68 __P((const struct __db185 *, const DBT185 *, DBT185 *, u_int)); 69 int (*put) 70 __P((const struct __db185 *, DBT185 *, const DBT185 *, u_int)); 71 int (*seq) 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 *)); 76 77 /* 78 * !!! 79 * The following elements added to the end of the DB 1.85 DB 80 * structure. 81 */ 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)); 87} DB185; 88 89/* Structure used to pass parameters to the btree routines. */ 90typedef struct { 91#define R_DUP 0x01 /* duplicate keys */ 92 u_int32_t flags; 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 */ 102} BTREEINFO; 103 104/* Structure used to pass parameters to the hashing routines. */ 105typedef struct { 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 */ 113} HASHINFO; 114 115/* Structure used to pass parameters to the record routines. */ 116typedef struct { 117#define R_FIXEDLEN 0x01 /* fixed-length records */ 118#define R_NOKEY 0x02 /* key not required */ 119#define R_SNAPSHOT 0x04 /* snapshot the input */ 120 u_int32_t flags; 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 */ 127} RECNOINFO; 128#endif /* !_DB185_INT_H_ */ 129 130/* DO NOT EDIT: automatically built by dist/s_include. */ 131#ifndef _DB_EXT_185_PROT_IN_ 132#define _DB_EXT_185_PROT_IN_ 133 134#if defined(__cplusplus) 135extern "C" { 136#endif 137 138#ifdef _DB185_INT_H_ 139DB185 *__db185_open __P((const char *, int, int, DBTYPE, const void *)); 140#else 141DB *__db185_open __P((const char *, int, int, DBTYPE, const void *)); 142#endif 143 144#if defined(__cplusplus) 145} 146#endif 147#endif /* !_DB_EXT_185_PROT_IN_ */ 148