Lines Matching defs:tdb
39 #include "tdb.h"
102 /* a tdb tool for manipulating a tdb database */
104 static TDB_CONTEXT *tdb;
168 " move key file : move a record to a destination tdb\n"
189 if (tdb) tdb_close(tdb);
190 tdb = tdb_open(tdbname, 0, TDB_CLEAR_IF_FIRST,
192 if (!tdb) {
199 if (tdb) tdb_close(tdb);
200 tdb = tdb_open(tdbname, 0, 0, O_RDWR, 0600);
201 if (!tdb) {
220 if (tdb_store(tdb, key, dbuf, TDB_INSERT) == -1) {
245 print_rec(tdb, key, dbuf, NULL);
247 if (tdb_store(tdb, key, dbuf, TDB_REPLACE) == -1) {
264 dbuf = tdb_fetch(tdb, key);
270 print_rec(tdb, key, dbuf, NULL);
289 if (tdb_delete(tdb, key) != 0) {
305 terror("need destination tdb name");
312 dbuf = tdb_fetch(tdb, key);
318 print_rec(tdb, key, dbuf, NULL);
322 terror("unable to open destination tdb");
374 if ((count = tdb_traverse(tdb, traverse_fn, NULL)) == -1)
375 printf("Error = %s\n", tdb_errorstr(tdb));
458 if (!tdb) {
467 tdb_traverse(tdb, do_delete_fn, NULL);
471 tdb_traverse(tdb, print_rec, NULL);
490 tdb_traverse(tdb, print_key, NULL);
493 tdb_traverse(tdb, print_hexkey, NULL);
500 tdb_dump_all(tdb);
503 tdb_printfreelist(tdb);
510 first_record(tdb, &iterate_kbuf);
514 next_record(tdb, &iterate_kbuf);
586 while ((cmdname = tdb_getline("tdb> "))) {
617 if (tdb) tdb_close(tdb);