summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/libndr.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-11 04:04:36 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-11 04:04:36 +0000
commitcecbf0cd8b99f7019a83def88baec889d6a06e6f (patch)
tree108181e24bac1a4fa10a55de40547d9177b488e8 /source4/librpc/ndr/libndr.h
parenta934f89549b3d23199d68b7dc3fc3ad16e86b9ad (diff)
downloadsamba-cecbf0cd8b99f7019a83def88baec889d6a06e6f.tar.gz
samba-cecbf0cd8b99f7019a83def88baec889d6a06e6f.tar.bz2
samba-cecbf0cd8b99f7019a83def88baec889d6a06e6f.zip
automatically generate ndr_print_*() functions for every IDL
structure. This allows easy debug and test tool writing without having to write functions that print every element of complex structures. (This used to be commit 81d6181172e36c6fbae0907550a29511ce708574)
Diffstat (limited to 'source4/librpc/ndr/libndr.h')
-rw-r--r--source4/librpc/ndr/libndr.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 870500d169..24ae09f538 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -58,9 +58,23 @@ struct ndr_push_save {
uint32 offset;
};
+
+/* structure passed to functions that print IDL structures */
+struct ndr_print {
+ uint32 flags; /* LIBNDR_FLAG_* */
+ TALLOC_CTX *mem_ctx;
+ uint32 depth;
+ void (*print)(struct ndr_print *, const char *, ...);
+};
+
#define LIBNDR_FLAG_BIGENDIAN 1
+/* useful macro for debugging */
+#define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p)
+
+
+
/*
flags passed to control parse flow
*/
@@ -97,6 +111,7 @@ typedef NTSTATUS (*ndr_pull_fn_t)(struct ndr_pull *, void *);
typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void *);
typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *);
+typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
/* now pull in the individual parsers */
#include "librpc/ndr/ndr_sec.h"