From 0a05bdb9eb096e4426d06b8663ad295f6a693af2 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 20 Jan 2005 05:57:05 +0000 Subject: r4865: Fix up subtree name when dissecting unions. E.g in LSA, The subtree used to be called something like "Level, R->out.info" but now is called "Lsa PolicyInformation". (This used to be commit be2bb36856bee1c2882e063beb7c04ac5e5889de) --- source4/build/pidl/eparser.pm | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index 4f65d5ac17..a4279cce53 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -584,17 +584,33 @@ sub RewriteC($$$) \);) /ndr_pull_$2(ndr, tree, hf_$4, $3);/smgx; - # Add subtree argument to calls dissecting structures, e.g + # Add subtree argument to calls dissecting structures/unions, e.g # # ndr_pull_string(ndr, NDR_SCALARS|NDR_BUFFERS, &r->command); # ndr_pull_atsvc_enum_ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr); - s/(ndr_pull_([^\)]*?)\( - ndr,\ - (NDR_[^,]*?),\ - (&?r->(in|out|)\.?([^\(].*?))\);) - /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), $4); - /smgx; + # Three argument version is for structures + + if (/ndr_pull([^\)]*?)\(ndr, (NDR_[^,]*?), ([^,]*?)\);/) { + + s/(ndr_pull_([^\)]*?)\( + ndr,\ + (NDR_[^,]*?),\ + (&?r->(in|out|)\.?([^\(].*?))\);) + /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$6\", ndr, ett_$2), $4); + /smgx; + } + + # Four argument version if for unions + + if (/ndr_pull([^\)]*?)\(ndr, (NDR_[SB][^,]*?), ([^,]*?), ([^,]*?)\);/) { + s/(ndr_pull_([^\)]*?)\( + ndr,\ + (NDR_[^,]*?),\ + (&?r->(in|out|)\.?([^\(].*?))\);) + /ndr_pull_$2(ndr, $3, get_subtree(tree, \"$2\", ndr, ett_$2), $4); + /smgx; + } # Add proto_tree parameter to pull function prototypes, e.g # -- cgit