X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fprivate.h;h=97ae5e18575654a28814a355891c059472689164;hp=4bce11a1c539ea8e39bb09c6179d495bf669e342;hb=c8c3b3568677e8b0105f84e4ab068c580faf4591;hpb=c8f6f8c2dea76042f74c02eff048847e62adcca6 diff --git a/ccan/tdb2/private.h b/ccan/tdb2/private.h index 4bce11a1..97ae5e18 100644 --- a/ccan/tdb2/private.h +++ b/ccan/tdb2/private.h @@ -55,6 +55,7 @@ typedef uint64_t tdb_off_t; #define TDB_MAGIC_FOOD "TDB file\n" #define TDB_VERSION ((uint64_t)(0x26011967 + 7)) +#define TDB1_VERSION (0x26011967 + 6) #define TDB_USED_MAGIC ((uint64_t)0x1999) #define TDB_HTABLE_MAGIC ((uint64_t)0x1888) #define TDB_CHAIN_MAGIC ((uint64_t)0x1777) @@ -628,6 +629,23 @@ struct tdb_context { } tdb1; }; +#define TDB1_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24)) + +/* tdb1_open.c: */ +int tdb1_new_database(struct tdb_context *tdb, + struct tdb_attribute_tdb1_hashsize *hashsize); +enum TDB_ERROR tdb1_open(struct tdb_context *tdb); + +/* tdb1_io.c: */ +enum TDB_ERROR tdb1_probe_length(struct tdb_context *tdb); + +/* tdb1_lock.c: */ +int tdb1_allrecord_unlock(struct tdb_context *tdb, int ltype); + +/* tdb1_transaction.c: */ +int tdb1_transaction_recover(struct tdb_context *tdb); +int tdb1_transaction_cancel(struct tdb_context *tdb); + /* tdb.c: */ enum TDB_ERROR COLD tdb_logerr(struct tdb_context *tdb, enum TDB_ERROR ecode,