diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-10-27 15:19:05 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-10-27 04:42:06 +0000 |
commit | d9b7123cb7dd4ed04f266aa48c35e70569ae258e (patch) | |
tree | c5760918470e434e9b27ec60442566205697727a /librpc/tools | |
parent | cf310a4306b3a4b6b9201d01c5d6dbbe5ff8f09e (diff) | |
download | samba-d9b7123cb7dd4ed04f266aa48c35e70569ae258e.tar.gz samba-d9b7123cb7dd4ed04f266aa48c35e70569ae258e.tar.bz2 samba-d9b7123cb7dd4ed04f266aa48c35e70569ae258e.zip |
librpc Make ndrdump use printf() rather than having to mess with DEBUG()
This means it no longer needs to force the debug level etc.
(this builds on the fine work by Volker to create dump_data_cb())
Andrew Bartlett
Diffstat (limited to 'librpc/tools')
-rw-r--r-- | librpc/tools/ndrdump.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c index 6fc903fa32..b9b4bc7fd6 100644 --- a/librpc/tools/ndrdump.c +++ b/librpc/tools/ndrdump.c @@ -127,13 +127,14 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug return p; } +static void printf_cb(const char *buf, void *private_data) +{ + printf("%s", buf); +} + static void ndrdump_data(uint8_t *d, uint32_t l, bool force) { - if (force) { - dump_data(0, d, l); - } else { - dump_data_skip_zeros(0, d, l); - } + dump_data_cb(d, l, !force, printf_cb, NULL); } int main(int argc, const char *argv[]) @@ -172,10 +173,6 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) { NULL } }; - if (DEBUGLEVEL < 1) { - DEBUGLEVEL = 1; - } - ndr_table_init(); /* Initialise samba stuff */ @@ -183,8 +180,6 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) setlinebuf(stdout); - dbf = x_stderr; - setup_logging_stdout(); pc = poptGetContext("ndrdump", argc, argv, long_options, 0); @@ -354,7 +349,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) } ndr_print = talloc_zero(mem_ctx, struct ndr_print); - ndr_print->print = ndr_print_debug_helper; + ndr_print->print = ndr_print_printf_helper; ndr_print->depth = 1; f->ndr_print(ndr_print, function, flags, st); |