r4519: added the enum print function in ndr_basic.c
authorAndrew Tridgell <tridge@samba.org>
Tue, 4 Jan 2005 23:26:12 +0000 (23:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:17 +0000 (13:08 -0500)
(This used to be commit 29955004aa256d5ac27b941f48384ab97ff5e4b8)

source4/librpc/ndr/ndr_basic.c

index 315dc7605905da7f83bd53701102503fdbd1ca42..8874984f4b0c1b5c6a1cd22e3ae00f4060a22f2d 100644 (file)
@@ -999,6 +999,12 @@ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
        ndr->print(ndr, "%s: struct %s", name, type);
 }
 
+void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, 
+                   const char *val, uint32_t value)
+{
+       ndr->print(ndr, "%-25s: %s (%u)", name, val?val:"UNKNOWN", value);
+}
+
 void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8_t v)
 {
        ndr->print(ndr, "%-25s: 0x%02x (%u)", name, v, v);