Commit 98ff03a3 authored by Rich Prohaska's avatar Rich Prohaska

fix the DB_ENV->set_errcall prototype. closes #225

git-svn-id: file:///svn/tokudb@1416 c7de825b-a66e-492c-adef-691d508d4ae1
parent 47932c34
...@@ -115,7 +115,7 @@ struct __toku_db_env { ...@@ -115,7 +115,7 @@ struct __toku_db_env {
void* __toku_dummy6[9]; void* __toku_dummy6[9];
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=336 size=4, 64=bit offset=576 size=8 */ int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=336 size=4, 64=bit offset=576 size=8 */
void* __toku_dummy7[2]; void* __toku_dummy7[2];
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=348 size=4, 64=bit offset=600 size=8 */ void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *)); /* 32-bit offset=348 size=4, 64=bit offset=600 size=8 */
void* __toku_dummy8[1]; void* __toku_dummy8[1];
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=356 size=4, 64=bit offset=616 size=8 */ void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=356 size=4, 64=bit offset=616 size=8 */
void* __toku_dummy9[1]; void* __toku_dummy9[1];
......
...@@ -124,7 +124,7 @@ struct __toku_db_env { ...@@ -124,7 +124,7 @@ struct __toku_db_env {
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=716 size=4, 64=bit offset=1304 size=8 */ int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=716 size=4, 64=bit offset=1304 size=8 */
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=720 size=4, 64=bit offset=1312 size=8 */ int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=720 size=4, 64=bit offset=1312 size=8 */
void* __toku_dummy11[1]; void* __toku_dummy11[1];
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=728 size=4, 64=bit offset=1328 size=8 */ void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *)); /* 32-bit offset=728 size=4, 64=bit offset=1328 size=8 */
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=732 size=4, 64=bit offset=1336 size=8 */ void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=732 size=4, 64=bit offset=1336 size=8 */
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=736 size=4, 64=bit offset=1344 size=8 */ void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=736 size=4, 64=bit offset=1344 size=8 */
void* __toku_dummy12[1]; void* __toku_dummy12[1];
......
...@@ -124,7 +124,7 @@ struct __toku_db_env { ...@@ -124,7 +124,7 @@ struct __toku_db_env {
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=776 size=4, 64=bit offset=1424 size=8 */ int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=776 size=4, 64=bit offset=1424 size=8 */
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=780 size=4, 64=bit offset=1432 size=8 */ int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=780 size=4, 64=bit offset=1432 size=8 */
void* __toku_dummy11[1]; void* __toku_dummy11[1];
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=788 size=4, 64=bit offset=1448 size=8 */ void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *)); /* 32-bit offset=788 size=4, 64=bit offset=1448 size=8 */
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=792 size=4, 64=bit offset=1456 size=8 */ void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=792 size=4, 64=bit offset=1456 size=8 */
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=796 size=4, 64=bit offset=1464 size=8 */ void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=796 size=4, 64=bit offset=1464 size=8 */
void* __toku_dummy12[2]; void* __toku_dummy12[2];
......
...@@ -126,7 +126,7 @@ struct __toku_db_env { ...@@ -126,7 +126,7 @@ struct __toku_db_env {
void* __toku_dummy11[1]; void* __toku_dummy11[1];
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=824 size=4, 64=bit offset=1504 size=8 */ int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=824 size=4, 64=bit offset=1504 size=8 */
void* __toku_dummy12[1]; void* __toku_dummy12[1];
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=832 size=4, 64=bit offset=1520 size=8 */ void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *)); /* 32-bit offset=832 size=4, 64=bit offset=1520 size=8 */
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=836 size=4, 64=bit offset=1528 size=8 */ void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=836 size=4, 64=bit offset=1528 size=8 */
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=840 size=4, 64=bit offset=1536 size=8 */ void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=840 size=4, 64=bit offset=1536 size=8 */
void* __toku_dummy13[2]; void* __toku_dummy13[2];
......
...@@ -14,7 +14,7 @@ struct fieldinfo db_env_fields32[] = { ...@@ -14,7 +14,7 @@ struct fieldinfo db_env_fields32[] = {
{"void (*err) (const DB_ENV *, int, const char *, ...)", 288, 4}, {"void (*err) (const DB_ENV *, int, const char *, ...)", 288, 4},
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 296, 4}, {"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 296, 4},
{"int (*set_data_dir) (DB_ENV *, const char *)", 336, 4}, {"int (*set_data_dir) (DB_ENV *, const char *)", 336, 4},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 348, 4}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 348, 4},
{"void (*set_errfile) (DB_ENV *, FILE*)", 356, 4}, {"void (*set_errfile) (DB_ENV *, FILE*)", 356, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 364, 4}, {"void (*set_errpfx) (DB_ENV *, const char *)", 364, 4},
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 372, 4}, {"int (*get_flags) (DB_ENV *, u_int32_t *)", 372, 4},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 664, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 716, 4},
{"int (*set_data_dir) (DB_ENV *, const char *)", 720, 4}, {"int (*set_data_dir) (DB_ENV *, const char *)", 720, 4},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 728, 4}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 728, 4},
{"void (*set_errfile) (DB_ENV *, FILE*)", 732, 4}, {"void (*set_errfile) (DB_ENV *, FILE*)", 732, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 736, 4}, {"void (*set_errpfx) (DB_ENV *, const char *)", 736, 4},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 744, 4}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 744, 4},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 664, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 776, 4},
{"int (*set_data_dir) (DB_ENV *, const char *)", 780, 4}, {"int (*set_data_dir) (DB_ENV *, const char *)", 780, 4},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 788, 4}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 788, 4},
{"void (*set_errfile) (DB_ENV *, FILE*)", 792, 4}, {"void (*set_errfile) (DB_ENV *, FILE*)", 792, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 796, 4}, {"void (*set_errpfx) (DB_ENV *, const char *)", 796, 4},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 808, 4}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 808, 4},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields32[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 692, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 816, 4},
{"int (*set_data_dir) (DB_ENV *, const char *)", 824, 4}, {"int (*set_data_dir) (DB_ENV *, const char *)", 824, 4},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 832, 4}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 832, 4},
{"void (*set_errfile) (DB_ENV *, FILE*)", 836, 4}, {"void (*set_errfile) (DB_ENV *, FILE*)", 836, 4},
{"void (*set_errpfx) (DB_ENV *, const char *)", 840, 4}, {"void (*set_errpfx) (DB_ENV *, const char *)", 840, 4},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 852, 4}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 852, 4},
......
...@@ -14,7 +14,7 @@ struct fieldinfo db_env_fields64[] = { ...@@ -14,7 +14,7 @@ struct fieldinfo db_env_fields64[] = {
{"void (*err) (const DB_ENV *, int, const char *, ...)", 480, 8}, {"void (*err) (const DB_ENV *, int, const char *, ...)", 480, 8},
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 496, 8}, {"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 496, 8},
{"int (*set_data_dir) (DB_ENV *, const char *)", 576, 8}, {"int (*set_data_dir) (DB_ENV *, const char *)", 576, 8},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 600, 8}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 600, 8},
{"void (*set_errfile) (DB_ENV *, FILE*)", 616, 8}, {"void (*set_errfile) (DB_ENV *, FILE*)", 616, 8},
{"void (*set_errpfx) (DB_ENV *, const char *)", 632, 8}, {"void (*set_errpfx) (DB_ENV *, const char *)", 632, 8},
{"int (*get_flags) (DB_ENV *, u_int32_t *)", 648, 8}, {"int (*get_flags) (DB_ENV *, u_int32_t *)", 648, 8},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1200, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1304, 8},
{"int (*set_data_dir) (DB_ENV *, const char *)", 1312, 8}, {"int (*set_data_dir) (DB_ENV *, const char *)", 1312, 8},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 1328, 8}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 1328, 8},
{"void (*set_errfile) (DB_ENV *, FILE*)", 1336, 8}, {"void (*set_errfile) (DB_ENV *, FILE*)", 1336, 8},
{"void (*set_errpfx) (DB_ENV *, const char *)", 1344, 8}, {"void (*set_errpfx) (DB_ENV *, const char *)", 1344, 8},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1360, 8}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1360, 8},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1200, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1424, 8},
{"int (*set_data_dir) (DB_ENV *, const char *)", 1432, 8}, {"int (*set_data_dir) (DB_ENV *, const char *)", 1432, 8},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 1448, 8}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 1448, 8},
{"void (*set_errfile) (DB_ENV *, FILE*)", 1456, 8}, {"void (*set_errfile) (DB_ENV *, FILE*)", 1456, 8},
{"void (*set_errpfx) (DB_ENV *, const char *)", 1464, 8}, {"void (*set_errpfx) (DB_ENV *, const char *)", 1464, 8},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1488, 8}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1488, 8},
......
...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = { ...@@ -19,7 +19,7 @@ struct fieldinfo db_env_fields64[] = {
{"int (*open) (DB_ENV *, const char *, u_int32_t, int)", 1240, 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_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)", 1488, 8},
{"int (*set_data_dir) (DB_ENV *, const char *)", 1504, 8}, {"int (*set_data_dir) (DB_ENV *, const char *)", 1504, 8},
{"void (*set_errcall) (DB_ENV *, void (*)(const char *, char *))", 1520, 8}, {"void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *))", 1520, 8},
{"void (*set_errfile) (DB_ENV *, FILE*)", 1528, 8}, {"void (*set_errfile) (DB_ENV *, FILE*)", 1528, 8},
{"void (*set_errpfx) (DB_ENV *, const char *)", 1536, 8}, {"void (*set_errpfx) (DB_ENV *, const char *)", 1536, 8},
{"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1560, 8}, {"int (*set_flags) (DB_ENV *, u_int32_t, int)", 1560, 8},
......
...@@ -124,7 +124,7 @@ struct __toku_db_env { ...@@ -124,7 +124,7 @@ struct __toku_db_env {
int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=716 size=4, 64=bit offset=1304 size=8 */ int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int); /* 32-bit offset=716 size=4, 64=bit offset=1304 size=8 */
int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=720 size=4, 64=bit offset=1312 size=8 */ int (*set_data_dir) (DB_ENV *, const char *); /* 32-bit offset=720 size=4, 64=bit offset=1312 size=8 */
void* __toku_dummy11[1]; void* __toku_dummy11[1];
void (*set_errcall) (DB_ENV *, void (*)(const char *, char *)); /* 32-bit offset=728 size=4, 64=bit offset=1328 size=8 */ void (*set_errcall) (DB_ENV *, void (*)(DB_ENV *, const char *, const char *)); /* 32-bit offset=728 size=4, 64=bit offset=1328 size=8 */
void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=732 size=4, 64=bit offset=1336 size=8 */ void (*set_errfile) (DB_ENV *, FILE*); /* 32-bit offset=732 size=4, 64=bit offset=1336 size=8 */
void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=736 size=4, 64=bit offset=1344 size=8 */ void (*set_errpfx) (DB_ENV *, const char *); /* 32-bit offset=736 size=4, 64=bit offset=1344 size=8 */
void* __toku_dummy12[1]; void* __toku_dummy12[1];
......
...@@ -36,11 +36,19 @@ struct __toku_db_txn_internal { ...@@ -36,11 +36,19 @@ struct __toku_db_txn_internal {
static char *construct_full_name(const char *dir, const char *fname); static char *construct_full_name(const char *dir, const char *fname);
static int do_associated_inserts (DB_TXN *txn, DBT *key, DBT *data, DB *secondary); static int do_associated_inserts (DB_TXN *txn, DBT *key, DBT *data, DB *secondary);
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 1
typedef void (*toku_env_errcall_t)(const char *, char *);
#elif DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
typedef void (*toku_env_errcall_t)(DB_ENV *, const char *, const char *);
#else
#error
#endif
struct __toku_db_env_internal { struct __toku_db_env_internal {
int ref_count; int ref_count;
u_int32_t open_flags; u_int32_t open_flags;
int open_mode; int open_mode;
void (*errcall) (const char *, char *); toku_env_errcall_t errcall;
void *errfile; void *errfile;
char *errpfx; char *errpfx;
char *dir; /* A malloc'd copy of the directory. */ char *dir; /* A malloc'd copy of the directory. */
...@@ -407,7 +415,7 @@ static int toku_db_env_set_data_dir(DB_ENV * env, const char *dir) { ...@@ -407,7 +415,7 @@ static int toku_db_env_set_data_dir(DB_ENV * env, const char *dir) {
return 0; return 0;
} }
static void toku_db_env_set_errcall(DB_ENV * env, void (*errcall) (const char *, char *)) { static void toku_db_env_set_errcall(DB_ENV * env, toku_env_errcall_t errcall) {
env->i->errcall = errcall; env->i->errcall = errcall;
} }
...@@ -490,7 +498,12 @@ static int toku_db_env_txn_stat(DB_ENV * env, DB_TXN_STAT ** statp, u_int32_t fl ...@@ -490,7 +498,12 @@ static int toku_db_env_txn_stat(DB_ENV * env, DB_TXN_STAT ** statp, u_int32_t fl
return 1; return 1;
} }
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 1
void toku_default_errcall(const char *errpfx, char *msg) { void toku_default_errcall(const char *errpfx, char *msg) {
#else
void toku_default_errcall(DB_ENV *env, const char *errpfx, const char *msg) {
env = env;
#endif
fprintf(stderr, "YDB: %s: %s", errpfx, msg); fprintf(stderr, "YDB: %s: %s", errpfx, msg);
} }
......
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