]> git.ozlabs.org Git - ccan/blob - ccan/tdb2/test/logging.h
tdb2: implement tdb_exists and tdb_parse_record
[ccan] / ccan / tdb2 / test / logging.h
1 #ifndef TDB2_TEST_LOGGING_H
2 #define TDB2_TEST_LOGGING_H
3 #include <ccan/tdb2/tdb2.h>
4 #include <stdbool.h>
5 #include <string.h>
6
7 extern bool suppress_logging;
8 extern const char *log_prefix;
9 extern unsigned tap_log_messages;
10 extern union tdb_attribute tap_log_attr;
11
12 void tap_log_fn(struct tdb_context *tdb,
13                 enum tdb_log_level level, void *priv,
14                 const char *message);
15
16 static inline bool data_equal(struct tdb_data a, struct tdb_data b)
17 {
18         if (a.dsize != b.dsize)
19                 return false;
20         return memcmp(a.dptr, b.dptr, a.dsize) == 0;
21 }
22 #endif /* TDB2_TEST_LOGGING_H */