tdb2: shorten attribute members.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 7 Apr 2011 03:36:11 +0000 (13:06 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 7 Apr 2011 03:36:11 +0000 (13:06 +0930)
It's redundant calling hash.hash_fn for example.  Standardize on fn
and data as names (private conflicts with C++).

18 files changed:
ccan/tdb2/check.c
ccan/tdb2/hash.c
ccan/tdb2/open.c
ccan/tdb2/private.h
ccan/tdb2/tdb.c
ccan/tdb2/tdb2.h
ccan/tdb2/test/logging.c
ccan/tdb2/test/run-04-basichash.c
ccan/tdb2/test/run-12-store.c
ccan/tdb2/test/run-13-delete.c
ccan/tdb2/test/run-20-growhash.c
ccan/tdb2/test/run-25-hashoverload.c
ccan/tdb2/test/run-missing-entries.c
ccan/tdb2/test/run-seed.c
ccan/tdb2/test/run-traverse.c
ccan/tdb2/tools/speed.c
ccan/tdb2/tools/tdbtool.c
ccan/tdb2/tools/tdbtorture.c

index ab6621ea85b4596aa192c3b53a9dc1aab73de366..88b86429cb97aed7a2486f53a7699626d7fc3041 100644 (file)
@@ -94,7 +94,7 @@ static enum TDB_ERROR check_hash_tree(struct tdb_context *tdb,
                                      size_t *num_found,
                                      enum TDB_ERROR (*check)(TDB_DATA,
                                                              TDB_DATA, void *),
-                                     void *private_data);
+                                     void *data);
 
 static enum TDB_ERROR check_hash_chain(struct tdb_context *tdb,
                                       tdb_off_t off,
@@ -105,7 +105,7 @@ static enum TDB_ERROR check_hash_chain(struct tdb_context *tdb,
                                       enum TDB_ERROR (*check)(TDB_DATA,
                                                               TDB_DATA,
                                                               void *),
-                                      void *private_data)
+                                      void *data)
 {
        struct tdb_used_record rec;
        enum TDB_ERROR ecode;
@@ -141,7 +141,7 @@ static enum TDB_ERROR check_hash_chain(struct tdb_context *tdb,
 
        off += sizeof(rec);
        ecode = check_hash_tree(tdb, off, 0, hash, 64,
-                               used, num_used, num_found, check, private_data);
+                               used, num_used, num_found, check, data);
        if (ecode != TDB_SUCCESS) {
                return ecode;
        }
@@ -154,7 +154,7 @@ static enum TDB_ERROR check_hash_chain(struct tdb_context *tdb,
                return TDB_SUCCESS;
        (*num_found)++;
        return check_hash_chain(tdb, off, hash, used, num_used, num_found,
-                               check, private_data);
+                               check, data);
 }
 
 static enum TDB_ERROR check_hash_record(struct tdb_context *tdb,
@@ -167,14 +167,14 @@ static enum TDB_ERROR check_hash_record(struct tdb_context *tdb,
                                        enum TDB_ERROR (*check)(TDB_DATA,
                                                                TDB_DATA,
                                                                void *),
-                                       void *private_data)
+                                       void *data)
 {
        struct tdb_used_record rec;
        enum TDB_ERROR ecode;
 
        if (hprefix_bits >= 64)
                return check_hash_chain(tdb, off, hprefix, used, num_used,
-                                       num_found, check, private_data);
+                                       num_found, check, data);
 
        ecode = tdb_read_convert(tdb, off, &rec, sizeof(rec));
        if (ecode != TDB_SUCCESS) {
@@ -210,7 +210,7 @@ static enum TDB_ERROR check_hash_record(struct tdb_context *tdb,
        return check_hash_tree(tdb, off,
                               TDB_SUBLEVEL_HASH_BITS-TDB_HASH_GROUP_BITS,
                               hprefix, hprefix_bits,
-                              used, num_used, num_found, check, private_data);
+                              used, num_used, num_found, check, data);
 }
 
 static int off_cmp(const tdb_off_t *a, const tdb_off_t *b)
@@ -237,7 +237,7 @@ static enum TDB_ERROR check_hash_tree(struct tdb_context *tdb,
                                      size_t *num_found,
                                      enum TDB_ERROR (*check)(TDB_DATA,
                                                              TDB_DATA, void *),
-                                     void *private_data)
+                                     void *data)
 {
        unsigned int g, b;
        const tdb_off_t *hash;
@@ -318,7 +318,7 @@ static enum TDB_ERROR check_hash_tree(struct tdb_context *tdb,
                                                       + group_bits
                                                       + TDB_HASH_GROUP_BITS,
                                               used, num_used, num_found,
-                                              check, private_data);
+                                              check, data);
                                if (ecode != TDB_SUCCESS) {
                                        goto fail;
                                }
@@ -401,7 +401,7 @@ static enum TDB_ERROR check_hash_tree(struct tdb_context *tdb,
 
                check:
                        if (check) {
-                               TDB_DATA key, data;
+                               TDB_DATA k, d;
                                const unsigned char *kptr;
 
                                kptr = tdb_access_read(tdb,
@@ -414,10 +414,10 @@ static enum TDB_ERROR check_hash_tree(struct tdb_context *tdb,
                                        goto fail;
                                }
 
-                               key = tdb_mkdata(kptr, rec_key_length(&rec));
-                               data = tdb_mkdata(kptr + key.dsize,
-                                                 rec_data_length(&rec));
-                               ecode = check(key, data, private_data);
+                               k = tdb_mkdata(kptr, rec_key_length(&rec));
+                               d = tdb_mkdata(kptr + k.dsize,
+                                              rec_data_length(&rec));
+                               ecode = check(k, d, data);
                                tdb_access_release(tdb, kptr);
                                if (ecode != TDB_SUCCESS) {
                                        goto fail;
@@ -437,7 +437,7 @@ static enum TDB_ERROR check_hash(struct tdb_context *tdb,
                                 tdb_off_t used[],
                                 size_t num_used, size_t num_ftables,
                                 int (*check)(TDB_DATA, TDB_DATA, void *),
-                                void *private_data)
+                                void *data)
 {
        /* Free tables also show up as used. */
        size_t num_found = num_ftables;
@@ -446,7 +446,7 @@ static enum TDB_ERROR check_hash(struct tdb_context *tdb,
        ecode = check_hash_tree(tdb, offsetof(struct tdb_header, hashtable),
                                TDB_TOPLEVEL_HASH_BITS-TDB_HASH_GROUP_BITS,
                                0, 0, used, num_used, &num_found,
-                               check, private_data);
+                               check, data);
        if (ecode == TDB_SUCCESS) {
                if (num_found != num_used) {
                        ecode = tdb_logerr(tdb, TDB_ERR_CORRUPT, TDB_LOG_ERROR,
@@ -772,9 +772,8 @@ static enum TDB_ERROR check_linear(struct tdb_context *tdb,
 }
 
 enum TDB_ERROR tdb_check_(struct tdb_context *tdb,
-                         enum TDB_ERROR (*check)(TDB_DATA key, TDB_DATA data,
-                                                 void *private_data),
-                         void *private_data)
+                         enum TDB_ERROR (*check)(TDB_DATA, TDB_DATA, void *),
+                         void *data)
 {
        tdb_off_t *fr = NULL, *used = NULL, ft, recovery;
        size_t num_free = 0, num_used = 0, num_found = 0, num_ftables = 0;
@@ -815,8 +814,7 @@ enum TDB_ERROR tdb_check_(struct tdb_context *tdb,
        }
 
        /* FIXME: Check key uniqueness? */
-       ecode = check_hash(tdb, used, num_used, num_ftables, check,
-                          private_data);
+       ecode = check_hash(tdb, used, num_used, num_ftables, check, data);
        if (ecode != TDB_SUCCESS)
                goto out;
 
index 2b997008f7782961b370439488a570642be452eb..b1307d985bef413edc2ebea3bb0fe2eaec4e16b0 100644 (file)
@@ -31,13 +31,12 @@ static uint64_t jenkins_hash(const void *key, size_t length, uint64_t seed,
 
 void tdb_hash_init(struct tdb_context *tdb)
 {
-       tdb->khash = jenkins_hash;
-       tdb->hash_priv = NULL;
+       tdb->hashfn = jenkins_hash;
 }
 
 uint64_t tdb_hash(struct tdb_context *tdb, const void *ptr, size_t len)
 {
-       return tdb->khash(ptr, len, tdb->hash_seed, tdb->hash_priv);
+       return tdb->hashfn(ptr, len, tdb->hash_seed, tdb->hash_data);
 }
 
 uint64_t hash_record(struct tdb_context *tdb, tdb_off_t off)
index 7bb50f1db5964ae13687f0c792fab5a8603e8481..a26148fc80d46cb9ee160a2e94b4bb857138917d 100644 (file)
@@ -101,10 +101,10 @@ static enum TDB_ERROR tdb_new_database(struct tdb_context *tdb,
        else
                newdb.hdr.hash_seed = random_number(tdb);
        newdb.hdr.hash_test = TDB_HASH_MAGIC;
-       newdb.hdr.hash_test = tdb->khash(&newdb.hdr.hash_test,
-                                        sizeof(newdb.hdr.hash_test),
-                                        newdb.hdr.hash_seed,
-                                        tdb->hash_priv);
+       newdb.hdr.hash_test = tdb->hashfn(&newdb.hdr.hash_test,
+                                         sizeof(newdb.hdr.hash_test),
+                                         newdb.hdr.hash_seed,
+                                         tdb->hash_data);
        newdb.hdr.recovery = 0;
        newdb.hdr.features_used = newdb.hdr.features_offered = TDB_FEATURE_MASK;
        newdb.hdr.seqnum = 0;
@@ -217,12 +217,12 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags,
        while (attr) {
                switch (attr->base.attr) {
                case TDB_ATTRIBUTE_LOG:
-                       tdb->logfn = attr->log.log_fn;
-                       tdb->log_private = attr->log.log_private;
+                       tdb->logfn = attr->log.fn;
+                       tdb->log_data = attr->log.data;
                        break;
                case TDB_ATTRIBUTE_HASH:
-                       tdb->khash = attr->hash.hash_fn;
-                       tdb->hash_priv = attr->hash.hash_private;
+                       tdb->hashfn = attr->hash.fn;
+                       tdb->hash_data = attr->hash.data;
                        break;
                case TDB_ATTRIBUTE_SEED:
                        seed = &attr->seed;
index 0a030d6e317e368fbf0d057a21ece3b28fd8a624..ab9dc35f76f3a15cb1e7a4716e9ef56359c4711f 100644 (file)
@@ -367,13 +367,13 @@ struct tdb_context {
        /* Logging function */
        void (*logfn)(struct tdb_context *tdb,
                      enum tdb_log_level level,
-                     void *log_private,
+                     void *data,
                      const char *message);
-       void *log_private;
+       void *log_data;
 
        /* Hash function. */
-       uint64_t (*khash)(const void *key, size_t len, uint64_t seed, void *);
-       void *hash_priv;
+       uint64_t (*hashfn)(const void *key, size_t len, uint64_t seed, void *);
+       void *hash_data;
        uint64_t hash_seed;
 
        /* Set if we are in a transaction. */
index 1dbbb7e93bdf46c16e8200abb9b5e0b3b3a885f4..01e77733f86c27fd84c438b6b2a1ee51f4b200ab 100644 (file)
@@ -406,11 +406,11 @@ enum TDB_ERROR COLD tdb_logerr(struct tdb_context *tdb,
        va_end(ap);
 
        if (len < 0) {
-               tdb->logfn(tdb, TDB_LOG_ERROR, tdb->log_private,
+               tdb->logfn(tdb, TDB_LOG_ERROR, tdb->log_data,
                           "out of memory formatting message:");
-               tdb->logfn(tdb, level, tdb->log_private, fmt);
+               tdb->logfn(tdb, level, tdb->log_data, fmt);
        } else {
-               tdb->logfn(tdb, level, tdb->log_private, message);
+               tdb->logfn(tdb, level, tdb->log_data, message);
                free(message);
        }
        errno = saved_errno;
@@ -419,10 +419,10 @@ enum TDB_ERROR COLD tdb_logerr(struct tdb_context *tdb,
 
 enum TDB_ERROR tdb_parse_record_(struct tdb_context *tdb,
                                 TDB_DATA key,
-                                enum TDB_ERROR (*parse)(TDB_DATA key,
-                                                        TDB_DATA data,
-                                                        void *p),
-                                void *p)
+                                enum TDB_ERROR (*parse)(TDB_DATA k,
+                                                        TDB_DATA d,
+                                                        void *data),
+                                void *data)
 {
        tdb_off_t off;
        struct tdb_used_record rec;
@@ -443,9 +443,9 @@ enum TDB_ERROR tdb_parse_record_(struct tdb_context *tdb,
                if (TDB_PTR_IS_ERR(dptr)) {
                        ecode = TDB_PTR_ERR(dptr);
                } else {
-                       TDB_DATA data = tdb_mkdata(dptr, rec_data_length(&rec));
+                       TDB_DATA d = tdb_mkdata(dptr, rec_data_length(&rec));
 
-                       ecode = parse(key, data, p);
+                       ecode = parse(key, d, data);
                        tdb_access_release(tdb, dptr);
                }
        }
index 802bcdbe10e02d7b52fc51fb90a9cec968a2f527..47ec3041b85723b49e45c8b10458ee57c1f8cacc 100644 (file)
@@ -324,7 +324,7 @@ int64_t tdb_traverse_(struct tdb_context *tdb,
  * @tdb: the tdb context returned from tdb_open()
  * @key: the key whose record we should hand to @parse
  * @parse: the function to call for the data
- * @p: the private pointer to hand to @parse (types must match).
+ * @data: the private pointer to hand to @parse (types must match).
  *
  * This avoids a copy for many cases, by handing you a pointer into
  * the memory-mapped database.  It also locks the record to prevent
@@ -332,18 +332,18 @@ int64_t tdb_traverse_(struct tdb_context *tdb,
  *
  * Do not alter the data handed to parse()!
  */
-#define tdb_parse_record(tdb, key, parse, p)                           \
+#define tdb_parse_record(tdb, key, parse, data)                                \
        tdb_parse_record_((tdb), (key),                                 \
                          typesafe_cb_preargs(enum TDB_ERROR, void *,   \
-                                             (parse), (p),             \
-                                             TDB_DATA, TDB_DATA), (p))
+                                             (parse), (data),          \
+                                             TDB_DATA, TDB_DATA), (data))
 
 enum TDB_ERROR tdb_parse_record_(struct tdb_context *tdb,
                                 TDB_DATA key,
-                                enum TDB_ERROR (*parse)(TDB_DATA key,
-                                                        TDB_DATA data,
-                                                        void *p),
-                                void *p);
+                                enum TDB_ERROR (*parse)(TDB_DATA k,
+                                                        TDB_DATA d,
+                                                        void *data),
+                                void *data);
 
 /**
  * tdb_get_seqnum - get a database sequence number
@@ -490,7 +490,7 @@ enum TDB_ERROR tdb_wipe_all(struct tdb_context *tdb);
  * tdb_check - check a TDB for consistency
  * @tdb: the tdb context returned from tdb_open()
  * @check: function to check each key/data pair (or NULL)
- * @private_data: argument for @check, must match type.
+ * @data: argument for @check, must match type.
  *
  * This performs a consistency check of the open database, optionally calling
  * a check() function on each record so you can do your own data consistency
@@ -499,18 +499,18 @@ enum TDB_ERROR tdb_wipe_all(struct tdb_context *tdb);
  *
  * Returns TDB_SUCCESS or an error.
  */
-#define tdb_check(tdb, check, private_data)                            \
+#define tdb_check(tdb, check, data)                                    \
        tdb_check_((tdb), typesafe_cb_preargs(enum TDB_ERROR, void *,   \
-                                             (check), (private_data),  \
+                                             (check), (data),          \
                                              struct tdb_data,          \
                                              struct tdb_data),         \
-                  (private_data))
+                  (data))
 
 enum TDB_ERROR tdb_check_(struct tdb_context *tdb,
-                         enum TDB_ERROR (*check)(struct tdb_data key,
-                                                 struct tdb_data data,
-                                                 void *private_data),
-                         void *private_data);
+                         enum TDB_ERROR (*check)(struct tdb_data k,
+                                                 struct tdb_data d,
+                                                 void *data),
+                         void *data);
 
 /**
  * tdb_error - get the last error (not threadsafe)
@@ -640,11 +640,11 @@ enum tdb_log_level {
  */
 struct tdb_attribute_log {
        struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_LOG */
-       void (*log_fn)(struct tdb_context *tdb,
-                      enum tdb_log_level level,
-                      void *log_private,
-                      const char *message);
-       void *log_private;
+       void (*fn)(struct tdb_context *tdb,
+                  enum tdb_log_level level,
+                  void *data,
+                  const char *message);
+       void *data;
 };
 
 /**
@@ -661,9 +661,9 @@ struct tdb_attribute_log {
  */
 struct tdb_attribute_hash {
        struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_HASH */
-       uint64_t (*hash_fn)(const void *key, size_t len, uint64_t seed,
-                           void *priv);
-       void *hash_private;
+       uint64_t (*fn)(const void *key, size_t len, uint64_t seed,
+                      void *data);
+       void *data;
 };
 
 /**
index dfb332474a24b3eb462278685a19da2126f01abe..a3ddb329bcdfa9a28f1ffce84bb528fea0c03f3a 100644 (file)
@@ -9,7 +9,7 @@ bool suppress_logging;
 
 union tdb_attribute tap_log_attr = {
        .log = { .base = { .attr = TDB_ATTRIBUTE_LOG },
-                .log_fn = tap_log_fn }
+                .fn = tap_log_fn }
 };
 
 void tap_log_fn(struct tdb_context *tdb,
index 0f962f82b63bfcb59a2f5b5998bf25b6dccd77af..50c7c77df119642cba9b62a91fab3e133b897fc3 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
        struct tdb_data key = { (unsigned char *)&v, sizeof(v) };
        struct tdb_data dbuf = { (unsigned char *)&v, sizeof(v) };
        union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                                               .hash_fn = clash } };
+                                               .fn = clash } };
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT,
                        TDB_NOMMAP|TDB_CONVERT,
index 5c21e3a1d0cd0ab8d3658b18d31bfd4979b03843..971665535f80406f19994a79103f8ede06bb6224 100644 (file)
@@ -23,8 +23,8 @@ int main(int argc, char *argv[])
        uint64_t seed = 16014841315512641303ULL;
        union tdb_attribute fixed_hattr
                = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                             .hash_fn = fixedhash,
-                             .hash_private = &seed } };
+                             .fn = fixedhash,
+                             .data = &seed } };
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT,
                        TDB_NOMMAP|TDB_CONVERT };
index c70fec84828059edbb4fb26e0026ef3233857e6a..3b464d927ef9bd9460db9f6405573b618ff72edc 100644 (file)
@@ -146,11 +146,11 @@ int main(int argc, char *argv[])
        uint64_t seed = 16014841315512641303ULL;
        union tdb_attribute clash_hattr
                = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                             .hash_fn = clash } };
+                             .fn = clash } };
        union tdb_attribute fixed_hattr
                = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                             .hash_fn = fixedhash,
-                             .hash_private = &seed } };
+                             .fn = fixedhash,
+                             .data = &seed } };
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT,
                        TDB_NOMMAP|TDB_CONVERT };
index 1b6e7450e240ec8dacb462c0423bc7d249c33a33..22a88c450438b06bf94e8f29d554ea5f1e71d595 100644 (file)
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
        struct tdb_data key = { (unsigned char *)&kdata, sizeof(kdata) };
        struct tdb_data dbuf = { (unsigned char *)&kdata, sizeof(kdata) };
        union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                                               .hash_fn = myhash } };
+                                               .fn = myhash } };
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT,
                        TDB_NOMMAP|TDB_CONVERT,
index 4ddb54bc4efcef72350226ea83a71b081066f3d2..83f549d6b2633e4def88084d304ed0bdb1b5e753 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
        struct tdb_data key = { (unsigned char *)&j, sizeof(j) };
        struct tdb_data dbuf = { (unsigned char *)&j, sizeof(j) };
        union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                                               .hash_fn = badhash } };
+                                               .fn = badhash } };
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT,
                        TDB_NOMMAP|TDB_CONVERT,
index 9bc778771df0638d00b29f5e1f3a2ddfee294c6e..e99572f64c120cb0bbe44375ea34a60681044bc4 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
        struct tdb_data key = { (unsigned char *)&i, sizeof(i) };
        struct tdb_data data = { (unsigned char *)&i, sizeof(i) };
        union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                                               .hash_fn = failhash } };
+                                               .fn = failhash } };
 
        hattr.base.next = &tap_log_attr;
        plan_tests(1 + 2 * NUM_RECORDS + 1);
index 09ed1cb31c39207e14adaa64fe132e53f4e4f513..624bb15c8bce649c46904a34e071ff0aa754813c 100644 (file)
@@ -21,7 +21,7 @@ static void my_log_fn(struct tdb_context *tdb,
 
 static union tdb_attribute log_attr = {
        .log = { .base = { .attr = TDB_ATTRIBUTE_LOG },
-                .log_fn = my_log_fn }
+                .fn = my_log_fn }
 };
 
 int main(int argc, char *argv[])
index 36077e4acd7c4ecc316365f51059b6368eed571f..583e649dbd3a23727640a87eb368a07d8b67cf8b 100644 (file)
@@ -114,8 +114,8 @@ int main(int argc, char *argv[])
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, 
                        TDB_NOMMAP|TDB_CONVERT };
        union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH },
-                                               .hash_fn = fixedhash,
-                                               .hash_private = &seed } };
+                                               .fn = fixedhash,
+                                               .data = &seed } };
 
        hattr.base.next = &tap_log_attr;
 
index dc5f0ad820db09c7cff610c46d89408ba43317b3..c9fb0d0516145e001f93112159809bf93849e5e7 100644 (file)
@@ -95,7 +95,7 @@ static void dump_and_clear_stats(struct tdb_attribute_stats *stats)
 }
 
 static void tdb_log(struct tdb_context *tdb, enum tdb_log_level level,
-                   void *private, const char *message)
+                   void *data, const char *message)
 {
        fputs(message, stderr);
 }
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
 
        log.base.attr = TDB_ATTRIBUTE_LOG;
        log.base.next = &seed;
-       log.log.log_fn = tdb_log;
+       log.log.fn = tdb_log;
 
        memset(&stats, 0, sizeof(stats));
        stats.base.attr = TDB_ATTRIBUTE_STATS;
index 15ae052c4b2e3480b41a3eef9f283730146904b0..1cfcca8e26fdb5be18f167bb9065b5adcf6e0164 100644 (file)
@@ -233,7 +233,7 @@ static void create_tdb(const char *tdbname)
        union tdb_attribute log_attr;
        log_attr.base.attr = TDB_ATTRIBUTE_LOG;
        log_attr.base.next = NULL;
-       log_attr.log.log_fn = tdb_log;
+       log_attr.log.fn = tdb_log;
 
        if (tdb) tdb_close(tdb);
        tdb = tdb_open(tdbname, (disable_mmap?TDB_NOMMAP:0),
@@ -248,7 +248,7 @@ static void open_tdb(const char *tdbname)
        union tdb_attribute log_attr;
        log_attr.base.attr = TDB_ATTRIBUTE_LOG;
        log_attr.base.next = NULL;
-       log_attr.log.log_fn = tdb_log;
+       log_attr.log.fn = tdb_log;
 
        if (tdb) tdb_close(tdb);
        tdb = tdb_open(tdbname, disable_mmap?TDB_NOMMAP:0, O_RDWR, 0600,
index a409dab9dcc8f10916c37b696f3ec026a83d3281..42967751c3e7984dd15dbb9fe7671b9358cec1db 100644 (file)
@@ -43,7 +43,7 @@ static union tdb_attribute log_attr;
 static union tdb_attribute seed_attr;
 
 static void tdb_log(struct tdb_context *tdb, enum tdb_log_level level,
-                   void *private, const char *message)
+                   void *data, const char *message)
 {
        fputs(message, stdout);
        fflush(stdout);
@@ -327,7 +327,7 @@ int main(int argc, char * const *argv)
 
        log_attr.base.attr = TDB_ATTRIBUTE_LOG;
        log_attr.base.next = &seed_attr;
-       log_attr.log.log_fn = tdb_log;
+       log_attr.log.fn = tdb_log;
        seed_attr.base.attr = TDB_ATTRIBUTE_SEED;
 
        while ((c = getopt(argc, argv, "n:l:s:thkS")) != -1) {