Lines Matching refs:dbuf

107 static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state);
108 static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state);
109 static int print_hexkey(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state);
209 TDB_DATA key, dbuf; in insert_tdb() local
218 dbuf.dptr = (unsigned char *)data; in insert_tdb()
219 dbuf.dsize = datalen; in insert_tdb()
221 if (tdb_store(tdb, key, dbuf, TDB_INSERT) == -1) { in insert_tdb()
228 TDB_DATA key, dbuf; in store_tdb() local
242 dbuf.dptr = (unsigned char *)data; in store_tdb()
243 dbuf.dsize = datalen; in store_tdb()
246 print_rec(tdb, key, dbuf, NULL); in store_tdb()
248 if (tdb_store(tdb, key, dbuf, TDB_REPLACE) == -1) { in store_tdb()
255 TDB_DATA key, dbuf; in show_tdb() local
265 dbuf = tdb_fetch(tdb, key); in show_tdb()
266 if (!dbuf.dptr) { in show_tdb()
271 print_rec(tdb, key, dbuf, NULL); in show_tdb()
273 free( dbuf.dptr ); in show_tdb()
297 TDB_DATA key, dbuf; in move_rec() local
313 dbuf = tdb_fetch(tdb, key); in move_rec()
314 if (!dbuf.dptr) { in move_rec()
319 print_rec(tdb, key, dbuf, NULL); in move_rec()
327 if ( tdb_store( dst_tdb, key, dbuf, TDB_REPLACE ) == -1 ) { in move_rec()
338 static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) in print_rec() argument
342 printf("\ndata %d bytes\n", (int)dbuf.dsize); in print_rec()
343 print_data((const char *)dbuf.dptr, dbuf.dsize); in print_rec()
347 static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) in print_key() argument
355 static int print_hexkey(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) in print_hexkey() argument
365 static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state) in traverse_fn() argument
367 total_bytes += dbuf.dsize; in traverse_fn()
393 static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, in do_delete_fn() argument
401 TDB_DATA dbuf; in first_record() local
404 dbuf = tdb_fetch(the_tdb, *pkey); in first_record()
405 if (!dbuf.dptr) terror("fetch failed"); in first_record()
407 print_rec(the_tdb, *pkey, dbuf, NULL); in first_record()
413 TDB_DATA dbuf; in next_record() local
416 dbuf = tdb_fetch(the_tdb, *pkey); in next_record()
417 if (!dbuf.dptr) in next_record()
420 print_rec(the_tdb, *pkey, dbuf, NULL); in next_record()