diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-12-09 23:40:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:47:15 -0500 |
commit | 7b090b06bf494bcc9bbd080ec2f8761659d8cc6b (patch) | |
tree | ce261f3cc4a8cc78ca0cbbe602309203360714e5 /source4/lib | |
parent | 7e6a90d6b839f5b015d1fb10a8e9601b30b7583e (diff) | |
download | samba-7b090b06bf494bcc9bbd080ec2f8761659d8cc6b.tar.gz samba-7b090b06bf494bcc9bbd080ec2f8761659d8cc6b.tar.bz2 samba-7b090b06bf494bcc9bbd080ec2f8761659d8cc6b.zip |
r12157: ldb_dump_results() is useful to call from within gdb, so you can see a
set of results
(This used to be commit 2be62eb2dde9250f8bfe3a3272851e152a1d6b68)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index f4a49e47ce..269599818c 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -671,3 +671,20 @@ time_t ldb_string_to_time(const char *s) return timegm(&tm); } + +/* + dump a set of results to a file. Useful from within gdb +*/ +void ldb_dump_results(struct ldb_context *ldb, struct ldb_result *result, FILE *f) +{ + int i; + + for (i = 0; i < result->count; i++) { + struct ldb_ldif ldif; + fprintf(f, "# record %d\n", i+1); + ldif.changetype = LDB_CHANGETYPE_NONE; + ldif.msg = result->msgs[i]; + ldb_ldif_write_file(ldb, f, &ldif); + } +} + |