/* For uint64_t */
#include <stdint.h>
#endif
+#include <ccan/compiler/compiler.h>
/* flags to tdb_store() */
#define TDB_REPLACE 1 /* Unused */
size_t dsize;
} TDB_DATA;
-#ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
-/** Use gcc attribute to check printf fns. a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
struct tdb_context;
/* FIXME: Make typesafe */
enum tdb_attribute_type {
TDB_ATTRIBUTE_LOG = 0,
- TDB_ATTRIBUTE_HASH = 1
+ TDB_ATTRIBUTE_HASH = 1,
+ TDB_ATTRIBUTE_SEED = 2
};
struct tdb_attribute_base {
void *hash_private;
};
+struct tdb_attribute_seed {
+ struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_SEED */
+ uint64_t seed;
+};
+
union tdb_attribute {
struct tdb_attribute_base base;
struct tdb_attribute_log log;
struct tdb_attribute_hash hash;
+ struct tdb_attribute_seed seed;
};
struct tdb_context *tdb_open(const char *name, int tdb_flags,