summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-01-04 06:35:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:17 -0500
commit5f8802ff01aaf8a9604dfca734b9924ebf5d4d4e (patch)
treec13892c995cbcb71f0fb4718b0c9c9a4bdeb31d7
parent522c54ce93d726033dca73bc556d64094a8ee27d (diff)
downloadsamba-5f8802ff01aaf8a9604dfca734b9924ebf5d4d4e.tar.gz
samba-5f8802ff01aaf8a9604dfca734b9924ebf5d4d4e.tar.bz2
samba-5f8802ff01aaf8a9604dfca734b9924ebf5d4d4e.zip
r4512: Give arrays of scalar types their own subtree.
(This used to be commit b9432130959aeaab6d1720ac2c6f99e3d8f9e037)
-rw-r--r--source4/build/pidl/eparser.pm37
1 files changed, 25 insertions, 12 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index ea250cbb07..a67aa0626d 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -173,25 +173,36 @@ sub NeededTypedef($)
if ($t->{DATA}->{TYPE} eq "STRUCT") {
for my $e (@{$t->{DATA}->{ELEMENTS}}) {
+
$e->{PARENT} = $t->{DATA};
+
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{TYPE}"} = 1;
}
if (util::is_scalar_type($e->{TYPE})) {
+
+ if (defined($e->{ARRAY_LEN}) or
+ util::has_property($e, "size_is")) {
+
+ $needed{"ett_$e->{NAME}"} = 1;
+
+ } else {
- $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => type2ft($e->{TYPE}),
- 'base' => elementbase($e)
- };
-
- $e->{PARENT} = $t->{DATA};
-
- if ($needed{"pull_$t->{NAME}"}) {
- $needed{"pull_$e->{TYPE}"} = 1;
+ $needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
+ 'name' => field2name($e->{NAME}),
+ 'type' => $e->{TYPE},
+ 'ft' => type2ft($e->{TYPE}),
+ 'base' => elementbase($e)
+ };
+
+ $e->{PARENT} = $t->{DATA};
+
+ if ($needed{"pull_$t->{NAME}"}) {
+ $needed{"pull_$e->{TYPE}"} = 1;
+ }
}
+
} else {
$needed{"ett_$e->{TYPE}"} = 1;
@@ -420,8 +431,10 @@ sub RewriteC($$$)
# Add tree argument to ndr_pull_array()
- s/(ndr_pull_array([^\(]*?)\(ndr, (NDR_[^,]*?), ([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
+ s/(ndr_pull_array([^\(_]*?)\(ndr, (NDR_[^,]*?), ([^\)].*?)\);)/ndr_pull_array$2( ndr, $3, tree, $4);/smg;
+ s/(ndr_pull_array_([^\(]*?)\(ndr, (NDR_[^,]*?), (r->((in|out).)?([^,]*?)), (.*?)\);)/ndr_pull_array_$2( ndr, $3, get_subtree(tree, \"$7\", ndr, ett_$7), $4, $8);/smg;
+
# Save ndr_pull_relative[12]() calls from being wrapped by the
# proceeding regexp.