compiler: use everywhere.
[ccan] / ccan / tdb / traverse.c
index 1ca88d71b6326a6cf1a7f67170d030800c26a0c6..d329ef4da4030c095e530b0d7b05b344c2256305 100644 (file)
@@ -32,7 +32,7 @@
 /* Uses traverse lock: 0 = finish, TDB_NEXT_LOCK_ERR = error,
    other = record offset */
 static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock *tlock,
 /* Uses traverse lock: 0 = finish, TDB_NEXT_LOCK_ERR = error,
    other = record offset */
 static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock *tlock,
-                        struct list_struct *rec)
+                        struct tdb_record *rec)
 {
        int want_next = (tlock->off != 0);
 
 {
        int want_next = (tlock->off != 0);
 
@@ -140,12 +140,12 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock
    if fn is NULL then it is not called
    a non-zero return value from fn() indicates that the traversal should stop
   */
    if fn is NULL then it is not called
    a non-zero return value from fn() indicates that the traversal should stop
   */
-static int _tdb_traverse(struct tdb_context *tdb, 
-                        tdb_traverse_func fn, void *private_data,
-                        struct tdb_traverse_lock *tl)
+static int tdb_traverse_internal(struct tdb_context *tdb, 
+                                tdb_traverse_func fn, void *private_data,
+                                struct tdb_traverse_lock *tl)
 {
        TDB_DATA key, dbuf;
 {
        TDB_DATA key, dbuf;
-       struct list_struct rec;
+       struct tdb_record rec;
        int ret = 0, count = 0;
        tdb_off_t off;
 
        int ret = 0, count = 0;
        tdb_off_t off;
 
@@ -226,7 +226,7 @@ int tdb_traverse_read(struct tdb_context *tdb,
 
        tdb->traverse_read++;
        tdb_trace(tdb, "tdb_traverse_read_start");
 
        tdb->traverse_read++;
        tdb_trace(tdb, "tdb_traverse_read_start");
-       ret = _tdb_traverse(tdb, fn, private_data, &tl);
+       ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_read--;
 
        tdb_transaction_unlock(tdb, F_RDLCK);
        tdb->traverse_read--;
 
        tdb_transaction_unlock(tdb, F_RDLCK);
@@ -257,7 +257,7 @@ int tdb_traverse(struct tdb_context *tdb,
 
        tdb->traverse_write++;
        tdb_trace(tdb, "tdb_traverse_start");
 
        tdb->traverse_write++;
        tdb_trace(tdb, "tdb_traverse_start");
-       ret = _tdb_traverse(tdb, fn, private_data, &tl);
+       ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_write--;
 
        tdb_transaction_unlock(tdb, F_WRLCK);
        tdb->traverse_write--;
 
        tdb_transaction_unlock(tdb, F_WRLCK);
@@ -270,7 +270,7 @@ int tdb_traverse(struct tdb_context *tdb,
 TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 {
        TDB_DATA key;
 TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 {
        TDB_DATA key;
-       struct list_struct rec;
+       struct tdb_record rec;
        tdb_off_t off;
 
        /* release any old lock */
        tdb_off_t off;
 
        /* release any old lock */
@@ -302,7 +302,7 @@ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
 {
        uint32_t oldhash;
        TDB_DATA key = tdb_null;
 {
        uint32_t oldhash;
        TDB_DATA key = tdb_null;
-       struct list_struct rec;
+       struct tdb_record rec;
        unsigned char *k = NULL;
        tdb_off_t off;
 
        unsigned char *k = NULL;
        tdb_off_t off;