From fe15b46d61ee50f4225458faf963c818cde3e283 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Oct 2004 09:22:21 +0000 Subject: r2990: Add support to pidl for autogenerating ndr_size_*() functions. Adding the [gensize] property to a struct or union will make pidl generate a ndr_size_*() function. (not all nasty bits of NDR are completely covered yet by the ndr_size*() functions, support for those will be added when necessary) I also have a local patch (not applied now) that simplifies the pidl output and eliminates the number of functions required. It would, however, make pidl more complex. (This used to be commit 7c823f886afd0c4c6ee838f17882ca0658417011) --- source4/librpc/ndr/libndr.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/librpc/ndr/libndr.h') diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 59e8b744df..306e480c98 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -188,6 +188,11 @@ enum ndr_err_code { } \ } while(0) +#define NDR_SIZE_ALIGN(t, n, flags) ((flags & LIBNDR_FLAG_NOALIGN)?(t):(((t) + (n-1)) & ~(n-1))) +#define ndr_size_uint8(t, p, flags) (NDR_SIZE_ALIGN(t, 1, flags) + 1) +#define ndr_size_uint16(t, p, flags) (NDR_SIZE_ALIGN(t, 2, flags) + 2) +#define ndr_size_uint32(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4) +#define ndr_size_ptr(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4) /* these are used to make the error checking on each element in libndr less tedious, hopefully making the code more readable */ -- cgit