summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_basic.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-05 15:36:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:19 -0500
commitd0da601ff78c1df7422e3a558db5a4c4862eb785 (patch)
tree1c1f1fa2893a369e8671de83eec4ba37f7f21e06 /source4/librpc/ndr/ndr_basic.c
parent31de71f0a2fd8cbd9c75c6573a02189178ebabe8 (diff)
downloadsamba-d0da601ff78c1df7422e3a558db5a4c4862eb785.tar.gz
samba-d0da601ff78c1df7422e3a558db5a4c4862eb785.tar.bz2
samba-d0da601ff78c1df7422e3a558db5a4c4862eb785.zip
r4535: add full support for
typedef bitmap { FLAG1 = 0x01 } fooflags; typedef struct { fooflags flags; } metze (This used to be commit 052a7d4f9a3a178149c65a616fdfd87152dff7eb)
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r--source4/librpc/ndr/ndr_basic.c13
1 files changed, 11 insertions, 2 deletions
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)