r4865: Fix up subtree name when dissecting unions. E.g in LSA, The subtree
authorTim Potter <tpot@samba.org>
Thu, 20 Jan 2005 05:57:05 +0000 (05:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:01 +0000 (13:09 -0500)
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

index 4f65d5ac171e2d4bdd9c1fe6daf8b238e497ee21..a4279cce53d001f01e4f533cfb3f2f72857d416d 100644 (file)
@@ -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
        #