r19428: moved tdbutil.c from lib/tdb/common/ to lib/util/util_tdb.c
authorAndrew Tridgell <tridge@samba.org>
Fri, 20 Oct 2006 23:32:23 +0000 (23:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:21:30 +0000 (14:21 -0500)
tdbutil.c is Samba specific, so should not be part of the generic tdb
library
(This used to be commit 979dd24f5e44605fc1603b690913b8c31be7478f)

18 files changed:
source4/lib/gencache/gencache.c
source4/lib/messaging/config.mk
source4/lib/messaging/messaging.c
source4/lib/samba3/group.c
source4/lib/samba3/idmap.c
source4/lib/samba3/policy.c
source4/lib/samba3/registry.c
source4/lib/samba3/secrets.c
source4/lib/samba3/share_info.c
source4/lib/samba3/tdbsam.c
source4/lib/tdb/config.mk
source4/lib/tdb/include/tdbutil.h [deleted file]
source4/lib/util/config.mk
source4/lib/util/util_tdb.c [moved from source4/lib/tdb/common/tdbutil.c with 98% similarity]
source4/ntvfs/common/notify.c
source4/passdb/config.mk
source4/passdb/secrets.c
source4/torture/basic/mangle_test.c

index 4c60d76095b4a580cf919a31465035c05079fbf9..dff67054d47923708629646842324c8743ee7c0e 100644 (file)
@@ -22,7 +22,6 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdbutil.h"
 #include "system/time.h"
 #include "system/filesys.h"
 #include "db_wrap.h"
index 5a0cc4c18fcf3552e200a8f6bc86fc05437eeb7f..186f54ba74f033a1770bd051009049312a80f50c 100644 (file)
@@ -7,6 +7,7 @@ OBJ_FILES = \
 PUBLIC_DEPENDENCIES = \
                DB_WRAP \
                NDR_IRPC \
-               UNIX_PRIVS
+               UNIX_PRIVS \
+               UTIL_TDB 
 # End SUBSYSTEM MESSAGING
 ################################################
index 00b33017d844c1a4408140e40d19abeaa512b20b..09e04fda9be016642c396d0bbd2942a83da0fe55 100644 (file)
 #include "librpc/gen_ndr/ndr_irpc.h"
 #include "lib/messaging/irpc.h"
 #include "db_wrap.h"
-#include "lib/tdb/include/tdbutil.h"
 #include "lib/util/unix_privs.h"
 #include "librpc/rpc/dcerpc.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 
 /* change the message version with any incompatible changes in the protocol */
 #define MESSAGING_VERSION 1
index fcf015de680bb1f7960d7d1300a68f516f6e91f4..44d8775e428c26a24781b2b426ac2b60f7290d31 100644 (file)
@@ -21,7 +21,8 @@
 
 #include "includes.h"
 #include "lib/samba3/samba3.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "system/filesys.h"
 #include "libcli/security/security.h"
 
index 334accc2aa2dab94bd5edd47796be8a979703575..c5c771cdd35938523d40add83e12216c30c71102 100644 (file)
@@ -24,7 +24,8 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "lib/samba3/samba3.h"
 #include "system/filesys.h"
 #include "libcli/security/security.h"
index cfe6284fc476ba9932085277234714860d2c484f..936a16bca878f6a595be057262d481f2013dffa1 100644 (file)
@@ -19,7 +19,8 @@
  */
 
 #include "includes.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "lib/samba3/samba3.h"
 #include "system/filesys.h"
 
index 7f68c9df74562932a1f9dc1520b1a8324607abda..05855b6583d692cf5b35e8079a431ba5762d47d5 100644 (file)
@@ -24,7 +24,8 @@
 #include "includes.h"
 #include "lib/samba3/samba3.h"
 #include "librpc/gen_ndr/winreg.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "system/filesys.h"
 #include "pstring.h"
 
index 479fedbc28bc887d0e2f3b6c1a50bad135267058..f838b06154a39706beab27f2d492a4e43343e0e1 100644 (file)
 
 #include "includes.h"
 #include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "lib/samba3/samba3.h"
 #include "system/filesys.h"
 #include "librpc/gen_ndr/security.h"
-#include "lib/tdb/include/tdbutil.h"
 #include "auth/credentials/credentials.h"
 
 /**
index 318e0ff01f9e07d53b3308649220a82e805cfd9c..464dcc38e345656d06a716ddc5e16e1743920438 100644 (file)
@@ -23,7 +23,8 @@
 
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_security.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "lib/samba3/samba3.h"
 #include "system/filesys.h"
 
index 148a3c90f5646e7ee6ddd75b52c24ddb78d1537c..0d4854a270af02d0e8919a6ad3a5a3a9fa457068 100644 (file)
@@ -22,7 +22,8 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "lib/samba3/samba3.h"
 
 #define TDB_FORMAT_STRING_V0       "ddddddBBBBBBBBBBBBddBBwdwdBwwd"
index c5d1a3399076d222c821d41e9a4573dc6780de80..0162b78381776236137232b4a3d110888df52df7 100644 (file)
@@ -7,7 +7,7 @@ DESCRIPTION = Trivial Database Library
 OBJ_FILES = \
        common/tdb.o common/dump.o common/io.o common/lock.o \
        common/open.o common/traverse.o common/freelist.o \
-       common/error.o common/transaction.o common/tdbutil.o
+       common/error.o common/transaction.o
 CFLAGS = -Ilib/tdb/include
 PUBLIC_HEADERS = include/tdb.h
 #
diff --git a/source4/lib/tdb/include/tdbutil.h b/source4/lib/tdb/include/tdbutil.h
deleted file mode 100644 (file)
index 2674737..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   tdb utility functions
-   Copyright (C) Andrew Tridgell 1999
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __TDBUTIL_H__
-#define __TDBUTIL_H__
-
-#include "tdb.h"
-
-/* single node of a list returned by tdb_search_keys */
-typedef struct keys_node 
-{
-       struct keys_node *prev, *next;
-       TDB_DATA node_key;
-} TDB_LIST_NODE;
-
-
-TDB_LIST_NODE *tdb_search_keys(struct tdb_context*, const char*);
-void tdb_search_list_free(TDB_LIST_NODE*);
-int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val);
-int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval);
-void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval);
-int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
-BOOL tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value);
-int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v);
-BOOL tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value);
-int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf,
-                     void *state);
-int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags);
-TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr);
-int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr);
-int tdb_unpack(struct tdb_context *tdb, char *buf, int bufsize, const char *fmt, ...);
-size_t tdb_pack(struct tdb_context *tdb, char *buf, int bufsize, const char *fmt, ...);
-
-#endif /* __TDBUTIL_H__ */
index 401b4df005d0d62bf944c7ba672c2487743ed888..5e49eb839ac01eb0ac1574eab6f64a35310d03f5 100644 (file)
@@ -49,3 +49,13 @@ PUBLIC_DEPENDENCIES = XATTR
 #
 # End SUBSYSTEM WRAP_XATTR
 ################################################
+
+################################################
+# Start SUBSYSTEM UTIL_TDB
+[SUBSYSTEM::UTIL_TDB]
+PUBLIC_PROTO_HEADER = util_tdb.h
+OBJ_FILES = \
+               util_tdb.o
+PUBLIC_DEPENDENCIES = LIBTDB
+# End SUBSYSTEM UTIL_TDB
+################################################
similarity index 98%
rename from source4/lib/tdb/common/tdbutil.c
rename to source4/lib/util/util_tdb.c
index 1cf1eb8842f8f9a95f4481d251c3bd95080027c4..820fc2dbb19fa58088d62910c6657c56b2caf0c5 100644 (file)
@@ -3,7 +3,7 @@
 
    tdb utility functions
 
-   Copyright (C) Andrew Tridgell 1992-2005
+   Copyright (C) Andrew Tridgell 1992-2006
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
-/*
-  NOTE: these utility functions are specific to Samba, and are not part
-  of the core tdb code
-*/
 
 #include "includes.h"
-#include "lib/tdb/include/tdbutil.h"
-#include "system/glob.h"
-#include "system/wait.h"
-#include "system/filesys.h"
-#include "lib/util/dlinklist.h"
+#include "lib/tdb/include/tdb.h"
 #include "pstring.h"
 
 /* these are little tdb utility functions that are meant to make
index 17c6e81c6fdb6b75f73945bddbbb527eae27fe8c..19a60a51a9704cd42fea120e1e8e19d88d155de7 100644 (file)
@@ -27,7 +27,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "lib/tdb/include/tdb.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/util/util_tdb.h"
 #include "messaging/messaging.h"
 #include "db_wrap.h"
 #include "lib/messaging/irpc.h"
index 51e2c4a83e700a99a0fe96db84466ea4e7dddd5f..81897323c955f49796c83167755cdf636a66f69a 100644 (file)
@@ -1,4 +1,5 @@
 [SUBSYSTEM::SECRETS]
 PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = secrets.o
-PRIVATE_DEPENDENCIES = DB_WRAP
+PRIVATE_DEPENDENCIES = DB_WRAP UTIL_TDB
+
index 7171fa11aba33cb487687e1f4d3ddbe0cd05a6cd..876be607f1f1d1e2790227b63106417cb3d47918 100644 (file)
    such as the local SID and machine trust password */
 
 #include "includes.h"
-#include "lib/tdb/include/tdbutil.h"
 #include "secrets.h"
 #include "param/param.h"
 #include "system/filesys.h"
 #include "db_wrap.h"
 #include "lib/ldb/include/ldb.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "dsdb/samdb/samdb.h"
 
 static struct tdb_wrap *tdb;
index 091e471e8a69ce11dd9c79ae7ea231de36a9005f..68ee0b63f550ca4145b33122d068469de78b7af5 100644 (file)
@@ -22,7 +22,8 @@
 #include "torture/torture.h"
 #include "system/filesys.h"
 #include "system/dir.h"
-#include "lib/tdb/include/tdbutil.h"
+#include "lib/tdb/include/tdb.h"
+#include "lib/util/util_tdb.h"
 #include "libcli/libcli.h"
 #include "torture/util.h"
 #include "pstring.h"