From d9b7123cb7dd4ed04f266aa48c35e70569ae258e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 27 Oct 2010 15:19:05 +1100 Subject: 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 --- librpc/ndr/ndr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'librpc/ndr/ndr.c') diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 3f553a7cbc..0e16a43525 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -190,6 +190,25 @@ _PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, free(s); } +_PUBLIC_ void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) +{ + va_list ap; + int i; + + if (!ndr->no_newline) { + for (i=0;idepth;i++) { + printf(" "); + } + } + + va_start(ap, format); + vprintf(format, ap); + va_end(ap); + if (!ndr->no_newline) { + printf("\n"); + } +} + _PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) { va_list ap; -- cgit