From e9d66999c6003009aac5a4e115963b1ef581c9dc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 25 Jan 2012 09:10:04 +0100 Subject: Introduce dump_data_file Autobuild-User: Volker Lendecke Autobuild-Date: Wed Jan 25 11:57:18 CET 2012 on sn-devel-104 --- lib/util/util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/util/util.c') diff --git a/lib/util/util.c b/lib/util/util.c index c7c37bc8152..c4fbd0b39fc 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -462,6 +462,17 @@ _PUBLIC_ void dump_data_skip_zeros(int level, const uint8_t *buf, int len) dump_data_cb(buf, len, true, debugadd_cb, &level); } +static void fprintf_cb(const char *buf, void *private_data) +{ + FILE *f = (FILE *)private_data; + fprintf(f, "%s", buf); +} + +void dump_data_file(const uint8_t *buf, int len, bool omit_zero_bytes, + FILE *f) +{ + dump_data_cb(buf, len, omit_zero_bytes, fprintf_cb, f); +} /** malloc that aborts with smb_panic on fail or zero size. -- cgit v1.2.1