From d0da601ff78c1df7422e3a558db5a4c4862eb785 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 5 Jan 2005 15:36:26 +0000 Subject: r4535: add full support for typedef bitmap { FLAG1 = 0x01 } fooflags; typedef struct { fooflags flags; } metze (This used to be commit 052a7d4f9a3a178149c65a616fdfd87152dff7eb) --- source4/librpc/ndr/ndr_basic.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source4/librpc/ndr') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 8874984f4b..8c9664771d 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -1000,9 +1000,18 @@ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type) } void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, - const char *val, uint32_t value) + const char *val, uint_t value) { - ndr->print(ndr, "%-25s: %s (%u)", name, val?val:"UNKNOWN", value); + ndr->print(ndr, "%-25s: %s (%d)", name, val?val:"UNKNOWN_ENUM_VALUE", value); +} + +void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint_t flag, uint_t value) +{ + /* size can be later used to print something like: + * ...1.... .........: FLAG1_NAME + * .....0.. .........: FLAG2_NAME + */ + ndr->print(ndr, "%s: %-25s", (flag & value)?"1":"0", flag_name); } void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8_t v) -- cgit