diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-05-22 17:26:55 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-05-23 00:36:48 +0200 |
commit | 66762985e78f6f717658489b6618cb515ca6db71 (patch) | |
tree | 69cda782dfc44ec3c917ded20af97a15ba912c02 /source4/lib/tdb/tdb.i | |
parent | 9893651c0237c9dba43aadfb8f5f68be74bbfd6c (diff) | |
download | samba-66762985e78f6f717658489b6618cb515ca6db71.tar.gz samba-66762985e78f6f717658489b6618cb515ca6db71.tar.bz2 samba-66762985e78f6f717658489b6618cb515ca6db71.zip |
Add some docstrings to tdb.
(This used to be commit 3563d62663c36ff267011f1f6f9b256be21c32fb)
Diffstat (limited to 'source4/lib/tdb/tdb.i')
-rw-r--r-- | source4/lib/tdb/tdb.i | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source4/lib/tdb/tdb.i b/source4/lib/tdb/tdb.i index 704f0facc6..5f23568170 100644 --- a/source4/lib/tdb/tdb.i +++ b/source4/lib/tdb/tdb.i @@ -24,7 +24,11 @@ License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -%module tdb +%define DOCSTRING +"TDB is a simple key-value database similar to GDBM that supports multiple writers." +%enddef + +%module(docstring=DOCSTRING) tdb %{ @@ -138,7 +142,8 @@ enum TDB_ERROR { $1 = TDB_REPLACE; } -%rename(Tdb) tdb; +%rename(Tdb) tdb_context; +%feature("docstring") tdb_context "A TDB file."; %typemap(out,noblock=1) tdb * { /* Throw an IOError exception from errno if tdb_open() returns NULL */ if ($1 == NULL) { @@ -150,34 +155,68 @@ enum TDB_ERROR { typedef struct tdb_context { %extend { + %feature("docstring") tdb "S.__init__(name,hash_size=0,tdb_flags=TDB_DEFAULT,flags=O_RDWR,mode=0600)\n" + "Open a TDB file."; tdb(const char *name, int hash_size, int tdb_flags, int flags, mode_t mode) { return tdb_open(name, hash_size, tdb_flags, flags, mode); } enum TDB_ERROR error(); ~tdb() { tdb_close($self); } + %feature("docstring") close "S.close() -> None\n" + "Close the TDB file."; int close(); int append(TDB_DATA key, TDB_DATA new_dbuf); + %feature("docstring") errorstr "S.errorstr() -> errorstring\n" + "Obtain last error message."; const char *errorstr(); %rename(get) fetch; + %feature("docstring") fetch "S.fetch(key) -> value\n" + "Fetch a value."; TDB_DATA fetch(TDB_DATA key); + %feature("docstring") delete "S.delete(key) -> None\n" + "Delete an entry."; int delete(TDB_DATA key); + %feature("docstring") store "S.store(key, value, flag=TDB_REPLACE) -> None\n" + "Store an entry."; int store(TDB_DATA key, TDB_DATA dbuf, int flag); int exists(TDB_DATA key); + %feature("docstring") firstkey "S.firstkey() -> data\n" + "Return the first key in this database."; TDB_DATA firstkey(); + %feature("docstring") nextkey "S.nextkey(prev) -> data\n" + "Return the next key in this database."; TDB_DATA nextkey(TDB_DATA key); + %feature("docstring") lockall "S.lockall() -> bool"; int lockall(); + %feature("docstring") unlockall "S.unlockall() -> bool"; int unlockall(); + %feature("docstring") unlockall "S.lockall_read() -> bool"; int lockall_read(); + %feature("docstring") unlockall "S.unlockall_read() -> bool"; int unlockall_read(); + %feature("docstring") reopen "S.reopen() -> bool\n" + "Reopen this file."; int reopen(); + %feature("docstring") transaction_start "S.transaction_start() -> None\n" + "Start a new transaction."; int transaction_start(); + %feature("docstring") transaction_commit "S.transaction_commit() -> None\n" + "Commit the currently active transaction."; int transaction_commit(); + %feature("docstring") transaction_cancel "S.transaction_cancel() -> None\n" + "Cancel the currently active transaction."; int transaction_cancel(); int transaction_recover(); + %feature("docstring") hash_size "S.hash_size() -> int"; int hash_size(); + %feature("docstring") map_size "S.map_size() -> int"; size_t map_size(); + %feature("docstring") get_flags "S.get_flags() -> int"; int get_flags(); + %feature("docstring") set_max_dead "S.set_max_dead(int) -> None"; void set_max_dead(int max_dead); + %feature("docstring") name "S.name() -> path\n" \ + "Return filename of this TDB file."; const char *name(); } |