mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
[t:4575] Undo merge. {{{svn merge -r -40368 .}}}. Refs #4575.
git-svn-id: file:///svn/toku/tokudb@40369 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
85994d4252
commit
6ff114b7ed
22 changed files with 3685 additions and 18 deletions
|
@ -1,3 +1,16 @@
|
|||
# How to build db.h_4_4
|
||||
# 1. cd ../../berkeleydb/db-4.4.20; ../dist/configure; make; make install
|
||||
# 2. on both 32 and 64 bit architectures
|
||||
# make sample_offsets_4_4
|
||||
# 3. gather the sample_offsets_32/64_4_4.h files into a single directory
|
||||
# 4. make db.h_4_4
|
||||
#
|
||||
# How to build all of the db.h files
|
||||
# 1. install all of the bdb's
|
||||
# 2. make samples
|
||||
# 3. gather the generated sample_offsets header files
|
||||
# 4. make hs
|
||||
|
||||
BDB = 4_6
|
||||
BDBDIR = ../../../berkeleydb
|
||||
MYSQL_H = -I$(BDBDIR)/db-4.1.25/build_unix/
|
||||
|
@ -10,12 +23,83 @@ endif
|
|||
CFLAGS = $(GCC_VERSION_SPECIFIC_WARNINGS) -Wall -W -Werror -g $(OPTFLAGS)
|
||||
CPPFLAGS = -I. -I../toku_include
|
||||
|
||||
default: ../include/db.h
|
||||
runs: runs_mysql runs_installed
|
||||
samples: sample_offsets_4_6 sample_offsets_4_5 sample_offsets_4_4 sample_offsets_4_3 sample_offsets_4_1
|
||||
hs: db.h_4_6 db.h_4_5 db.h_4_4 db.h_4_3 db.h_4_1 tdb.h
|
||||
# the mysql versions use the header in the mysql distribution.
|
||||
runs_mysql: ./sample_offsets_mysql
|
||||
./sample_offsets_mysql
|
||||
runs_installed: sample_offsets
|
||||
./sample_offsets
|
||||
sample_offsets_mysql: CPPFLAGS+=$(MYSQL_H)
|
||||
sample_offsets_mysql: sample_offsets.c
|
||||
$(CC) $(CFLAGS) -I../toku_include $(CPPFLAGS) $< -o $@
|
||||
|
||||
../include/db.h: make_tdb
|
||||
./make_tdb > $@
|
||||
make_db_h_4_1.o: make_db_h.c sample_offsets_32_4_1.h sample_offsets_64_4_1.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.1.25/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=1 -DTDB_NATIVE=0
|
||||
db.h_4_1: make_db_h_4_1
|
||||
./make_db_h_4_1 > $@
|
||||
sample_offsets_4_1: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.1.25/build_unix $< -o $@
|
||||
./sample_offsets_4_1
|
||||
|
||||
hfiles: tdb.h
|
||||
make_db_h_4_3.o: make_db_h.c sample_offsets_32_4_3.h sample_offsets_64_4_3.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.3.29/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=3 -DTDB_NATIVE=0
|
||||
db.h_4_3: make_db_h_4_3
|
||||
./make_db_h_4_3 > $@
|
||||
sample_offsets_4_3: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.3.29/build_unix $< -o $@
|
||||
./sample_offsets_4_3
|
||||
|
||||
make_db_h_4_4.o: make_db_h.c sample_offsets_32_4_4.h sample_offsets_64_4_4.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.4.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=4 -DTDB_NATIVE=0
|
||||
db.h_4_4: make_db_h_4_4
|
||||
./make_db_h_4_4 > $@
|
||||
sample_offsets_4_4: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.4.20/build_unix $< -o $@
|
||||
./sample_offsets_4_4
|
||||
|
||||
make_db_h_4_5.o: make_db_h.c sample_offsets_32_4_5.h sample_offsets_64_4_5.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.5.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=5 -DTDB_NATIVE=0
|
||||
db.h_4_5: make_db_h_4_5
|
||||
./make_db_h_4_5 > $@
|
||||
sample_offsets_4_5: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.5.20/build_unix $< -o $@
|
||||
./sample_offsets_4_5
|
||||
|
||||
make_db_h_4_6.o: make_db_h.c sample_offsets_32_4_6.h sample_offsets_64_4_6.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6 -DTDB_NATIVE=0
|
||||
db.h_4_6: make_db_h_4_6
|
||||
./make_db_h_4_6 > $@
|
||||
sample_offsets_4_6: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.6.19/build_unix $< -o $@
|
||||
./sample_offsets_4_6
|
||||
|
||||
make_tdb_h.o: make_db_h.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6 -DTDB_NATIVE=1
|
||||
tdb.h: make_tdb_h
|
||||
./make_tdb_h > $@
|
||||
|
||||
sample_offsets: CPPFLAGS+=-I../toku_include
|
||||
sample_offsets_local: ./db.h
|
||||
sample_offsets_local: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -DLOCAL $< -o $@
|
||||
|
||||
hfiles: db.h_4_1 db.h_4_3 db.h_4_4 db.h_4_5 db.h_4_6 tdb.h
|
||||
|
||||
check32: sample_offsets_local
|
||||
./sample_offsets_local
|
||||
diff sample_offsets_local.h sample_offsets_32.h
|
||||
|
||||
clean:
|
||||
rm -f *.o make_tdb
|
||||
rm -f sample_offsets_mysql sample_offsets sample_offsets_?_? *.o make_db_h_?_?
|
||||
install: tdb.h
|
||||
cp tdb.h ../include/db.h
|
||||
install_bdb_compatible: db.h_$(BDB)
|
||||
cp db.h_$(BDB) ../include/db.h
|
||||
|
||||
# Note: To make the compile work, you must cd to the ../../berkeleydb/db-4.1.25/build_unix
|
||||
# and do ../dist/configure
|
||||
|
||||
# to build mysql-5.0.27 with berkeley db 4.1.25
|
||||
# ./configure --with-berkeley-db=../../berkeleydb/db-4.1.25/build_unix
|
||||
|
|
465
buildheader/db.h_4_1
Normal file
465
buildheader/db.h_4_1
Normal file
|
@ -0,0 +1,465 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
#define TOKUDB 1
|
||||
#define TOKUDB_NATIVE_H 0
|
||||
#define DB_VERSION_MAJOR 4
|
||||
#define DB_VERSION_MINOR 1
|
||||
#define DB_VERSION_PATCH 25
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERSION_STRING "Tokutek: TokuDB 4.1.25"
|
||||
#else
|
||||
#define DB_VERSION_STRING_ydb "Tokutek: TokuDB (wrapped bdb)"
|
||||
#endif
|
||||
#ifndef TOKU_OFF_T_DEFINED
|
||||
#define TOKU_OFF_T_DEFINED
|
||||
typedef int64_t toku_off_t;
|
||||
#endif
|
||||
#define DB_GID_SIZE 128
|
||||
typedef struct __toku_db_env DB_ENV;
|
||||
typedef struct __toku_db_key_range DB_KEY_RANGE;
|
||||
typedef struct __toku_db_lsn DB_LSN;
|
||||
typedef struct __toku_db DB;
|
||||
typedef struct __toku_db_txn DB_TXN;
|
||||
typedef struct __toku_db_txn_active DB_TXN_ACTIVE;
|
||||
typedef struct __toku_db_txn_stat DB_TXN_STAT;
|
||||
typedef struct __toku_dbc DBC;
|
||||
typedef struct __toku_dbt DBT;
|
||||
typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_PREPLIST;
|
||||
typedef u_int32_t db_recno_t;
|
||||
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
|
||||
#include <tdb-internal.h>
|
||||
#ifndef __BIGGEST_ALIGNMENT__
|
||||
#define __BIGGEST_ALIGNMENT__ 16
|
||||
#endif
|
||||
typedef struct __toku_db_btree_stat64 {
|
||||
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
|
||||
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
|
||||
u_int64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */
|
||||
u_int64_t bt_fsize; /* how big is the underlying file */
|
||||
u_int64_t bt_create_time_sec; /* Creation time, in seconds */
|
||||
u_int64_t bt_modify_time_sec; /* Time of last serialization, in seconds */
|
||||
u_int64_t bt_verify_time_sec; /* Time of last verification, in seconds */
|
||||
} DB_BTREE_STAT64;
|
||||
typedef struct __toku_loader DB_LOADER;
|
||||
struct __toku_loader_internal;
|
||||
struct __toku_loader {
|
||||
struct __toku_loader_internal *i;
|
||||
int (*set_error_callback)(DB_LOADER *loader, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_LOADER *loader, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*put)(DB_LOADER *loader, DBT *key, DBT* val); /* give a row to the loader */
|
||||
int (*close)(DB_LOADER *loader); /* finish loading, free memory */
|
||||
int (*abort)(DB_LOADER *loader); /* abort loading, free memory */
|
||||
};
|
||||
typedef struct __toku_indexer DB_INDEXER;
|
||||
struct __toku_indexer_internal;
|
||||
struct __toku_indexer {
|
||||
struct __toku_indexer_internal *i;
|
||||
int (*set_error_callback)(DB_INDEXER *indexer, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_INDEXER *indexer, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*build)(DB_INDEXER *indexer); /* build the indexes */
|
||||
int (*close)(DB_INDEXER *indexer); /* finish indexing, free memory */
|
||||
int (*abort)(DB_INDEXER *indexer); /* abort indexing, free memory */
|
||||
};
|
||||
typedef enum {
|
||||
FS_GREEN = 0, // green zone (we have lots of space)
|
||||
FS_YELLOW = 1, // yellow zone (issue warning but allow operations)
|
||||
FS_RED = 2, // red zone (prevent insert operations)
|
||||
FS_BLOCKED = 3 // For reporting engine status, completely blocked
|
||||
} fs_redzone_state;
|
||||
typedef enum {
|
||||
FS_STATE = 0, // interpret as file system state (redzone) enum
|
||||
UINT64, // interpret as uint64_t
|
||||
CHARSTR, // interpret as char *
|
||||
UNIXTIME, // interpret as time_t
|
||||
TOKUTIME // interpret as tokutime_t
|
||||
} toku_engine_status_display_type;
|
||||
typedef struct __toku_engine_status_row {
|
||||
char * keyname; // info schema key, should not change across revisions without good reason
|
||||
char * legend; // the text that will appear at user interface
|
||||
toku_engine_status_display_type type; // how to interpret the value
|
||||
union {
|
||||
uint64_t num;
|
||||
char * str;
|
||||
} value;
|
||||
} * TOKU_ENGINE_STATUS_ROW, TOKU_ENGINE_STATUS_ROW_S;
|
||||
typedef enum {
|
||||
DB_BTREE=1,
|
||||
DB_UNKNOWN=5
|
||||
} DBTYPE;
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERB_DEADLOCK 2
|
||||
#define DB_VERB_RECOVERY 4
|
||||
#define DB_VERB_REPLICATION 8
|
||||
#define DB_VERB_WAITSFOR 16
|
||||
#define DB_ARCH_ABS 1
|
||||
#define DB_ARCH_LOG 4
|
||||
#define DB_CREATE 1
|
||||
#define DB_CXX_NO_EXCEPTIONS 2
|
||||
#define DB_EXCL 2048
|
||||
#define DB_PRIVATE 262144
|
||||
#define DB_RDONLY 16
|
||||
#define DB_RECOVER 32
|
||||
#define DB_RUNRECOVERY -30982
|
||||
#define DB_THREAD 64
|
||||
#define DB_TXN_NOSYNC 256
|
||||
#define DB_LOCK_DEFAULT 1
|
||||
#define DB_LOCK_OLDEST 6
|
||||
#define DB_LOCK_RANDOM 7
|
||||
#define DB_KEYFIRST 16
|
||||
#define DB_KEYLAST 17
|
||||
#define DB_NOOVERWRITE 23
|
||||
#define DB_NODUPDATA 22
|
||||
#define DB_NOOVERWRITE_NO_ERROR 1
|
||||
#define DB_OPFLAGS_MASK 255
|
||||
#define DB_AUTO_COMMIT 8388608
|
||||
#define DB_INIT_LOCK 4096
|
||||
#define DB_INIT_LOG 8192
|
||||
#define DB_INIT_MPOOL 16384
|
||||
#define DB_INIT_TXN 32768
|
||||
#define DB_KEYEXIST -30997
|
||||
#define DB_LOCK_DEADLOCK -30996
|
||||
#define DB_LOCK_NOTGRANTED -30995
|
||||
#define DB_NOTFOUND -30991
|
||||
#define DB_SECONDARY_BAD -30981
|
||||
#define DB_DONOTINDEX -30999
|
||||
#define DB_BADFORMAT -30500
|
||||
#define DB_DELETE_ANY 65536
|
||||
#define DB_TRUNCATE_WITHCURSORS 131072
|
||||
#define DB_FIRST 10
|
||||
#define DB_LAST 18
|
||||
#define DB_CURRENT 8
|
||||
#define DB_NEXT 19
|
||||
#define DB_NEXT_NODUP 21
|
||||
#define DB_PREV 27
|
||||
#define DB_PREV_NODUP 28
|
||||
#define DB_SET 30
|
||||
#define DB_SET_RANGE 32
|
||||
#define DB_CURRENT_BINDING 253
|
||||
#define DB_SET_RANGE_REVERSE 252
|
||||
#define DB_RMW 1073741824
|
||||
#define DB_IS_RESETTING_OP 0x01000000
|
||||
#define DB_PRELOCKED 0x00800000
|
||||
#define DB_PRELOCKED_WRITE 0x00400000
|
||||
#define DB_IS_HOT_INDEX 0x00100000
|
||||
#define DBC_DISABLE_PREFETCHING 0x20000000
|
||||
#define DB_DBT_APPMALLOC 1
|
||||
#define DB_DBT_DUPOK 64
|
||||
#define DB_DBT_MALLOC 4
|
||||
#define DB_DBT_REALLOC 16
|
||||
#define DB_DBT_USERMEM 32
|
||||
#define DB_TXN_WRITE_NOSYNC 524288
|
||||
#define DB_TXN_NOWAIT 2048
|
||||
#define DB_TXN_SYNC 4096
|
||||
#define DB_TXN_SNAPSHOT 1
|
||||
#define DB_READ_UNCOMMITTED 2
|
||||
#define DB_READ_COMMITTED 4
|
||||
#define DB_INHERIT_ISOLATION 8
|
||||
#define DB_SERIALIZABLE 16
|
||||
#endif
|
||||
/* TOKUDB specific error codes */
|
||||
#define TOKUDB_OUT_OF_LOCKS -100000
|
||||
#define TOKUDB_SUCCEEDED_EARLY -100001
|
||||
#define TOKUDB_FOUND_BUT_REJECTED -100002
|
||||
#define TOKUDB_USER_CALLBACK_ERROR -100003
|
||||
#define TOKUDB_DICTIONARY_TOO_OLD -100004
|
||||
#define TOKUDB_DICTIONARY_TOO_NEW -100005
|
||||
#define TOKUDB_DICTIONARY_NO_HEADER -100006
|
||||
#define TOKUDB_CANCELED -100007
|
||||
#define TOKUDB_NO_DATA -100008
|
||||
#define TOKUDB_ACCEPT -100009
|
||||
#define TOKUDB_MVCC_DICTIONARY_TOO_NEW -100010
|
||||
#define TOKUDB_UPGRADE_FAILURE -100011
|
||||
#define TOKUDB_TRY_AGAIN -100012
|
||||
#define TOKUDB_NEEDS_REPAIR -100013
|
||||
#define TOKUDB_CURSOR_CONTINUE -100014
|
||||
/* LOADER flags */
|
||||
#define LOADER_USE_PUTS 1
|
||||
typedef int (*generate_row_for_put_func)(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val);
|
||||
typedef int (*generate_row_for_del_func)(DB *dest_db, DB *src_db, DBT *dest_key, const DBT *src_key, const DBT *src_val);
|
||||
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#undef txn_begin
|
||||
#endif
|
||||
struct __toku_db_env {
|
||||
struct __toku_db_env_internal *i;
|
||||
#define db_env_struct_i(x) ((x)->i)
|
||||
int (*checkpointing_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*checkpointing_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*cleaner_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_set_iterations) (DB_ENV*, u_int32_t) /* Change the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*cleaner_get_iterations) (DB_ENV*, u_int32_t*) /* Retrieve the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
|
||||
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
|
||||
void *app_private; /* 32-bit offset=36 size=4, 64=bit offset=72 size=8 */
|
||||
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
|
||||
int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */;
|
||||
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
|
||||
int (*get_engine_status_num_rows) (DB_ENV*, uint64_t*) /* return number of rows in engine status */;
|
||||
int (*get_engine_status) (DB_ENV*, TOKU_ENGINE_STATUS_ROW, uint64_t, fs_redzone_state*, uint64_t*, char*, int) /* Fill in status struct and redzone state, possibly env panic string */;
|
||||
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
|
||||
int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);;
|
||||
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* FOR TEST ONLY: lookup existing iname */;
|
||||
int (*create_loader) (DB_ENV *env, DB_TXN *txn, DB_LOADER **blp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t dbt_flags[/*N*/], uint32_t loader_flags);
|
||||
int (*create_indexer) (DB_ENV *env, DB_TXN *txn, DB_INDEXER **idxrp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t indexer_flags);
|
||||
int (*put_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, DBT *vals, uint32_t *flags_array) /* insert into multiple DBs */;
|
||||
int (*set_generate_row_callback_for_put) (DB_ENV *env, generate_row_for_put_func generate_row_for_put);
|
||||
int (*del_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, uint32_t *flags_array) /* delete from multiple DBs */;
|
||||
int (*set_generate_row_callback_for_del) (DB_ENV *env, generate_row_for_del_func generate_row_for_del);
|
||||
int (*update_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
DBT *old_src_key, DBT *old_src_data,
|
||||
DBT *new_src_key, DBT *new_src_data,
|
||||
uint32_t num_dbs, DB **db_array, uint32_t *flags_array,
|
||||
uint32_t num_keys, DBT *keys,
|
||||
uint32_t num_vals, DBT *vals) /* update multiple DBs */;
|
||||
int (*get_redzone) (DB_ENV *env, int *redzone) /* get the redzone limit */;
|
||||
int (*set_redzone) (DB_ENV *env, int redzone) /* set the redzone limit in percent of total space */;
|
||||
int (*set_lk_max_memory) (DB_ENV *env, uint64_t max);
|
||||
int (*get_lk_max_memory) (DB_ENV *env, uint64_t *max);
|
||||
void (*set_update) (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra));
|
||||
int (*set_lock_timeout) (DB_ENV *env, uint64_t lock_wait_time_msec);
|
||||
int (*get_lock_timeout) (DB_ENV *env, uint64_t *lock_wait_time_msec);
|
||||
void* __toku_dummy0[5];
|
||||
char __toku_dummy1[64];
|
||||
void *api1_internal; /* 32-bit offset=212 size=4, 64=bit offset=360 size=8 */
|
||||
void* __toku_dummy2[7];
|
||||
int (*close) (DB_ENV *, u_int32_t); /* 32-bit offset=244 size=4, 64=bit offset=424 size=8 */
|
||||
int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t); /* 32-bit offset=248 size=4, 64=bit offset=432 size=8 */
|
||||
int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=252 size=4, 64=bit offset=440 size=8 */
|
||||
void (*err) (const DB_ENV *, int, const char *, ...); /* 32-bit offset=256 size=4, 64=bit offset=448 size=8 */
|
||||
void* __toku_dummy3[1];
|
||||
int (*open) (DB_ENV *, const char *, u_int32_t, int); /* 32-bit offset=264 size=4, 64=bit offset=464 size=8 */
|
||||
void* __toku_dummy4[1];
|
||||
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=272 size=4, 64=bit offset=480 size=8 */
|
||||
void* __toku_dummy5[3];
|
||||
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=288 size=4, 64=bit offset=512 size=8 */
|
||||
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=292 size=4, 64=bit offset=520 size=8 */
|
||||
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=296 size=4, 64=bit offset=528 size=8 */
|
||||
void* __toku_dummy6[1];
|
||||
int (*set_flags) (DB_ENV *, u_int32_t, int); /* 32-bit offset=304 size=4, 64=bit offset=544 size=8 */
|
||||
void* __toku_dummy7[4];
|
||||
int (*set_tmp_dir) (DB_ENV *, const char *); /* 32-bit offset=324 size=4, 64=bit offset=584 size=8 */
|
||||
int (*set_verbose) (DB_ENV *, u_int32_t, int); /* 32-bit offset=328 size=4, 64=bit offset=592 size=8 */
|
||||
void* __toku_dummy8[1];
|
||||
int (*set_lg_bsize) (DB_ENV *, u_int32_t); /* 32-bit offset=336 size=4, 64=bit offset=608 size=8 */
|
||||
int (*set_lg_dir) (DB_ENV *, const char *); /* 32-bit offset=340 size=4, 64=bit offset=616 size=8 */
|
||||
int (*set_lg_max) (DB_ENV *, u_int32_t); /* 32-bit offset=344 size=4, 64=bit offset=624 size=8 */
|
||||
void* __toku_dummy9[1];
|
||||
int (*log_archive) (DB_ENV *, char **[], u_int32_t); /* 32-bit offset=352 size=4, 64=bit offset=640 size=8 */
|
||||
void* __toku_dummy10[2];
|
||||
int (*log_flush) (DB_ENV *, const DB_LSN *); /* 32-bit offset=364 size=4, 64=bit offset=664 size=8 */
|
||||
void* __toku_dummy11[4];
|
||||
int (*set_lk_detect) (DB_ENV *, u_int32_t); /* 32-bit offset=384 size=4, 64=bit offset=704 size=8 */
|
||||
int (*set_lk_max) (DB_ENV *, u_int32_t); /* 32-bit offset=388 size=4, 64=bit offset=712 size=8 */
|
||||
int (*set_lk_max_locks) (DB_ENV *, u_int32_t); /* 32-bit offset=392 size=4, 64=bit offset=720 size=8 */
|
||||
void* __toku_dummy12[14];
|
||||
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=452 size=4, 64=bit offset=840 size=8 */
|
||||
void* __toku_dummy13[21];
|
||||
int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t); /* 32-bit offset=540 size=4, 64=bit offset=1016 size=8 */
|
||||
int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1024 size=8 */
|
||||
void* __toku_dummy14[1];
|
||||
int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags); /* 32-bit offset=552 size=4, 64=bit offset=1040 size=8 */
|
||||
int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t); /* 32-bit offset=556 size=4, 64=bit offset=1048 size=8 */
|
||||
void* __toku_dummy15[2]; /* Padding at the end */
|
||||
char __toku_dummy16[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_key_range {
|
||||
double less; /* 32-bit offset=0 size=8, 64=bit offset=0 size=8 */
|
||||
double equal; /* 32-bit offset=8 size=8, 64=bit offset=8 size=8 */
|
||||
double greater; /* 32-bit offset=16 size=8, 64=bit offset=16 size=8 */
|
||||
void* __toku_dummy0[126]; /* Padding at the end */
|
||||
char __toku_dummy1[48]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_lsn {
|
||||
char __toku_dummy0[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_dbt {
|
||||
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
u_int32_t size; /* 32-bit offset=4 size=4, 64=bit offset=8 size=4 */
|
||||
u_int32_t ulen; /* 32-bit offset=8 size=4, 64=bit offset=12 size=4 */
|
||||
char __toku_dummy0[8];
|
||||
u_int32_t flags; /* 32-bit offset=20 size=4, 64=bit offset=24 size=4 */
|
||||
/* 4 more bytes of alignment in the 64-bit case. */
|
||||
};
|
||||
typedef struct __toku_descriptor {
|
||||
DBT dbt;
|
||||
} *DESCRIPTOR, DESCRIPTOR_S;
|
||||
//One header is included in 'data'
|
||||
//One header is included in 'additional for checkpoint'
|
||||
typedef struct __toku_db_fragmentation {
|
||||
uint64_t file_size_bytes; //Total file size in bytes
|
||||
uint64_t data_bytes; //Compressed User Data in bytes
|
||||
uint64_t data_blocks; //Number of blocks of compressed User Data
|
||||
uint64_t checkpoint_bytes_additional; //Additional bytes used for checkpoint system
|
||||
uint64_t checkpoint_blocks_additional; //Additional blocks used for checkpoint system
|
||||
uint64_t unused_bytes; //Unused space in file
|
||||
uint64_t unused_blocks; //Number of contiguous regions of unused space
|
||||
uint64_t largest_unused_block; //Size of largest contiguous unused space
|
||||
} *TOKU_DB_FRAGMENTATION, TOKU_DB_FRAGMENTATION_S;
|
||||
struct __toku_db {
|
||||
struct __toku_db_internal *i;
|
||||
#define db_struct_i(x) ((x)->i)
|
||||
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
|
||||
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
|
||||
int (*pre_acquire_table_lock)(DB*, DB_TXN*);
|
||||
void *app_private; /* 32-bit offset=16 size=4, 64=bit offset=32 size=8 */
|
||||
DB_ENV *dbenv; /* 32-bit offset=20 size=4, 64=bit offset=40 size=8 */
|
||||
int (*pre_acquire_fileops_lock)(DB*, DB_TXN*);
|
||||
const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/;
|
||||
const DBT* (*dbt_neg_infty)(void)/* Return the special DBT that refers to negative infinity in the lock table.*/;
|
||||
void (*get_max_row_size) (DB*, u_int32_t *max_key_size, u_int32_t *max_row_size);
|
||||
DESCRIPTOR descriptor /* saved row/dictionary descriptor for aiding in comparisons */;
|
||||
int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, u_int32_t) /* change row/dictionary descriptor for a db. Available only while db is open */;
|
||||
int (*getf_set)(DB*, DB_TXN*, u_int32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */;
|
||||
int (*optimize)(DB*) /* Run garbage collecion and promote all transactions older than oldest. Amortized (happens during flattening) */;
|
||||
int (*hot_optimize)(DB*, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra);
|
||||
int (*get_fragmentation)(DB*,TOKU_DB_FRAGMENTATION);
|
||||
int (*get_readpagesize)(DB*,u_int32_t*);
|
||||
int (*set_readpagesize)(DB*,u_int32_t);
|
||||
int (*set_indexer)(DB*, DB_INDEXER*);
|
||||
void (*get_indexer)(DB*, DB_INDEXER**);
|
||||
int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going);
|
||||
int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags);
|
||||
int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags);
|
||||
void* __toku_dummy0[12];
|
||||
char __toku_dummy1[96];
|
||||
void *api_internal; /* 32-bit offset=236 size=4, 64=bit offset=376 size=8 */
|
||||
void* __toku_dummy2[5];
|
||||
int (*close) (DB*, u_int32_t); /* 32-bit offset=260 size=4, 64=bit offset=424 size=8 */
|
||||
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=264 size=4, 64=bit offset=432 size=8 */
|
||||
int (*del) (DB *, DB_TXN *, DBT *, u_int32_t); /* 32-bit offset=268 size=4, 64=bit offset=440 size=8 */
|
||||
void* __toku_dummy3[2];
|
||||
int (*fd) (DB *, int *); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
|
||||
int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=284 size=4, 64=bit offset=472 size=8 */
|
||||
void* __toku_dummy4[4];
|
||||
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=304 size=4, 64=bit offset=512 size=8 */
|
||||
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=308 size=4, 64=bit offset=520 size=8 */
|
||||
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=312 size=4, 64=bit offset=528 size=8 */
|
||||
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=316 size=4, 64=bit offset=536 size=8 */
|
||||
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=320 size=4, 64=bit offset=544 size=8 */
|
||||
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=324 size=4, 64=bit offset=552 size=8 */
|
||||
void* __toku_dummy5[7];
|
||||
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=356 size=4, 64=bit offset=616 size=8 */
|
||||
void* __toku_dummy6[2];
|
||||
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=368 size=4, 64=bit offset=640 size=8 */
|
||||
void* __toku_dummy7[1];
|
||||
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=376 size=4, 64=bit offset=656 size=8 */
|
||||
void* __toku_dummy8[1];
|
||||
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=384 size=4, 64=bit offset=672 size=8 */
|
||||
void* __toku_dummy9[2];
|
||||
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=396 size=4, 64=bit offset=696 size=8 */
|
||||
void* __toku_dummy10[16]; /* Padding at the end */
|
||||
char __toku_dummy11[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_txn_active {
|
||||
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
|
||||
char __toku_dummy0[4];
|
||||
DB_LSN lsn; /* 32-bit offset=8 size=8, 64=bit offset=8 size=8 */
|
||||
};
|
||||
typedef struct __toku_txn_progress {
|
||||
uint64_t entries_total;
|
||||
uint64_t entries_processed;
|
||||
uint8_t is_commit;
|
||||
uint8_t stalled_on_checkpoint;
|
||||
} *TOKU_TXN_PROGRESS, TOKU_TXN_PROGRESS_S;
|
||||
typedef void(*TXN_PROGRESS_POLL_FUNCTION)(TOKU_TXN_PROGRESS, void*);
|
||||
struct txn_stat {
|
||||
u_int64_t rollback_raw_count;
|
||||
};
|
||||
struct __toku_db_txn {
|
||||
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
|
||||
int (*txn_stat)(DB_TXN *, struct txn_stat **);
|
||||
struct toku_list open_txns;
|
||||
int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
void* __toku_dummy0[5];
|
||||
char __toku_dummy1[24];
|
||||
void *api_internal; /* 32-bit offset=68 size=4, 64=bit offset=112 size=8 */
|
||||
void* __toku_dummy2[1];
|
||||
int (*abort) (DB_TXN *); /* 32-bit offset=76 size=4, 64=bit offset=128 size=8 */
|
||||
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=80 size=4, 64=bit offset=136 size=8 */
|
||||
void* __toku_dummy3[1];
|
||||
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=88 size=4, 64=bit offset=152 size=8 */
|
||||
int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE]); /* 32-bit offset=92 size=4, 64=bit offset=160 size=8 */
|
||||
void* __toku_dummy4[2]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_txn_stat {
|
||||
void* __toku_dummy0[1];
|
||||
char __toku_dummy1[28];
|
||||
u_int32_t st_nactive; /* 32-bit offset=32 size=4, 64=bit offset=36 size=4 */
|
||||
char __toku_dummy2[8];
|
||||
DB_TXN_ACTIVE *st_txnarray; /* 32-bit offset=44 size=4, 64=bit offset=48 size=8 */
|
||||
void* __toku_dummy3[1]; /* Padding at the end */
|
||||
char __toku_dummy4[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_dbc {
|
||||
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*);
|
||||
void* __toku_dummy0[10];
|
||||
char __toku_dummy1[104];
|
||||
int (*c_close) (DBC *); /* 32-bit offset=188 size=4, 64=bit offset=272 size=8 */
|
||||
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=192 size=4, 64=bit offset=280 size=8 */
|
||||
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=196 size=4, 64=bit offset=288 size=8 */
|
||||
void* __toku_dummy2[1];
|
||||
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=204 size=4, 64=bit offset=304 size=8 */
|
||||
void* __toku_dummy3[11]; /* Padding at the end */
|
||||
};
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#define txn_begin txn_begin_tokudb
|
||||
#endif
|
||||
int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
|
||||
int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
|
||||
char *db_strerror(int) __attribute__((__visibility__("default")));
|
||||
const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
|
||||
int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fsync (int (*)(int)) __attribute__((__visibility__("default")));
|
||||
int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")));
|
||||
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fdopen (FILE* (*)(int, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fopen (FILE* (*)(const char *, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_open (int (*)(const char *, int, int)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fclose (int (*)(FILE*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pread (ssize_t (*)(int, void *, size_t, off_t)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_func_loader_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_loader_size_factor (uint32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_mvcc_garbage_collection_verification(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_enable_engine_status(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) __attribute__((__visibility__("default")));
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
479
buildheader/db.h_4_3
Normal file
479
buildheader/db.h_4_3
Normal file
|
@ -0,0 +1,479 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
#define TOKUDB 1
|
||||
#define TOKUDB_NATIVE_H 0
|
||||
#define DB_VERSION_MAJOR 4
|
||||
#define DB_VERSION_MINOR 3
|
||||
#define DB_VERSION_PATCH 29
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERSION_STRING "Tokutek: TokuDB 4.3.29"
|
||||
#else
|
||||
#define DB_VERSION_STRING_ydb "Tokutek: TokuDB (wrapped bdb)"
|
||||
#endif
|
||||
#ifndef TOKU_OFF_T_DEFINED
|
||||
#define TOKU_OFF_T_DEFINED
|
||||
typedef int64_t toku_off_t;
|
||||
#endif
|
||||
#define DB_GID_SIZE 128
|
||||
typedef struct __toku_db_env DB_ENV;
|
||||
typedef struct __toku_db_key_range DB_KEY_RANGE;
|
||||
typedef struct __toku_db_lsn DB_LSN;
|
||||
typedef struct __toku_db DB;
|
||||
typedef struct __toku_db_txn DB_TXN;
|
||||
typedef struct __toku_db_txn_active DB_TXN_ACTIVE;
|
||||
typedef struct __toku_db_txn_stat DB_TXN_STAT;
|
||||
typedef struct __toku_dbc DBC;
|
||||
typedef struct __toku_dbt DBT;
|
||||
typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_PREPLIST;
|
||||
typedef u_int32_t db_recno_t;
|
||||
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
|
||||
#include <tdb-internal.h>
|
||||
#ifndef __BIGGEST_ALIGNMENT__
|
||||
#define __BIGGEST_ALIGNMENT__ 16
|
||||
#endif
|
||||
typedef struct __toku_db_btree_stat64 {
|
||||
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
|
||||
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
|
||||
u_int64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */
|
||||
u_int64_t bt_fsize; /* how big is the underlying file */
|
||||
u_int64_t bt_create_time_sec; /* Creation time, in seconds */
|
||||
u_int64_t bt_modify_time_sec; /* Time of last serialization, in seconds */
|
||||
u_int64_t bt_verify_time_sec; /* Time of last verification, in seconds */
|
||||
} DB_BTREE_STAT64;
|
||||
typedef struct __toku_loader DB_LOADER;
|
||||
struct __toku_loader_internal;
|
||||
struct __toku_loader {
|
||||
struct __toku_loader_internal *i;
|
||||
int (*set_error_callback)(DB_LOADER *loader, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_LOADER *loader, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*put)(DB_LOADER *loader, DBT *key, DBT* val); /* give a row to the loader */
|
||||
int (*close)(DB_LOADER *loader); /* finish loading, free memory */
|
||||
int (*abort)(DB_LOADER *loader); /* abort loading, free memory */
|
||||
};
|
||||
typedef struct __toku_indexer DB_INDEXER;
|
||||
struct __toku_indexer_internal;
|
||||
struct __toku_indexer {
|
||||
struct __toku_indexer_internal *i;
|
||||
int (*set_error_callback)(DB_INDEXER *indexer, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_INDEXER *indexer, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*build)(DB_INDEXER *indexer); /* build the indexes */
|
||||
int (*close)(DB_INDEXER *indexer); /* finish indexing, free memory */
|
||||
int (*abort)(DB_INDEXER *indexer); /* abort indexing, free memory */
|
||||
};
|
||||
typedef enum {
|
||||
FS_GREEN = 0, // green zone (we have lots of space)
|
||||
FS_YELLOW = 1, // yellow zone (issue warning but allow operations)
|
||||
FS_RED = 2, // red zone (prevent insert operations)
|
||||
FS_BLOCKED = 3 // For reporting engine status, completely blocked
|
||||
} fs_redzone_state;
|
||||
typedef enum {
|
||||
FS_STATE = 0, // interpret as file system state (redzone) enum
|
||||
UINT64, // interpret as uint64_t
|
||||
CHARSTR, // interpret as char *
|
||||
UNIXTIME, // interpret as time_t
|
||||
TOKUTIME // interpret as tokutime_t
|
||||
} toku_engine_status_display_type;
|
||||
typedef struct __toku_engine_status_row {
|
||||
char * keyname; // info schema key, should not change across revisions without good reason
|
||||
char * legend; // the text that will appear at user interface
|
||||
toku_engine_status_display_type type; // how to interpret the value
|
||||
union {
|
||||
uint64_t num;
|
||||
char * str;
|
||||
} value;
|
||||
} * TOKU_ENGINE_STATUS_ROW, TOKU_ENGINE_STATUS_ROW_S;
|
||||
typedef enum {
|
||||
DB_BTREE=1,
|
||||
DB_UNKNOWN=5
|
||||
} DBTYPE;
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERB_DEADLOCK 1
|
||||
#define DB_VERB_RECOVERY 2
|
||||
#define DB_VERB_REPLICATION 4
|
||||
#define DB_VERB_WAITSFOR 8
|
||||
#define DB_ARCH_ABS 1
|
||||
#define DB_ARCH_LOG 4
|
||||
#define DB_CREATE 1
|
||||
#define DB_CXX_NO_EXCEPTIONS 2
|
||||
#define DB_EXCL 4096
|
||||
#define DB_PRIVATE 1048576
|
||||
#define DB_RDONLY 16
|
||||
#define DB_RECOVER 32
|
||||
#define DB_RUNRECOVERY -30977
|
||||
#define DB_THREAD 64
|
||||
#define DB_TXN_NOSYNC 256
|
||||
#define DB_LOCK_DEFAULT 1
|
||||
#define DB_LOCK_OLDEST 7
|
||||
#define DB_LOCK_RANDOM 8
|
||||
#define DB_KEYFIRST 15
|
||||
#define DB_KEYLAST 16
|
||||
#define DB_NOOVERWRITE 22
|
||||
#define DB_NODUPDATA 21
|
||||
#define DB_NOOVERWRITE_NO_ERROR 1
|
||||
#define DB_OPFLAGS_MASK 255
|
||||
#define DB_AUTO_COMMIT 16777216
|
||||
#define DB_INIT_LOCK 8192
|
||||
#define DB_INIT_LOG 16384
|
||||
#define DB_INIT_MPOOL 32768
|
||||
#define DB_INIT_TXN 131072
|
||||
#define DB_KEYEXIST -30996
|
||||
#define DB_LOCK_DEADLOCK -30995
|
||||
#define DB_LOCK_NOTGRANTED -30994
|
||||
#define DB_NOTFOUND -30989
|
||||
#define DB_SECONDARY_BAD -30976
|
||||
#define DB_DONOTINDEX -30998
|
||||
#define DB_BUFFER_SMALL -30999
|
||||
#define DB_BADFORMAT -30500
|
||||
#define DB_DELETE_ANY 65536
|
||||
#define DB_TRUNCATE_WITHCURSORS 131072
|
||||
#define DB_FIRST 9
|
||||
#define DB_LAST 17
|
||||
#define DB_CURRENT 7
|
||||
#define DB_NEXT 18
|
||||
#define DB_NEXT_NODUP 20
|
||||
#define DB_PREV 25
|
||||
#define DB_PREV_NODUP 26
|
||||
#define DB_SET 28
|
||||
#define DB_SET_RANGE 30
|
||||
#define DB_CURRENT_BINDING 253
|
||||
#define DB_SET_RANGE_REVERSE 252
|
||||
#define DB_RMW 536870912
|
||||
#define DB_IS_RESETTING_OP 0x01000000
|
||||
#define DB_PRELOCKED 0x00800000
|
||||
#define DB_PRELOCKED_WRITE 0x00400000
|
||||
#define DB_IS_HOT_INDEX 0x00100000
|
||||
#define DBC_DISABLE_PREFETCHING 0x20000000
|
||||
#define DB_DBT_APPMALLOC 1
|
||||
#define DB_DBT_DUPOK 64
|
||||
#define DB_DBT_MALLOC 4
|
||||
#define DB_DBT_REALLOC 16
|
||||
#define DB_DBT_USERMEM 32
|
||||
#define DB_LOG_AUTOREMOVE 65536
|
||||
#define DB_TXN_WRITE_NOSYNC 268435456
|
||||
#define DB_TXN_NOWAIT 4096
|
||||
#define DB_TXN_SYNC 8192
|
||||
#define DB_TXN_SNAPSHOT 1
|
||||
#define DB_READ_UNCOMMITTED 2
|
||||
#define DB_READ_COMMITTED 4
|
||||
#define DB_INHERIT_ISOLATION 8
|
||||
#define DB_SERIALIZABLE 16
|
||||
#endif
|
||||
/* TOKUDB specific error codes */
|
||||
#define TOKUDB_OUT_OF_LOCKS -100000
|
||||
#define TOKUDB_SUCCEEDED_EARLY -100001
|
||||
#define TOKUDB_FOUND_BUT_REJECTED -100002
|
||||
#define TOKUDB_USER_CALLBACK_ERROR -100003
|
||||
#define TOKUDB_DICTIONARY_TOO_OLD -100004
|
||||
#define TOKUDB_DICTIONARY_TOO_NEW -100005
|
||||
#define TOKUDB_DICTIONARY_NO_HEADER -100006
|
||||
#define TOKUDB_CANCELED -100007
|
||||
#define TOKUDB_NO_DATA -100008
|
||||
#define TOKUDB_ACCEPT -100009
|
||||
#define TOKUDB_MVCC_DICTIONARY_TOO_NEW -100010
|
||||
#define TOKUDB_UPGRADE_FAILURE -100011
|
||||
#define TOKUDB_TRY_AGAIN -100012
|
||||
#define TOKUDB_NEEDS_REPAIR -100013
|
||||
#define TOKUDB_CURSOR_CONTINUE -100014
|
||||
/* LOADER flags */
|
||||
#define LOADER_USE_PUTS 1
|
||||
typedef int (*generate_row_for_put_func)(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val);
|
||||
typedef int (*generate_row_for_del_func)(DB *dest_db, DB *src_db, DBT *dest_key, const DBT *src_key, const DBT *src_val);
|
||||
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#undef txn_begin
|
||||
#endif
|
||||
struct __toku_db_env {
|
||||
struct __toku_db_env_internal *i;
|
||||
#define db_env_struct_i(x) ((x)->i)
|
||||
int (*checkpointing_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*checkpointing_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*cleaner_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_set_iterations) (DB_ENV*, u_int32_t) /* Change the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*cleaner_get_iterations) (DB_ENV*, u_int32_t*) /* Retrieve the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
|
||||
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
|
||||
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
|
||||
int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */;
|
||||
void *app_private; /* 32-bit offset=44 size=4, 64=bit offset=88 size=8 */
|
||||
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
|
||||
int (*get_engine_status_num_rows) (DB_ENV*, uint64_t*) /* return number of rows in engine status */;
|
||||
int (*get_engine_status) (DB_ENV*, TOKU_ENGINE_STATUS_ROW, uint64_t, fs_redzone_state*, uint64_t*, char*, int) /* Fill in status struct and redzone state, possibly env panic string */;
|
||||
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
|
||||
int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);;
|
||||
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* FOR TEST ONLY: lookup existing iname */;
|
||||
int (*create_loader) (DB_ENV *env, DB_TXN *txn, DB_LOADER **blp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t dbt_flags[/*N*/], uint32_t loader_flags);
|
||||
int (*create_indexer) (DB_ENV *env, DB_TXN *txn, DB_INDEXER **idxrp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t indexer_flags);
|
||||
int (*put_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, DBT *vals, uint32_t *flags_array) /* insert into multiple DBs */;
|
||||
int (*set_generate_row_callback_for_put) (DB_ENV *env, generate_row_for_put_func generate_row_for_put);
|
||||
int (*del_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, uint32_t *flags_array) /* delete from multiple DBs */;
|
||||
int (*set_generate_row_callback_for_del) (DB_ENV *env, generate_row_for_del_func generate_row_for_del);
|
||||
int (*update_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
DBT *old_src_key, DBT *old_src_data,
|
||||
DBT *new_src_key, DBT *new_src_data,
|
||||
uint32_t num_dbs, DB **db_array, uint32_t *flags_array,
|
||||
uint32_t num_keys, DBT *keys,
|
||||
uint32_t num_vals, DBT *vals) /* update multiple DBs */;
|
||||
int (*get_redzone) (DB_ENV *env, int *redzone) /* get the redzone limit */;
|
||||
int (*set_redzone) (DB_ENV *env, int redzone) /* set the redzone limit in percent of total space */;
|
||||
int (*set_lk_max_memory) (DB_ENV *env, uint64_t max);
|
||||
int (*get_lk_max_memory) (DB_ENV *env, uint64_t *max);
|
||||
void (*set_update) (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra));
|
||||
int (*set_lock_timeout) (DB_ENV *env, uint64_t lock_wait_time_msec);
|
||||
int (*get_lock_timeout) (DB_ENV *env, uint64_t *lock_wait_time_msec);
|
||||
void* __toku_dummy0[5];
|
||||
char __toku_dummy1[96];
|
||||
void *api1_internal; /* 32-bit offset=244 size=4, 64=bit offset=392 size=8 */
|
||||
void* __toku_dummy2[7];
|
||||
int (*close) (DB_ENV *, u_int32_t); /* 32-bit offset=276 size=4, 64=bit offset=456 size=8 */
|
||||
int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
|
||||
int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=284 size=4, 64=bit offset=472 size=8 */
|
||||
void (*err) (const DB_ENV *, int, const char *, ...); /* 32-bit offset=288 size=4, 64=bit offset=480 size=8 */
|
||||
void* __toku_dummy3[1];
|
||||
int (*open) (DB_ENV *, const char *, u_int32_t, int); /* 32-bit offset=296 size=4, 64=bit offset=496 size=8 */
|
||||
void* __toku_dummy4[9];
|
||||
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=336 size=4, 64=bit offset=576 size=8 */
|
||||
void* __toku_dummy5[2];
|
||||
void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *)); /* 32-bit offset=348 size=4, 64=bit offset=600 size=8 */
|
||||
void* __toku_dummy6[1];
|
||||
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=356 size=4, 64=bit offset=616 size=8 */
|
||||
void* __toku_dummy7[1];
|
||||
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=364 size=4, 64=bit offset=632 size=8 */
|
||||
void* __toku_dummy8[1];
|
||||
int (*get_flags) (DB_ENV *, u_int32_t *); /* 32-bit offset=372 size=4, 64=bit offset=648 size=8 */
|
||||
int (*set_flags) (DB_ENV *, u_int32_t, int); /* 32-bit offset=376 size=4, 64=bit offset=656 size=8 */
|
||||
void* __toku_dummy9[13];
|
||||
int (*set_tmp_dir) (DB_ENV *, const char *); /* 32-bit offset=432 size=4, 64=bit offset=768 size=8 */
|
||||
void* __toku_dummy10[1];
|
||||
int (*set_verbose) (DB_ENV *, u_int32_t, int); /* 32-bit offset=440 size=4, 64=bit offset=784 size=8 */
|
||||
void* __toku_dummy11[2];
|
||||
int (*set_lg_bsize) (DB_ENV *, u_int32_t); /* 32-bit offset=452 size=4, 64=bit offset=808 size=8 */
|
||||
void* __toku_dummy12[1];
|
||||
int (*set_lg_dir) (DB_ENV *, const char *); /* 32-bit offset=460 size=4, 64=bit offset=824 size=8 */
|
||||
int (*get_lg_max) (DB_ENV *, u_int32_t*); /* 32-bit offset=464 size=4, 64=bit offset=832 size=8 */
|
||||
int (*set_lg_max) (DB_ENV *, u_int32_t); /* 32-bit offset=468 size=4, 64=bit offset=840 size=8 */
|
||||
void* __toku_dummy13[2];
|
||||
int (*log_archive) (DB_ENV *, char **[], u_int32_t); /* 32-bit offset=480 size=4, 64=bit offset=864 size=8 */
|
||||
void* __toku_dummy14[2];
|
||||
int (*log_flush) (DB_ENV *, const DB_LSN *); /* 32-bit offset=492 size=4, 64=bit offset=888 size=8 */
|
||||
void* __toku_dummy15[7];
|
||||
int (*set_lk_detect) (DB_ENV *, u_int32_t); /* 32-bit offset=524 size=4, 64=bit offset=952 size=8 */
|
||||
int (*set_lk_max) (DB_ENV *, u_int32_t); /* 32-bit offset=528 size=4, 64=bit offset=960 size=8 */
|
||||
int (*get_lk_max_locks) (DB_ENV *, u_int32_t *); /* 32-bit offset=532 size=4, 64=bit offset=968 size=8 */
|
||||
int (*set_lk_max_locks) (DB_ENV *, u_int32_t); /* 32-bit offset=536 size=4, 64=bit offset=976 size=8 */
|
||||
void* __toku_dummy16[13];
|
||||
int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *); /* 32-bit offset=592 size=4, 64=bit offset=1088 size=8 */
|
||||
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=596 size=4, 64=bit offset=1096 size=8 */
|
||||
void* __toku_dummy17[28];
|
||||
int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t); /* 32-bit offset=712 size=4, 64=bit offset=1328 size=8 */
|
||||
int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t); /* 32-bit offset=716 size=4, 64=bit offset=1336 size=8 */
|
||||
int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags); /* 32-bit offset=720 size=4, 64=bit offset=1344 size=8 */
|
||||
int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t); /* 32-bit offset=724 size=4, 64=bit offset=1352 size=8 */
|
||||
void* __toku_dummy18[3]; /* Padding at the end */
|
||||
char __toku_dummy19[16]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_key_range {
|
||||
double less; /* 32-bit offset=0 size=8, 64=bit offset=0 size=8 */
|
||||
double equal; /* 32-bit offset=8 size=8, 64=bit offset=8 size=8 */
|
||||
double greater; /* 32-bit offset=16 size=8, 64=bit offset=16 size=8 */
|
||||
void* __toku_dummy0[161]; /* Padding at the end */
|
||||
char __toku_dummy1[88]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_lsn {
|
||||
char __toku_dummy0[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_dbt {
|
||||
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
u_int32_t size; /* 32-bit offset=4 size=4, 64=bit offset=8 size=4 */
|
||||
u_int32_t ulen; /* 32-bit offset=8 size=4, 64=bit offset=12 size=4 */
|
||||
char __toku_dummy0[8];
|
||||
u_int32_t flags; /* 32-bit offset=20 size=4, 64=bit offset=24 size=4 */
|
||||
/* 4 more bytes of alignment in the 64-bit case. */
|
||||
};
|
||||
typedef struct __toku_descriptor {
|
||||
DBT dbt;
|
||||
} *DESCRIPTOR, DESCRIPTOR_S;
|
||||
//One header is included in 'data'
|
||||
//One header is included in 'additional for checkpoint'
|
||||
typedef struct __toku_db_fragmentation {
|
||||
uint64_t file_size_bytes; //Total file size in bytes
|
||||
uint64_t data_bytes; //Compressed User Data in bytes
|
||||
uint64_t data_blocks; //Number of blocks of compressed User Data
|
||||
uint64_t checkpoint_bytes_additional; //Additional bytes used for checkpoint system
|
||||
uint64_t checkpoint_blocks_additional; //Additional blocks used for checkpoint system
|
||||
uint64_t unused_bytes; //Unused space in file
|
||||
uint64_t unused_blocks; //Number of contiguous regions of unused space
|
||||
uint64_t largest_unused_block; //Size of largest contiguous unused space
|
||||
} *TOKU_DB_FRAGMENTATION, TOKU_DB_FRAGMENTATION_S;
|
||||
struct __toku_db {
|
||||
struct __toku_db_internal *i;
|
||||
#define db_struct_i(x) ((x)->i)
|
||||
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
|
||||
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
|
||||
int (*pre_acquire_table_lock)(DB*, DB_TXN*);
|
||||
void *app_private; /* 32-bit offset=16 size=4, 64=bit offset=32 size=8 */
|
||||
DB_ENV *dbenv; /* 32-bit offset=20 size=4, 64=bit offset=40 size=8 */
|
||||
int (*pre_acquire_fileops_lock)(DB*, DB_TXN*);
|
||||
const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/;
|
||||
const DBT* (*dbt_neg_infty)(void)/* Return the special DBT that refers to negative infinity in the lock table.*/;
|
||||
void (*get_max_row_size) (DB*, u_int32_t *max_key_size, u_int32_t *max_row_size);
|
||||
DESCRIPTOR descriptor /* saved row/dictionary descriptor for aiding in comparisons */;
|
||||
int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, u_int32_t) /* change row/dictionary descriptor for a db. Available only while db is open */;
|
||||
int (*getf_set)(DB*, DB_TXN*, u_int32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */;
|
||||
int (*optimize)(DB*) /* Run garbage collecion and promote all transactions older than oldest. Amortized (happens during flattening) */;
|
||||
int (*hot_optimize)(DB*, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra);
|
||||
int (*get_fragmentation)(DB*,TOKU_DB_FRAGMENTATION);
|
||||
int (*get_readpagesize)(DB*,u_int32_t*);
|
||||
int (*set_readpagesize)(DB*,u_int32_t);
|
||||
int (*set_indexer)(DB*, DB_INDEXER*);
|
||||
void (*get_indexer)(DB*, DB_INDEXER**);
|
||||
int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going);
|
||||
int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags);
|
||||
int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags);
|
||||
void* __toku_dummy0[15];
|
||||
char __toku_dummy1[96];
|
||||
void *api_internal; /* 32-bit offset=248 size=4, 64=bit offset=400 size=8 */
|
||||
void* __toku_dummy2[5];
|
||||
int (*close) (DB*, u_int32_t); /* 32-bit offset=272 size=4, 64=bit offset=448 size=8 */
|
||||
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=276 size=4, 64=bit offset=456 size=8 */
|
||||
int (*del) (DB *, DB_TXN *, DBT *, u_int32_t); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
|
||||
void* __toku_dummy3[3];
|
||||
int (*fd) (DB *, int *); /* 32-bit offset=296 size=4, 64=bit offset=496 size=8 */
|
||||
int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=300 size=4, 64=bit offset=504 size=8 */
|
||||
void* __toku_dummy4[8];
|
||||
int (*get_flags) (DB *, u_int32_t *); /* 32-bit offset=336 size=4, 64=bit offset=576 size=8 */
|
||||
void* __toku_dummy5[2];
|
||||
int (*get_pagesize) (DB *, u_int32_t *); /* 32-bit offset=348 size=4, 64=bit offset=600 size=8 */
|
||||
void* __toku_dummy6[3];
|
||||
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=364 size=4, 64=bit offset=632 size=8 */
|
||||
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=368 size=4, 64=bit offset=640 size=8 */
|
||||
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=372 size=4, 64=bit offset=648 size=8 */
|
||||
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=376 size=4, 64=bit offset=656 size=8 */
|
||||
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=380 size=4, 64=bit offset=664 size=8 */
|
||||
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=384 size=4, 64=bit offset=672 size=8 */
|
||||
void* __toku_dummy7[6];
|
||||
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=412 size=4, 64=bit offset=728 size=8 */
|
||||
void* __toku_dummy8[2];
|
||||
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=424 size=4, 64=bit offset=752 size=8 */
|
||||
void* __toku_dummy9[4];
|
||||
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=444 size=4, 64=bit offset=792 size=8 */
|
||||
void* __toku_dummy10[1];
|
||||
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=452 size=4, 64=bit offset=808 size=8 */
|
||||
void* __toku_dummy11[3];
|
||||
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=468 size=4, 64=bit offset=840 size=8 */
|
||||
void* __toku_dummy12[25]; /* Padding at the end */
|
||||
char __toku_dummy13[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_txn_active {
|
||||
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
|
||||
char __toku_dummy0[4];
|
||||
DB_LSN lsn; /* 32-bit offset=8 size=8, 64=bit offset=8 size=8 */
|
||||
char __toku_dummy1[132]; /* Padding at the end */
|
||||
};
|
||||
typedef struct __toku_txn_progress {
|
||||
uint64_t entries_total;
|
||||
uint64_t entries_processed;
|
||||
uint8_t is_commit;
|
||||
uint8_t stalled_on_checkpoint;
|
||||
} *TOKU_TXN_PROGRESS, TOKU_TXN_PROGRESS_S;
|
||||
typedef void(*TXN_PROGRESS_POLL_FUNCTION)(TOKU_TXN_PROGRESS, void*);
|
||||
struct txn_stat {
|
||||
u_int64_t rollback_raw_count;
|
||||
};
|
||||
struct __toku_db_txn {
|
||||
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
|
||||
int (*txn_stat)(DB_TXN *, struct txn_stat **);
|
||||
struct toku_list open_txns;
|
||||
int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
void* __toku_dummy0[10];
|
||||
char __toku_dummy1[24];
|
||||
void *api_internal; /* 32-bit offset=88 size=4, 64=bit offset=152 size=8 */
|
||||
void* __toku_dummy2[2];
|
||||
int (*abort) (DB_TXN *); /* 32-bit offset=100 size=4, 64=bit offset=176 size=8 */
|
||||
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=104 size=4, 64=bit offset=184 size=8 */
|
||||
void* __toku_dummy3[1];
|
||||
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=112 size=4, 64=bit offset=200 size=8 */
|
||||
int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE]); /* 32-bit offset=116 size=4, 64=bit offset=208 size=8 */
|
||||
void* __toku_dummy4[3]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_db_txn_stat {
|
||||
void* __toku_dummy0[1];
|
||||
char __toku_dummy1[28];
|
||||
u_int32_t st_nactive; /* 32-bit offset=32 size=4, 64=bit offset=36 size=4 */
|
||||
char __toku_dummy2[8];
|
||||
DB_TXN_ACTIVE *st_txnarray; /* 32-bit offset=44 size=4, 64=bit offset=48 size=8 */
|
||||
void* __toku_dummy3[1]; /* Padding at the end */
|
||||
char __toku_dummy4[8]; /* Padding at the end */
|
||||
};
|
||||
struct __toku_dbc {
|
||||
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
|
||||
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*);
|
||||
void* __toku_dummy0[8];
|
||||
char __toku_dummy1[112];
|
||||
int (*c_close) (DBC *); /* 32-bit offset=188 size=4, 64=bit offset=264 size=8 */
|
||||
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=192 size=4, 64=bit offset=272 size=8 */
|
||||
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=196 size=4, 64=bit offset=280 size=8 */
|
||||
void* __toku_dummy2[1];
|
||||
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=204 size=4, 64=bit offset=296 size=8 */
|
||||
void* __toku_dummy3[10]; /* Padding at the end */
|
||||
};
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#define txn_begin txn_begin_tokudb
|
||||
#endif
|
||||
int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
|
||||
int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
|
||||
char *db_strerror(int) __attribute__((__visibility__("default")));
|
||||
const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
|
||||
int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fsync (int (*)(int)) __attribute__((__visibility__("default")));
|
||||
int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")));
|
||||
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fdopen (FILE* (*)(int, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fopen (FILE* (*)(const char *, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_open (int (*)(const char *, int, int)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fclose (int (*)(FILE*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pread (ssize_t (*)(int, void *, size_t, off_t)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_func_loader_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_loader_size_factor (uint32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_mvcc_garbage_collection_verification(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_enable_engine_status(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) __attribute__((__visibility__("default")));
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
11
buildheader/db.h_4_4
Normal file
11
buildheader/db.h_4_4
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
11
buildheader/db.h_4_5
Normal file
11
buildheader/db.h_4_5
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
11
buildheader/db.h_4_6
Normal file
11
buildheader/db.h_4_6
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
50
buildheader/make.include
Normal file
50
buildheader/make.include
Normal file
|
@ -0,0 +1,50 @@
|
|||
BUILDHEADER_NUMBERED_VERSIONS = 4_6 4_5 4_4 4_3 4_1
|
||||
|
||||
BUILDHEADER_CPPFLAGS = -Ibuildheader -Itoku_include
|
||||
BUILDHEADER_BDBDIR = ../../berkeleydb
|
||||
|
||||
BUILDHEADER_MAKE_H_FILES_EXE = $(patsubst %,buildheader/make_db_h_%,$(BUILDHEADER_NUMBERED_VERSIONS))
|
||||
BUILDHEADER_MAKE_H_FILES_O = $(patsubst %,%.o,$(BUILDHEADER_MAKE_H_FILES_EXE))
|
||||
BUILDHEADER_H_FILES = $(patsubst %,buildheader/db.h_%,$(BUILDHEADER_NUMBERED_VERSIONS))
|
||||
$(BUILDHEADER_MAKE_H_FILES_O): C99=
|
||||
buildheader/make_db_h_4_1.o: BUILDHEADER_MAJMINDOT=4.1.25
|
||||
buildheader/make_db_h_4_3.o: BUILDHEADER_MAJMINDOT=4.3.29
|
||||
buildheader/make_db_h_4_4.o: BUILDHEADER_MAJMINDOT=4.4.20
|
||||
buildheader/make_db_h_4_5.o: BUILDHEADER_MAJMINDOT=4.5.20
|
||||
buildheader/make_db_h_4_6.o: BUILDHEADER_MAJMINDOT=4.6.19
|
||||
buildheader/make_db_h_4_%.o: buildheader/make_db_h.c buildheader/sample_offsets_32_4_1.h buildheader/sample_offsets_64_4_1.h
|
||||
$(CC) $(CFLAGS) $(BUILDHEADER_CPPFLAGS) -I$(BUILDHEADER_BDBDIR)/db-$(BUILDHEADER_MAJMINDOT)/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=$(patsubst buildheader/make_db_h_4_%.o,%,$@) -DTDB_NATIVE=0
|
||||
buildheader/make_tdb_h.o: C99=
|
||||
buildheader/make_tdb_h.o: buildheader/make_db_h.c
|
||||
$(CC) $(CFLAGS) $(BUILDHEADER_CPPFLAGS) -I$(BUILDHEADER_BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6 -DTDB_NATIVE=1
|
||||
|
||||
$(BUILDHEADER_MAKE_H_FILES_EXE):
|
||||
buildheader/make_db_h_%: buildheader/make_db_h_%.o
|
||||
buildheader/db.h_%: buildheader/make_db_h_%
|
||||
./$< > $@
|
||||
sample_offsets_4_1: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.1.25/build_unix $< -o $@
|
||||
./sample_offsets_4_1
|
||||
|
||||
sample_offsets_4_3: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.3.29/build_unix $< -o $@
|
||||
./sample_offsets_4_3
|
||||
|
||||
sample_offsets_4_4: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.4.20/build_unix $< -o $@
|
||||
./sample_offsets_4_4
|
||||
|
||||
sample_offsets_4_5: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.5.20/build_unix $< -o $@
|
||||
./sample_offsets_4_5
|
||||
|
||||
sample_offsets_4_6: sample_offsets.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(BDBDIR)/db-4.6.19/build_unix $< -o $@
|
||||
./sample_offsets_4_6
|
||||
|
||||
buildheader/tdb.h: buildheader/make_tdb_h
|
||||
./$< > $@
|
||||
|
||||
buildheader/build: include/db.h $(BUILDHEADER_H_FILES)
|
||||
include/db.h: buildheader/tdb.h
|
||||
cp $< $@
|
693
buildheader/make_db_h.c
Normal file
693
buildheader/make_db_h.c
Normal file
|
@ -0,0 +1,693 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "$Id$"
|
||||
/* LICENSE: This file is licensed under the GPL or from Tokutek. */
|
||||
|
||||
/* Make a db.h that will be link-time compatible with Sleepycat's Berkeley DB. */
|
||||
|
||||
#include <db.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define VISIBLE "__attribute__((__visibility__(\"default\")))"
|
||||
|
||||
static void print_dbtype(void) {
|
||||
/* DBTYPE is mentioned by db_open.html */
|
||||
printf("typedef enum {\n");
|
||||
printf(" DB_BTREE=%d,\n", DB_BTREE);
|
||||
printf(" DB_UNKNOWN=%d\n", DB_UNKNOWN);
|
||||
printf("} DBTYPE;\n");
|
||||
}
|
||||
#if 0
|
||||
void print_db_notices (void) {
|
||||
printf("typedef enum { /* This appears to be a mysql-specific addition to the api. */ \n");
|
||||
printf(" DB_NOTICE_LOGFILE_CHANGED=%d\n", DB_NOTICE_LOGFILE_CHANGED);
|
||||
printf("} db_notices;\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#define dodefine(name) printf("#define %s %d\n", #name, name)
|
||||
#define dodefine_track(flags, name) do {assert((flags & name) != name); \
|
||||
flags |= (name); \
|
||||
printf("#define %s %d\n", #name, name);} while (0)
|
||||
#define dodefine_from_track(flags, name) do { \
|
||||
uint32_t which; \
|
||||
uint32_t bit; \
|
||||
for (which = 0; which < 32; which++) { \
|
||||
bit = 1U << which; \
|
||||
if (!(flags & bit)) break; \
|
||||
} \
|
||||
assert(which < 32); \
|
||||
printf("#define %s %u\n", #name, bit); \
|
||||
flags |= bit; \
|
||||
} while (0)
|
||||
|
||||
#define dodefine_track_enum(flags, name) do {assert(name>=0 && name<256); \
|
||||
assert(!(flags[name])); \
|
||||
flags[name] = 1; \
|
||||
printf("#define %s %d\n", #name, (int)(name));} while (0)
|
||||
#define dodefine_from_track_enum(flags, name) do { \
|
||||
uint32_t which; \
|
||||
/* don't use 0 */ \
|
||||
for (which = 1; which < 256; which++) { \
|
||||
if (!(flags[which])) break; \
|
||||
} \
|
||||
assert(which < 256); \
|
||||
flags[which] = 1; \
|
||||
printf("#define %s %u\n", #name, which); \
|
||||
} while (0)
|
||||
|
||||
|
||||
enum {
|
||||
TOKUDB_OUT_OF_LOCKS = -100000,
|
||||
TOKUDB_SUCCEEDED_EARLY = -100001,
|
||||
TOKUDB_FOUND_BUT_REJECTED = -100002,
|
||||
TOKUDB_USER_CALLBACK_ERROR = -100003,
|
||||
TOKUDB_DICTIONARY_TOO_OLD = -100004,
|
||||
TOKUDB_DICTIONARY_TOO_NEW = -100005,
|
||||
TOKUDB_DICTIONARY_NO_HEADER = -100006,
|
||||
TOKUDB_CANCELED = -100007,
|
||||
TOKUDB_NO_DATA = -100008,
|
||||
TOKUDB_ACCEPT = -100009,
|
||||
TOKUDB_MVCC_DICTIONARY_TOO_NEW = -100010,
|
||||
TOKUDB_UPGRADE_FAILURE = -100011,
|
||||
TOKUDB_TRY_AGAIN = -100012,
|
||||
TOKUDB_NEEDS_REPAIR = -100013,
|
||||
TOKUDB_CURSOR_CONTINUE = -100014,
|
||||
DONTUSE_I_JUST_PUT_THIS_HERE_SO_I_COULD_HAVE_A_COMMA_AFTER_EACH_ITEM
|
||||
};
|
||||
|
||||
static void print_defines (void) {
|
||||
printf("#ifndef _TOKUDB_WRAP_H\n");
|
||||
dodefine(DB_VERB_DEADLOCK);
|
||||
dodefine(DB_VERB_RECOVERY);
|
||||
dodefine(DB_VERB_REPLICATION);
|
||||
dodefine(DB_VERB_WAITSFOR);
|
||||
|
||||
dodefine(DB_ARCH_ABS);
|
||||
dodefine(DB_ARCH_LOG);
|
||||
|
||||
dodefine(DB_CREATE);
|
||||
dodefine(DB_CXX_NO_EXCEPTIONS);
|
||||
dodefine(DB_EXCL);
|
||||
dodefine(DB_PRIVATE);
|
||||
dodefine(DB_RDONLY);
|
||||
dodefine(DB_RECOVER);
|
||||
dodefine(DB_RUNRECOVERY);
|
||||
dodefine(DB_THREAD);
|
||||
dodefine(DB_TXN_NOSYNC);
|
||||
|
||||
dodefine(DB_LOCK_DEFAULT);
|
||||
dodefine(DB_LOCK_OLDEST);
|
||||
dodefine(DB_LOCK_RANDOM);
|
||||
|
||||
//dodefine(DB_DUP); No longer supported #2862
|
||||
//dodefine(DB_DUPSORT); No longer supported #2862
|
||||
|
||||
dodefine(DB_KEYFIRST);
|
||||
dodefine(DB_KEYLAST);
|
||||
{
|
||||
static uint8_t insert_flags[256];
|
||||
dodefine_track_enum(insert_flags, DB_NOOVERWRITE);
|
||||
dodefine_track_enum(insert_flags, DB_NODUPDATA);
|
||||
dodefine_from_track_enum(insert_flags, DB_NOOVERWRITE_NO_ERROR);
|
||||
}
|
||||
dodefine(DB_OPFLAGS_MASK);
|
||||
|
||||
dodefine(DB_AUTO_COMMIT);
|
||||
|
||||
dodefine(DB_INIT_LOCK);
|
||||
dodefine(DB_INIT_LOG);
|
||||
dodefine(DB_INIT_MPOOL);
|
||||
dodefine(DB_INIT_TXN);
|
||||
|
||||
//dodefine(DB_KEYEMPTY); /// KEYEMPTY is no longer used. We just use DB_NOTFOUND
|
||||
dodefine(DB_KEYEXIST);
|
||||
dodefine(DB_LOCK_DEADLOCK);
|
||||
dodefine(DB_LOCK_NOTGRANTED);
|
||||
dodefine(DB_NOTFOUND);
|
||||
dodefine(DB_SECONDARY_BAD);
|
||||
dodefine(DB_DONOTINDEX);
|
||||
#ifdef DB_BUFFER_SMALL
|
||||
dodefine(DB_BUFFER_SMALL);
|
||||
#endif
|
||||
printf("#define DB_BADFORMAT -30500\n"); // private tokudb
|
||||
printf("#define DB_DELETE_ANY %d\n", 1<<16); // private tokudb
|
||||
printf("#define DB_TRUNCATE_WITHCURSORS %d\n", 1<<17); // private tokudb
|
||||
|
||||
dodefine(DB_FIRST);
|
||||
//dodefine(DB_GET_BOTH); No longer supported #2862.
|
||||
//dodefine(DB_GET_BOTH_RANGE); No longer supported because we only support NODUP. #2862.
|
||||
dodefine(DB_LAST);
|
||||
dodefine(DB_CURRENT);
|
||||
dodefine(DB_NEXT);
|
||||
//dodefine(DB_NEXT_DUP); No longer supported #2862
|
||||
dodefine(DB_NEXT_NODUP);
|
||||
dodefine(DB_PREV);
|
||||
#if defined(DB_PREV_DUP)
|
||||
//dodefine(DB_PREV_DUP);
|
||||
#endif
|
||||
dodefine(DB_PREV_NODUP);
|
||||
dodefine(DB_SET);
|
||||
dodefine(DB_SET_RANGE);
|
||||
printf("#define DB_CURRENT_BINDING 253\n"); // private tokudb
|
||||
printf("#define DB_SET_RANGE_REVERSE 252\n"); // private tokudb
|
||||
//printf("#define DB_GET_BOTH_RANGE_REVERSE 251\n"); // private tokudb. No longer supported #2862.
|
||||
dodefine(DB_RMW);
|
||||
printf("#define DB_IS_RESETTING_OP 0x01000000\n"); // private tokudb
|
||||
printf("#define DB_PRELOCKED 0x00800000\n"); // private tokudb
|
||||
printf("#define DB_PRELOCKED_WRITE 0x00400000\n"); // private tokudb
|
||||
//printf("#define DB_PRELOCKED_FILE_READ 0x00200000\n"); // private tokudb. No longer supported in #4472
|
||||
printf("#define DB_IS_HOT_INDEX 0x00100000\n"); // private tokudb
|
||||
printf("#define DBC_DISABLE_PREFETCHING 0x20000000\n"); // private tokudb
|
||||
|
||||
{
|
||||
//dbt flags
|
||||
uint32_t dbt_flags = 0;
|
||||
dodefine_track(dbt_flags, DB_DBT_APPMALLOC);
|
||||
dodefine_track(dbt_flags, DB_DBT_DUPOK);
|
||||
dodefine_track(dbt_flags, DB_DBT_MALLOC);
|
||||
#ifdef DB_DBT_MULTIPLE
|
||||
dodefine_track(dbt_flags, DB_DBT_MULTIPLE);
|
||||
#endif
|
||||
dodefine_track(dbt_flags, DB_DBT_REALLOC);
|
||||
dodefine_track(dbt_flags, DB_DBT_USERMEM);
|
||||
}
|
||||
|
||||
// flags for the env->set_flags function
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
|
||||
dodefine(DB_LOG_AUTOREMOVE);
|
||||
#endif
|
||||
|
||||
{
|
||||
//Txn begin/commit flags
|
||||
uint32_t txn_flags = 0;
|
||||
dodefine_track(txn_flags, DB_TXN_WRITE_NOSYNC);
|
||||
dodefine_track(txn_flags, DB_TXN_NOWAIT);
|
||||
dodefine_track(txn_flags, DB_TXN_SYNC);
|
||||
#ifdef DB_TXN_SNAPSHOT
|
||||
dodefine_track(txn_flags, DB_TXN_SNAPSHOT);
|
||||
#endif
|
||||
#ifdef DB_READ_UNCOMMITTED
|
||||
dodefine_track(txn_flags, DB_READ_UNCOMMITTED);
|
||||
#endif
|
||||
#ifdef DB_READ_COMMITTED
|
||||
dodefine_track(txn_flags, DB_READ_COMMITTED);
|
||||
#endif
|
||||
//Add them if they didn't exist
|
||||
#ifndef DB_TXN_SNAPSHOT
|
||||
dodefine_from_track(txn_flags, DB_TXN_SNAPSHOT);
|
||||
#endif
|
||||
#ifndef DB_READ_UNCOMMITTED
|
||||
dodefine_from_track(txn_flags, DB_READ_UNCOMMITTED);
|
||||
#endif
|
||||
#ifndef DB_READ_COMMITTED
|
||||
dodefine_from_track(txn_flags, DB_READ_COMMITTED);
|
||||
#endif
|
||||
dodefine_from_track(txn_flags, DB_INHERIT_ISOLATION);
|
||||
dodefine_from_track(txn_flags, DB_SERIALIZABLE);
|
||||
}
|
||||
|
||||
printf("#endif\n");
|
||||
|
||||
/* TOKUDB specific error codes*/
|
||||
printf("/* TOKUDB specific error codes */\n");
|
||||
dodefine(TOKUDB_OUT_OF_LOCKS);
|
||||
dodefine(TOKUDB_SUCCEEDED_EARLY);
|
||||
dodefine(TOKUDB_FOUND_BUT_REJECTED);
|
||||
dodefine(TOKUDB_USER_CALLBACK_ERROR);
|
||||
dodefine(TOKUDB_DICTIONARY_TOO_OLD);
|
||||
dodefine(TOKUDB_DICTIONARY_TOO_NEW);
|
||||
dodefine(TOKUDB_DICTIONARY_NO_HEADER);
|
||||
dodefine(TOKUDB_CANCELED);
|
||||
dodefine(TOKUDB_NO_DATA);
|
||||
dodefine(TOKUDB_ACCEPT);
|
||||
dodefine(TOKUDB_MVCC_DICTIONARY_TOO_NEW);
|
||||
dodefine(TOKUDB_UPGRADE_FAILURE);
|
||||
dodefine(TOKUDB_TRY_AGAIN);
|
||||
dodefine(TOKUDB_NEEDS_REPAIR);
|
||||
dodefine(TOKUDB_CURSOR_CONTINUE);
|
||||
|
||||
/* LOADER flags */
|
||||
printf("/* LOADER flags */\n");
|
||||
printf("#define LOADER_USE_PUTS 1\n"); // minimize space usage
|
||||
}
|
||||
|
||||
//#define DECL_LIMIT 100
|
||||
struct fieldinfo {
|
||||
char *decl;
|
||||
unsigned int off;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
#if USE_MAJOR==4 && USE_MINOR==1
|
||||
#include "sample_offsets_32_4_1.h"
|
||||
#include "sample_offsets_64_4_1.h"
|
||||
#elif USE_MAJOR==4 && USE_MINOR==3
|
||||
#include "sample_offsets_32_4_3.h"
|
||||
#include "sample_offsets_64_4_3.h"
|
||||
#elif USE_MAJOR==4 && USE_MINOR==4
|
||||
#include "sample_offsets_32_4_4.h"
|
||||
#include "sample_offsets_64_4_4.h"
|
||||
#elif USE_MAJOR==4 && USE_MINOR==5
|
||||
#include "sample_offsets_32_4_5.h"
|
||||
#include "sample_offsets_64_4_5.h"
|
||||
#elif USE_MAJOR==4 && USE_MINOR==6
|
||||
#include "sample_offsets_32_4_6.h"
|
||||
#include "sample_offsets_64_4_6.h"
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
|
||||
enum need_internal_type { NO_INTERNAL=0, INTERNAL_NAMED=1, INTERNAL_AT_END=2};
|
||||
|
||||
static void print_struct (const char *structname, enum need_internal_type need_internal, struct fieldinfo *fields32, struct fieldinfo *fields64, unsigned int N, const char *extra_decls[]) {
|
||||
unsigned int i;
|
||||
unsigned int current_32 = 0;
|
||||
unsigned int current_64 = 0;
|
||||
int dummy_counter=0;
|
||||
int did_toku_internal=0;
|
||||
// int total32 = fields32[N-1].size;
|
||||
// int total64 = fields32[N-1].size;
|
||||
assert(need_internal==NO_INTERNAL || need_internal==INTERNAL_NAMED || need_internal==INTERNAL_AT_END);
|
||||
printf("struct __toku_%s {\n", structname);
|
||||
for (i=0; i<N-1; i++) {
|
||||
unsigned int this_32 = fields32[i].off;
|
||||
unsigned int this_64 = fields64[i].off;
|
||||
//fprintf(stderr, "this32=%d current32=%d this64=%d current64=%d\n", this_32, current_32, this_64, current_64);
|
||||
if (this_32 > current_32 || this_64 > current_64) {
|
||||
unsigned int diff32 = this_32-current_32;
|
||||
unsigned int diff64 = this_64-current_64;
|
||||
assert(this_32 > current_32 && this_64 > current_64);
|
||||
if (diff32!=diff64) {
|
||||
unsigned int diff = diff64-diff32;
|
||||
unsigned int n_dummys = diff/4;
|
||||
if (need_internal==INTERNAL_NAMED && !did_toku_internal) {
|
||||
if (TDB_NATIVE &&
|
||||
(strcmp(structname, "dbc")==0 ||
|
||||
strcmp(structname, "db_txn")==0)) {
|
||||
printf(" struct __toku_%s_internal ii;\n", structname);
|
||||
printf("#define %s_struct_i(x) (&(x)->ii)\n", structname);
|
||||
} else {
|
||||
printf(" struct __toku_%s_internal *i;\n", structname);
|
||||
printf("#define %s_struct_i(x) ((x)->i)\n", structname);
|
||||
}
|
||||
n_dummys--;
|
||||
did_toku_internal=1;
|
||||
}
|
||||
while (n_dummys>0 && extra_decls && *extra_decls) {
|
||||
printf(" %s;\n", *extra_decls);
|
||||
extra_decls++;
|
||||
n_dummys--;
|
||||
}
|
||||
if (n_dummys>0) {
|
||||
if (!TDB_NATIVE)
|
||||
printf(" void* __toku_dummy%d[%u];\n", dummy_counter, n_dummys);
|
||||
dummy_counter++;
|
||||
}
|
||||
diff64-=diff*2;
|
||||
diff32-=diff;
|
||||
|
||||
}
|
||||
assert(diff32==diff64);
|
||||
if (diff32>0) {
|
||||
if (!TDB_NATIVE)
|
||||
printf(" char __toku_dummy%d[%u];\n", dummy_counter, diff32);
|
||||
dummy_counter++;
|
||||
}
|
||||
current_32 = this_32;
|
||||
current_64 = this_64;
|
||||
}
|
||||
if (this_32<current_32 || this_64<current_64) {
|
||||
printf("Whoops this_32=%u this_64=%u\n", this_32, this_64);
|
||||
}
|
||||
if (i+1<N) {
|
||||
if (strcmp(fields32[i].decl, fields64[i].decl)!=0) fprintf(stderr, "decl didn't match for %s\n", fields32[i].decl),
|
||||
assert(strcmp(fields32[i].decl, fields64[i].decl)==0);
|
||||
printf(" %s;", fields32[i].decl);
|
||||
if (!TDB_NATIVE)
|
||||
printf(" /* 32-bit offset=%u size=%u, 64=bit offset=%u size=%u */", fields32[i].off, fields32[i].size, fields64[i].off, fields64[i].size);
|
||||
printf("\n");
|
||||
} else {
|
||||
assert(fields32[i].decl==0);
|
||||
assert(fields64[i].decl==0);
|
||||
}
|
||||
current_32 += fields32[i].size;
|
||||
current_64 += fields64[i].size;
|
||||
}
|
||||
if (extra_decls) assert(NULL==*extra_decls); // make sure that the extra decls all got used up.
|
||||
{
|
||||
unsigned int this_32 = fields32[N-1].off;
|
||||
unsigned int this_64 = fields64[N-1].off;
|
||||
unsigned int diff32 = this_32-current_32;
|
||||
unsigned int diff64 = this_64-current_64;
|
||||
if (diff32>0 && diff32<diff64) {
|
||||
unsigned int diff = diff64-diff32;
|
||||
if (!TDB_NATIVE)
|
||||
printf(" void* __toku_dummy%d[%u]; /* Padding at the end */ \n", dummy_counter, diff/4);
|
||||
dummy_counter++;
|
||||
diff64-=diff*2;
|
||||
diff32-=diff;
|
||||
}
|
||||
if (diff32>0) {
|
||||
if (!TDB_NATIVE)
|
||||
printf(" char __toku_dummy%d[%u]; /* Padding at the end */ \n", dummy_counter, diff32);
|
||||
dummy_counter++;
|
||||
diff64-=diff32;
|
||||
diff32=0;
|
||||
}
|
||||
if (diff64>0)
|
||||
if (!TDB_NATIVE)
|
||||
printf(" /* %u more bytes of alignment in the 64-bit case. */\n", diff64);
|
||||
assert(diff64<8); /* there could be a few left from alignment. */
|
||||
}
|
||||
if (need_internal==INTERNAL_AT_END) {
|
||||
did_toku_internal = 1;
|
||||
}
|
||||
printf("};\n");
|
||||
assert(did_toku_internal || !need_internal);
|
||||
}
|
||||
|
||||
int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__((__unused__))) {
|
||||
printf("#ifndef _DB_H\n");
|
||||
printf("#define _DB_H\n");
|
||||
printf("/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */\n");
|
||||
printf("#ident \"Copyright (c) 2007-2011 Tokutek Inc. All rights reserved.\"\n");
|
||||
printf("#include <sys/types.h>\n");
|
||||
printf("/*stdio is needed for the FILE* in db->verify*/\n");
|
||||
printf("#include <stdio.h>\n");
|
||||
printf("#include <stdint.h>\n");
|
||||
//printf("#include <inttypes.h>\n");
|
||||
printf("#if defined(__cplusplus)\nextern \"C\" {\n#endif\n");
|
||||
|
||||
assert(DB_VERSION_MAJOR==DB_VERSION_MAJOR_32);
|
||||
assert(DB_VERSION_MINOR==DB_VERSION_MINOR_32);
|
||||
printf("#define TOKUDB 1\n");
|
||||
printf("#define TOKUDB_NATIVE_H %d\n", TDB_NATIVE);
|
||||
dodefine(DB_VERSION_MAJOR);
|
||||
dodefine(DB_VERSION_MINOR);
|
||||
dodefine(DB_VERSION_PATCH);
|
||||
printf("#ifndef _TOKUDB_WRAP_H\n");
|
||||
printf("#define DB_VERSION_STRING \"Tokutek: TokuDB %d.%d.%d\"\n", DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
|
||||
printf("#else\n");
|
||||
printf("#define DB_VERSION_STRING_ydb \"Tokutek: TokuDB (wrapped bdb)\"\n");
|
||||
printf("#endif\n");
|
||||
|
||||
if (0) {
|
||||
printf("#ifndef __BIT_TYPES_DEFINED__\n");
|
||||
printf("/* Define some int types if not provided by the system. BIND does this, so we do it too. */\n");
|
||||
printf("typedef unsigned int u_int32_t;\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
|
||||
//Typedef toku_off_t
|
||||
printf("#ifndef TOKU_OFF_T_DEFINED\n"
|
||||
"#define TOKU_OFF_T_DEFINED\n"
|
||||
"typedef int64_t toku_off_t;\n"
|
||||
"#endif\n");
|
||||
|
||||
#ifndef DB_GID_SIZE
|
||||
#define DB_GID_SIZE DB_XIDDATASIZE
|
||||
#endif
|
||||
dodefine(DB_GID_SIZE);
|
||||
|
||||
//printf("typedef struct __toku_db_btree_stat DB_BTREE_STAT;\n");
|
||||
printf("typedef struct __toku_db_env DB_ENV;\n");
|
||||
printf("typedef struct __toku_db_key_range DB_KEY_RANGE;\n");
|
||||
printf("typedef struct __toku_db_lsn DB_LSN;\n");
|
||||
printf("typedef struct __toku_db DB;\n");
|
||||
printf("typedef struct __toku_db_txn DB_TXN;\n");
|
||||
printf("typedef struct __toku_db_txn_active DB_TXN_ACTIVE;\n");
|
||||
printf("typedef struct __toku_db_txn_stat DB_TXN_STAT;\n");
|
||||
printf("typedef struct __toku_dbc DBC;\n");
|
||||
printf("typedef struct __toku_dbt DBT;\n");
|
||||
printf("typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_PREPLIST;\n");
|
||||
printf("typedef u_int32_t db_recno_t;\n");
|
||||
printf("typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);\n");
|
||||
|
||||
printf("#include <tdb-internal.h>\n");
|
||||
|
||||
printf("#ifndef __BIGGEST_ALIGNMENT__\n #define __BIGGEST_ALIGNMENT__ 16\n#endif\n");
|
||||
|
||||
//stat64
|
||||
printf("typedef struct __toku_db_btree_stat64 {\n");
|
||||
printf(" u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */\n");
|
||||
printf(" u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */\n");
|
||||
printf(" u_int64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */\n");
|
||||
printf(" u_int64_t bt_fsize; /* how big is the underlying file */\n");
|
||||
// 4018
|
||||
printf(" u_int64_t bt_create_time_sec; /* Creation time, in seconds */\n");
|
||||
printf(" u_int64_t bt_modify_time_sec; /* Time of last serialization, in seconds */\n");
|
||||
printf(" u_int64_t bt_verify_time_sec; /* Time of last verification, in seconds */\n");
|
||||
printf("} DB_BTREE_STAT64;\n");
|
||||
|
||||
//bulk loader
|
||||
printf("typedef struct __toku_loader DB_LOADER;\n");
|
||||
printf("struct __toku_loader_internal;\n");
|
||||
printf("struct __toku_loader {\n");
|
||||
printf(" struct __toku_loader_internal *i;\n");
|
||||
printf(" int (*set_error_callback)(DB_LOADER *loader, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */\n");
|
||||
printf(" int (*set_poll_function)(DB_LOADER *loader, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */\n");
|
||||
printf(" int (*put)(DB_LOADER *loader, DBT *key, DBT* val); /* give a row to the loader */\n");
|
||||
printf(" int (*close)(DB_LOADER *loader); /* finish loading, free memory */\n");
|
||||
printf(" int (*abort)(DB_LOADER *loader); /* abort loading, free memory */\n");
|
||||
printf("};\n");
|
||||
|
||||
//indexer
|
||||
printf("typedef struct __toku_indexer DB_INDEXER;\n");
|
||||
printf("struct __toku_indexer_internal;\n");
|
||||
printf("struct __toku_indexer {\n");
|
||||
printf(" struct __toku_indexer_internal *i;\n");
|
||||
printf(" int (*set_error_callback)(DB_INDEXER *indexer, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */\n");
|
||||
printf(" int (*set_poll_function)(DB_INDEXER *indexer, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */\n");
|
||||
printf(" int (*build)(DB_INDEXER *indexer); /* build the indexes */\n");
|
||||
printf(" int (*close)(DB_INDEXER *indexer); /* finish indexing, free memory */\n");
|
||||
printf(" int (*abort)(DB_INDEXER *indexer); /* abort indexing, free memory */\n");
|
||||
printf("};\n");
|
||||
|
||||
// Filesystem redzone state
|
||||
printf("typedef enum { \n");
|
||||
printf(" FS_GREEN = 0, // green zone (we have lots of space) \n");
|
||||
printf(" FS_YELLOW = 1, // yellow zone (issue warning but allow operations) \n");
|
||||
printf(" FS_RED = 2, // red zone (prevent insert operations) \n");
|
||||
printf(" FS_BLOCKED = 3 // For reporting engine status, completely blocked \n");
|
||||
printf("} fs_redzone_state;\n");
|
||||
|
||||
|
||||
// engine status info
|
||||
// engine status is passed to handlerton as an array of TOKU_ENGINE_STATUS_ROW_S[]
|
||||
printf("typedef enum {\n");
|
||||
printf(" FS_STATE = 0, // interpret as file system state (redzone) enum \n");
|
||||
printf(" UINT64, // interpret as uint64_t \n");
|
||||
printf(" CHARSTR, // interpret as char * \n");
|
||||
printf(" UNIXTIME, // interpret as time_t \n");
|
||||
printf(" TOKUTIME // interpret as tokutime_t \n");
|
||||
printf("} toku_engine_status_display_type; \n");
|
||||
|
||||
printf("typedef struct __toku_engine_status_row {\n");
|
||||
printf(" char * keyname; // info schema key, should not change across revisions without good reason \n");
|
||||
printf(" char * legend; // the text that will appear at user interface \n");
|
||||
printf(" toku_engine_status_display_type type; // how to interpret the value \n");
|
||||
printf(" union { \n");
|
||||
printf(" uint64_t num; \n");
|
||||
printf(" char * str; \n");
|
||||
printf(" } value; \n");
|
||||
printf("} * TOKU_ENGINE_STATUS_ROW, TOKU_ENGINE_STATUS_ROW_S; \n");
|
||||
|
||||
print_dbtype();
|
||||
// print_db_notices();
|
||||
print_defines();
|
||||
|
||||
printf("typedef int (*generate_row_for_put_func)(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val);\n");
|
||||
printf("typedef int (*generate_row_for_del_func)(DB *dest_db, DB *src_db, DBT *dest_key, const DBT *src_key, const DBT *src_val);\n");
|
||||
|
||||
printf("/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/\n");
|
||||
printf("#ifdef _TOKUDB_WRAP_H\n#undef txn_begin\n#endif\n");
|
||||
assert(sizeof(db_btree_stat_fields32)==sizeof(db_btree_stat_fields64));
|
||||
// Don't produce db_btree_stat records.
|
||||
//print_struct("db_btree_stat", 0, db_btree_stat_fields32, db_btree_stat_fields64, sizeof(db_btree_stat_fields32)/sizeof(db_btree_stat_fields32[0]), 0);
|
||||
assert(sizeof(db_env_fields32)==sizeof(db_env_fields64));
|
||||
{
|
||||
const char *extra[]={
|
||||
"int (*checkpointing_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic checkpoints. 0 means disabled. */",
|
||||
"int (*checkpointing_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic checkpoints. 0 means disabled. */",
|
||||
"int (*cleaner_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic cleaner attempts. 0 means disabled. */",
|
||||
"int (*cleaner_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic cleaner attempts. 0 means disabled. */",
|
||||
"int (*cleaner_set_iterations) (DB_ENV*, u_int32_t) /* Change the number of attempts on each cleaner invokation. 0 means disabled. */",
|
||||
"int (*cleaner_get_iterations) (DB_ENV*, u_int32_t*) /* Retrieve the number of attempts on each cleaner invokation. 0 means disabled. */",
|
||||
"int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */",
|
||||
"int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */",
|
||||
"int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */",
|
||||
"int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */",
|
||||
"int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */",
|
||||
"int (*get_engine_status_num_rows) (DB_ENV*, uint64_t*) /* return number of rows in engine status */",
|
||||
"int (*get_engine_status) (DB_ENV*, TOKU_ENGINE_STATUS_ROW, uint64_t, fs_redzone_state*, uint64_t*, char*, int) /* Fill in status struct and redzone state, possibly env panic string */",
|
||||
"int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */",
|
||||
"int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);",
|
||||
"int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* FOR TEST ONLY: lookup existing iname */",
|
||||
"int (*create_loader) (DB_ENV *env, DB_TXN *txn, DB_LOADER **blp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t dbt_flags[/*N*/], uint32_t loader_flags)",
|
||||
"int (*create_indexer) (DB_ENV *env, DB_TXN *txn, DB_INDEXER **idxrp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t indexer_flags)",
|
||||
"int (*put_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,\n"
|
||||
" const DBT *src_key, const DBT *src_val,\n"
|
||||
" uint32_t num_dbs, DB **db_array, DBT *keys, DBT *vals, uint32_t *flags_array) /* insert into multiple DBs */",
|
||||
"int (*set_generate_row_callback_for_put) (DB_ENV *env, generate_row_for_put_func generate_row_for_put)",
|
||||
"int (*del_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,\n"
|
||||
" const DBT *src_key, const DBT *src_val,\n"
|
||||
" uint32_t num_dbs, DB **db_array, DBT *keys, uint32_t *flags_array) /* delete from multiple DBs */",
|
||||
"int (*set_generate_row_callback_for_del) (DB_ENV *env, generate_row_for_del_func generate_row_for_del)",
|
||||
"int (*update_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,\n"
|
||||
" DBT *old_src_key, DBT *old_src_data,\n"
|
||||
" DBT *new_src_key, DBT *new_src_data,\n"
|
||||
" uint32_t num_dbs, DB **db_array, uint32_t *flags_array,\n"
|
||||
" uint32_t num_keys, DBT *keys,\n"
|
||||
" uint32_t num_vals, DBT *vals) /* update multiple DBs */",
|
||||
"int (*get_redzone) (DB_ENV *env, int *redzone) /* get the redzone limit */",
|
||||
"int (*set_redzone) (DB_ENV *env, int redzone) /* set the redzone limit in percent of total space */",
|
||||
"int (*set_lk_max_memory) (DB_ENV *env, uint64_t max)",
|
||||
"int (*get_lk_max_memory) (DB_ENV *env, uint64_t *max)",
|
||||
"void (*set_update) (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra))",
|
||||
"int (*set_lock_timeout) (DB_ENV *env, uint64_t lock_wait_time_msec)",
|
||||
"int (*get_lock_timeout) (DB_ENV *env, uint64_t *lock_wait_time_msec)",
|
||||
NULL};
|
||||
print_struct("db_env", 1, db_env_fields32, db_env_fields64, sizeof(db_env_fields32)/sizeof(db_env_fields32[0]), extra);
|
||||
}
|
||||
|
||||
assert(sizeof(db_key_range_fields32)==sizeof(db_key_range_fields64));
|
||||
print_struct("db_key_range", 0, db_key_range_fields32, db_key_range_fields64, sizeof(db_key_range_fields32)/sizeof(db_key_range_fields32[0]), 0);
|
||||
|
||||
assert(sizeof(db_lsn_fields32)==sizeof(db_lsn_fields64));
|
||||
{
|
||||
//const char *extra[] = {"u_int64_t lsn", NULL};
|
||||
print_struct("db_lsn", 0, db_lsn_fields32, db_lsn_fields64, sizeof(db_lsn_fields32)/sizeof(db_lsn_fields32[0]), 0);
|
||||
}
|
||||
|
||||
assert(sizeof(dbt_fields32)==sizeof(dbt_fields64));
|
||||
print_struct("dbt", 0, dbt_fields32, dbt_fields64, sizeof(dbt_fields32)/sizeof(dbt_fields32[0]), 0);
|
||||
|
||||
//descriptor
|
||||
printf("typedef struct __toku_descriptor {\n");
|
||||
printf(" DBT dbt;\n");
|
||||
printf("} *DESCRIPTOR, DESCRIPTOR_S;\n");
|
||||
|
||||
assert(sizeof(db_fields32)==sizeof(db_fields64));
|
||||
{
|
||||
//file fragmentation info
|
||||
//a block is just a contiguous region in a file.
|
||||
printf("//One header is included in 'data'\n");
|
||||
printf("//One header is included in 'additional for checkpoint'\n");
|
||||
printf("typedef struct __toku_db_fragmentation {\n");
|
||||
printf(" uint64_t file_size_bytes; //Total file size in bytes\n");
|
||||
printf(" uint64_t data_bytes; //Compressed User Data in bytes\n");
|
||||
printf(" uint64_t data_blocks; //Number of blocks of compressed User Data\n");
|
||||
printf(" uint64_t checkpoint_bytes_additional; //Additional bytes used for checkpoint system\n");
|
||||
printf(" uint64_t checkpoint_blocks_additional; //Additional blocks used for checkpoint system \n");
|
||||
printf(" uint64_t unused_bytes; //Unused space in file\n");
|
||||
printf(" uint64_t unused_blocks; //Number of contiguous regions of unused space\n");
|
||||
printf(" uint64_t largest_unused_block; //Size of largest contiguous unused space\n");
|
||||
printf("} *TOKU_DB_FRAGMENTATION, TOKU_DB_FRAGMENTATION_S;\n");
|
||||
|
||||
const char *extra[]={"int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact)",
|
||||
"int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *)",
|
||||
"int (*pre_acquire_table_lock)(DB*, DB_TXN*)",
|
||||
"int (*pre_acquire_fileops_lock)(DB*, DB_TXN*)",
|
||||
"const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/",
|
||||
"const DBT* (*dbt_neg_infty)(void)/* Return the special DBT that refers to negative infinity in the lock table.*/",
|
||||
"void (*get_max_row_size) (DB*, u_int32_t *max_key_size, u_int32_t *max_row_size)",
|
||||
"DESCRIPTOR descriptor /* saved row/dictionary descriptor for aiding in comparisons */",
|
||||
"int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, u_int32_t) /* change row/dictionary descriptor for a db. Available only while db is open */",
|
||||
"int (*getf_set)(DB*, DB_TXN*, u_int32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */",
|
||||
"int (*optimize)(DB*) /* Run garbage collecion and promote all transactions older than oldest. Amortized (happens during flattening) */",
|
||||
"int (*hot_optimize)(DB*, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra)",
|
||||
"int (*get_fragmentation)(DB*,TOKU_DB_FRAGMENTATION)",
|
||||
"int (*get_readpagesize)(DB*,u_int32_t*)",
|
||||
"int (*set_readpagesize)(DB*,u_int32_t)",
|
||||
"int (*set_indexer)(DB*, DB_INDEXER*)",
|
||||
"void (*get_indexer)(DB*, DB_INDEXER**)",
|
||||
"int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going)",
|
||||
"int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags)",
|
||||
"int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags)",
|
||||
NULL};
|
||||
print_struct("db", 1, db_fields32, db_fields64, sizeof(db_fields32)/sizeof(db_fields32[0]), extra);
|
||||
}
|
||||
|
||||
assert(sizeof(db_txn_active_fields32)==sizeof(db_txn_active_fields64));
|
||||
print_struct("db_txn_active", 0, db_txn_active_fields32, db_txn_active_fields64, sizeof(db_txn_active_fields32)/sizeof(db_txn_active_fields32[0]), 0);
|
||||
assert(sizeof(db_txn_fields32)==sizeof(db_txn_fields64));
|
||||
{
|
||||
//txn progress info
|
||||
printf("typedef struct __toku_txn_progress {\n");
|
||||
printf(" uint64_t entries_total;\n");
|
||||
printf(" uint64_t entries_processed;\n");
|
||||
printf(" uint8_t is_commit;\n");
|
||||
printf(" uint8_t stalled_on_checkpoint;\n");
|
||||
printf("} *TOKU_TXN_PROGRESS, TOKU_TXN_PROGRESS_S;\n");
|
||||
printf("typedef void(*TXN_PROGRESS_POLL_FUNCTION)(TOKU_TXN_PROGRESS, void*);\n");
|
||||
|
||||
printf("struct txn_stat {\n u_int64_t rollback_raw_count;\n};\n");
|
||||
const char *extra[] = {
|
||||
"int (*txn_stat)(DB_TXN *, struct txn_stat **)",
|
||||
"struct toku_list open_txns",
|
||||
"int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*)",
|
||||
"int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*)",
|
||||
NULL};
|
||||
print_struct("db_txn", INTERNAL_AT_END, db_txn_fields32, db_txn_fields64, sizeof(db_txn_fields32)/sizeof(db_txn_fields32[0]), extra);
|
||||
}
|
||||
|
||||
assert(sizeof(db_txn_stat_fields32)==sizeof(db_txn_stat_fields64));
|
||||
print_struct("db_txn_stat", 0, db_txn_stat_fields32, db_txn_stat_fields64, sizeof(db_txn_stat_fields32)/sizeof(db_txn_stat_fields32[0]), 0);
|
||||
|
||||
{
|
||||
const char *extra[]={
|
||||
"int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
|
||||
|
||||
"int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
|
||||
"int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*)",
|
||||
NULL};
|
||||
assert(sizeof(dbc_fields32)==sizeof(dbc_fields64));
|
||||
print_struct("dbc", INTERNAL_AT_END, dbc_fields32, dbc_fields64, sizeof(dbc_fields32)/sizeof(dbc_fields32[0]), extra);
|
||||
}
|
||||
|
||||
printf("#ifdef _TOKUDB_WRAP_H\n#define txn_begin txn_begin_tokudb\n#endif\n");
|
||||
printf("int db_env_create(DB_ENV **, u_int32_t) %s;\n", VISIBLE);
|
||||
printf("int db_create(DB **, DB_ENV *, u_int32_t) %s;\n", VISIBLE);
|
||||
printf("char *db_strerror(int) %s;\n", VISIBLE);
|
||||
printf("const char *db_version(int*,int *,int *) %s;\n", VISIBLE);
|
||||
printf("int log_compare (const DB_LSN*, const DB_LSN *) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_fsync (int (*)(int)) %s;\n", VISIBLE);
|
||||
printf("int toku_set_trace_file (char *fname) %s;\n", VISIBLE);
|
||||
printf("int toku_close_trace_file (void) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_free (void (*)(void*)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_malloc (void *(*)(size_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_realloc (void *(*)(void*, size_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_full_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_write (ssize_t (*)(int, const void *, size_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_full_write (ssize_t (*)(int, const void *, size_t)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_fdopen (FILE* (*)(int, const char *)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_fopen (FILE* (*)(const char *, const char *)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_open (int (*)(const char *, int, int)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_fclose (int (*)(FILE*)) %s;\n", VISIBLE);
|
||||
printf("int db_env_set_func_pread (ssize_t (*)(int, void *, size_t, off_t)) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_func_loader_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_checkpoint_callback (void (*)(void*), void*) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_checkpoint_callback2 (void (*)(void*), void*) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_recover_callback (void (*)(void*), void*) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_recover_callback2 (void (*)(void*), void*) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_loader_size_factor (uint32_t) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_mvcc_garbage_collection_verification(u_int32_t) %s;\n", VISIBLE);
|
||||
printf("void db_env_enable_engine_status(u_int32_t) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) %s;\n", VISIBLE);
|
||||
printf("#if defined(__cplusplus)\n}\n#endif\n");
|
||||
printf("#endif\n");
|
||||
return 0;
|
||||
}
|
224
buildheader/sample_offsets.c
Normal file
224
buildheader/sample_offsets.c
Normal file
|
@ -0,0 +1,224 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
||||
#ident "$Id$"
|
||||
/* LICENSE: This file is licensed under the GPL or from Tokutek. */
|
||||
|
||||
/* Make a db.h that will be link-time compatible with Sleepycat's Berkeley DB. */
|
||||
|
||||
|
||||
#include <db.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
// Don't include toku_assert.h. Just use assert.h
|
||||
#include <assert.h>
|
||||
|
||||
#define DECL_LIMIT 200
|
||||
#define FIELD_LIMIT 100
|
||||
struct fieldinfo {
|
||||
char decl[DECL_LIMIT];
|
||||
unsigned int off;
|
||||
unsigned int size;
|
||||
} fields[FIELD_LIMIT];
|
||||
static int field_counter=0;
|
||||
|
||||
static int compare_fields (const void *av, const void *bv) {
|
||||
const struct fieldinfo *a = av;
|
||||
const struct fieldinfo *b = bv;
|
||||
if (a->off < b->off) return -1;
|
||||
if (a->off > b->off) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define STRUCT_SETUP(typ, name, fstring) ({ \
|
||||
int len=snprintf(fields[field_counter].decl, DECL_LIMIT, fstring, #name); \
|
||||
assert(len<DECL_LIMIT); \
|
||||
fields[field_counter].off = __builtin_offsetof(typ, name); \
|
||||
{ typ dummy; \
|
||||
fields[field_counter].size = sizeof(dummy.name); } \
|
||||
field_counter++; })
|
||||
|
||||
static FILE *outf;
|
||||
static void open_file (void) {
|
||||
char fname[100];
|
||||
#ifdef LOCAL
|
||||
snprintf(fname, 100, "sample_offsets_local.h");
|
||||
#else
|
||||
snprintf(fname, 100, "sample_offsets_%d_%d_%d.h", __WORDSIZE, DB_VERSION_MAJOR, DB_VERSION_MINOR);
|
||||
#endif
|
||||
outf = fopen(fname, "w");
|
||||
assert(outf);
|
||||
|
||||
}
|
||||
|
||||
static void sort_and_dump_fields (const char *structname, unsigned int sizeofstruct) {
|
||||
int i;
|
||||
qsort(fields, field_counter, sizeof(fields[0]), compare_fields);
|
||||
fprintf(outf, "struct fieldinfo %s_fields%d[] = {\n", structname, __WORDSIZE);
|
||||
for (i=0; i<field_counter; i++) {
|
||||
fprintf(outf, " {\"%s\", %u, %u},\n", fields[i].decl, fields[i].off, fields[i].size);
|
||||
}
|
||||
fprintf(outf, " {0, %u, %u} /* size of whole struct */\n", sizeofstruct, sizeofstruct);
|
||||
fprintf(outf, "};\n");
|
||||
}
|
||||
|
||||
static void sample_db_btree_stat_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_BTREE_STAT, bt_ndata, "u_int32_t %s");
|
||||
STRUCT_SETUP(DB_BTREE_STAT, bt_nkeys, "u_int32_t %s");
|
||||
sort_and_dump_fields("db_btree_stat", sizeof(DB_BTREE_STAT));
|
||||
}
|
||||
|
||||
static void sample_db_env_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_ENV, api1_internal, "void *%s"); /* Used for C++ hacking. */
|
||||
STRUCT_SETUP(DB_ENV, app_private, "void *%s");
|
||||
STRUCT_SETUP(DB_ENV, close, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, err, "void (*%s) (const DB_ENV *, int, const char *, ...)");
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
|
||||
STRUCT_SETUP(DB_ENV, get_cachesize, "int (*%s) (DB_ENV *, u_int32_t *, u_int32_t *, int *)");
|
||||
STRUCT_SETUP(DB_ENV, get_flags, "int (*%s) (DB_ENV *, u_int32_t *)");
|
||||
STRUCT_SETUP(DB_ENV, get_lk_max_locks, "int (*%s) (DB_ENV *, u_int32_t *)");
|
||||
STRUCT_SETUP(DB_ENV, get_lg_max, "int (*%s) (DB_ENV *, u_int32_t*)");
|
||||
#endif
|
||||
STRUCT_SETUP(DB_ENV, log_archive, "int (*%s) (DB_ENV *, char **[], u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, log_flush, "int (*%s) (DB_ENV *, const DB_LSN *)");
|
||||
STRUCT_SETUP(DB_ENV, open, "int (*%s) (DB_ENV *, const char *, u_int32_t, int)");
|
||||
STRUCT_SETUP(DB_ENV, set_cachesize, "int (*%s) (DB_ENV *, u_int32_t, u_int32_t, int)");
|
||||
STRUCT_SETUP(DB_ENV, set_data_dir, "int (*%s) (DB_ENV *, const char *)");
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 1
|
||||
STRUCT_SETUP(DB_ENV, set_errcall, "void (*%s) (DB_ENV *, void (*)(const char *, char *))");
|
||||
#endif
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
|
||||
STRUCT_SETUP(DB_ENV, set_errcall, "void (*%s) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))");
|
||||
#endif
|
||||
STRUCT_SETUP(DB_ENV, set_errfile, "void (*%s) (DB_ENV *, FILE*)");
|
||||
STRUCT_SETUP(DB_ENV, set_errpfx, "void (*%s) (DB_ENV *, const char *)");
|
||||
STRUCT_SETUP(DB_ENV, set_flags, "int (*%s) (DB_ENV *, u_int32_t, int)");
|
||||
STRUCT_SETUP(DB_ENV, set_lg_bsize, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, set_lg_dir, "int (*%s) (DB_ENV *, const char *)");
|
||||
STRUCT_SETUP(DB_ENV, set_lg_max, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, set_lk_detect, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 4
|
||||
STRUCT_SETUP(DB_ENV, set_lk_max, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
#endif
|
||||
STRUCT_SETUP(DB_ENV, set_lk_max_locks, "int (*%s) (DB_ENV *, u_int32_t)");
|
||||
//STRUCT_SETUP(DB_ENV, set_noticecall, "void (*%s) (DB_ENV *, void (*)(DB_ENV *, db_notices))");
|
||||
STRUCT_SETUP(DB_ENV, set_tmp_dir, "int (*%s) (DB_ENV *, const char *)");
|
||||
STRUCT_SETUP(DB_ENV, set_verbose, "int (*%s) (DB_ENV *, u_int32_t, int)");
|
||||
STRUCT_SETUP(DB_ENV, txn_checkpoint, "int (*%s) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, txn_stat, "int (*%s) (DB_ENV *, DB_TXN_STAT **, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, txn_begin, "int (*%s) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, txn_recover, "int (*%s) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)");
|
||||
STRUCT_SETUP(DB_ENV, dbremove, "int (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)");
|
||||
STRUCT_SETUP(DB_ENV, dbrename, "int (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)");
|
||||
sort_and_dump_fields("db_env", sizeof(DB_ENV));
|
||||
}
|
||||
|
||||
static void sample_db_key_range_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_KEY_RANGE, less, "double %s");
|
||||
STRUCT_SETUP(DB_KEY_RANGE, equal, "double %s");
|
||||
STRUCT_SETUP(DB_KEY_RANGE, greater, "double %s");
|
||||
sort_and_dump_fields("db_key_range", sizeof(DB_ENV));
|
||||
}
|
||||
|
||||
static void sample_db_lsn_offsets (void) {
|
||||
field_counter=0;
|
||||
sort_and_dump_fields("db_lsn", sizeof(DB_LSN));
|
||||
}
|
||||
|
||||
static void sample_db_offsets (void) {
|
||||
/* Do these in alphabetical order. */
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB, api_internal, "void *%s"); /* Used for C++ hacking. */
|
||||
STRUCT_SETUP(DB, app_private, "void *%s");
|
||||
STRUCT_SETUP(DB, close, "int (*%s) (DB*, u_int32_t)");
|
||||
STRUCT_SETUP(DB, cursor, "int (*%s) (DB *, DB_TXN *, DBC **, u_int32_t)");
|
||||
STRUCT_SETUP(DB, dbenv, "DB_ENV *%s");
|
||||
STRUCT_SETUP(DB, del, "int (*%s) (DB *, DB_TXN *, DBT *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, fd, "int (*%s) (DB *, int *)");
|
||||
STRUCT_SETUP(DB, get, "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)");
|
||||
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
|
||||
STRUCT_SETUP(DB, get_flags, "int (*%s) (DB *, u_int32_t *)");
|
||||
STRUCT_SETUP(DB, get_pagesize, "int (*%s) (DB *, u_int32_t *)");
|
||||
#endif
|
||||
STRUCT_SETUP(DB, key_range, "int (*%s) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, open, "int (*%s) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)");
|
||||
STRUCT_SETUP(DB, put, "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, remove, "int (*%s) (DB *, const char *, const char *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, rename, "int (*%s) (DB *, const char *, const char *, const char *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, set_errfile, "void (*%s) (DB *, FILE*)");
|
||||
STRUCT_SETUP(DB, set_flags, "int (*%s) (DB *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, set_pagesize, "int (*%s) (DB *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, stat, "int (*%s) (DB *, void *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, truncate, "int (*%s) (DB *, DB_TXN *, u_int32_t *, u_int32_t)");
|
||||
STRUCT_SETUP(DB, verify, "int (*%s) (DB *, const char *, const char *, FILE *, u_int32_t)");
|
||||
sort_and_dump_fields("db", sizeof(DB));
|
||||
}
|
||||
|
||||
static void sample_db_txn_active_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_TXN_ACTIVE, lsn, "DB_LSN %s");
|
||||
STRUCT_SETUP(DB_TXN_ACTIVE, txnid, "u_int32_t %s");
|
||||
sort_and_dump_fields("db_txn_active", sizeof(DB_TXN_ACTIVE));
|
||||
}
|
||||
|
||||
static void sample_db_txn_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_TXN, abort, "int (*%s) (DB_TXN *)");
|
||||
STRUCT_SETUP(DB_TXN, api_internal,"void *%s");
|
||||
STRUCT_SETUP(DB_TXN, commit, "int (*%s) (DB_TXN*, u_int32_t)");
|
||||
STRUCT_SETUP(DB_TXN, prepare, "int (*%s) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])");
|
||||
STRUCT_SETUP(DB_TXN, id, "u_int32_t (*%s) (DB_TXN *)");
|
||||
STRUCT_SETUP(DB_TXN, mgrp, "DB_ENV *%s /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/");
|
||||
STRUCT_SETUP(DB_TXN, parent, "DB_TXN *%s");
|
||||
sort_and_dump_fields("db_txn", sizeof(DB_TXN));
|
||||
}
|
||||
|
||||
static void sample_db_txn_stat_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DB_TXN_STAT, st_nactive, "u_int32_t %s");
|
||||
STRUCT_SETUP(DB_TXN_STAT, st_txnarray, "DB_TXN_ACTIVE *%s");
|
||||
sort_and_dump_fields("db_txn_stat", sizeof(DB_TXN_STAT));
|
||||
}
|
||||
|
||||
static void sample_dbc_offsets (void) {
|
||||
field_counter=0;
|
||||
STRUCT_SETUP(DBC, c_close, "int (*%s) (DBC *)");
|
||||
STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, u_int32_t)");
|
||||
STRUCT_SETUP(DBC, c_del, "int (*%s) (DBC *, u_int32_t)");
|
||||
STRUCT_SETUP(DBC, c_get, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
|
||||
STRUCT_SETUP(DBC, dbp, "DB *%s");
|
||||
sort_and_dump_fields("dbc", sizeof(DBC));
|
||||
}
|
||||
|
||||
static void sample_dbt_offsets (void) {
|
||||
field_counter=0;
|
||||
#if 0 && DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==1
|
||||
STRUCT_SETUP(DBT, app_private, "void*%s");
|
||||
#endif
|
||||
STRUCT_SETUP(DBT, data, "void*%s");
|
||||
STRUCT_SETUP(DBT, flags, "u_int32_t %s");
|
||||
STRUCT_SETUP(DBT, size, "u_int32_t %s");
|
||||
STRUCT_SETUP(DBT, ulen, "u_int32_t %s");
|
||||
sort_and_dump_fields("dbt", sizeof(DBT));
|
||||
}
|
||||
|
||||
int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__((__unused__))) {
|
||||
open_file();
|
||||
fprintf(outf, "/* BDB offsets on a %d-bit machine */\n", __WORDSIZE);
|
||||
fprintf(outf, "#define DB_VERSION_MAJOR_%d %d\n", __WORDSIZE, DB_VERSION_MAJOR);
|
||||
fprintf(outf, "#define DB_VERSION_MINOR_%d %d\n", __WORDSIZE, DB_VERSION_MINOR);
|
||||
fprintf(outf, "#define DB_VERSION_STRING_%d \"Berkeley DB Compatability Header %d.%d\"\n", __WORDSIZE, DB_VERSION_MAJOR, DB_VERSION_MINOR);
|
||||
sample_db_btree_stat_offsets();
|
||||
sample_db_env_offsets();
|
||||
sample_db_key_range_offsets();
|
||||
sample_db_lsn_offsets();
|
||||
sample_db_offsets();
|
||||
sample_db_txn_active_offsets();
|
||||
sample_db_txn_offsets();
|
||||
sample_db_txn_stat_offsets();
|
||||
sample_dbc_offsets();
|
||||
sample_dbt_offsets();
|
||||
return 0;
|
||||
}
|
105
buildheader/sample_offsets_32_4_1.h
Normal file
105
buildheader/sample_offsets_32_4_1.h
Normal file
|
@ -0,0 +1,105 @@
|
|||
/* BDB offsets on a 32-bit machine */
|
||||
#define DB_VERSION_MAJOR_32 4
|
||||
#define DB_VERSION_MINOR_32 1
|
||||
#define DB_VERSION_STRING_32 "Berkeley DB Compatability Header 4.1"
|
||||
struct fieldinfo db_btree_stat_fields32[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields32[] = {
|
||||
{"void *app_private", 36, 4},
|
||||
{"void *api1_internal", 212, 4},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 244, 4},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 248, 4},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 252, 4},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 256, 4},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 264, 4},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 272, 4},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 288, 4},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 292, 4},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 296, 4},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 304, 4},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 324, 4},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 328, 4},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 336, 4},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 340, 4},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 344, 4},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 352, 4},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 364, 4},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 384, 4},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 388, 4},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 392, 4},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 452, 4},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 540, 4},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 544, 4},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 552, 4},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 556, 4},
|
||||
{0, 576, 576} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields32[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 576, 576} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields32[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields32[] = {
|
||||
{"void *app_private", 16, 4},
|
||||
{"DB_ENV *dbenv", 20, 4},
|
||||
{"void *api_internal", 236, 4},
|
||||
{"int (*close) (DB*, u_int32_t)", 260, 4},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 264, 4},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 268, 4},
|
||||
{"int (*fd) (DB *, int *)", 280, 4},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 284, 4},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 304, 4},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 308, 4},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 312, 4},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 316, 4},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 320, 4},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 324, 4},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 356, 4},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 368, 4},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 376, 4},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 384, 4},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 396, 4},
|
||||
{0, 472, 472} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields32[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 8, 8},
|
||||
{0, 16, 16} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields32[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
|
||||
{"DB_TXN *parent", 4, 4},
|
||||
{"void *api_internal", 68, 4},
|
||||
{"int (*abort) (DB_TXN *)", 76, 4},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 80, 4},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 88, 4},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 92, 4},
|
||||
{0, 104, 104} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields32[] = {
|
||||
{"u_int32_t st_nactive", 32, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 44, 4},
|
||||
{0, 60, 60} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields32[] = {
|
||||
{"DB *dbp", 0, 4},
|
||||
{"int (*c_close) (DBC *)", 188, 4},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
|
||||
{0, 252, 252} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields32[] = {
|
||||
{"void*data", 0, 4},
|
||||
{"u_int32_t size", 4, 4},
|
||||
{"u_int32_t ulen", 8, 4},
|
||||
{"u_int32_t flags", 20, 4},
|
||||
{0, 24, 24} /* size of whole struct */
|
||||
};
|
111
buildheader/sample_offsets_32_4_3.h
Normal file
111
buildheader/sample_offsets_32_4_3.h
Normal file
|
@ -0,0 +1,111 @@
|
|||
/* BDB offsets on a 32-bit machine */
|
||||
#define DB_VERSION_MAJOR_32 4
|
||||
#define DB_VERSION_MINOR_32 3
|
||||
#define DB_VERSION_STRING_32 "Berkeley DB Compatability Header 4.3"
|
||||
struct fieldinfo db_btree_stat_fields32[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 84, 84} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields32[] = {
|
||||
{"void *app_private", 44, 4},
|
||||
{"void *api1_internal", 244, 4},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 276, 4},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 280, 4},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 284, 4},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 288, 4},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 296, 4},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 336, 4},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 348, 4},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 356, 4},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 364, 4},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 372, 4},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 376, 4},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 432, 4},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 440, 4},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 452, 4},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 460, 4},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 464, 4},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 468, 4},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 480, 4},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 492, 4},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 524, 4},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 528, 4},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 532, 4},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 536, 4},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 592, 4},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 596, 4},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 712, 4},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 716, 4},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 720, 4},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 724, 4},
|
||||
{0, 756, 756} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields32[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 756, 756} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields32[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields32[] = {
|
||||
{"void *app_private", 16, 4},
|
||||
{"DB_ENV *dbenv", 20, 4},
|
||||
{"void *api_internal", 248, 4},
|
||||
{"int (*close) (DB*, u_int32_t)", 272, 4},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 276, 4},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 280, 4},
|
||||
{"int (*fd) (DB *, int *)", 296, 4},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 300, 4},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 336, 4},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 348, 4},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 364, 4},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 368, 4},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 372, 4},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 376, 4},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 380, 4},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 384, 4},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 412, 4},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 424, 4},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 444, 4},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 452, 4},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 468, 4},
|
||||
{0, 580, 580} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields32[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 8, 8},
|
||||
{0, 148, 148} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields32[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
|
||||
{"DB_TXN *parent", 4, 4},
|
||||
{"void *api_internal", 88, 4},
|
||||
{"int (*abort) (DB_TXN *)", 100, 4},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 104, 4},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 112, 4},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 116, 4},
|
||||
{0, 132, 132} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields32[] = {
|
||||
{"u_int32_t st_nactive", 32, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 44, 4},
|
||||
{0, 60, 60} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields32[] = {
|
||||
{"DB *dbp", 0, 4},
|
||||
{"int (*c_close) (DBC *)", 188, 4},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
|
||||
{0, 248, 248} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields32[] = {
|
||||
{"void*data", 0, 4},
|
||||
{"u_int32_t size", 4, 4},
|
||||
{"u_int32_t ulen", 8, 4},
|
||||
{"u_int32_t flags", 20, 4},
|
||||
{0, 24, 24} /* size of whole struct */
|
||||
};
|
111
buildheader/sample_offsets_32_4_4.h
Normal file
111
buildheader/sample_offsets_32_4_4.h
Normal file
|
@ -0,0 +1,111 @@
|
|||
/* BDB offsets on a 32-bit machine */
|
||||
#define DB_VERSION_MAJOR_32 4
|
||||
#define DB_VERSION_MINOR_32 4
|
||||
#define DB_VERSION_STRING_32 "Berkeley DB Compatability Header 4.4"
|
||||
struct fieldinfo db_btree_stat_fields32[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields32[] = {
|
||||
{"void *app_private", 44, 4},
|
||||
{"void *api1_internal", 336, 4},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 368, 4},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 372, 4},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 376, 4},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 380, 4},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 396, 4},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 416, 4},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 436, 4},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 456, 4},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 548, 4},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 560, 4},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 664, 4},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 716, 4},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 720, 4},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 728, 4},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 732, 4},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 736, 4},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 744, 4},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 756, 4},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 760, 4},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 768, 4},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 780, 4},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 784, 4},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 792, 4},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 860, 4},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 872, 4},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 880, 4},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 884, 4},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 888, 4},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 892, 4},
|
||||
{0, 920, 920} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields32[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 920, 920} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields32[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields32[] = {
|
||||
{"void *app_private", 16, 4},
|
||||
{"DB_ENV *dbenv", 20, 4},
|
||||
{"void *api_internal", 256, 4},
|
||||
{"int (*close) (DB*, u_int32_t)", 280, 4},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 288, 4},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 292, 4},
|
||||
{"int (*fd) (DB *, int *)", 304, 4},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 308, 4},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 344, 4},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 372, 4},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 408, 4},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 412, 4},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 420, 4},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 424, 4},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 428, 4},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 468, 4},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 480, 4},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 508, 4},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 536, 4},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 548, 4},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 556, 4},
|
||||
{0, 596, 596} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields32[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 16, 8},
|
||||
{0, 208, 208} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields32[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
|
||||
{"DB_TXN *parent", 4, 4},
|
||||
{"void *api_internal", 84, 4},
|
||||
{"int (*abort) (DB_TXN *)", 96, 4},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 100, 4},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 112, 4},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 116, 4},
|
||||
{0, 136, 136} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields32[] = {
|
||||
{"u_int32_t st_nactive", 32, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 44, 4},
|
||||
{0, 60, 60} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields32[] = {
|
||||
{"DB *dbp", 0, 4},
|
||||
{"int (*c_close) (DBC *)", 188, 4},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
|
||||
{0, 248, 248} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields32[] = {
|
||||
{"void*data", 0, 4},
|
||||
{"u_int32_t size", 4, 4},
|
||||
{"u_int32_t ulen", 8, 4},
|
||||
{"u_int32_t flags", 20, 4},
|
||||
{0, 24, 24} /* size of whole struct */
|
||||
};
|
110
buildheader/sample_offsets_32_4_5.h
Normal file
110
buildheader/sample_offsets_32_4_5.h
Normal file
|
@ -0,0 +1,110 @@
|
|||
/* BDB offsets on a 32-bit machine */
|
||||
#define DB_VERSION_MAJOR_32 4
|
||||
#define DB_VERSION_MINOR_32 5
|
||||
#define DB_VERSION_STRING_32 "Berkeley DB Compatability Header 4.5"
|
||||
struct fieldinfo db_btree_stat_fields32[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields32[] = {
|
||||
{"void *app_private", 52, 4},
|
||||
{"void *api1_internal", 336, 4},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 372, 4},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 376, 4},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 380, 4},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 384, 4},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 400, 4},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 420, 4},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 440, 4},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 460, 4},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 548, 4},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 560, 4},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 664, 4},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 776, 4},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 780, 4},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 788, 4},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 792, 4},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 796, 4},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 808, 4},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 820, 4},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 824, 4},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 832, 4},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 844, 4},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 852, 4},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 912, 4},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 924, 4},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 932, 4},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 936, 4},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 940, 4},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 944, 4},
|
||||
{0, 972, 972} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields32[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 972, 972} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields32[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields32[] = {
|
||||
{"void *app_private", 16, 4},
|
||||
{"DB_ENV *dbenv", 20, 4},
|
||||
{"void *api_internal", 268, 4},
|
||||
{"int (*close) (DB*, u_int32_t)", 292, 4},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 300, 4},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 304, 4},
|
||||
{"int (*fd) (DB *, int *)", 316, 4},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 320, 4},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 356, 4},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 384, 4},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 420, 4},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 424, 4},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 432, 4},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 436, 4},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 440, 4},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 480, 4},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 492, 4},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 520, 4},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 548, 4},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 560, 4},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 568, 4},
|
||||
{0, 608, 608} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields32[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 16, 8},
|
||||
{0, 224, 224} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields32[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
|
||||
{"DB_TXN *parent", 4, 4},
|
||||
{"void *api_internal", 84, 4},
|
||||
{"int (*abort) (DB_TXN *)", 96, 4},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 100, 4},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 112, 4},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 116, 4},
|
||||
{0, 136, 136} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields32[] = {
|
||||
{"u_int32_t st_nactive", 32, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 52, 4},
|
||||
{0, 68, 68} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields32[] = {
|
||||
{"DB *dbp", 0, 4},
|
||||
{"int (*c_close) (DBC *)", 204, 4},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 208, 4},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 212, 4},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 220, 4},
|
||||
{0, 264, 264} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields32[] = {
|
||||
{"void*data", 0, 4},
|
||||
{"u_int32_t size", 4, 4},
|
||||
{"u_int32_t ulen", 8, 4},
|
||||
{"u_int32_t flags", 24, 4},
|
||||
{0, 28, 28} /* size of whole struct */
|
||||
};
|
110
buildheader/sample_offsets_32_4_6.h
Normal file
110
buildheader/sample_offsets_32_4_6.h
Normal file
|
@ -0,0 +1,110 @@
|
|||
/* BDB offsets on a 32-bit machine */
|
||||
#define DB_VERSION_MAJOR_32 4
|
||||
#define DB_VERSION_MINOR_32 6
|
||||
#define DB_VERSION_STRING_32 "Berkeley DB Compatability Header 4.6"
|
||||
struct fieldinfo db_btree_stat_fields32[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 84, 84} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields32[] = {
|
||||
{"void *app_private", 52, 4},
|
||||
{"void *api1_internal", 356, 4},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 392, 4},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 396, 4},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 400, 4},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 404, 4},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 420, 4},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 444, 4},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 464, 4},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 484, 4},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 576, 4},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 588, 4},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 692, 4},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 816, 4},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 824, 4},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 832, 4},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 836, 4},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 840, 4},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 852, 4},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 864, 4},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 868, 4},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 876, 4},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 888, 4},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 896, 4},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 956, 4},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 968, 4},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 976, 4},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 980, 4},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 984, 4},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 988, 4},
|
||||
{0, 1016, 1016} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields32[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1016, 1016} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields32[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields32[] = {
|
||||
{"void *app_private", 20, 4},
|
||||
{"DB_ENV *dbenv", 24, 4},
|
||||
{"void *api_internal", 276, 4},
|
||||
{"int (*close) (DB*, u_int32_t)", 300, 4},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 308, 4},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 312, 4},
|
||||
{"int (*fd) (DB *, int *)", 328, 4},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 332, 4},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 368, 4},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 400, 4},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 440, 4},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 444, 4},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 452, 4},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 456, 4},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 460, 4},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 500, 4},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 512, 4},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 544, 4},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 576, 4},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 588, 4},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 596, 4},
|
||||
{0, 636, 636} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields32[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 16, 8},
|
||||
{0, 224, 224} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields32[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
|
||||
{"DB_TXN *parent", 4, 4},
|
||||
{"void *api_internal", 88, 4},
|
||||
{"int (*abort) (DB_TXN *)", 100, 4},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 104, 4},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 116, 4},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 120, 4},
|
||||
{0, 140, 140} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields32[] = {
|
||||
{"u_int32_t st_nactive", 36, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 52, 4},
|
||||
{0, 68, 68} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields32[] = {
|
||||
{"DB *dbp", 0, 4},
|
||||
{"int (*c_close) (DBC *)", 244, 4},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 248, 4},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 252, 4},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 260, 4},
|
||||
{0, 304, 304} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields32[] = {
|
||||
{"void*data", 0, 4},
|
||||
{"u_int32_t size", 4, 4},
|
||||
{"u_int32_t ulen", 8, 4},
|
||||
{"u_int32_t flags", 24, 4},
|
||||
{0, 28, 28} /* size of whole struct */
|
||||
};
|
105
buildheader/sample_offsets_64_4_1.h
Normal file
105
buildheader/sample_offsets_64_4_1.h
Normal file
|
@ -0,0 +1,105 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 1
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.1"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 72, 8},
|
||||
{"void *api1_internal", 360, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 424, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 432, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 440, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 448, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 464, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 480, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 512, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 520, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 528, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 544, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 584, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 592, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 608, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 616, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 624, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 640, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 664, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 704, 8},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 712, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 720, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 840, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1016, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1024, 8},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 1040, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1048, 8},
|
||||
{0, 1080, 1080} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1080, 1080} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 376, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 424, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 432, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 440, 8},
|
||||
{"int (*fd) (DB *, int *)", 464, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 472, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 512, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 520, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 528, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 536, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 544, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 552, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 616, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 640, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 656, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 672, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 696, 8},
|
||||
{0, 840, 840} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 8, 8},
|
||||
{0, 16, 16} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 112, 8},
|
||||
{"int (*abort) (DB_TXN *)", 128, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 136, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 152, 8},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 160, 8},
|
||||
{0, 184, 184} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 36, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 48, 8},
|
||||
{0, 72, 72} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 272, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 280, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 288, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 304, 8},
|
||||
{0, 400, 400} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 24, 4},
|
||||
{0, 32, 32} /* size of whole struct */
|
||||
};
|
111
buildheader/sample_offsets_64_4_3.h
Normal file
111
buildheader/sample_offsets_64_4_3.h
Normal file
|
@ -0,0 +1,111 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 3
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.3"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 84, 84} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 88, 8},
|
||||
{"void *api1_internal", 392, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 456, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 464, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 472, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 480, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 496, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 576, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 600, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 616, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 632, 8},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 648, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 656, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 768, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 784, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 808, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 824, 8},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 832, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 840, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 864, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 888, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 952, 8},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 960, 8},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 968, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 976, 8},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 1088, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1096, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1328, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1336, 8},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 1344, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1352, 8},
|
||||
{0, 1400, 1400} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1400, 1400} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 400, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 448, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 456, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 464, 8},
|
||||
{"int (*fd) (DB *, int *)", 496, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 504, 8},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 576, 8},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 600, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 632, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 640, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 648, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 656, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 664, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 672, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 728, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 752, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 792, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 808, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 840, 8},
|
||||
{0, 1056, 1056} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 8, 8},
|
||||
{0, 148, 148} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 152, 8},
|
||||
{"int (*abort) (DB_TXN *)", 176, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 184, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 200, 8},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 208, 8},
|
||||
{0, 240, 240} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 36, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 48, 8},
|
||||
{0, 72, 72} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 264, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 272, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 280, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 296, 8},
|
||||
{0, 384, 384} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 24, 4},
|
||||
{0, 32, 32} /* size of whole struct */
|
||||
};
|
111
buildheader/sample_offsets_64_4_4.h
Normal file
111
buildheader/sample_offsets_64_4_4.h
Normal file
|
@ -0,0 +1,111 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 4
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.4"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 88, 8},
|
||||
{"void *api1_internal", 544, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 608, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 616, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 624, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 632, 8},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 664, 8},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 704, 8},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 744, 8},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 784, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 968, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 992, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1200, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1304, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 1312, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 1328, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 1336, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 1344, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1360, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 1384, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 1392, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 1408, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 1432, 8},
|
||||
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 1440, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 1456, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 1592, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 1616, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1632, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1640, 8},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 1648, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1656, 8},
|
||||
{0, 1696, 1696} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1696, 1696} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 416, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 464, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 480, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 488, 8},
|
||||
{"int (*fd) (DB *, int *)", 512, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 520, 8},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 592, 8},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 648, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 720, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 728, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 744, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 752, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 760, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 840, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 864, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 920, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 976, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1000, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1016, 8},
|
||||
{0, 1080, 1080} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 24, 8},
|
||||
{0, 216, 216} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 160, 8},
|
||||
{"int (*abort) (DB_TXN *)", 184, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 192, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 216, 8},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 224, 8},
|
||||
{0, 264, 264} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 36, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 48, 8},
|
||||
{0, 72, 72} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 272, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 280, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 288, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 304, 8},
|
||||
{0, 392, 392} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 24, 4},
|
||||
{0, 32, 32} /* size of whole struct */
|
||||
};
|
110
buildheader/sample_offsets_64_4_5.h
Normal file
110
buildheader/sample_offsets_64_4_5.h
Normal file
|
@ -0,0 +1,110 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 5
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.5"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 104, 8},
|
||||
{"void *api1_internal", 544, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 616, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 624, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 632, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 640, 8},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 672, 8},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 712, 8},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 752, 8},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 792, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 968, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 992, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1200, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1424, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 1432, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 1448, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 1456, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 1464, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1488, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 1512, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 1520, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 1536, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 1560, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 1576, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 1696, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 1720, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1736, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1744, 8},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 1752, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1760, 8},
|
||||
{0, 1800, 1800} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1800, 1800} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 440, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 488, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 504, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 512, 8},
|
||||
{"int (*fd) (DB *, int *)", 536, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 544, 8},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 616, 8},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 672, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 744, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 752, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 768, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 776, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 784, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 864, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 888, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 944, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 1000, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1024, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1040, 8},
|
||||
{0, 1104, 1104} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 24, 8},
|
||||
{0, 232, 232} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 160, 8},
|
||||
{"int (*abort) (DB_TXN *)", 184, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 192, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 216, 8},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 224, 8},
|
||||
{0, 264, 264} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 36, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 56, 8},
|
||||
{0, 80, 80} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 304, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 312, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 320, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 336, 8},
|
||||
{0, 424, 424} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 32, 4},
|
||||
{0, 40, 40} /* size of whole struct */
|
||||
};
|
110
buildheader/sample_offsets_64_4_6.h
Normal file
110
buildheader/sample_offsets_64_4_6.h
Normal file
|
@ -0,0 +1,110 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 6
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.6"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 84, 84} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 104, 8},
|
||||
{"void *api1_internal", 568, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 640, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 648, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 656, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 664, 8},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 696, 8},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 744, 8},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 784, 8},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 824, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 1008, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 1032, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1240, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1488, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 1504, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 1520, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 1528, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 1536, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1560, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 1584, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 1592, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 1608, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 1632, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 1648, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 1768, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 1792, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1808, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1816, 8},
|
||||
{"int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)", 1824, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1832, 8},
|
||||
{0, 1872, 1872} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1872, 1872} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 464, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 512, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 528, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 536, 8},
|
||||
{"int (*fd) (DB *, int *)", 568, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 576, 8},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 648, 8},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 712, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 792, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 800, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 816, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 824, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 832, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 912, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 936, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 1000, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 1064, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1088, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1104, 8},
|
||||
{0, 1168, 1168} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 24, 8},
|
||||
{0, 232, 232} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 168, 8},
|
||||
{"int (*abort) (DB_TXN *)", 192, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 200, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 224, 8},
|
||||
{"int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])", 232, 8},
|
||||
{0, 272, 272} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 44, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 64, 8},
|
||||
{0, 88, 88} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 384, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 392, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 400, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 416, 8},
|
||||
{0, 504, 504} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 32, 4},
|
||||
{0, 40, 40} /* size of whole struct */
|
||||
};
|
108
buildheader/sample_offsets_64_4_7.h
Normal file
108
buildheader/sample_offsets_64_4_7.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
/* BDB offsets on a 64-bit machine */
|
||||
#define DB_VERSION_MAJOR_64 4
|
||||
#define DB_VERSION_MINOR_64 7
|
||||
#define DB_VERSION_STRING_64 "Berkeley DB Compatability Header 4.7"
|
||||
struct fieldinfo db_btree_stat_fields64[] = {
|
||||
{"u_int32_t bt_nkeys", 12, 4},
|
||||
{"u_int32_t bt_ndata", 16, 4},
|
||||
{0, 84, 84} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_env_fields64[] = {
|
||||
{"void *app_private", 216, 8},
|
||||
{"void *api1_internal", 224, 8},
|
||||
{"int (*close) (DB_ENV *, u_int32_t)", 408, 8},
|
||||
{"int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)", 416, 8},
|
||||
{"int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)", 424, 8},
|
||||
{"void (*err) (const DB_ENV *, int, const char *, ...)", 432, 8},
|
||||
{"int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *)", 472, 8},
|
||||
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 520, 8},
|
||||
{"int (*get_lg_max) (DB_ENV *, u_int32_t*)", 568, 8},
|
||||
{"int (*get_lk_max_locks) (DB_ENV *, u_int32_t *)", 608, 8},
|
||||
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 800, 8},
|
||||
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 824, 8},
|
||||
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1048, 8},
|
||||
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1328, 8},
|
||||
{"int (*set_data_dir) (DB_ENV *, const char *)", 1336, 8},
|
||||
{"void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *))", 1352, 8},
|
||||
{"void (*set_errfile) (DB_ENV *, FILE*)", 1360, 8},
|
||||
{"void (*set_errpfx) (DB_ENV *, const char *)", 1368, 8},
|
||||
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1392, 8},
|
||||
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 1416, 8},
|
||||
{"int (*set_lg_dir) (DB_ENV *, const char *)", 1424, 8},
|
||||
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 1440, 8},
|
||||
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 1464, 8},
|
||||
{"int (*set_lk_max_locks) (DB_ENV *, u_int32_t)", 1480, 8},
|
||||
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 1600, 8},
|
||||
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 1624, 8},
|
||||
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 1640, 8},
|
||||
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 1648, 8},
|
||||
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 1664, 8},
|
||||
{0, 1688, 1688} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_key_range_fields64[] = {
|
||||
{"double less", 0, 8},
|
||||
{"double equal", 8, 8},
|
||||
{"double greater", 16, 8},
|
||||
{0, 1688, 1688} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_lsn_fields64[] = {
|
||||
{0, 8, 8} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_fields64[] = {
|
||||
{"void *app_private", 32, 8},
|
||||
{"DB_ENV *dbenv", 40, 8},
|
||||
{"void *api_internal", 488, 8},
|
||||
{"int (*close) (DB*, u_int32_t)", 544, 8},
|
||||
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 560, 8},
|
||||
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 568, 8},
|
||||
{"int (*fd) (DB *, int *)", 600, 8},
|
||||
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 608, 8},
|
||||
{"int (*get_flags) (DB *, u_int32_t *)", 688, 8},
|
||||
{"int (*get_pagesize) (DB *, u_int32_t *)", 752, 8},
|
||||
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 832, 8},
|
||||
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 840, 8},
|
||||
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 856, 8},
|
||||
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 864, 8},
|
||||
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 872, 8},
|
||||
{"void (*set_errfile) (DB *, FILE*)", 952, 8},
|
||||
{"int (*set_flags) (DB *, u_int32_t)", 976, 8},
|
||||
{"int (*set_pagesize) (DB *, u_int32_t)", 1040, 8},
|
||||
{"int (*stat) (DB *, void *, u_int32_t)", 1104, 8},
|
||||
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1128, 8},
|
||||
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1144, 8},
|
||||
{0, 1208, 1208} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_active_fields64[] = {
|
||||
{"u_int32_t txnid", 0, 4},
|
||||
{"DB_LSN lsn", 24, 8},
|
||||
{0, 232, 232} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_fields64[] = {
|
||||
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 8},
|
||||
{"DB_TXN *parent", 8, 8},
|
||||
{"void *api_internal", 176, 8},
|
||||
{"int (*abort) (DB_TXN *)", 200, 8},
|
||||
{"int (*commit) (DB_TXN*, u_int32_t)", 208, 8},
|
||||
{"u_int32_t (*id) (DB_TXN *)", 232, 8},
|
||||
{0, 280, 280} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo db_txn_stat_fields64[] = {
|
||||
{"u_int32_t st_nactive", 44, 4},
|
||||
{"DB_TXN_ACTIVE *st_txnarray", 64, 8},
|
||||
{0, 88, 88} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbc_fields64[] = {
|
||||
{"DB *dbp", 0, 8},
|
||||
{"int (*c_close) (DBC *)", 408, 8},
|
||||
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 416, 8},
|
||||
{"int (*c_del) (DBC *, u_int32_t)", 424, 8},
|
||||
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 440, 8},
|
||||
{0, 528, 528} /* size of whole struct */
|
||||
};
|
||||
struct fieldinfo dbt_fields64[] = {
|
||||
{"void*data", 0, 8},
|
||||
{"u_int32_t size", 8, 4},
|
||||
{"u_int32_t ulen", 12, 4},
|
||||
{"u_int32_t flags", 32, 4},
|
||||
{0, 40, 40} /* size of whole struct */
|
||||
};
|
424
buildheader/tdb.h
Normal file
424
buildheader/tdb.h
Normal file
|
@ -0,0 +1,424 @@
|
|||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#include <sys/types.h>
|
||||
/*stdio is needed for the FILE* in db->verify*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
#define TOKUDB 1
|
||||
#define TOKUDB_NATIVE_H 1
|
||||
#define DB_VERSION_MAJOR 4
|
||||
#define DB_VERSION_MINOR 6
|
||||
#define DB_VERSION_PATCH 19
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERSION_STRING "Tokutek: TokuDB 4.6.19"
|
||||
#else
|
||||
#define DB_VERSION_STRING_ydb "Tokutek: TokuDB (wrapped bdb)"
|
||||
#endif
|
||||
#ifndef TOKU_OFF_T_DEFINED
|
||||
#define TOKU_OFF_T_DEFINED
|
||||
typedef int64_t toku_off_t;
|
||||
#endif
|
||||
#define DB_GID_SIZE 128
|
||||
typedef struct __toku_db_env DB_ENV;
|
||||
typedef struct __toku_db_key_range DB_KEY_RANGE;
|
||||
typedef struct __toku_db_lsn DB_LSN;
|
||||
typedef struct __toku_db DB;
|
||||
typedef struct __toku_db_txn DB_TXN;
|
||||
typedef struct __toku_db_txn_active DB_TXN_ACTIVE;
|
||||
typedef struct __toku_db_txn_stat DB_TXN_STAT;
|
||||
typedef struct __toku_dbc DBC;
|
||||
typedef struct __toku_dbt DBT;
|
||||
typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_PREPLIST;
|
||||
typedef u_int32_t db_recno_t;
|
||||
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
|
||||
#include <tdb-internal.h>
|
||||
#ifndef __BIGGEST_ALIGNMENT__
|
||||
#define __BIGGEST_ALIGNMENT__ 16
|
||||
#endif
|
||||
typedef struct __toku_db_btree_stat64 {
|
||||
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
|
||||
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
|
||||
u_int64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */
|
||||
u_int64_t bt_fsize; /* how big is the underlying file */
|
||||
u_int64_t bt_create_time_sec; /* Creation time, in seconds */
|
||||
u_int64_t bt_modify_time_sec; /* Time of last serialization, in seconds */
|
||||
u_int64_t bt_verify_time_sec; /* Time of last verification, in seconds */
|
||||
} DB_BTREE_STAT64;
|
||||
typedef struct __toku_loader DB_LOADER;
|
||||
struct __toku_loader_internal;
|
||||
struct __toku_loader {
|
||||
struct __toku_loader_internal *i;
|
||||
int (*set_error_callback)(DB_LOADER *loader, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_LOADER *loader, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*put)(DB_LOADER *loader, DBT *key, DBT* val); /* give a row to the loader */
|
||||
int (*close)(DB_LOADER *loader); /* finish loading, free memory */
|
||||
int (*abort)(DB_LOADER *loader); /* abort loading, free memory */
|
||||
};
|
||||
typedef struct __toku_indexer DB_INDEXER;
|
||||
struct __toku_indexer_internal;
|
||||
struct __toku_indexer {
|
||||
struct __toku_indexer_internal *i;
|
||||
int (*set_error_callback)(DB_INDEXER *indexer, void (*error_cb)(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra), void *error_extra); /* set the error callback */
|
||||
int (*set_poll_function)(DB_INDEXER *indexer, int (*poll_func)(void *extra, float progress), void *poll_extra); /* set the polling function */
|
||||
int (*build)(DB_INDEXER *indexer); /* build the indexes */
|
||||
int (*close)(DB_INDEXER *indexer); /* finish indexing, free memory */
|
||||
int (*abort)(DB_INDEXER *indexer); /* abort indexing, free memory */
|
||||
};
|
||||
typedef enum {
|
||||
FS_GREEN = 0, // green zone (we have lots of space)
|
||||
FS_YELLOW = 1, // yellow zone (issue warning but allow operations)
|
||||
FS_RED = 2, // red zone (prevent insert operations)
|
||||
FS_BLOCKED = 3 // For reporting engine status, completely blocked
|
||||
} fs_redzone_state;
|
||||
typedef enum {
|
||||
FS_STATE = 0, // interpret as file system state (redzone) enum
|
||||
UINT64, // interpret as uint64_t
|
||||
CHARSTR, // interpret as char *
|
||||
UNIXTIME, // interpret as time_t
|
||||
TOKUTIME // interpret as tokutime_t
|
||||
} toku_engine_status_display_type;
|
||||
typedef struct __toku_engine_status_row {
|
||||
char * keyname; // info schema key, should not change across revisions without good reason
|
||||
char * legend; // the text that will appear at user interface
|
||||
toku_engine_status_display_type type; // how to interpret the value
|
||||
union {
|
||||
uint64_t num;
|
||||
char * str;
|
||||
} value;
|
||||
} * TOKU_ENGINE_STATUS_ROW, TOKU_ENGINE_STATUS_ROW_S;
|
||||
typedef enum {
|
||||
DB_BTREE=1,
|
||||
DB_UNKNOWN=5
|
||||
} DBTYPE;
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERB_DEADLOCK 1
|
||||
#define DB_VERB_RECOVERY 8
|
||||
#define DB_VERB_REPLICATION 32
|
||||
#define DB_VERB_WAITSFOR 64
|
||||
#define DB_ARCH_ABS 1
|
||||
#define DB_ARCH_LOG 4
|
||||
#define DB_CREATE 1
|
||||
#define DB_CXX_NO_EXCEPTIONS 1
|
||||
#define DB_EXCL 16384
|
||||
#define DB_PRIVATE 8388608
|
||||
#define DB_RDONLY 32
|
||||
#define DB_RECOVER 64
|
||||
#define DB_RUNRECOVERY -30975
|
||||
#define DB_THREAD 128
|
||||
#define DB_TXN_NOSYNC 512
|
||||
#define DB_LOCK_DEFAULT 1
|
||||
#define DB_LOCK_OLDEST 7
|
||||
#define DB_LOCK_RANDOM 8
|
||||
#define DB_KEYFIRST 13
|
||||
#define DB_KEYLAST 14
|
||||
#define DB_NOOVERWRITE 20
|
||||
#define DB_NODUPDATA 19
|
||||
#define DB_NOOVERWRITE_NO_ERROR 1
|
||||
#define DB_OPFLAGS_MASK 255
|
||||
#define DB_AUTO_COMMIT 33554432
|
||||
#define DB_INIT_LOCK 131072
|
||||
#define DB_INIT_LOG 262144
|
||||
#define DB_INIT_MPOOL 524288
|
||||
#define DB_INIT_TXN 2097152
|
||||
#define DB_KEYEXIST -30996
|
||||
#define DB_LOCK_DEADLOCK -30995
|
||||
#define DB_LOCK_NOTGRANTED -30994
|
||||
#define DB_NOTFOUND -30989
|
||||
#define DB_SECONDARY_BAD -30974
|
||||
#define DB_DONOTINDEX -30998
|
||||
#define DB_BUFFER_SMALL -30999
|
||||
#define DB_BADFORMAT -30500
|
||||
#define DB_DELETE_ANY 65536
|
||||
#define DB_TRUNCATE_WITHCURSORS 131072
|
||||
#define DB_FIRST 7
|
||||
#define DB_LAST 15
|
||||
#define DB_CURRENT 6
|
||||
#define DB_NEXT 16
|
||||
#define DB_NEXT_NODUP 18
|
||||
#define DB_PREV 23
|
||||
#define DB_PREV_NODUP 25
|
||||
#define DB_SET 26
|
||||
#define DB_SET_RANGE 27
|
||||
#define DB_CURRENT_BINDING 253
|
||||
#define DB_SET_RANGE_REVERSE 252
|
||||
#define DB_RMW 1073741824
|
||||
#define DB_IS_RESETTING_OP 0x01000000
|
||||
#define DB_PRELOCKED 0x00800000
|
||||
#define DB_PRELOCKED_WRITE 0x00400000
|
||||
#define DB_IS_HOT_INDEX 0x00100000
|
||||
#define DBC_DISABLE_PREFETCHING 0x20000000
|
||||
#define DB_DBT_APPMALLOC 1
|
||||
#define DB_DBT_DUPOK 2
|
||||
#define DB_DBT_MALLOC 8
|
||||
#define DB_DBT_MULTIPLE 16
|
||||
#define DB_DBT_REALLOC 64
|
||||
#define DB_DBT_USERMEM 256
|
||||
#define DB_LOG_AUTOREMOVE 524288
|
||||
#define DB_TXN_WRITE_NOSYNC 4096
|
||||
#define DB_TXN_NOWAIT 1024
|
||||
#define DB_TXN_SYNC 16384
|
||||
#define DB_TXN_SNAPSHOT 268435456
|
||||
#define DB_READ_UNCOMMITTED 134217728
|
||||
#define DB_READ_COMMITTED 67108864
|
||||
#define DB_INHERIT_ISOLATION 1
|
||||
#define DB_SERIALIZABLE 2
|
||||
#endif
|
||||
/* TOKUDB specific error codes */
|
||||
#define TOKUDB_OUT_OF_LOCKS -100000
|
||||
#define TOKUDB_SUCCEEDED_EARLY -100001
|
||||
#define TOKUDB_FOUND_BUT_REJECTED -100002
|
||||
#define TOKUDB_USER_CALLBACK_ERROR -100003
|
||||
#define TOKUDB_DICTIONARY_TOO_OLD -100004
|
||||
#define TOKUDB_DICTIONARY_TOO_NEW -100005
|
||||
#define TOKUDB_DICTIONARY_NO_HEADER -100006
|
||||
#define TOKUDB_CANCELED -100007
|
||||
#define TOKUDB_NO_DATA -100008
|
||||
#define TOKUDB_ACCEPT -100009
|
||||
#define TOKUDB_MVCC_DICTIONARY_TOO_NEW -100010
|
||||
#define TOKUDB_UPGRADE_FAILURE -100011
|
||||
#define TOKUDB_TRY_AGAIN -100012
|
||||
#define TOKUDB_NEEDS_REPAIR -100013
|
||||
#define TOKUDB_CURSOR_CONTINUE -100014
|
||||
/* LOADER flags */
|
||||
#define LOADER_USE_PUTS 1
|
||||
typedef int (*generate_row_for_put_func)(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val);
|
||||
typedef int (*generate_row_for_del_func)(DB *dest_db, DB *src_db, DBT *dest_key, const DBT *src_key, const DBT *src_val);
|
||||
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#undef txn_begin
|
||||
#endif
|
||||
struct __toku_db_env {
|
||||
struct __toku_db_env_internal *i;
|
||||
#define db_env_struct_i(x) ((x)->i)
|
||||
int (*checkpointing_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*checkpointing_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic checkpoints. 0 means disabled. */;
|
||||
int (*cleaner_set_period) (DB_ENV*, u_int32_t) /* Change the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_get_period) (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic cleaner attempts. 0 means disabled. */;
|
||||
int (*cleaner_set_iterations) (DB_ENV*, u_int32_t) /* Change the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*cleaner_get_iterations) (DB_ENV*, u_int32_t*) /* Retrieve the number of attempts on each cleaner invokation. 0 means disabled. */;
|
||||
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
|
||||
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
|
||||
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
|
||||
int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */;
|
||||
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
|
||||
int (*get_engine_status_num_rows) (DB_ENV*, uint64_t*) /* return number of rows in engine status */;
|
||||
void *app_private;
|
||||
int (*get_engine_status) (DB_ENV*, TOKU_ENGINE_STATUS_ROW, uint64_t, fs_redzone_state*, uint64_t*, char*, int) /* Fill in status struct and redzone state, possibly env panic string */;
|
||||
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
|
||||
int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);;
|
||||
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* FOR TEST ONLY: lookup existing iname */;
|
||||
int (*create_loader) (DB_ENV *env, DB_TXN *txn, DB_LOADER **blp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t dbt_flags[/*N*/], uint32_t loader_flags);
|
||||
int (*create_indexer) (DB_ENV *env, DB_TXN *txn, DB_INDEXER **idxrp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t indexer_flags);
|
||||
int (*put_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, DBT *vals, uint32_t *flags_array) /* insert into multiple DBs */;
|
||||
int (*set_generate_row_callback_for_put) (DB_ENV *env, generate_row_for_put_func generate_row_for_put);
|
||||
int (*del_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
const DBT *src_key, const DBT *src_val,
|
||||
uint32_t num_dbs, DB **db_array, DBT *keys, uint32_t *flags_array) /* delete from multiple DBs */;
|
||||
int (*set_generate_row_callback_for_del) (DB_ENV *env, generate_row_for_del_func generate_row_for_del);
|
||||
int (*update_multiple) (DB_ENV *env, DB *src_db, DB_TXN *txn,
|
||||
DBT *old_src_key, DBT *old_src_data,
|
||||
DBT *new_src_key, DBT *new_src_data,
|
||||
uint32_t num_dbs, DB **db_array, uint32_t *flags_array,
|
||||
uint32_t num_keys, DBT *keys,
|
||||
uint32_t num_vals, DBT *vals) /* update multiple DBs */;
|
||||
int (*get_redzone) (DB_ENV *env, int *redzone) /* get the redzone limit */;
|
||||
int (*set_redzone) (DB_ENV *env, int redzone) /* set the redzone limit in percent of total space */;
|
||||
int (*set_lk_max_memory) (DB_ENV *env, uint64_t max);
|
||||
int (*get_lk_max_memory) (DB_ENV *env, uint64_t *max);
|
||||
void (*set_update) (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra));
|
||||
int (*set_lock_timeout) (DB_ENV *env, uint64_t lock_wait_time_msec);
|
||||
int (*get_lock_timeout) (DB_ENV *env, uint64_t *lock_wait_time_msec);
|
||||
void *api1_internal;
|
||||
int (*close) (DB_ENV *, u_int32_t);
|
||||
int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t);
|
||||
int (*dbrename) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t);
|
||||
void (*err) (const DB_ENV *, int, const char *, ...);
|
||||
int (*get_cachesize) (DB_ENV *, u_int32_t *, u_int32_t *, int *);
|
||||
int (*get_flags) (DB_ENV *, u_int32_t *);
|
||||
int (*get_lg_max) (DB_ENV *, u_int32_t*);
|
||||
int (*get_lk_max_locks) (DB_ENV *, u_int32_t *);
|
||||
int (*log_archive) (DB_ENV *, char **[], u_int32_t);
|
||||
int (*log_flush) (DB_ENV *, const DB_LSN *);
|
||||
int (*open) (DB_ENV *, const char *, u_int32_t, int);
|
||||
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int);
|
||||
int (*set_data_dir) (DB_ENV *, const char *);
|
||||
void (*set_errcall) (DB_ENV *, void (*)(const DB_ENV *, const char *, const char *));
|
||||
void (*set_errfile) (DB_ENV *, FILE*);
|
||||
void (*set_errpfx) (DB_ENV *, const char *);
|
||||
int (*set_flags) (DB_ENV *, u_int32_t, int);
|
||||
int (*set_lg_bsize) (DB_ENV *, u_int32_t);
|
||||
int (*set_lg_dir) (DB_ENV *, const char *);
|
||||
int (*set_lg_max) (DB_ENV *, u_int32_t);
|
||||
int (*set_lk_detect) (DB_ENV *, u_int32_t);
|
||||
int (*set_lk_max_locks) (DB_ENV *, u_int32_t);
|
||||
int (*set_tmp_dir) (DB_ENV *, const char *);
|
||||
int (*set_verbose) (DB_ENV *, u_int32_t, int);
|
||||
int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t);
|
||||
int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t);
|
||||
int (*txn_recover) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags);
|
||||
int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t);
|
||||
};
|
||||
struct __toku_db_key_range {
|
||||
double less;
|
||||
double equal;
|
||||
double greater;
|
||||
};
|
||||
struct __toku_db_lsn {
|
||||
};
|
||||
struct __toku_dbt {
|
||||
void*data;
|
||||
u_int32_t size;
|
||||
u_int32_t ulen;
|
||||
u_int32_t flags;
|
||||
};
|
||||
typedef struct __toku_descriptor {
|
||||
DBT dbt;
|
||||
} *DESCRIPTOR, DESCRIPTOR_S;
|
||||
//One header is included in 'data'
|
||||
//One header is included in 'additional for checkpoint'
|
||||
typedef struct __toku_db_fragmentation {
|
||||
uint64_t file_size_bytes; //Total file size in bytes
|
||||
uint64_t data_bytes; //Compressed User Data in bytes
|
||||
uint64_t data_blocks; //Number of blocks of compressed User Data
|
||||
uint64_t checkpoint_bytes_additional; //Additional bytes used for checkpoint system
|
||||
uint64_t checkpoint_blocks_additional; //Additional blocks used for checkpoint system
|
||||
uint64_t unused_bytes; //Unused space in file
|
||||
uint64_t unused_blocks; //Number of contiguous regions of unused space
|
||||
uint64_t largest_unused_block; //Size of largest contiguous unused space
|
||||
} *TOKU_DB_FRAGMENTATION, TOKU_DB_FRAGMENTATION_S;
|
||||
struct __toku_db {
|
||||
struct __toku_db_internal *i;
|
||||
#define db_struct_i(x) ((x)->i)
|
||||
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
|
||||
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
|
||||
void *app_private;
|
||||
DB_ENV *dbenv;
|
||||
int (*pre_acquire_table_lock)(DB*, DB_TXN*);
|
||||
int (*pre_acquire_fileops_lock)(DB*, DB_TXN*);
|
||||
const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/;
|
||||
const DBT* (*dbt_neg_infty)(void)/* Return the special DBT that refers to negative infinity in the lock table.*/;
|
||||
void (*get_max_row_size) (DB*, u_int32_t *max_key_size, u_int32_t *max_row_size);
|
||||
DESCRIPTOR descriptor /* saved row/dictionary descriptor for aiding in comparisons */;
|
||||
int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, u_int32_t) /* change row/dictionary descriptor for a db. Available only while db is open */;
|
||||
int (*getf_set)(DB*, DB_TXN*, u_int32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */;
|
||||
int (*optimize)(DB*) /* Run garbage collecion and promote all transactions older than oldest. Amortized (happens during flattening) */;
|
||||
int (*hot_optimize)(DB*, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra);
|
||||
int (*get_fragmentation)(DB*,TOKU_DB_FRAGMENTATION);
|
||||
int (*get_readpagesize)(DB*,u_int32_t*);
|
||||
int (*set_readpagesize)(DB*,u_int32_t);
|
||||
int (*set_indexer)(DB*, DB_INDEXER*);
|
||||
void (*get_indexer)(DB*, DB_INDEXER**);
|
||||
int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going);
|
||||
int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags);
|
||||
int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags);
|
||||
void *api_internal;
|
||||
int (*close) (DB*, u_int32_t);
|
||||
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t);
|
||||
int (*del) (DB *, DB_TXN *, DBT *, u_int32_t);
|
||||
int (*fd) (DB *, int *);
|
||||
int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t);
|
||||
int (*get_flags) (DB *, u_int32_t *);
|
||||
int (*get_pagesize) (DB *, u_int32_t *);
|
||||
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t);
|
||||
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int);
|
||||
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t);
|
||||
int (*remove) (DB *, const char *, const char *, u_int32_t);
|
||||
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t);
|
||||
void (*set_errfile) (DB *, FILE*);
|
||||
int (*set_flags) (DB *, u_int32_t);
|
||||
int (*set_pagesize) (DB *, u_int32_t);
|
||||
int (*stat) (DB *, void *, u_int32_t);
|
||||
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t);
|
||||
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t);
|
||||
};
|
||||
struct __toku_db_txn_active {
|
||||
u_int32_t txnid;
|
||||
DB_LSN lsn;
|
||||
};
|
||||
typedef struct __toku_txn_progress {
|
||||
uint64_t entries_total;
|
||||
uint64_t entries_processed;
|
||||
uint8_t is_commit;
|
||||
uint8_t stalled_on_checkpoint;
|
||||
} *TOKU_TXN_PROGRESS, TOKU_TXN_PROGRESS_S;
|
||||
typedef void(*TXN_PROGRESS_POLL_FUNCTION)(TOKU_TXN_PROGRESS, void*);
|
||||
struct txn_stat {
|
||||
u_int64_t rollback_raw_count;
|
||||
};
|
||||
struct __toku_db_txn {
|
||||
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/;
|
||||
DB_TXN *parent;
|
||||
int (*txn_stat)(DB_TXN *, struct txn_stat **);
|
||||
struct toku_list open_txns;
|
||||
int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
void *api_internal;
|
||||
int (*abort) (DB_TXN *);
|
||||
int (*commit) (DB_TXN*, u_int32_t);
|
||||
u_int32_t (*id) (DB_TXN *);
|
||||
int (*prepare) (DB_TXN*, u_int8_t gid[DB_GID_SIZE]);
|
||||
};
|
||||
struct __toku_db_txn_stat {
|
||||
u_int32_t st_nactive;
|
||||
DB_TXN_ACTIVE *st_txnarray;
|
||||
};
|
||||
struct __toku_dbc {
|
||||
DB *dbp;
|
||||
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*);
|
||||
int (*c_close) (DBC *);
|
||||
int (*c_count) (DBC *, db_recno_t *, u_int32_t);
|
||||
int (*c_del) (DBC *, u_int32_t);
|
||||
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t);
|
||||
};
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#define txn_begin txn_begin_tokudb
|
||||
#endif
|
||||
int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
|
||||
int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
|
||||
char *db_strerror(int) __attribute__((__visibility__("default")));
|
||||
const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
|
||||
int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fsync (int (*)(int)) __attribute__((__visibility__("default")));
|
||||
int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")));
|
||||
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_pwrite (ssize_t (*)(int, const void *, size_t, toku_off_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_full_write (ssize_t (*)(int, const void *, size_t)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fdopen (FILE* (*)(int, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fopen (FILE* (*)(const char *, const char *)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_open (int (*)(const char *, int, int)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_fclose (int (*)(FILE*)) __attribute__((__visibility__("default")));
|
||||
int db_env_set_func_pread (ssize_t (*)(int, void *, size_t, off_t)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_func_loader_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_checkpoint_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_recover_callback2 (void (*)(void*), void*) __attribute__((__visibility__("default")));
|
||||
void db_env_set_loader_size_factor (uint32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_mvcc_garbage_collection_verification(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_enable_engine_status(u_int32_t) __attribute__((__visibility__("default")));
|
||||
void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) __attribute__((__visibility__("default")));
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
39
include/db.h
39
include/db.h
|
@ -13,14 +13,17 @@ extern "C" {
|
|||
#define TOKUDB_NATIVE_H 1
|
||||
#define DB_VERSION_MAJOR 4
|
||||
#define DB_VERSION_MINOR 6
|
||||
/* As of r40364 (post TokuDB 5.2.7), the patch version number is 100+ the BDB header patch version number.*/
|
||||
#define DB_VERSION_PATCH 119
|
||||
#define DB_VERSION_STRING "Tokutek: TokuDB 4.6.119"
|
||||
#define DB_GID_SIZE 128
|
||||
#define DB_VERSION_PATCH 19
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERSION_STRING "Tokutek: TokuDB 4.6.19"
|
||||
#else
|
||||
#define DB_VERSION_STRING_ydb "Tokutek: TokuDB (wrapped bdb)"
|
||||
#endif
|
||||
#ifndef TOKU_OFF_T_DEFINED
|
||||
#define TOKU_OFF_T_DEFINED
|
||||
typedef int64_t toku_off_t;
|
||||
#endif
|
||||
#define DB_GID_SIZE 128
|
||||
typedef struct __toku_db_env DB_ENV;
|
||||
typedef struct __toku_db_key_range DB_KEY_RANGE;
|
||||
typedef struct __toku_db_lsn DB_LSN;
|
||||
|
@ -34,6 +37,9 @@ typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_
|
|||
typedef u_int32_t db_recno_t;
|
||||
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
|
||||
#include <tdb-internal.h>
|
||||
#ifndef __BIGGEST_ALIGNMENT__
|
||||
#define __BIGGEST_ALIGNMENT__ 16
|
||||
#endif
|
||||
typedef struct __toku_db_btree_stat64 {
|
||||
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
|
||||
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
|
||||
|
@ -69,8 +75,6 @@ typedef enum {
|
|||
FS_RED = 2, // red zone (prevent insert operations)
|
||||
FS_BLOCKED = 3 // For reporting engine status, completely blocked
|
||||
} fs_redzone_state;
|
||||
// engine status info
|
||||
// engine status is passed to handlerton as an array of TOKU_ENGINE_STATUS_ROW_S[]
|
||||
typedef enum {
|
||||
FS_STATE = 0, // interpret as file system state (redzone) enum
|
||||
UINT64, // interpret as uint64_t
|
||||
|
@ -91,6 +95,7 @@ typedef enum {
|
|||
DB_BTREE=1,
|
||||
DB_UNKNOWN=5
|
||||
} DBTYPE;
|
||||
#ifndef _TOKUDB_WRAP_H
|
||||
#define DB_VERB_DEADLOCK 1
|
||||
#define DB_VERB_RECOVERY 8
|
||||
#define DB_VERB_REPLICATION 32
|
||||
|
@ -162,6 +167,7 @@ typedef enum {
|
|||
#define DB_READ_COMMITTED 67108864
|
||||
#define DB_INHERIT_ISOLATION 1
|
||||
#define DB_SERIALIZABLE 2
|
||||
#endif
|
||||
/* TOKUDB specific error codes */
|
||||
#define TOKUDB_OUT_OF_LOCKS -100000
|
||||
#define TOKUDB_SUCCEEDED_EARLY -100001
|
||||
|
@ -182,6 +188,10 @@ typedef enum {
|
|||
#define LOADER_USE_PUTS 1
|
||||
typedef int (*generate_row_for_put_func)(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val);
|
||||
typedef int (*generate_row_for_del_func)(DB *dest_db, DB *src_db, DBT *dest_key, const DBT *src_key, const DBT *src_val);
|
||||
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#undef txn_begin
|
||||
#endif
|
||||
struct __toku_db_env {
|
||||
struct __toku_db_env_internal *i;
|
||||
#define db_env_struct_i(x) ((x)->i)
|
||||
|
@ -197,9 +207,10 @@ struct __toku_db_env {
|
|||
int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */;
|
||||
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
|
||||
int (*get_engine_status_num_rows) (DB_ENV*, uint64_t*) /* return number of rows in engine status */;
|
||||
void *app_private;
|
||||
int (*get_engine_status) (DB_ENV*, TOKU_ENGINE_STATUS_ROW, uint64_t, fs_redzone_state*, uint64_t*, char*, int) /* Fill in status struct and redzone state, possibly env panic string */;
|
||||
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
|
||||
int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);
|
||||
int (*crash) (DB_ENV*, const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/);;
|
||||
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* FOR TEST ONLY: lookup existing iname */;
|
||||
int (*create_loader) (DB_ENV *env, DB_TXN *txn, DB_LOADER **blp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t dbt_flags[/*N*/], uint32_t loader_flags);
|
||||
int (*create_indexer) (DB_ENV *env, DB_TXN *txn, DB_INDEXER **idxrp, DB *src_db, int N, DB *dbs[/*N*/], uint32_t db_flags[/*N*/], uint32_t indexer_flags);
|
||||
|
@ -224,7 +235,6 @@ struct __toku_db_env {
|
|||
void (*set_update) (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra));
|
||||
int (*set_lock_timeout) (DB_ENV *env, uint64_t lock_wait_time_msec);
|
||||
int (*get_lock_timeout) (DB_ENV *env, uint64_t *lock_wait_time_msec);
|
||||
void *app_private;
|
||||
void *api1_internal;
|
||||
int (*close) (DB_ENV *, u_int32_t);
|
||||
int (*dbremove) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t);
|
||||
|
@ -288,6 +298,8 @@ struct __toku_db {
|
|||
#define db_struct_i(x) ((x)->i)
|
||||
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
|
||||
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
|
||||
void *app_private;
|
||||
DB_ENV *dbenv;
|
||||
int (*pre_acquire_table_lock)(DB*, DB_TXN*);
|
||||
int (*pre_acquire_fileops_lock)(DB*, DB_TXN*);
|
||||
const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/;
|
||||
|
@ -306,8 +318,6 @@ struct __toku_db {
|
|||
int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going);
|
||||
int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags);
|
||||
int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags);
|
||||
void *app_private;
|
||||
DB_ENV *dbenv;
|
||||
void *api_internal;
|
||||
int (*close) (DB*, u_int32_t);
|
||||
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t);
|
||||
|
@ -343,12 +353,12 @@ struct txn_stat {
|
|||
u_int64_t rollback_raw_count;
|
||||
};
|
||||
struct __toku_db_txn {
|
||||
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/;
|
||||
DB_TXN *parent;
|
||||
int (*txn_stat)(DB_TXN *, struct txn_stat **);
|
||||
struct toku_list open_txns;
|
||||
int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*);
|
||||
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/;
|
||||
DB_TXN *parent;
|
||||
void *api_internal;
|
||||
int (*abort) (DB_TXN *);
|
||||
int (*commit) (DB_TXN*, u_int32_t);
|
||||
|
@ -360,6 +370,7 @@ struct __toku_db_txn_stat {
|
|||
DB_TXN_ACTIVE *st_txnarray;
|
||||
};
|
||||
struct __toku_dbc {
|
||||
DB *dbp;
|
||||
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
|
||||
|
@ -370,12 +381,14 @@ struct __toku_dbc {
|
|||
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
|
||||
int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*);
|
||||
DB *dbp;
|
||||
int (*c_close) (DBC *);
|
||||
int (*c_count) (DBC *, db_recno_t *, u_int32_t);
|
||||
int (*c_del) (DBC *, u_int32_t);
|
||||
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t);
|
||||
};
|
||||
#ifdef _TOKUDB_WRAP_H
|
||||
#define txn_begin txn_begin_tokudb
|
||||
#endif
|
||||
int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
|
||||
int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
|
||||
char *db_strerror(int) __attribute__((__visibility__("default")));
|
||||
|
|
Loading…
Add table
Reference in a new issue