diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-11 04:38:51 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-11 04:38:51 +0000 |
commit | deeb8d98a10a0fb1dbeca13653a802cef43d9e07 (patch) | |
tree | 52e058702da89b0b408d73688fd1f7f8f60da008 /source4/librpc/ndr/ndr.c | |
parent | 161321f68db0e83e71099364a654c796e49b8152 (diff) | |
download | samba-deeb8d98a10a0fb1dbeca13653a802cef43d9e07.tar.gz samba-deeb8d98a10a0fb1dbeca13653a802cef43d9e07.tar.bz2 samba-deeb8d98a10a0fb1dbeca13653a802cef43d9e07.zip |
start using automatic union printing
(This used to be commit e81040a902f67fd10ca1f9c9ca1c22bc95e36005)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r-- | source4/librpc/ndr/ndr.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index f7aead014c..6401523028 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -300,7 +300,25 @@ void ndr_print_debug(void (*fn)(struct ndr_print *, const char *, void *), ndr.mem_ctx = talloc_init("ndr_print_debug"); if (!ndr.mem_ctx) return; ndr.print = ndr_print_debug_helper; - ndr.depth = 0; + ndr.depth = 1; fn(&ndr, name, ptr); talloc_destroy(ndr.mem_ctx); } + +/* + a useful helper function for printing idl unions via DEBUG() +*/ +void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint16, void *), + const char *name, + uint16 level, + void *ptr) +{ + struct ndr_print ndr; + + ndr.mem_ctx = talloc_init("ndr_print_debug"); + if (!ndr.mem_ctx) return; + ndr.print = ndr_print_debug_helper; + ndr.depth = 1; + fn(&ndr, name, level, ptr); + talloc_destroy(ndr.mem_ctx); +} |