1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-29 13:49:30 +03:00

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 89740efc67)
This commit is contained in:
Tim Potter
2007-09-09 06:41:15 +00:00
committed by Gerald (Jerry) Carter
parent d2f33d4380
commit 90b692de7d

View File

@ -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);