ldb: replace 'struct TDB_DATA' with 'TDB_DATA'
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:10:32 +0000 (18:40 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:18:35 +0000 (11:18 +0200)
The typedef is TDB2 compatible, the struct isn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/include/printing.h
source3/printing/printing_db.c
source3/smbd/proto.h
source3/smbd/statcache.c
source4/lib/ldb/ldb_tdb/ldb_pack.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h

index bba7d53a162847fe3b05b2f98a4b65b9c1d66ee3..1bbb72c7be6c8d7fb38b134df0a7e6279bdecd24 100644 (file)
@@ -24,6 +24,7 @@
    This file defines the low-level printing system interfaces used by the
    SAMBA printing subsystem.
 */
+#include "tdb_compat.h"
 
 /* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */
 
@@ -158,9 +159,6 @@ extern struct printif       iprint_printif;
 /* There can be this many printing tdb's open, plus any locked ones. */
 #define MAX_PRINT_DBS_OPEN 1
 
-struct TDB_DATA;
-struct tdb_context;
-
 struct tdb_print_db {
        struct tdb_print_db *next, *prev;
        struct tdb_context *tdb;
@@ -252,7 +250,7 @@ uint32_t print_parse_jobid(const char *fname);
 struct tdb_print_db *get_print_db_byname(const char *printername);
 void release_print_db( struct tdb_print_db *pdb);
 void close_all_print_db(void);
-struct TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist);
+TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist);
 
 void print_queue_receive(struct messaging_context *msg,
                                void *private_data,
index b836c2145b4eaa30c0581ff32742037fc53f8b42..e442551b833f0aa54c5d3b6d277400ff13df473c 100644 (file)
@@ -160,7 +160,7 @@ void close_all_print_db(void)
  messages. data needs freeing on exit.
 ****************************************************************************/
 
-struct TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist)
+TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist)
 {
        TDB_DATA data;
        size_t i;
index 486ff335982845dc052a14f12b5841dc628c937b..6e515278b4924c13092e3160076a874c108d4233 100644 (file)
@@ -1049,8 +1049,13 @@ bool stat_cache_lookup(connection_struct *conn,
 void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
                                    const char *name);
 void stat_cache_delete(const char *name);
+#if BUILD_TDB2
+struct tdb_data;
+unsigned int fast_string_hash(struct tdb_data *key);
+#else
 struct TDB_DATA;
 unsigned int fast_string_hash(struct TDB_DATA *key);
+#endif
 bool reset_stat_cache( void );
 
 /* The following definitions come from smbd/statvfs.c  */
index e1597fdd583a62e331435dfe1698c063ebd23ebd..b0904c9ff719dd132e42f4a77d5c18279aaff4ec 100644 (file)
@@ -377,7 +377,7 @@ void stat_cache_delete(const char *name)
  JRA. Use a djb-algorithm hash for speed.
 ***************************************************************/
 
-unsigned int fast_string_hash(struct TDB_DATA *key)
+unsigned int fast_string_hash(TDB_DATA *key)
 {
         unsigned int n = 0;
         const char *p;
index 8ab07cd347c67c6af6662cc50d6e38fdaac2d47c..7c13065aeeff39611bd8eb823e4e21e287a5d29e 100644 (file)
@@ -74,7 +74,7 @@ static int attribute_storable_values(const struct ldb_message_element *el)
 */
 int ltdb_pack_data(struct ldb_module *module,
                   const struct ldb_message *message,
-                  struct TDB_DATA *data)
+                  TDB_DATA *data)
 {
        struct ldb_context *ldb;
        unsigned int i, j, real_elements=0;
@@ -155,7 +155,7 @@ int ltdb_pack_data(struct ldb_module *module,
   Free with ltdb_unpack_data_free()
 */
 int ltdb_unpack_data(struct ldb_module *module,
-                    const struct TDB_DATA *data,
+                    const TDB_DATA *data,
                     struct ldb_message *message)
 {
        struct ldb_context *ldb;
index 16e556d78d958ff67fb0e242f40afc0bb693757a..6033f84ef39603ccc5751aba9377c6a0ee1f6415 100644 (file)
@@ -126,7 +126,7 @@ int ltdb_unlock_read(struct ldb_module *module)
   note that the key for a record can depend on whether the
   dn refers to a case sensitive index record or not
 */
-struct TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn)
+TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn)
 {
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        TDB_DATA key;
index 82127a1f5625b24075be66ebef24e4b7039a74c7..96ad43fbd6c2209552ef9115f36420a88e94ace0 100644 (file)
@@ -102,11 +102,11 @@ int ltdb_index_transaction_cancel(struct ldb_module *module);
 
 int ltdb_pack_data(struct ldb_module *module,
                   const struct ldb_message *message,
-                  struct TDB_DATA *data);
+                  TDB_DATA *data);
 void ltdb_unpack_data_free(struct ldb_module *module,
                           struct ldb_message *message);
 int ltdb_unpack_data(struct ldb_module *module,
-                    const struct TDB_DATA *data,
+                    const TDB_DATA *data,
                     struct ldb_message *message);
 
 /* The following definitions come from lib/ldb/ldb_tdb/ldb_search.c  */
@@ -127,7 +127,7 @@ int ltdb_search(struct ltdb_context *ctx);
 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c  */
 int ltdb_lock_read(struct ldb_module *module);
 int ltdb_unlock_read(struct ldb_module *module);
-struct TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn);
+TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn);
 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
 int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg, struct ldb_request *req);
 int ltdb_delete_noindex(struct ldb_module *module, struct ldb_dn *dn);