File indexing completed on 2024-05-18 08:29:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef _DB_185_H_
0038 #define _DB_185_H_
0039
0040 #include <sys/types.h>
0041
0042 #include <limits.h>
0043
0044 #if defined(__cplusplus)
0045 extern "C" {
0046 #endif
0047
0048
0049
0050
0051
0052
0053 #undef __P
0054 #if defined(__STDC__) || defined(__cplusplus)
0055 #define __P(protos) protos
0056 #else
0057 #define const
0058 #define __P(protos) ()
0059 #endif
0060
0061 #define RET_ERROR -1
0062 #define RET_SUCCESS 0
0063 #define RET_SPECIAL 1
0064
0065 #ifndef __BIT_TYPES_DEFINED__
0066 #define __BIT_TYPES_DEFINED__
0067
0068
0069
0070
0071
0072 #endif
0073
0074
0075
0076
0077
0078 #ifdef __sgi
0079 #define pgno_t db_pgno_t
0080 #endif
0081
0082 #define MAX_PAGE_NUMBER 0xffffffff
0083 typedef u_int32_t pgno_t;
0084 #define MAX_PAGE_OFFSET 65535
0085 typedef u_int16_t indx_t;
0086 #define MAX_REC_NUMBER 0xffffffff
0087 typedef u_int32_t recno_t;
0088
0089
0090 typedef struct {
0091 void *data;
0092 size_t size;
0093 } DBT;
0094
0095
0096 #define R_CURSOR 1
0097 #define __R_UNUSED 2
0098 #define R_FIRST 3
0099 #define R_IAFTER 4
0100 #define R_IBEFORE 5
0101 #define R_LAST 6
0102 #define R_NEXT 7
0103 #define R_NOOVERWRITE 8
0104 #define R_PREV 9
0105 #define R_SETCURSOR 10
0106 #define R_RECNOSYNC 11
0107
0108 typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
0109
0110
0111 typedef struct __db {
0112 DBTYPE type;
0113 int (*close) __P((struct __db *));
0114 int (*del) __P((const struct __db *, const DBT *, u_int));
0115 int (*get) __P((const struct __db *, const DBT *, DBT *, u_int));
0116 int (*put) __P((const struct __db *, DBT *, const DBT *, u_int));
0117 int (*seq) __P((const struct __db *, DBT *, DBT *, u_int));
0118 int (*sync) __P((const struct __db *, u_int));
0119 void *internal;
0120 int (*fd) __P((const struct __db *));
0121 } DB;
0122
0123 #define BTREEMAGIC 0x053162
0124 #define BTREEVERSION 3
0125
0126
0127 typedef struct {
0128 #define R_DUP 0x01
0129 u_int32_t flags;
0130 u_int32_t cachesize;
0131 u_int32_t maxkeypage;
0132 u_int32_t minkeypage;
0133 u_int32_t psize;
0134 int (*compare)
0135 __P((const DBT *, const DBT *));
0136 size_t (*prefix)
0137 __P((const DBT *, const DBT *));
0138 int lorder;
0139 } BTREEINFO;
0140
0141 #define HASHMAGIC 0x061561
0142 #define HASHVERSION 2
0143
0144
0145 typedef struct {
0146 u_int32_t bsize;
0147 u_int32_t ffactor;
0148 u_int32_t nelem;
0149 u_int32_t cachesize;
0150 u_int32_t
0151 (*hash) __P((const void *, size_t));
0152 int lorder;
0153 } HASHINFO;
0154
0155
0156 typedef struct {
0157 #define R_FIXEDLEN 0x01
0158 #define R_NOKEY 0x02
0159 #define R_SNAPSHOT 0x04
0160 u_int32_t flags;
0161 u_int32_t cachesize;
0162 u_int32_t psize;
0163 int lorder;
0164 size_t reclen;
0165 u_char bval;
0166 char *bfname;
0167 } RECNOINFO;
0168
0169
0170 #define dbopen __db185_open
0171
0172 #if defined(__cplusplus)
0173 }
0174 #endif
0175
0176 #endif
0177
0178
0179 #ifndef _DB_EXT_185_PROT_IN_
0180 #define _DB_EXT_185_PROT_IN_
0181
0182 #if defined(__cplusplus)
0183 extern "C" {
0184 #endif
0185
0186 #ifdef _DB185_INT_H_
0187 DB185 *__db185_open __P((const char *, int, int, DBTYPE, const void *));
0188 #else
0189 DB *__db185_open __P((const char *, int, int, DBTYPE, const void *));
0190 #endif
0191
0192 #if defined(__cplusplus)
0193 }
0194 #endif
0195 #endif