[SCM] Samba Shared Repository - branch master updated - 3b0a1b0363145e4ec606b9df97450bd6e2532167

Jelmer Vernooij jelmer at samba.org
Sun Oct 12 15:51:06 GMT 2008


The branch, master has been updated
       via  3b0a1b0363145e4ec606b9df97450bd6e2532167 (commit)
      from  1b99d8fbb591bedb375c1251d5d29a5674e1b74a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3b0a1b0363145e4ec606b9df97450bd6e2532167
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 12 17:50:41 2008 +0200

    Make util_tdb.h static since it is now used by Samba3.

-----------------------------------------------------------------------

Summary of changes:
 .gitignore          |    1 -
 lib/util/config.mk  |    2 -
 lib/util/util_tdb.h |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+), 3 deletions(-)
 create mode 100644 lib/util/util_tdb.h


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index fa4fc5f..27ee256 100644
--- a/.gitignore
+++ b/.gitignore
@@ -235,7 +235,6 @@ lib/util/asn1_proto.h
 lib/util/pidfile.h
 lib/util/unix_privs.h
 lib/util/util_proto.h
-lib/util/util_tdb.h
 source4/mkconfig.mk
 source4/nbt_server/dgram/proto.h
 source4/nbt_server/nbt_server_proto.h
diff --git a/lib/util/config.mk b/lib/util/config.mk
index 4918a4d..6873c1b 100644
--- a/lib/util/config.mk
+++ b/lib/util/config.mk
@@ -64,8 +64,6 @@ PUBLIC_DEPENDENCIES = LIBTDB
 
 UTIL_TDB_OBJ_FILES = $(libutilsrcdir)/util_tdb.o
 
-$(eval $(call proto_header_template,$(libutilsrcdir)/util_tdb.h,$(UTIL_TDB_OBJ_FILES:.o=.c)))
-
 [SUBSYSTEM::UTIL_LDB]
 PUBLIC_DEPENDENCIES = LIBLDB
 
diff --git a/lib/util/util_tdb.h b/lib/util/util_tdb.h
new file mode 100644
index 0000000..da6378e
--- /dev/null
+++ b/lib/util/util_tdb.h
@@ -0,0 +1,114 @@
+#ifndef _____LIB_UTIL_UTIL_TDB_H__
+#define _____LIB_UTIL_UTIL_TDB_H__
+
+
+/***************************************************************
+ Make a TDB_DATA and keep the const warning in one place
+****************************************************************/
+TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize);
+TDB_DATA string_tdb_data(const char *string);
+TDB_DATA string_term_tdb_data(const char *string);
+
+/****************************************************************************
+ Lock a chain by string. Return -1 if lock failed.
+****************************************************************************/
+int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval);
+
+/****************************************************************************
+ Unlock a chain by string.
+****************************************************************************/
+void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval);
+
+/****************************************************************************
+ Read lock a chain by string. Return -1 if lock failed.
+****************************************************************************/
+int tdb_read_lock_bystring(struct tdb_context *tdb, const char *keyval);
+
+/****************************************************************************
+ Read unlock a chain by string.
+****************************************************************************/
+void tdb_read_unlock_bystring(struct tdb_context *tdb, const char *keyval);
+
+/****************************************************************************
+ Fetch a int32_t value by a arbitrary blob key, return -1 if not found.
+ Output is int32_t in native byte order.
+****************************************************************************/
+int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key);
+
+/****************************************************************************
+ Fetch a int32_t value by string key, return -1 if not found.
+ Output is int32_t in native byte order.
+****************************************************************************/
+int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
+
+/****************************************************************************
+ Store a int32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
+****************************************************************************/
+int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key, int32_t v);
+
+/****************************************************************************
+ Store a int32_t value by string key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
+****************************************************************************/
+int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v);
+
+/****************************************************************************
+ Fetch a uint32_t value by a arbitrary blob key, return -1 if not found.
+ Output is uint32_t in native byte order.
+****************************************************************************/
+bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *value);
+
+/****************************************************************************
+ Fetch a uint32_t value by string key, return -1 if not found.
+ Output is uint32_t in native byte order.
+****************************************************************************/
+bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value);
+
+/****************************************************************************
+ Store a uint32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
+****************************************************************************/
+bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t value);
+
+/****************************************************************************
+ Store a uint32_t value by string key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
+****************************************************************************/
+bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value);
+
+/****************************************************************************
+ Store a buffer by a null terminated string key.  Return 0 on success, -1
+ on failure.
+****************************************************************************/
+int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags);
+
+/****************************************************************************
+ Fetch a buffer using a null terminated string key.  Don't forget to call
+ free() on the result dptr.
+****************************************************************************/
+TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr);
+
+/****************************************************************************
+ Delete an entry using a null terminated string key. 
+****************************************************************************/
+int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr);
+
+/****************************************************************************
+ Atomic integer change. Returns old value. To create, set initial value in *oldval. 
+****************************************************************************/
+int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val);
+
+/****************************************************************************
+ Atomic unsigned integer change. Returns old value. To create, set initial value in *oldval. 
+****************************************************************************/
+bool tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr, uint32_t *oldval, uint32_t change_val);
+
+/****************************************************************************
+ Allow tdb_delete to be used as a tdb_traversal_fn.
+****************************************************************************/
+int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf,
+                     void *state);
+
+#endif /* _____LIB_UTIL_UTIL_TDB_H__ */
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list