diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-03-27 15:59:58 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-03-27 18:14:56 +0100 |
commit | 32e7cc5193a2c6eaf06a977e16915c74db19d76c (patch) | |
tree | 7f37bec5ff748a48bf4175d45e129af10eede2fc | |
parent | 1b9c4763eec7770008d85796dc5a05c3f5739042 (diff) | |
download | samba-32e7cc5193a2c6eaf06a977e16915c74db19d76c.tar.gz samba-32e7cc5193a2c6eaf06a977e16915c74db19d76c.tar.bz2 samba-32e7cc5193a2c6eaf06a977e16915c74db19d76c.zip |
dbwrap: add dbwrap_trans_store_int32()
metze
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit f05e889bc05a816aef5b9ce4f22267e977dade01)
-rw-r--r-- | source3/lib/dbwrap_util.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index 0bafbe6858..550e5c482b 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -195,3 +195,18 @@ int dbwrap_trans_delete(struct db_context *db, TDB_DATA key) } return -1; } + +int dbwrap_trans_store_int32(struct db_context *db, const char *keystr, int32_t v) +{ + int ret; + int32 v_store; + + SIVAL(&v_store, 0, v); + + ret = dbwrap_trans_store(db, string_term_tdb_data(keystr), + make_tdb_data((const uint8 *)&v_store, + sizeof(v_store)), + TDB_REPLACE); + + return ret; +} |