From 90b692de7d695f8deb9cd615883dfbd1b19c857e Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 9 Sep 2007 06:41:15 +0000 Subject: r25045: Add constants for enum TDB_ERROR. Remove some functions that I don't think should be in at the moment - tdb_open_ex(), tdb_reopen{,_all} and locking functions. Locking functions may come back at a later stage along with transaction support. (This used to be commit 89740efc6795c25f222e45a8aa76dd80f0f2ae4e) --- source4/lib/tdb/swig/tdb.i | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'source4/lib/tdb') diff --git a/source4/lib/tdb/swig/tdb.i b/source4/lib/tdb/swig/tdb.i index b72d8436a1..892a4de63f 100644 --- a/source4/lib/tdb/swig/tdb.i +++ b/source4/lib/tdb/swig/tdb.i @@ -102,7 +102,21 @@ typedef int mode_t; #define TDB_CONVERT 16 /* convert endian (internal use) */ #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */ -/* Throw an IOError exception if tdb_open() or tdb_open_ex() returns NULL */ +enum TDB_ERROR { + TDB_SUCCESS=0, + TDB_ERR_CORRUPT, + TDB_ERR_IO, + TDB_ERR_LOCK, + TDB_ERR_OOM, + TDB_ERR_EXISTS, + TDB_ERR_NOLOCK, + TDB_ERR_LOCK_TIMEOUT, + TDB_ERR_NOEXIST, + TDB_ERR_EINVAL, + TDB_ERR_RDONLY +}; + +/* Throw an IOError exception from errno if tdb_open() returns NULL */ %exception { $action @@ -115,17 +129,8 @@ typedef int mode_t; TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); -TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, - int open_flags, mode_t mode, - tdb_log_func log_fn, - tdb_hash_func hash_fn); - %exception; -int tdb_reopen(TDB_CONTEXT *tdb); - -int tdb_reopen_all(int parent_longlived); - enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb); const char *tdb_errorstr(TDB_CONTEXT *tdb); @@ -147,13 +152,3 @@ TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state); int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key); - -int tdb_lockall(TDB_CONTEXT *tdb); - -void tdb_unlockall(TDB_CONTEXT *tdb); - -/* Low level locking functions: use with care */ - -int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key); - -int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key); -- cgit