summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb1.h
AgeCommit message (Collapse)AuthorFilesLines
2011-09-14tdb2: Make TDB1 code use TDB2's open flags.Rusty Russell1-14/+0
This means getting rid of TDB_VOLATILE (perhaps we should use an attribute for that?), TDB_INCOMPATIBLE_HASH (use the tdb_attribute_hash for that) and TDB_CLEAR_IF_FIRST (use the tdb_attribute_openhook for that). We also get rid of TDB_DISALLOW_NESTING: that's the default for TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 22d0e0dc59fc9d7e0046fec6971ef478c2d604fd)
2011-09-14tdb2: approximate INCOMPATIBLE_HASH flag with tdb1_incompatible_hash()Rusty Russell1-2/+1
Rather than leak TDB_INCOMPATIBLE_HASH through to the TDB2 API, we make it that if they use the tdb1_incompatible_hash function as their hash, then we treat it as if they had specified the TDB_INCOMPATIBLE_HASH flag (ie. we mark the header so it's unusable by tdb < 1.2.6). This precludes the possibility of using TDB_INCOMPATIBLE_HASH with a custom hash function: that used to allow the user to ensure that old TDB versions couldn't open the TDB file (and recent ones check the header to ensure they're using the right hash). But that's a small loss. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 3004f7e89a5978064b4fb29c1027e6d0d39e9418)
2011-09-14tdb2: Make tdb1 share tdb_store flags, struct tdb_data and TDB_MAGIC_FOOD.Rusty Russell1-28/+18
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 8a47d50d72ea62e378dc92b150c92c1317c73fa3)
2011-09-14tdb2: make TDB1 code use tdb2's TDB_ERROR and tdb_logerr()Rusty Russell1-25/+2
To do this, we make sure that the first few fields of tdb1_context and tdb_context are the same. This sweep also fixes up a few paths where we weren't setting tdb->ecode before our old logging function. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 919937354a331bb964564a11b5a5b80403ff8db9)
2011-09-14tdb2: make tdb1 headers include tdb2 headers.Rusty Russell1-0/+1
They're about to start sharing TDB2's definitions. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 1e3138a0ad0c184d2ca49ce7bc47173eb2fe67bd)
2011-09-14tdb2: Remove unused tdb1 functions.Rusty Russell1-46/+0
We're going to use TDB2's API, so some TDB1 APIs are obviously unnecessary. We also get rid of USE_RIGHT_MERGES and TRACE code. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit b929638e3cfe629285af3ecd0813e03eaeaa1133)
2011-09-14tdb2: import TDB1 code.Rusty Russell1-0/+226
We import the entire codebase, putting a "tdb1_" prefix on the files and changing the "tdb_" prefix to "tdb1_" everywhere. The next patches will gradually merge it with the TDB2 code where necessary. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 19e6c1a250ade1e7204ada17163294855585e825)