tdb: Set _PUBLIC_ in C file rather than header files (Debian bug 600898)
authorJelmer Vernooij <jelmer@samba.org>
Thu, 21 Oct 2010 09:51:37 +0000 (11:51 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 21 Oct 2010 11:47:22 +0000 (11:47 +0000)
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Oct 21 11:47:22 UTC 2010 on sn-devel-104

12 files changed:
lib/tdb/common/check.c
lib/tdb/common/dump.c
lib/tdb/common/error.c
lib/tdb/common/freelist.c
lib/tdb/common/freelistcheck.c
lib/tdb/common/hash.c
lib/tdb/common/lock.c
lib/tdb/common/open.c
lib/tdb/common/tdb.c
lib/tdb/common/transaction.c
lib/tdb/common/traverse.c
lib/tdb/include/tdb.h

index 58c9c26540dcfb29d292e0c00bdb22bc9afc3c20..bbb566c6f77f97e3c8647c1ca7afae8f1973760f 100644 (file)
@@ -322,7 +322,7 @@ static size_t dead_space(struct tdb_context *tdb, tdb_off_t off)
        return len;
 }
 
-int tdb_check(struct tdb_context *tdb,
+_PUBLIC_ int tdb_check(struct tdb_context *tdb,
              int (*check)(TDB_DATA key, TDB_DATA data, void *private_data),
              void *private_data)
 {
index 9f770f81a52381d13d339bfff1b8701ca862cc80..67de04e37c655ede265052ec08338369e2156475 100644 (file)
@@ -80,7 +80,7 @@ static int tdb_dump_chain(struct tdb_context *tdb, int i)
        return tdb_unlock(tdb, i, F_WRLCK);
 }
 
-void tdb_dump_all(struct tdb_context *tdb)
+_PUBLIC_ void tdb_dump_all(struct tdb_context *tdb)
 {
        int i;
        for (i=0;i<tdb->header.hash_size;i++) {
@@ -90,7 +90,7 @@ void tdb_dump_all(struct tdb_context *tdb)
        tdb_dump_chain(tdb, -1);
 }
 
-int tdb_printfreelist(struct tdb_context *tdb)
+_PUBLIC_ int tdb_printfreelist(struct tdb_context *tdb)
 {
        int ret;
        long total_free = 0;
index 9197918ddeaa048f56c1ebbaa611989add0a6bf4..2aaaa8134e4cfd1a5c43077f06399fc13c2f736b 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "tdb_private.h"
 
-enum TDB_ERROR tdb_error(struct tdb_context *tdb)
+_PUBLIC_ enum TDB_ERROR tdb_error(struct tdb_context *tdb)
 {
        return tdb->ecode;
 }
@@ -46,7 +46,7 @@ static struct tdb_errname {
             {TDB_ERR_RDONLY, "write not permitted"} };
 
 /* Error string for the last tdb error */
-const char *tdb_errorstr(struct tdb_context *tdb)
+_PUBLIC_ const char *tdb_errorstr(struct tdb_context *tdb)
 {
        uint32_t i;
        for (i = 0; i < sizeof(emap) / sizeof(struct tdb_errname); i++)
index 79e3c344b8bb0f93a4dd85d4a42807afc1820f35..927078a7aa5cec47b7d67ee44410d8dd007936f6 100644 (file)
@@ -367,7 +367,7 @@ tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct tdb_rec
 /* 
    return the size of the freelist - used to decide if we should repack 
 */
-int tdb_freelist_size(struct tdb_context *tdb)
+_PUBLIC_ int tdb_freelist_size(struct tdb_context *tdb)
 {
        tdb_off_t ptr;
        int count=0;
index 8d1ebabe04e85c9c3650797bde2a83f187b9ce2b..ab6e78f02dbb751e5c44b208c330ac0023a6b802 100644 (file)
@@ -43,7 +43,7 @@ static int seen_insert(struct tdb_context *mem_tdb, tdb_off_t rec_ptr)
        return tdb_store(mem_tdb, key, data, TDB_INSERT);
 }
 
-int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
+_PUBLIC_ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
 {
        struct tdb_context *mem_tdb = NULL;
        struct tdb_record rec;
index c07297ec1908944a61c542e226fbf151cf874fff..2472ed1acec2177e9b7cc9e1959dafba3180ca81 100644 (file)
@@ -374,7 +374,7 @@ static uint32_t hashlittle( const void *key, size_t length )
   return c;
 }
 
-unsigned int tdb_jenkins_hash(TDB_DATA *key)
+_PUBLIC_ unsigned int tdb_jenkins_hash(TDB_DATA *key)
 {
        return hashlittle(key->dptr, key->dsize);
 }
index 803feeecbb0587d575206a7b72791cd40d413767..c6a2485171c2d3230d492bcdf10c27815e1266c8 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "tdb_private.h"
 
-void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *ptr)
+_PUBLIC_ void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *ptr)
 {
        tdb->interrupt_sig_ptr = ptr;
 }
@@ -644,28 +644,28 @@ int tdb_allrecord_unlock(struct tdb_context *tdb, int ltype, bool mark_lock)
 }
 
 /* lock entire database with write lock */
-int tdb_lockall(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_lockall");
        return tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_WAIT, false);
 }
 
 /* lock entire database with write lock - mark only */
-int tdb_lockall_mark(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall_mark(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_lockall_mark");
        return tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_MARK_ONLY, false);
 }
 
 /* unlock entire database with write lock - unmark only */
-int tdb_lockall_unmark(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall_unmark(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_lockall_unmark");
        return tdb_allrecord_unlock(tdb, F_WRLCK, true);
 }
 
 /* lock entire database with write lock - nonblocking varient */
-int tdb_lockall_nonblock(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall_nonblock(struct tdb_context *tdb)
 {
        int ret = tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_NOWAIT, false);
        tdb_trace_ret(tdb, "tdb_lockall_nonblock", ret);
@@ -673,21 +673,21 @@ int tdb_lockall_nonblock(struct tdb_context *tdb)
 }
 
 /* unlock entire database with write lock */
-int tdb_unlockall(struct tdb_context *tdb)
+_PUBLIC_ int tdb_unlockall(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_unlockall");
        return tdb_allrecord_unlock(tdb, F_WRLCK, false);
 }
 
 /* lock entire database with read lock */
-int tdb_lockall_read(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall_read(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_lockall_read");
        return tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);
 }
 
 /* lock entire database with read lock - nonblock varient */
-int tdb_lockall_read_nonblock(struct tdb_context *tdb)
+_PUBLIC_ int tdb_lockall_read_nonblock(struct tdb_context *tdb)
 {
        int ret = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_NOWAIT, false);
        tdb_trace_ret(tdb, "tdb_lockall_read_nonblock", ret);
@@ -695,7 +695,7 @@ int tdb_lockall_read_nonblock(struct tdb_context *tdb)
 }
 
 /* unlock entire database with read lock */
-int tdb_unlockall_read(struct tdb_context *tdb)
+_PUBLIC_ int tdb_unlockall_read(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_unlockall_read");
        return tdb_allrecord_unlock(tdb, F_RDLCK, false);
@@ -703,7 +703,7 @@ int tdb_unlockall_read(struct tdb_context *tdb)
 
 /* lock/unlock one hash chain. This is meant to be used to reduce
    contention - it cannot guarantee how many records will be locked */
-int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key)
 {
        int ret = tdb_lock(tdb, BUCKET(tdb->hash_fn(&key)), F_WRLCK);
        tdb_trace_1rec(tdb, "tdb_chainlock", key);
@@ -713,7 +713,7 @@ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key)
 /* lock/unlock one hash chain, non-blocking. This is meant to be used
    to reduce contention - it cannot guarantee how many records will be
    locked */
-int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key)
 {
        int ret = tdb_lock_nonblock(tdb, BUCKET(tdb->hash_fn(&key)), F_WRLCK);
        tdb_trace_1rec_ret(tdb, "tdb_chainlock_nonblock", key, ret);
@@ -721,7 +721,7 @@ int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key)
 }
 
 /* mark a chain as locked without actually locking it. Warning! use with great caution! */
-int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key)
 {
        int ret = tdb_nest_lock(tdb, lock_offset(BUCKET(tdb->hash_fn(&key))),
                                F_WRLCK, TDB_LOCK_MARK_ONLY);
@@ -730,20 +730,20 @@ int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key)
 }
 
 /* unmark a chain as locked without actually locking it. Warning! use with great caution! */
-int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key)
 {
        tdb_trace_1rec(tdb, "tdb_chainlock_unmark", key);
        return tdb_nest_unlock(tdb, lock_offset(BUCKET(tdb->hash_fn(&key))),
                               F_WRLCK, true);
 }
 
-int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key)
 {
        tdb_trace_1rec(tdb, "tdb_chainunlock", key);
        return tdb_unlock(tdb, BUCKET(tdb->hash_fn(&key)), F_WRLCK);
 }
 
-int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key)
 {
        int ret;
        ret = tdb_lock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK);
@@ -751,14 +751,12 @@ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key)
        return ret;
 }
 
-int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key)
 {
        tdb_trace_1rec(tdb, "tdb_chainunlock_read", key);
        return tdb_unlock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK);
 }
 
-
-
 /* record lock stops delete underneath */
 int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off)
 {
index 66539c3f6c5dd9fece0010a3822355ec07c9af34..f13df2c0d5db4587c4a33dc98875f3396f350334 100644 (file)
@@ -129,7 +129,7 @@ static int tdb_already_open(dev_t device,
    try to call tdb_error or tdb_errname, just do strerror(errno).
 
    @param name may be NULL for internal databases. */
-struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
+_PUBLIC_ struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
                      int open_flags, mode_t mode)
 {
        return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL, NULL);
@@ -162,7 +162,7 @@ static bool check_header_hash(struct tdb_context *tdb,
        return check_header_hash(tdb, false, m1, m2);
 }
 
-struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
+_PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
                                int open_flags, mode_t mode,
                                const struct tdb_logging_context *log_ctx,
                                tdb_hash_func hash_fn)
@@ -451,7 +451,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
  * Set the maximum number of dead records per hash chain
  */
 
-void tdb_set_max_dead(struct tdb_context *tdb, int max_dead)
+_PUBLIC_ void tdb_set_max_dead(struct tdb_context *tdb, int max_dead)
 {
        tdb->max_dead_records = max_dead;
 }
@@ -461,7 +461,7 @@ void tdb_set_max_dead(struct tdb_context *tdb, int max_dead)
  *
  * @returns -1 for error; 0 for success.
  **/
-int tdb_close(struct tdb_context *tdb)
+_PUBLIC_ int tdb_close(struct tdb_context *tdb)
 {
        struct tdb_context **i;
        int ret = 0;
@@ -502,13 +502,13 @@ int tdb_close(struct tdb_context *tdb)
 }
 
 /* register a loging function */
-void tdb_set_logging_function(struct tdb_context *tdb,
-                              const struct tdb_logging_context *log_ctx)
+_PUBLIC_ void tdb_set_logging_function(struct tdb_context *tdb,
+                                       const struct tdb_logging_context *log_ctx)
 {
         tdb->log = *log_ctx;
 }
 
-void *tdb_get_logging_private(struct tdb_context *tdb)
+_PUBLIC_ void *tdb_get_logging_private(struct tdb_context *tdb)
 {
        return tdb->log.log_private;
 }
@@ -577,13 +577,13 @@ fail:
 
 /* reopen a tdb - this can be used after a fork to ensure that we have an independent
    seek pointer from our parent and to re-establish locks */
-int tdb_reopen(struct tdb_context *tdb)
+_PUBLIC_ int tdb_reopen(struct tdb_context *tdb)
 {
        return tdb_reopen_internal(tdb, tdb->flags & TDB_CLEAR_IF_FIRST);
 }
 
 /* reopen all tdb's */
-int tdb_reopen_all(int parent_longlived)
+_PUBLIC_ int tdb_reopen_all(int parent_longlived)
 {
        struct tdb_context *tdb;
 
index 4d8c5fc59c9952056fa177c75ce93922276b45d8..a28e8837c86359950fd2228033e1476d950cbd6b 100644 (file)
 
 #include "tdb_private.h"
 
-TDB_DATA tdb_null;
+_PUBLIC_ TDB_DATA tdb_null;
 
 /*
   non-blocking increment of the tdb sequence number if the tdb has been opened using
   the TDB_SEQNUM flag
 */
-void tdb_increment_seqnum_nonblock(struct tdb_context *tdb)
+_PUBLIC_ void tdb_increment_seqnum_nonblock(struct tdb_context *tdb)
 {
        tdb_off_t seqnum=0;
 
@@ -199,7 +199,7 @@ static TDB_DATA _tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
        return ret;
 }
 
-TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
 {
        TDB_DATA ret = _tdb_fetch(tdb, key);
 
@@ -225,7 +225,7 @@ TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
  * Return -1 if the record was not found.
  */
 
-int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
+_PUBLIC_ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
                     int (*parser)(TDB_DATA key, TDB_DATA data,
                                   void *private_data),
                     void *private_data)
@@ -270,7 +270,7 @@ static int tdb_exists_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
        return 1;
 }
 
-int tdb_exists(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_exists(struct tdb_context *tdb, TDB_DATA key)
 {
        uint32_t hash = tdb->hash_fn(&key);
        int ret;
@@ -429,7 +429,7 @@ static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
        return ret;
 }
 
-int tdb_delete(struct tdb_context *tdb, TDB_DATA key)
+_PUBLIC_ int tdb_delete(struct tdb_context *tdb, TDB_DATA key)
 {
        uint32_t hash = tdb->hash_fn(&key);
        int ret;
@@ -599,7 +599,7 @@ static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
 
    return 0 on success, -1 on failure
 */
-int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
+_PUBLIC_ int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
 {
        uint32_t hash;
        int ret;
@@ -622,7 +622,7 @@ int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
 }
 
 /* Append to an entry. Create if not exist. */
-int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf)
+_PUBLIC_ int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf)
 {
        uint32_t hash;
        TDB_DATA dbuf;
@@ -673,7 +673,7 @@ failed:
   return the name of the current tdb file
   useful for external logging functions
 */
-const char *tdb_name(struct tdb_context *tdb)
+_PUBLIC_ const char *tdb_name(struct tdb_context *tdb)
 {
        return tdb->name;
 }
@@ -683,7 +683,7 @@ const char *tdb_name(struct tdb_context *tdb)
   useful for external routines that want to check the device/inode
   of the fd
 */
-int tdb_fd(struct tdb_context *tdb)
+_PUBLIC_ int tdb_fd(struct tdb_context *tdb)
 {
        return tdb->fd;
 }
@@ -692,7 +692,7 @@ int tdb_fd(struct tdb_context *tdb)
   return the current logging function
   useful for external tdb routines that wish to log tdb errors
 */
-tdb_log_func tdb_log_fn(struct tdb_context *tdb)
+_PUBLIC_ tdb_log_func tdb_log_fn(struct tdb_context *tdb)
 {
        return tdb->log.log_fn;
 }
@@ -708,7 +708,7 @@ tdb_log_func tdb_log_fn(struct tdb_context *tdb)
   The aim of this sequence number is to allow for a very lightweight
   test of a possible tdb change.
 */
-int tdb_get_seqnum(struct tdb_context *tdb)
+_PUBLIC_ int tdb_get_seqnum(struct tdb_context *tdb)
 {
        tdb_off_t seqnum=0;
 
@@ -716,22 +716,22 @@ int tdb_get_seqnum(struct tdb_context *tdb)
        return seqnum;
 }
 
-int tdb_hash_size(struct tdb_context *tdb)
+_PUBLIC_ int tdb_hash_size(struct tdb_context *tdb)
 {
        return tdb->header.hash_size;
 }
 
-size_t tdb_map_size(struct tdb_context *tdb)
+_PUBLIC_ size_t tdb_map_size(struct tdb_context *tdb)
 {
        return tdb->map_size;
 }
 
-int tdb_get_flags(struct tdb_context *tdb)
+_PUBLIC_ int tdb_get_flags(struct tdb_context *tdb)
 {
        return tdb->flags;
 }
 
-void tdb_add_flags(struct tdb_context *tdb, unsigned flags)
+_PUBLIC_ void tdb_add_flags(struct tdb_context *tdb, unsigned flags)
 {
        if ((flags & TDB_ALLOW_NESTING) &&
            (flags & TDB_DISALLOW_NESTING)) {
@@ -751,7 +751,7 @@ void tdb_add_flags(struct tdb_context *tdb, unsigned flags)
        tdb->flags |= flags;
 }
 
-void tdb_remove_flags(struct tdb_context *tdb, unsigned flags)
+_PUBLIC_ void tdb_remove_flags(struct tdb_context *tdb, unsigned flags)
 {
        if ((flags & TDB_ALLOW_NESTING) &&
            (flags & TDB_DISALLOW_NESTING)) {
@@ -775,7 +775,7 @@ void tdb_remove_flags(struct tdb_context *tdb, unsigned flags)
 /*
   enable sequence number handling on an open tdb
 */
-void tdb_enable_seqnum(struct tdb_context *tdb)
+_PUBLIC_ void tdb_enable_seqnum(struct tdb_context *tdb)
 {
        tdb->flags |= TDB_SEQNUM;
 }
@@ -812,7 +812,7 @@ static int tdb_free_region(struct tdb_context *tdb, tdb_off_t offset, ssize_t le
 
   This code carefully steps around the recovery area, leaving it alone
  */
-int tdb_wipe_all(struct tdb_context *tdb)
+_PUBLIC_ int tdb_wipe_all(struct tdb_context *tdb)
 {
        int i;
        tdb_off_t offset = 0;
@@ -919,7 +919,7 @@ static int repack_traverse(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data,
 /*
   repack a tdb
  */
-int tdb_repack(struct tdb_context *tdb)
+_PUBLIC_ int tdb_repack(struct tdb_context *tdb)
 {
        struct tdb_context *tmp_db;
        struct traverse_state state;
index ebf1cec5f2ff6fe837e8e19ae97ec572121c92e3..c49de3877cccca7c4fcef4b3f9cc8a4f4a962d86 100644 (file)
@@ -529,12 +529,12 @@ fail_allrecord_lock:
        return -1;
 }
 
-int tdb_transaction_start(struct tdb_context *tdb)
+_PUBLIC_ int tdb_transaction_start(struct tdb_context *tdb)
 {
        return _tdb_transaction_start(tdb, TDB_LOCK_WAIT);
 }
 
-int tdb_transaction_start_nonblock(struct tdb_context *tdb)
+_PUBLIC_ int tdb_transaction_start_nonblock(struct tdb_context *tdb)
 {
        return _tdb_transaction_start(tdb, TDB_LOCK_NOWAIT|TDB_LOCK_PROBE);
 }
@@ -625,7 +625,7 @@ static int _tdb_transaction_cancel(struct tdb_context *tdb)
 /*
   cancel the current transaction
 */
-int tdb_transaction_cancel(struct tdb_context *tdb)
+_PUBLIC_ int tdb_transaction_cancel(struct tdb_context *tdb)
 {
        tdb_trace(tdb, "tdb_transaction_cancel");
        return _tdb_transaction_cancel(tdb);
@@ -975,8 +975,8 @@ static int _tdb_transaction_prepare_commit(struct tdb_context *tdb)
 /*
    prepare to commit the current transaction
 */
-int tdb_transaction_prepare_commit(struct tdb_context *tdb)
-{      
+_PUBLIC_ int tdb_transaction_prepare_commit(struct tdb_context *tdb)
+{
        tdb_trace(tdb, "tdb_transaction_prepare_commit");
        return _tdb_transaction_prepare_commit(tdb);
 }
@@ -984,8 +984,8 @@ int tdb_transaction_prepare_commit(struct tdb_context *tdb)
 /*
   commit the current transaction
 */
-int tdb_transaction_commit(struct tdb_context *tdb)
-{      
+_PUBLIC_ int tdb_transaction_commit(struct tdb_context *tdb)
+{
        const struct tdb_methods *methods;
        int i;
        bool need_repack;
index d77086a79aa6c270dd3a7f799fa978ad74ca8da2..517fecb4fc8d6c1fcb50b3fec42b3ab9fa5d3358 100644 (file)
@@ -212,7 +212,7 @@ out:
 /*
   a write style traverse - temporarily marks the db read only
 */
-int tdb_traverse_read(struct tdb_context *tdb, 
+_PUBLIC_ int tdb_traverse_read(struct tdb_context *tdb, 
                      tdb_traverse_func fn, void *private_data)
 {
        struct tdb_traverse_lock tl = { NULL, 0, 0, F_RDLCK };
@@ -241,7 +241,7 @@ int tdb_traverse_read(struct tdb_context *tdb,
   WARNING: The data buffer given to the callback fn does NOT meet the
   alignment restrictions malloc gives you.
 */
-int tdb_traverse(struct tdb_context *tdb, 
+_PUBLIC_ int tdb_traverse(struct tdb_context *tdb, 
                 tdb_traverse_func fn, void *private_data)
 {
        struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
@@ -267,7 +267,7 @@ int tdb_traverse(struct tdb_context *tdb,
 
 
 /* find the first entry in the database and return its key */
-TDB_DATA tdb_firstkey(struct tdb_context *tdb)
+_PUBLIC_ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 {
        TDB_DATA key;
        struct tdb_record rec;
@@ -298,7 +298,7 @@ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 }
 
 /* find the next entry in the database, returning its key */
-TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
+_PUBLIC_ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
 {
        uint32_t oldhash;
        TDB_DATA key = tdb_null;
index 96fc157f6853810b7bd392796834333b5647f70f..115c6fada60a3d086381157459cdf3bf1f958890 100644 (file)
@@ -91,85 +91,85 @@ struct tdb_logging_context {
         void *log_private;
 };
 
-_PUBLIC_ struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
+struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
                      int open_flags, mode_t mode);
-_PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
+struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
                         int open_flags, mode_t mode,
                         const struct tdb_logging_context *log_ctx,
                         tdb_hash_func hash_fn);
-_PUBLIC_ void tdb_set_max_dead(struct tdb_context *tdb, int max_dead);
-
-_PUBLIC_ int tdb_reopen(struct tdb_context *tdb);
-_PUBLIC_ int tdb_reopen_all(int parent_longlived);
-_PUBLIC_ void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx);
-_PUBLIC_ enum TDB_ERROR tdb_error(struct tdb_context *tdb);
-_PUBLIC_ const char *tdb_errorstr(struct tdb_context *tdb);
-_PUBLIC_ TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
+void tdb_set_max_dead(struct tdb_context *tdb, int max_dead);
+
+int tdb_reopen(struct tdb_context *tdb);
+int tdb_reopen_all(int parent_longlived);
+void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx);
+enum TDB_ERROR tdb_error(struct tdb_context *tdb);
+const char *tdb_errorstr(struct tdb_context *tdb);
+TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key);
+int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
                              int (*parser)(TDB_DATA key, TDB_DATA data,
                                            void *private_data),
                              void *private_data);
-_PUBLIC_ int tdb_delete(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
-_PUBLIC_ int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf);
-_PUBLIC_ int tdb_close(struct tdb_context *tdb);
-_PUBLIC_ TDB_DATA tdb_firstkey(struct tdb_context *tdb);
-_PUBLIC_ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_traverse(struct tdb_context *tdb, tdb_traverse_func fn, void *);
-_PUBLIC_ int tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *);
-_PUBLIC_ int tdb_exists(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_lockall(struct tdb_context *tdb);
-_PUBLIC_ int tdb_lockall_nonblock(struct tdb_context *tdb);
-_PUBLIC_ int tdb_unlockall(struct tdb_context *tdb);
-_PUBLIC_ int tdb_lockall_read(struct tdb_context *tdb);
-_PUBLIC_ int tdb_lockall_read_nonblock(struct tdb_context *tdb);
-_PUBLIC_ int tdb_unlockall_read(struct tdb_context *tdb);
-_PUBLIC_ int tdb_lockall_mark(struct tdb_context *tdb);
-_PUBLIC_ int tdb_lockall_unmark(struct tdb_context *tdb);
-_PUBLIC_ const char *tdb_name(struct tdb_context *tdb);
-_PUBLIC_ int tdb_fd(struct tdb_context *tdb);
-_PUBLIC_ tdb_log_func tdb_log_fn(struct tdb_context *tdb);
-_PUBLIC_ void *tdb_get_logging_private(struct tdb_context *tdb);
-_PUBLIC_ int tdb_transaction_start(struct tdb_context *tdb);
-_PUBLIC_ int tdb_transaction_start_nonblock(struct tdb_context *tdb);
-_PUBLIC_ int tdb_transaction_prepare_commit(struct tdb_context *tdb);
-_PUBLIC_ int tdb_transaction_commit(struct tdb_context *tdb);
-_PUBLIC_ int tdb_transaction_cancel(struct tdb_context *tdb);
-_PUBLIC_ int tdb_get_seqnum(struct tdb_context *tdb);
-_PUBLIC_ int tdb_hash_size(struct tdb_context *tdb);
-_PUBLIC_ size_t tdb_map_size(struct tdb_context *tdb);
-_PUBLIC_ int tdb_get_flags(struct tdb_context *tdb);
-_PUBLIC_ void tdb_add_flags(struct tdb_context *tdb, unsigned flag);
-_PUBLIC_ void tdb_remove_flags(struct tdb_context *tdb, unsigned flag);
-_PUBLIC_ void tdb_enable_seqnum(struct tdb_context *tdb);
-_PUBLIC_ void tdb_increment_seqnum_nonblock(struct tdb_context *tdb);
-_PUBLIC_ unsigned int tdb_jenkins_hash(TDB_DATA *key);
-_PUBLIC_ int tdb_check(struct tdb_context *tdb,
+int tdb_delete(struct tdb_context *tdb, TDB_DATA key);
+int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
+int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf);
+int tdb_close(struct tdb_context *tdb);
+TDB_DATA tdb_firstkey(struct tdb_context *tdb);
+TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key);
+int tdb_traverse(struct tdb_context *tdb, tdb_traverse_func fn, void *);
+int tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *);
+int tdb_exists(struct tdb_context *tdb, TDB_DATA key);
+int tdb_lockall(struct tdb_context *tdb);
+int tdb_lockall_nonblock(struct tdb_context *tdb);
+int tdb_unlockall(struct tdb_context *tdb);
+int tdb_lockall_read(struct tdb_context *tdb);
+int tdb_lockall_read_nonblock(struct tdb_context *tdb);
+int tdb_unlockall_read(struct tdb_context *tdb);
+int tdb_lockall_mark(struct tdb_context *tdb);
+int tdb_lockall_unmark(struct tdb_context *tdb);
+const char *tdb_name(struct tdb_context *tdb);
+int tdb_fd(struct tdb_context *tdb);
+tdb_log_func tdb_log_fn(struct tdb_context *tdb);
+void *tdb_get_logging_private(struct tdb_context *tdb);
+int tdb_transaction_start(struct tdb_context *tdb);
+int tdb_transaction_start_nonblock(struct tdb_context *tdb);
+int tdb_transaction_prepare_commit(struct tdb_context *tdb);
+int tdb_transaction_commit(struct tdb_context *tdb);
+int tdb_transaction_cancel(struct tdb_context *tdb);
+int tdb_get_seqnum(struct tdb_context *tdb);
+int tdb_hash_size(struct tdb_context *tdb);
+size_t tdb_map_size(struct tdb_context *tdb);
+int tdb_get_flags(struct tdb_context *tdb);
+void tdb_add_flags(struct tdb_context *tdb, unsigned flag);
+void tdb_remove_flags(struct tdb_context *tdb, unsigned flag);
+void tdb_enable_seqnum(struct tdb_context *tdb);
+void tdb_increment_seqnum_nonblock(struct tdb_context *tdb);
+unsigned int tdb_jenkins_hash(TDB_DATA *key);
+int tdb_check(struct tdb_context *tdb,
              int (*check) (TDB_DATA key, TDB_DATA data, void *private_data),
              void *private_data);
 
 /* Low level locking functions: use with care */
-_PUBLIC_ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
-_PUBLIC_ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
 
-_PUBLIC_ void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *sigptr);
+void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *sigptr);
 
 /* wipe and repack */
-_PUBLIC_ int tdb_wipe_all(struct tdb_context *tdb);
-_PUBLIC_ int tdb_repack(struct tdb_context *tdb);
+int tdb_wipe_all(struct tdb_context *tdb);
+int tdb_repack(struct tdb_context *tdb);
 
 /* Debug functions. Not used in production. */
-_PUBLIC_ void tdb_dump_all(struct tdb_context *tdb);
-_PUBLIC_ int tdb_printfreelist(struct tdb_context *tdb);
-_PUBLIC_ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
-_PUBLIC_ int tdb_freelist_size(struct tdb_context *tdb);
+void tdb_dump_all(struct tdb_context *tdb);
+int tdb_printfreelist(struct tdb_context *tdb);
+int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
+int tdb_freelist_size(struct tdb_context *tdb);
 
-_PUBLIC_ extern TDB_DATA tdb_null;
+extern TDB_DATA tdb_null;
 
 #ifdef  __cplusplus
 }