tdb: Add tdb_trace_1plusn_rec_flag_ret
authorVolker Lendecke <vl@samba.org>
Wed, 10 Aug 2016 18:45:10 +0000 (20:45 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 29 Aug 2016 17:03:27 +0000 (19:03 +0200)
Needed for tdb_storev

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/tdb/common/tdb.c
lib/tdb/common/tdb_private.h

index 6d4ad6d..6869d15 100644 (file)
@@ -1214,6 +1214,25 @@ void tdb_trace_2rec_flag_ret(struct tdb_context *tdb, const char *op,
        tdb_trace_end_ret(tdb, ret);
 }
 
+void tdb_trace_1plusn_rec_flag_ret(struct tdb_context *tdb, const char *op,
+                                  TDB_DATA rec,
+                                  const TDB_DATA *recs, int num_recs,
+                                  unsigned flag, int ret)
+{
+       char msg[1 + sizeof(ret) * 4];
+       int i;
+
+       snprintf(msg, sizeof(msg), " %#x", flag);
+       tdb_trace_start(tdb);
+       tdb_trace_write(tdb, op);
+       tdb_trace_record(tdb, rec);
+       for (i=0; i<num_recs; i++) {
+               tdb_trace_record(tdb, recs[i]);
+       }
+       tdb_trace_write(tdb, msg);
+       tdb_trace_end_ret(tdb, ret);
+}
+
 void tdb_trace_2rec_retrec(struct tdb_context *tdb, const char *op,
                           TDB_DATA rec1, TDB_DATA rec2, TDB_DATA ret)
 {
index de8d9e6..7ff29aa 100644 (file)
@@ -96,6 +96,10 @@ void tdb_trace_1rec_retrec(struct tdb_context *tdb, const char *op,
 void tdb_trace_2rec_flag_ret(struct tdb_context *tdb, const char *op,
                             TDB_DATA rec1, TDB_DATA rec2, unsigned flag,
                             int ret);
+void tdb_trace_1plusn_rec_flag_ret(struct tdb_context *tdb, const char *op,
+                                  TDB_DATA rec,
+                                  const TDB_DATA *recs, int num_recs,
+                                  unsigned flag, int ret);
 void tdb_trace_2rec_retrec(struct tdb_context *tdb, const char *op,
                           TDB_DATA rec1, TDB_DATA rec2, TDB_DATA ret);
 #else
@@ -108,6 +112,7 @@ void tdb_trace_2rec_retrec(struct tdb_context *tdb, const char *op,
 #define tdb_trace_1rec_ret(tdb, op, rec, ret)
 #define tdb_trace_1rec_retrec(tdb, op, rec, ret)
 #define tdb_trace_2rec_flag_ret(tdb, op, rec1, rec2, flag, ret)
+#define tdb_trace_1plusn_rec_flag_ret(tdb, op, rec, recs, num_recs, flag, ret);
 #define tdb_trace_2rec_retrec(tdb, op, rec1, rec2, ret)
 #endif /* !TDB_TRACE */