Author: tridge Date: 2005-12-09 23:40:14 +0000 (Fri, 09 Dec 2005) New Revision: 12157
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12157 Log: ldb_dump_results() is useful to call from within gdb, so you can see a set of results Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c 2005-12-09 23:39:00 UTC (rev 12156) +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c 2005-12-09 23:40:14 UTC (rev 12157) @@ -671,3 +671,20 @@ 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); + } +} +
