Commit 2c41f560 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

dbc

git-svn-id: file:///svn/tokudb@256 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1b0a4df9
...@@ -47,7 +47,7 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo * ...@@ -47,7 +47,7 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
unsigned int diff = diff64-diff32; unsigned int diff = diff64-diff32;
unsigned int n_dummys = diff/4; unsigned int n_dummys = diff/4;
if (need_internal && !did_toku_internal) { if (need_internal && !did_toku_internal) {
printf(" struct __toku%s_internal *i;\n", structname); printf(" struct __toku_%s_internal *i;\n", structname);
n_dummys--; n_dummys--;
did_toku_internal=1; did_toku_internal=1;
} }
...@@ -89,7 +89,10 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un ...@@ -89,7 +89,10 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
print_struct("dbt", 0, dbt_fields32, dbt_fields64, sizeof(dbt_fields32)/sizeof(dbt_fields32[0])); print_struct("dbt", 0, dbt_fields32, dbt_fields64, sizeof(dbt_fields32)/sizeof(dbt_fields32[0]));
assert(sizeof(db_txn_fields32)==sizeof(db_txn_fields64)); assert(sizeof(db_txn_fields32)==sizeof(db_txn_fields64));
print_struct("db_txn", 0, db_txn_fields32, db_txn_fields64, sizeof(db_txn_fields32)/sizeof(db_txn_fields32[0])); print_struct("db_txn", 1, db_txn_fields32, db_txn_fields64, sizeof(db_txn_fields32)/sizeof(db_txn_fields32[0]));
assert(sizeof(dbc_fields32)==sizeof(dbc_fields64));
print_struct("dbc", 1, dbc_fields32, dbc_fields64, sizeof(dbc_fields32)/sizeof(dbc_fields32[0]));
printf("#if defined(__cplusplus)\n}\n#endif\n"); printf("#if defined(__cplusplus)\n}\n#endif\n");
printf("#endif\n"); printf("#endif\n");
......
...@@ -86,6 +86,16 @@ void sample_db_txn_offsets (void) { ...@@ -86,6 +86,16 @@ void sample_db_txn_offsets (void) {
sort_and_dump_fields("db_txn", sizeof(DB_TXN)); sort_and_dump_fields("db_txn", sizeof(DB_TXN));
} }
void sample_dbc_offsets (void) {
field_counter=0;
STRUCT_SETUP(DBC, c_get, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DBC, c_close, "int (*%s) (DBC *)");
STRUCT_SETUP(DBC, c_del, "int (*%s) (DBC *, u_int32_t)");
sort_and_dump_fields("dbc", sizeof(DBC));
}
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) { int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
open_file(); open_file();
fprintf(outf, "/* BDB offsets on a %d-bit machine */\n", __WORDSIZE); fprintf(outf, "/* BDB offsets on a %d-bit machine */\n", __WORDSIZE);
......
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