#include <stdint.h>
/* For bool */
#include <stdbool.h>
+/* For memcmp */
+#include <string.h>
#endif
#include <ccan/compiler/compiler.h>
#include <ccan/typesafe_cb/typesafe_cb.h>
*/
bool tdb_exists(struct tdb_context *tdb, TDB_DATA key);
+/**
+ * tdb_deq - are struct tdb_data equal?
+ * @a: one struct tdb_data
+ * @b: another struct tdb_data
+ */
+static inline bool tdb_deq(struct tdb_data a, struct tdb_data b)
+{
+ return a.dsize == b.dsize && memcmp(a.dptr, b.dptr, a.dsize) == 0;
+}
+
/**
* tdb_transaction_start - start a transaction
* @tdb: the tdb context returned from tdb_open()