diff options
author | Tim Potter <tpot@samba.org> | 2005-05-03 06:11:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:16:28 -0500 |
commit | c8d0e36312e351f0aba2e71d7744397d9fa11961 (patch) | |
tree | 1c63ca7e5f677d087cbecbd8a7a28a80ffda328e /source4/scripting | |
parent | 6950d5f8956c64a6f420b0207d6555e1b9a7bc0d (diff) | |
download | samba-c8d0e36312e351f0aba2e71d7744397d9fa11961.tar.gz samba-c8d0e36312e351f0aba2e71d7744397d9fa11961.tar.bz2 samba-c8d0e36312e351f0aba2e71d7744397d9fa11961.zip |
r6591: Add some comments.
Use SWIG %rename to get rid of prefix on every tdb function.
Treat mode_t as an int so we can actually pass a mode argument to
tdb_open().
(This used to be commit 0abd03f70c5c63a915086eaf6e3a25b3087769bc)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/swig/tdb.i | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/source4/scripting/swig/tdb.i b/source4/scripting/swig/tdb.i index a3d1a6ebbc..b381487ebc 100644 --- a/source4/scripting/swig/tdb.i +++ b/source4/scripting/swig/tdb.i @@ -3,7 +3,7 @@ Swig interface to tdb. - Copyright (C) 2004 Tim Potter <tpot@samba.org> + Copyright (C) 2004,2005 Tim Potter <tpot@samba.org> ** NOTE! The following LGPL license applies to the tdb ** library. This does NOT imply that all of Samba is released @@ -51,7 +51,6 @@ %} - /* The tdb functions will crash if a NULL tdb is passed */ %include exception.i @@ -63,7 +62,8 @@ } /* In and out typemaps for the TDB_DATA structure. This is converted to - and from the Python string type. */ + and from the Python string type which can contain arbitrary binary + data.. */ %typemap(in) TDB_DATA { if (!PyString_Check($input)) { @@ -85,7 +85,7 @@ /* Treat a mode_t as an unsigned integer */ -typedef uint_t mode_t; +typedef int mode_t; /* flags to tdb_store() */ @@ -103,36 +103,76 @@ typedef uint_t mode_t; #define TDB_CONVERT 16 /* convert endian (internal use) */ #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */ +%rename tdb_open open; TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); +%rename tdb_open_ex open_ex; 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); +%rename tdb_reopen reopen; int tdb_reopen(TDB_CONTEXT *tdb); + +%rename tdb_reopen_all reopen_all; int tdb_reopen_all(void); +%rename tdb_logging_function logging_function; void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func); + +%rename tdb_error error; enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb); + +%rename tdb_errorstr errorstr; const char *tdb_errorstr(TDB_CONTEXT *tdb); + +%rename tdb_fetch fetch; TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key); + +%rename tdb_delete delete; int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key); + +%rename tdb_store store; int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag = TDB_REPLACE); + +%rename tdb_append append; int tdb_append(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf); + +%rename tdb_close close; int tdb_close(TDB_CONTEXT *tdb); + +%rename tdb_firstkey firstkey; TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb); + +%rename tdb_nextkey nextkey; TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key); + +%rename tdb_traverse traverse; int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state); + +%rename tdb_exists exists; int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key); + +%rename tdb_lockall lockall; int tdb_lockall(TDB_CONTEXT *tdb); + +%rename tdb_unlockall unlockall; void tdb_unlockall(TDB_CONTEXT *tdb); /* Low level locking functions: use with care */ + +%rename tdb_chainlock chainlock; int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key); + +%rename tdb_chainunlock chainunlock; int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key); /* Debug functions. Not used in production. */ + +%rename tdb_dump_all dump_all; void tdb_dump_all(TDB_CONTEXT *tdb); + +%rename tdb_printfreelist printfreelist; int tdb_printfreelist(TDB_CONTEXT *tdb); |