/* simple tool to create a lot of records on a tdb and to read them out Copyright (C) Andrew Tridgell 2006 Ronnie sahlberg 2007 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include "includes.h" #include "lib/events/events.h" #include "system/filesys.h" #include "popt.h" #include "cmdline.h" #include #include static int num_records = 10; static void store_records(struct ctdb_context *ctdb, struct event_context *ev) { TDB_DATA key, data; struct ctdb_db_context *ctdb_db; TALLOC_CTX *tmp_ctx = talloc_new(ctdb); int ret; struct ctdb_record_handle *h; uint32_t i; ctdb_db = ctdb_db_handle(ctdb, "test.tdb"); printf("creating %d records\n", num_records); for (i=0;i