Commit bb616482 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Fix up the headers to be 4.3 compatible

git-svn-id: file:///svn/tokudb@421 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2ae07988
......@@ -15,7 +15,6 @@ struct fieldinfo {
} fields[FIELD_LIMIT];
int field_counter=0;
int compare_fields (const void *av, const void *bv) {
const struct fieldinfo *a = av;
const struct fieldinfo *b = bv;
......@@ -78,7 +77,7 @@ void sample_db_env_offsets (void) {
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)");
STRUCT_SETUP(DB_ENV, set_lk_max, "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_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)");
......@@ -130,6 +129,7 @@ void sample_db_txn_offsets (void) {
field_counter=0;
STRUCT_SETUP(DB_TXN, commit, "int (*%s) (DB_TXN*, u_int32_t)");
STRUCT_SETUP(DB_TXN, id, "u_int32_t (*%s) (DB_TXN *)");
STRUCT_SETUP(DB_TXN, abort, "int (*%s) __P((DB_TXN *)");
sort_and_dump_fields("db_txn", sizeof(DB_TXN));
}
......@@ -150,7 +150,7 @@ void sample_dbc_offsets (void) {
void sample_dbt_offsets (void) {
field_counter=0;
STRUCT_SETUP(DBT,app_private, "void*%s");
//STRUCT_SETUP(DBT,app_private, "void*%s");
STRUCT_SETUP(DBT,data, "void*%s");
STRUCT_SETUP(DBT,flags, "u_int32_t %s");
STRUCT_SETUP(DBT,size, "u_int32_t %s");
......@@ -161,6 +161,9 @@ void sample_dbt_offsets (void) {
int main (int argc __attribute__((__unused__)), char *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();
......
/* 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, 80, 80} /* size of whole struct */
{0, 84, 84} /* size of whole struct */
};
struct fieldinfo db_env_fields32[] = {
{"int (*close) (DB_ENV *, u_int32_t)", 248, 4},
{"void (*err) (const DB_ENV *, int, const char *, ...)", 260, 4},
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 268, 4},
{"int (*set_data_dir) (DB_ENV *, const char *)", 276, 4},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 292, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 300, 4},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 308, 4},
{"void (*set_noticecall) (DB_ENV *, void (*)(DB_ENV *, db_notices))", 312, 4},
{"int (*set_tmp_dir) (DB_ENV *, const char *)", 332, 4},
{"int (*set_verbose) (DB_ENV *, u_int32_t, int)", 336, 4},
{"int (*set_lg_bsize) (DB_ENV *, u_int32_t)", 344, 4},
{"int (*set_lg_dir) (DB_ENV *, const char *)", 348, 4},
{"int (*set_lg_max) (DB_ENV *, u_int32_t)", 352, 4},
{"int (*log_archive) (DB_ENV *, char **[], u_int32_t)", 360, 4},
{"int (*log_flush) (DB_ENV *, const DB_LSN *)", 372, 4},
{"int (*set_lk_detect) (DB_ENV *, u_int32_t)", 392, 4},
{"int (*set_lk_max) (DB_ENV *, u_int32_t)", 396, 4},
{"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 460, 4},
{"int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)", 548, 4},
{"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)", 552, 4},
{"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)", 564, 4},
{0, 584, 584} /* size of whole struct */
{"int (*close) (DB_ENV *, u_int32_t)", 276, 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 char *, char *))", 348, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 364, 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 (*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 (*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_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, 584, 584} /* size of whole struct */
{0, 756, 756} /* size of whole struct */
};
struct fieldinfo db_lsn_fields32[] = {
{0, 8, 8} /* size of whole struct */
......@@ -42,26 +44,27 @@ struct fieldinfo db_fields32[] = {
{"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 (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 296, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 316, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 320, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 324, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 328, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 332, 4},
{"int (*set_flags) (DB *, u_int32_t)", 380, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 396, 4},
{"int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 412, 4},
{0, 484, 484} /* size of whole struct */
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 300, 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 (*set_flags) (DB *, u_int32_t)", 424, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 452, 4},
{"int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 476, 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, 16, 16} /* size of whole struct */
{0, 148, 148} /* size of whole struct */
};
struct fieldinfo db_txn_fields32[] = {
{"int (*commit) (DB_TXN*, u_int32_t)", 80, 4},
{"u_int32_t (*id) (DB_TXN *)", 88, 4},
{0, 104, 104} /* size of whole struct */
{"int (*abort) __P((DB_TXN *)", 100, 4},
{"int (*commit) (DB_TXN*, u_int32_t)", 104, 4},
{"u_int32_t (*id) (DB_TXN *)", 112, 4},
{0, 132, 132} /* size of whole struct */
};
struct fieldinfo db_txn_stat_fields32[] = {
{"u_int32_t st_nactive", 32, 4},
......@@ -69,16 +72,15 @@ struct fieldinfo db_txn_stat_fields32[] = {
{0, 60, 60} /* size of whole struct */
};
struct fieldinfo dbc_fields32[] = {
{"int (*c_close) (DBC *)", 204, 4},
{"int (*c_del) (DBC *, u_int32_t)", 212, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 220, 4},
{0, 268, 268} /* size of whole struct */
{"int (*c_close) (DBC *)", 188, 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},
{"void*app_private", 20, 4},
{"u_int32_t flags", 24, 4},
{0, 28, 28} /* size of whole struct */
{"u_int32_t flags", 20, 4},
{0, 24, 24} /* size of whole struct */
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment