Commit de5d8782 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

[t:r4298] Resolve various conflicts with buildheader between 4298 and main. Refs #4298.

git-svn-id: file:///svn/toku/tokudb@39774 c7de825b-a66e-492c-adef-691d508d4ae1
parent 03c7a70c
This diff is collapsed.
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -396,7 +398,7 @@ 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 { void *next, *prev; } open_txns;
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];
......
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -402,7 +404,7 @@ 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 { void *next, *prev; } open_txns;
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[13];
......
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -402,7 +404,7 @@ 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 { void *next, *prev; } open_txns;
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[13];
......
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -405,7 +407,7 @@ 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 { void *next, *prev; } open_txns;
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[14];
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#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. */
......@@ -40,14 +41,14 @@ void print_db_notices (void) {
if (!(flags & bit)) break; \
} \
assert(which < 32); \
printf("#define %s %d\n", #name, bit); \
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, name);} while (0)
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 */ \
......@@ -56,7 +57,7 @@ void print_db_notices (void) {
} \
assert(which < 256); \
flags[which] = 1; \
printf("#define %s %d\n", #name, which); \
printf("#define %s %u\n", #name, which); \
} while (0)
......@@ -76,6 +77,7 @@ enum {
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) {
......@@ -303,7 +305,7 @@ static void print_struct (const char *structname, enum need_internal_type need_i
}
if (n_dummys>0) {
if (!TDB_NATIVE)
printf(" void* __toku_dummy%d[%d];\n", dummy_counter, n_dummys);
printf(" void* __toku_dummy%d[%u];\n", dummy_counter, n_dummys);
dummy_counter++;
}
diff64-=diff*2;
......@@ -313,20 +315,21 @@ static void print_struct (const char *structname, enum need_internal_type need_i
assert(diff32==diff64);
if (diff32>0) {
if (!TDB_NATIVE)
printf(" char __toku_dummy%d[%d];\n", dummy_counter, diff32);
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=%d this_64=%d\n", this_32, this_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=%d size=%d, 64=bit offset=%d size=%d */", fields32[i].off, fields32[i].size, fields64[i].off, fields64[i].size);
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);
......@@ -344,21 +347,21 @@ static void print_struct (const char *structname, enum need_internal_type need_i
if (diff32>0 && diff32<diff64) {
unsigned int diff = diff64-diff32;
if (!TDB_NATIVE)
printf(" void* __toku_dummy%d[%d]; /* Padding at the end */ \n", dummy_counter, diff/4);
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[%d]; /* Padding at the end */ \n", dummy_counter, diff32);
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(" /* %d more bytes of alignment in the 64-bit case. */\n", diff64);
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) {
......@@ -371,8 +374,8 @@ static void print_struct (const char *structname, enum need_internal_type need_i
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, 2008 Tokutek */\n");
printf("#ident \"Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved.\"\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");
......@@ -406,6 +409,11 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
"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");
......@@ -416,6 +424,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
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");
......@@ -502,7 +511,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
//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[]= {
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. */",
......@@ -542,8 +551,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
"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
};
NULL};
print_struct("db_env", 1, db_env_fields32, db_env_fields64, sizeof(db_env_fields32)/sizeof(db_env_fields32[0]), extra);
}
......@@ -622,11 +630,10 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
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 { void *next, *prev; } open_txns",
"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,
};
NULL};
print_struct("db_txn", INTERNAL_AT_END, db_txn_fields32, db_txn_fields64, sizeof(db_txn_fields32)/sizeof(db_txn_fields32[0]), extra);
}
......
/* -*- 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. */
......@@ -11,16 +12,16 @@
// Don't include toku_assert.h. Just use assert.h
#include <assert.h>
#define DECL_LIMIT 100
#define DECL_LIMIT 200
#define FIELD_LIMIT 100
struct fieldinfo {
char decl[DECL_LIMIT];
unsigned int off;
unsigned int size;
} fields[FIELD_LIMIT];
int field_counter=0;
static int field_counter=0;
int compare_fields (const void *av, const void *bv) {
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;
......@@ -28,14 +29,16 @@ int compare_fields (const void *av, const void *bv) {
return 0;
}
#define STRUCT_SETUP(typ, name, fstring) ({ snprintf(fields[field_counter].decl, DECL_LIMIT, fstring, #name); \
#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++; })
FILE *outf;
void open_file (void) {
static FILE *outf;
static void open_file (void) {
char fname[100];
#ifdef LOCAL
snprintf(fname, 100, "sample_offsets_local.h");
......@@ -47,25 +50,25 @@ void open_file (void) {
}
void sort_and_dump_fields (const char *structname, unsigned int sizeofstruct) {
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\", %d, %d},\n", fields[i].decl, fields[i].off, fields[i].size);
fprintf(outf, " {\"%s\", %u, %u},\n", fields[i].decl, fields[i].off, fields[i].size);
}
fprintf(outf, " {0, %d, %d} /* size of whole struct */\n", sizeofstruct, sizeofstruct);
fprintf(outf, " {0, %u, %u} /* size of whole struct */\n", sizeofstruct, sizeofstruct);
fprintf(outf, "};\n");
}
void sample_db_btree_stat_offsets (void) {
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));
}
void sample_db_env_offsets (void) {
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");
......@@ -105,12 +108,13 @@ void sample_db_env_offsets (void) {
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));
}
void sample_db_key_range_offsets (void) {
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");
......@@ -118,12 +122,12 @@ void sample_db_key_range_offsets (void) {
sort_and_dump_fields("db_key_range", sizeof(DB_ENV));
}
void sample_db_lsn_offsets (void) {
static void sample_db_lsn_offsets (void) {
field_counter=0;
sort_and_dump_fields("db_lsn", sizeof(DB_LSN));
}
void sample_db_offsets (void) {
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. */
......@@ -152,32 +156,33 @@ void sample_db_offsets (void) {
sort_and_dump_fields("db", sizeof(DB));
}
void sample_db_txn_active_offsets (void) {
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));
}
void sample_db_txn_offsets (void) {
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));
}
void sample_db_txn_stat_offsets (void) {
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));
}
void sample_dbc_offsets (void) {
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)");
......@@ -187,7 +192,7 @@ void sample_dbc_offsets (void) {
sort_and_dump_fields("dbc", sizeof(DBC));
}
void sample_dbt_offsets (void) {
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");
......
......@@ -33,6 +33,7 @@ struct fieldinfo db_env_fields32[] = {
{"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 */
};
......@@ -79,6 +80,7 @@ struct fieldinfo db_txn_fields32[] = {
{"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[] = {
......
......@@ -37,6 +37,7 @@ struct fieldinfo db_env_fields32[] = {
{"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 */
};
......@@ -85,6 +86,7 @@ struct fieldinfo db_txn_fields32[] = {
{"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[] = {
......
......@@ -37,6 +37,7 @@ struct fieldinfo db_env_fields32[] = {
{"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 */
};
......@@ -85,6 +86,7 @@ struct fieldinfo db_txn_fields32[] = {
{"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[] = {
......
......@@ -36,6 +36,7 @@ struct fieldinfo db_env_fields32[] = {
{"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 */
};
......@@ -84,6 +85,7 @@ struct fieldinfo db_txn_fields32[] = {
{"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[] = {
......
......@@ -36,6 +36,7 @@ struct fieldinfo db_env_fields32[] = {
{"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 */
};
......@@ -84,6 +85,7 @@ struct fieldinfo db_txn_fields32[] = {
{"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[] = {
......
......@@ -33,6 +33,7 @@ struct fieldinfo db_env_fields64[] = {
{"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 */
};
......@@ -79,6 +80,7 @@ struct fieldinfo db_txn_fields64[] = {
{"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[] = {
......
......@@ -37,6 +37,7 @@ struct fieldinfo db_env_fields64[] = {
{"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 */
};
......@@ -85,6 +86,7 @@ struct fieldinfo db_txn_fields64[] = {
{"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[] = {
......
......@@ -37,6 +37,7 @@ struct fieldinfo db_env_fields64[] = {
{"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 */
};
......@@ -85,6 +86,7 @@ struct fieldinfo db_txn_fields64[] = {
{"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[] = {
......
......@@ -36,6 +36,7 @@ struct fieldinfo db_env_fields64[] = {
{"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 */
};
......@@ -84,6 +85,7 @@ struct fieldinfo db_txn_fields64[] = {
{"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[] = {
......
......@@ -36,6 +36,7 @@ struct fieldinfo db_env_fields64[] = {
{"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 */
};
......@@ -84,6 +85,7 @@ struct fieldinfo db_txn_fields64[] = {
{"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[] = {
......
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -260,6 +262,7 @@ struct __toku_db_env {
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 {
......@@ -354,13 +357,14 @@ 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 { void *next, *prev; } open_txns;
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;
......
#ifndef _DB_H
#define _DB_H
/* This code generated by make_db_h. Copyright (c) 2007, 2008 Tokutek */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* 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>
......@@ -23,6 +23,7 @@ extern "C" {
#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;
......@@ -32,6 +33,7 @@ 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>
......@@ -260,6 +262,7 @@ struct __toku_db_env {
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 {
......@@ -354,13 +357,14 @@ 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 { void *next, *prev; } open_txns;
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;
......
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