diff options
Diffstat (limited to 'source4/lib/tdb/tools')
-rw-r--r-- | source4/lib/tdb/tools/tdbdump.c | 4 | ||||
-rw-r--r-- | source4/lib/tdb/tools/tdbtest.c | 8 | ||||
-rw-r--r-- | source4/lib/tdb/tools/tdbtool.c | 32 | ||||
-rw-r--r-- | source4/lib/tdb/tools/tdbtorture.c | 16 |
4 files changed, 30 insertions, 30 deletions
diff --git a/source4/lib/tdb/tools/tdbdump.c b/source4/lib/tdb/tools/tdbdump.c index 774093dbc0..9122551a0a 100644 --- a/source4/lib/tdb/tools/tdbdump.c +++ b/source4/lib/tdb/tools/tdbdump.c @@ -57,7 +57,7 @@ static void print_data(TDB_DATA d) } } -static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) +static int traverse_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { printf("{\n"); printf("key = \""); @@ -72,7 +72,7 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *stat static int dump_tdb(const char *fname) { - TDB_CONTEXT *tdb; + struct tdb_context *tdb; tdb = tdb_open(fname, 0, 0, O_RDONLY, 0); if (!tdb) { diff --git a/source4/lib/tdb/tools/tdbtest.c b/source4/lib/tdb/tools/tdbtest.c index 4f7f7faafc..edf12ecfdd 100644 --- a/source4/lib/tdb/tools/tdbtest.c +++ b/source4/lib/tdb/tools/tdbtest.c @@ -28,7 +28,7 @@ #define DELETE_PROB 7 #define STORE_PROB 5 -static TDB_CONTEXT *db; +static struct tdb_context *db; static GDBM_FILE gdbm; struct timeval tp1,tp2; @@ -52,9 +52,9 @@ static void fatal(const char *why) } #ifdef PRINTF_ATTRIBUTE -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); +static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); #endif -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) +static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) { va_list ap; @@ -191,7 +191,7 @@ static void addrec_gdbm(void) free(d); } -static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) +static int traverse_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { #if 0 printf("[%s] [%s]\n", key.dptr, dbuf.dptr); diff --git a/source4/lib/tdb/tools/tdbtool.c b/source4/lib/tdb/tools/tdbtool.c index 50486122bc..5a8c871699 100644 --- a/source4/lib/tdb/tools/tdbtool.c +++ b/source4/lib/tdb/tools/tdbtool.c @@ -59,9 +59,9 @@ typedef struct connections_data { time_t start; } connections_data; -static TDB_CONTEXT *tdb; +static struct tdb_context *tdb; -static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state); +static int print_rec(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state); static void print_asc(unsigned char *buf,int len) { @@ -207,9 +207,9 @@ static void insert_tdb(void) return; } - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = strlen(k)+1; - dbuf.dptr = d; + dbuf.dptr = (unsigned char *)d; dbuf.dsize = strlen(d)+1; if (tdb_store(tdb, key, dbuf, TDB_INSERT) == -1) { @@ -228,9 +228,9 @@ static void store_tdb(void) return; } - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = strlen(k)+1; - dbuf.dptr = d; + dbuf.dptr = (unsigned char *)d; dbuf.dsize = strlen(d)+1; printf("Storing key:\n"); @@ -251,7 +251,7 @@ static void show_tdb(void) return; } - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = strlen(k)+1; dbuf = tdb_fetch(tdb, key); @@ -284,7 +284,7 @@ static void delete_tdb(void) return; } - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = strlen(k)+1; if (tdb_delete(tdb, key) != 0) { @@ -297,7 +297,7 @@ static void move_rec(void) char *k = get_token(1); char *file = get_token(0); TDB_DATA key, dbuf; - TDB_CONTEXT *dst_tdb; + struct tdb_context *dst_tdb; if (!k) { help(); @@ -309,7 +309,7 @@ static void move_rec(void) return; } - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = strlen(k)+1; dbuf = tdb_fetch(tdb, key); @@ -343,7 +343,7 @@ static void move_rec(void) return; } -static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) +static int print_rec(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { printf("\nkey %d bytes\n", key.dsize); print_asc(key.dptr, key.dsize); @@ -352,7 +352,7 @@ static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *st return 0; } -static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) +static int print_key(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { print_asc(key.dptr, key.dsize); printf("\n"); @@ -361,7 +361,7 @@ static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *st static int total_bytes; -static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) +static int traverse_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { total_bytes += dbuf.dsize; return 0; @@ -389,13 +389,13 @@ static char *tdb_getline(char *prompt) return p?line:NULL; } -static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, +static int do_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { return tdb_delete(the_tdb, key); } -static void first_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey) +static void first_record(struct tdb_context *the_tdb, TDB_DATA *pkey) { TDB_DATA dbuf; *pkey = tdb_firstkey(the_tdb); @@ -408,7 +408,7 @@ static void first_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey) } } -static void next_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey) +static void next_record(struct tdb_context *the_tdb, TDB_DATA *pkey) { TDB_DATA dbuf; *pkey = tdb_nextkey(the_tdb, *pkey); diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c index 687d304b70..0cf82fa5a5 100644 --- a/source4/lib/tdb/tools/tdbtorture.c +++ b/source4/lib/tdb/tools/tdbtorture.c @@ -39,12 +39,12 @@ #define DATALEN 100 #define LOCKLEN 20 -static TDB_CONTEXT *db; +static struct tdb_context *db; #ifdef PRINTF_ATTRIBUTE -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); +static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); #endif -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) +static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) { va_list ap; @@ -81,7 +81,7 @@ static char *randbuf(int len) return buf; } -static int cull_traverse(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, +static int cull_traverse(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { if (random() % CULL_PROB == 0) { @@ -104,13 +104,13 @@ static void addrec_db(void) d = randbuf(dlen); s = randbuf(slen); - key.dptr = k; + key.dptr = (unsigned char *)k; key.dsize = klen+1; - data.dptr = d; + data.dptr = (unsigned char *)d; data.dsize = dlen+1; - lockkey.dptr = s; + lockkey.dptr = (unsigned char *)s; lockkey.dsize = slen+1; #if REOPEN_PROB @@ -174,7 +174,7 @@ next: free(s); } -static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, +static int traverse_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { tdb_delete(tdb, key); |