summaryrefslogtreecommitdiff
path: root/source4/build/pidl/parser.pm
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-21 06:46:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:01 -0500
commite0d2080219c7d52559a5bbcc7294995fccbd5e52 (patch)
treeaf6f408f2aae45a64a4cdd20c7d0619ac22d21e9 /source4/build/pidl/parser.pm
parent84b5890a960a74462ca593fcc4d113e96a77a051 (diff)
downloadsamba-e0d2080219c7d52559a5bbcc7294995fccbd5e52.tar.gz
samba-e0d2080219c7d52559a5bbcc7294995fccbd5e52.tar.bz2
samba-e0d2080219c7d52559a5bbcc7294995fccbd5e52.zip
r4884: - 2nd part of support ndr_size_ generation on unions as well as structures
- added "nopull" and "nopush" flags, to allow for externally written parsers for sub-structures (This used to be commit f65f239978425de795a0e188aaad3d5d1167da32)
Diffstat (limited to 'source4/build/pidl/parser.pm')
-rw-r--r--source4/build/pidl/parser.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index ac45b4d9bc..1368099403 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -1036,6 +1036,23 @@ sub ParseStructNdrSize($)
}
#####################################################################
+# calculate size of ndr struct
+sub ParseUnionNdrSize($)
+{
+ my $t = shift;
+ my $static = fn_prefix($t);
+ my $sizevar;
+
+ pidl "size_t ndr_size_$t->{NAME}(const union $t->{NAME} *r, uint32_t level, int flags)\n";
+ pidl "{\n";
+ if (my $flags = util::has_property($t, "flag")) {
+ pidl "\tflags |= $flags;\n";
+ }
+ pidl "\treturn ndr_size_union(r, flags, level, (ndr_push_union_fn_t)ndr_push_$t->{NAME});\n";
+ pidl "}\n\n";
+}
+
+#####################################################################
# parse a union - push side
sub ParseUnionPush($)
{
@@ -1395,6 +1412,9 @@ sub ParseTypedefNdrSize($)
($t->{DATA}->{TYPE} eq "STRUCT") &&
ParseStructNdrSize($t);
+
+ ($t->{DATA}->{TYPE} eq "UNION") &&
+ ParseUnionNdrSize($t);
}
#####################################################################