]> git.ozlabs.org Git - ccan/commitdiff
tdb2: remove _PUBLIC_ in tdb1 functions.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Aug 2011 05:43:16 +0000 (15:13 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Aug 2011 05:43:16 +0000 (15:13 +0930)
They'll all be accessed via the tdb2 API.

ccan/tdb2/tdb1_check.c
ccan/tdb2/tdb1_hash.c
ccan/tdb2/tdb1_lock.c
ccan/tdb2/tdb1_open.c
ccan/tdb2/tdb1_private.h
ccan/tdb2/tdb1_summary.c
ccan/tdb2/tdb1_tdb.c
ccan/tdb2/tdb1_transaction.c
ccan/tdb2/tdb1_traverse.c

index d62a4b927108a6e4d432517b157e5b2e8328a2ad..306cd7e05f811d55ad03e854c2ff7a3c050952ad 100644 (file)
@@ -322,7 +322,7 @@ size_t tdb1_dead_space(struct tdb1_context *tdb, tdb1_off_t off)
        return len;
 }
 
-_PUBLIC_ int tdb1_check(struct tdb1_context *tdb,
+int tdb1_check(struct tdb1_context *tdb,
              int (*check)(TDB1_DATA key, TDB1_DATA data, void *private_data),
              void *private_data)
 {
index 8a33e8a8cde92a85d6a0ac795612a45b2590e67d..a8dd065535e3a56b65888a2595928182f13f723c 100644 (file)
@@ -339,7 +339,7 @@ static uint32_t hashlittle( const void *key, size_t length )
   return c;
 }
 
-_PUBLIC_ unsigned int tdb1_jenkins_hash(TDB1_DATA *key)
+unsigned int tdb1_jenkins_hash(TDB1_DATA *key)
 {
        return hashlittle(key->dptr, key->dsize);
 }
index e355bfa60caad9dfe0c244f8d63e1f611b67296d..ee6aaf745e20b76a85fa1a0f876177e83539242a 100644 (file)
@@ -626,50 +626,50 @@ int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype, bool mark_lock)
 }
 
 /* lock entire database with write lock */
-_PUBLIC_ int tdb1_lockall(struct tdb1_context *tdb)
+int tdb1_lockall(struct tdb1_context *tdb)
 {
        return tdb1_allrecord_lock(tdb, F_WRLCK, TDB1_LOCK_WAIT, false);
 }
 
 /* unlock entire database with write lock */
-_PUBLIC_ int tdb1_unlockall(struct tdb1_context *tdb)
+int tdb1_unlockall(struct tdb1_context *tdb)
 {
        return tdb1_allrecord_unlock(tdb, F_WRLCK, false);
 }
 
 /* lock entire database with read lock */
-_PUBLIC_ int tdb1_lockall_read(struct tdb1_context *tdb)
+int tdb1_lockall_read(struct tdb1_context *tdb)
 {
        return tdb1_allrecord_lock(tdb, F_RDLCK, TDB1_LOCK_WAIT, false);
 }
 
 /* unlock entire database with read lock */
-_PUBLIC_ int tdb1_unlockall_read(struct tdb1_context *tdb)
+int tdb1_unlockall_read(struct tdb1_context *tdb)
 {
        return tdb1_allrecord_unlock(tdb, F_RDLCK, false);
 }
 
 /* lock/unlock one hash chain. This is meant to be used to reduce
    contention - it cannot guarantee how many records will be locked */
-_PUBLIC_ int tdb1_chainlock(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_chainlock(struct tdb1_context *tdb, TDB1_DATA key)
 {
        int ret = tdb1_lock(tdb, TDB1_BUCKET(tdb->hash_fn(&key)), F_WRLCK);
        return ret;
 }
 
-_PUBLIC_ int tdb1_chainunlock(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_chainunlock(struct tdb1_context *tdb, TDB1_DATA key)
 {
        return tdb1_unlock(tdb, TDB1_BUCKET(tdb->hash_fn(&key)), F_WRLCK);
 }
 
-_PUBLIC_ int tdb1_chainlock_read(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_chainlock_read(struct tdb1_context *tdb, TDB1_DATA key)
 {
        int ret;
        ret = tdb1_lock(tdb, TDB1_BUCKET(tdb->hash_fn(&key)), F_RDLCK);
        return ret;
 }
 
-_PUBLIC_ int tdb1_chainunlock_read(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_chainunlock_read(struct tdb1_context *tdb, TDB1_DATA key)
 {
        return tdb1_unlock(tdb, TDB1_BUCKET(tdb->hash_fn(&key)), F_RDLCK);
 }
index 7b548c1d05da11c43c362f120c5ff66aa3ac66b8..7c5100e3d1e17c45aed7edc51f76f537e2018106 100644 (file)
@@ -129,7 +129,7 @@ static int tdb1_already_open(dev_t device,
    try to call tdb1_error or tdb1_errname, just do strerror(errno).
 
    @param name may be NULL for internal databases. */
-_PUBLIC_ struct tdb1_context *tdb1_open(const char *name, int hash_size, int tdb1_flags,
+struct tdb1_context *tdb1_open(const char *name, int hash_size, int tdb1_flags,
                      int open_flags, mode_t mode)
 {
        return tdb1_open_ex(name, hash_size, tdb1_flags, open_flags, mode, NULL, NULL);
@@ -162,7 +162,7 @@ static bool check_header_hash(struct tdb1_context *tdb,
        return check_header_hash(tdb, false, m1, m2);
 }
 
-_PUBLIC_ struct tdb1_context *tdb1_open_ex(const char *name, int hash_size, int tdb1_flags,
+struct tdb1_context *tdb1_open_ex(const char *name, int hash_size, int tdb1_flags,
                                int open_flags, mode_t mode,
                                const struct tdb1_logging_context *log_ctx,
                                tdb1_hash_func hash_fn)
@@ -450,7 +450,7 @@ _PUBLIC_ struct tdb1_context *tdb1_open_ex(const char *name, int hash_size, int
  * Set the maximum number of dead records per hash chain
  */
 
-_PUBLIC_ void tdb1_set_max_dead(struct tdb1_context *tdb, int max_dead)
+void tdb1_set_max_dead(struct tdb1_context *tdb, int max_dead)
 {
        tdb->max_dead_records = max_dead;
 }
@@ -460,7 +460,7 @@ _PUBLIC_ void tdb1_set_max_dead(struct tdb1_context *tdb, int max_dead)
  *
  * @returns -1 for error; 0 for success.
  **/
-_PUBLIC_ int tdb1_close(struct tdb1_context *tdb)
+int tdb1_close(struct tdb1_context *tdb)
 {
        struct tdb1_context **i;
        int ret = 0;
index b34d4dd1ba194490871ed21c3ce87d9625b1b682..ae2888c0a719eecbac59bb0c0b57c22fcdb8088f 100644 (file)
 #include <limits.h>
 #include <stdio.h>
 #include <utime.h>
-
-#ifndef _PUBLIC_
-#define _PUBLIC_
-#endif
-
 #else
 #include "replace.h"
 #include "system/filesys.h"
index 61e1853579a0e43b021e07830b0291feef293fdc..a2d2ae8f2fdbb31884e1dc08750d85680855335a 100644 (file)
@@ -84,7 +84,7 @@ static size_t get_hash_length(struct tdb1_context *tdb, unsigned int i)
        return count;
 }
 
-_PUBLIC_ char *tdb1_summary(struct tdb1_context *tdb)
+char *tdb1_summary(struct tdb1_context *tdb)
 {
        tdb1_off_t off, rec_off;
        struct tally freet, keys, data, dead, extra, hash, uncoal;
index 93d2132f3847f453319054becf32fb4770672619..cc7e580f2c3f1e8fc596da4a53c3039b94ad36de 100644 (file)
 
 #include "tdb1_private.h"
 
-_PUBLIC_ TDB1_DATA tdb1_null;
+TDB1_DATA tdb1_null;
 
 /*
   non-blocking increment of the tdb sequence number if the tdb has been opened using
   the TDB1_SEQNUM flag
 */
-_PUBLIC_ void tdb1_increment_seqnum_nonblock(struct tdb1_context *tdb)
+void tdb1_increment_seqnum_nonblock(struct tdb1_context *tdb)
 {
        tdb1_off_t seqnum=0;
 
@@ -199,7 +199,7 @@ static TDB1_DATA _tdb1_fetch(struct tdb1_context *tdb, TDB1_DATA key)
        return ret;
 }
 
-_PUBLIC_ TDB1_DATA tdb1_fetch(struct tdb1_context *tdb, TDB1_DATA key)
+TDB1_DATA tdb1_fetch(struct tdb1_context *tdb, TDB1_DATA key)
 {
        TDB1_DATA ret = _tdb1_fetch(tdb, key);
 
@@ -224,7 +224,7 @@ _PUBLIC_ TDB1_DATA tdb1_fetch(struct tdb1_context *tdb, TDB1_DATA key)
  * Return -1 if the record was not found.
  */
 
-_PUBLIC_ int tdb1_parse_record(struct tdb1_context *tdb, TDB1_DATA key,
+int tdb1_parse_record(struct tdb1_context *tdb, TDB1_DATA key,
                     int (*parser)(TDB1_DATA key, TDB1_DATA data,
                                   void *private_data),
                     void *private_data)
@@ -267,7 +267,7 @@ static int tdb1_exists_hash(struct tdb1_context *tdb, TDB1_DATA key, uint32_t ha
        return 1;
 }
 
-_PUBLIC_ int tdb1_exists(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_exists(struct tdb1_context *tdb, TDB1_DATA key)
 {
        uint32_t hash = tdb->hash_fn(&key);
        int ret;
@@ -425,7 +425,7 @@ static int tdb1_delete_hash(struct tdb1_context *tdb, TDB1_DATA key, uint32_t ha
        return ret;
 }
 
-_PUBLIC_ int tdb1_delete(struct tdb1_context *tdb, TDB1_DATA key)
+int tdb1_delete(struct tdb1_context *tdb, TDB1_DATA key)
 {
        uint32_t hash = tdb->hash_fn(&key);
        int ret;
@@ -594,7 +594,7 @@ static int _tdb1_store(struct tdb1_context *tdb, TDB1_DATA key,
 
    return 0 on success, -1 on failure
 */
-_PUBLIC_ int tdb1_store(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA dbuf, int flag)
+int tdb1_store(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA dbuf, int flag)
 {
        uint32_t hash;
        int ret;
@@ -615,7 +615,7 @@ _PUBLIC_ int tdb1_store(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA dbuf,
 }
 
 /* Append to an entry. Create if not exist. */
-_PUBLIC_ int tdb1_append(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA new_dbuf)
+int tdb1_append(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA new_dbuf)
 {
        uint32_t hash;
        TDB1_DATA dbuf;
@@ -665,7 +665,7 @@ failed:
   return the current logging function
   useful for external tdb routines that wish to log tdb errors
 */
-_PUBLIC_ tdb1_log_func tdb1_log_fn(struct tdb1_context *tdb)
+tdb1_log_func tdb1_log_fn(struct tdb1_context *tdb)
 {
        return tdb->log.log_fn;
 }
@@ -681,7 +681,7 @@ _PUBLIC_ tdb1_log_func tdb1_log_fn(struct tdb1_context *tdb)
   The aim of this sequence number is to allow for a very lightweight
   test of a possible tdb change.
 */
-_PUBLIC_ int tdb1_get_seqnum(struct tdb1_context *tdb)
+int tdb1_get_seqnum(struct tdb1_context *tdb)
 {
        tdb1_off_t seqnum=0;
 
@@ -689,7 +689,7 @@ _PUBLIC_ int tdb1_get_seqnum(struct tdb1_context *tdb)
        return seqnum;
 }
 
-_PUBLIC_ int tdb1_hash_size(struct tdb1_context *tdb)
+int tdb1_hash_size(struct tdb1_context *tdb)
 {
        return tdb->header.hash_size;
 }
@@ -726,7 +726,7 @@ static int tdb1_free_region(struct tdb1_context *tdb, tdb1_off_t offset, ssize_t
 
   This code carefully steps around the recovery area, leaving it alone
  */
-_PUBLIC_ int tdb1_wipe_all(struct tdb1_context *tdb)
+int tdb1_wipe_all(struct tdb1_context *tdb)
 {
        int i;
        tdb1_off_t offset = 0;
@@ -832,7 +832,7 @@ static int repack_traverse(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA da
 /*
   repack a tdb
  */
-_PUBLIC_ int tdb1_repack(struct tdb1_context *tdb)
+int tdb1_repack(struct tdb1_context *tdb)
 {
        struct tdb1_context *tmp_db;
        struct traverse_state state;
index 3358e57a00e27ff993e4cac9f8355550663fe0bf..43e99024ce091b70492f0929207849cd9fb36ce2 100644 (file)
@@ -527,7 +527,7 @@ fail_allrecord_lock:
        return -1;
 }
 
-_PUBLIC_ int tdb1_transaction_start(struct tdb1_context *tdb)
+int tdb1_transaction_start(struct tdb1_context *tdb)
 {
        return _tdb1_transaction_start(tdb, TDB1_LOCK_WAIT);
 }
@@ -618,7 +618,7 @@ static int _tdb1_transaction_cancel(struct tdb1_context *tdb)
 /*
   cancel the current transaction
 */
-_PUBLIC_ int tdb1_transaction_cancel(struct tdb1_context *tdb)
+int tdb1_transaction_cancel(struct tdb1_context *tdb)
 {
        return _tdb1_transaction_cancel(tdb);
 }
@@ -983,7 +983,7 @@ static int _tdb1_transaction_prepare_commit(struct tdb1_context *tdb)
 /*
    prepare to commit the current transaction
 */
-_PUBLIC_ int tdb1_transaction_prepare_commit(struct tdb1_context *tdb)
+int tdb1_transaction_prepare_commit(struct tdb1_context *tdb)
 {
        return _tdb1_transaction_prepare_commit(tdb);
 }
@@ -1013,7 +1013,7 @@ static bool repack_worthwhile(struct tdb1_context *tdb)
 /*
   commit the current transaction
 */
-_PUBLIC_ int tdb1_transaction_commit(struct tdb1_context *tdb)
+int tdb1_transaction_commit(struct tdb1_context *tdb)
 {
        const struct tdb1_methods *methods;
        int i;
index 515beb1f0d2f69f7776d1d34213e3a0105080598..ba1501279dbdfee1e07b50c3680f823f76e4db80 100644 (file)
@@ -208,7 +208,7 @@ out:
 /*
   a write style traverse - temporarily marks the db read only
 */
-_PUBLIC_ int tdb1_traverse_read(struct tdb1_context *tdb,
+int tdb1_traverse_read(struct tdb1_context *tdb,
                      tdb1_traverse_func fn, void *private_data)
 {
        struct tdb1_traverse_lock tl = { NULL, 0, 0, F_RDLCK };
@@ -236,7 +236,7 @@ _PUBLIC_ int tdb1_traverse_read(struct tdb1_context *tdb,
   WARNING: The data buffer given to the callback fn does NOT meet the
   alignment restrictions malloc gives you.
 */
-_PUBLIC_ int tdb1_traverse(struct tdb1_context *tdb,
+int tdb1_traverse(struct tdb1_context *tdb,
                 tdb1_traverse_func fn, void *private_data)
 {
        struct tdb1_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
@@ -261,7 +261,7 @@ _PUBLIC_ int tdb1_traverse(struct tdb1_context *tdb,
 
 
 /* find the first entry in the database and return its key */
-_PUBLIC_ TDB1_DATA tdb1_firstkey(struct tdb1_context *tdb)
+TDB1_DATA tdb1_firstkey(struct tdb1_context *tdb)
 {
        TDB1_DATA key;
        struct tdb1_record rec;
@@ -289,7 +289,7 @@ _PUBLIC_ TDB1_DATA tdb1_firstkey(struct tdb1_context *tdb)
 }
 
 /* find the next entry in the database, returning its key */
-_PUBLIC_ TDB1_DATA tdb1_nextkey(struct tdb1_context *tdb, TDB1_DATA oldkey)
+TDB1_DATA tdb1_nextkey(struct tdb1_context *tdb, TDB1_DATA oldkey)
 {
        uint32_t oldhash;
        TDB1_DATA key = tdb1_null;