summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-01-16 01:57:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:52 -0500
commitf525d07202a067c2ee1bba5aa2821a003be97051 (patch)
tree4e3a1225133e863db1570610370b1c9289534e36 /source4/build/pidl
parent0d9fa3f46cc04450e5a9433519f2f77476791798 (diff)
downloadsamba-f525d07202a067c2ee1bba5aa2821a003be97051.tar.gz
samba-f525d07202a067c2ee1bba5aa2821a003be97051.tar.bz2
samba-f525d07202a067c2ee1bba5aa2821a003be97051.zip
r4771: Fix some indentation.
(This used to be commit b2a3b0221680fb54b058631846559e6151a7b562)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/eparser.pm31
1 files changed, 25 insertions, 6 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index 92467a6211..d0738af9c6 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -151,19 +151,25 @@ sub field2name($)
sub NeededFunction($)
{
my $fn = shift;
+
$needed{"pull_$fn->{NAME}"} = 1;
+
foreach my $e (@{$fn->{DATA}}) {
+
$e->{PARENT} = $fn;
$needed{"pull_$e->{TYPE}"} = 1;
if (util::is_scalar_type($e->{TYPE})) {
+
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft' => type2ft($e->{TYPE}),
'base' => elementbase($e)
}, if !defined($needed{"hf_$e->{NAME}_$e->{TYPE}"});
+
$e->{PARENT} = $fn;
+
} else {
$needed{"ett_$e->{TYPE}"} = 1;
}
@@ -173,6 +179,7 @@ sub NeededFunction($)
sub NeededTypedef($)
{
my $t = shift;
+
if (util::has_property($t, "public")) {
$needed{"pull_$t->{NAME}"} = 1;
}
@@ -180,7 +187,9 @@ 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;
}
@@ -200,6 +209,7 @@ sub NeededTypedef($)
};
} else {
+
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
@@ -223,12 +233,17 @@ sub NeededTypedef($)
}
if ($t->{DATA}->{TYPE} eq "UNION") {
+
for my $e (@{$t->{DATA}->{DATA}}) {
+
$e->{PARENT} = $t->{DATA};
+
if ($e->{TYPE} eq "UNION_ELEMENT") {
+
if ($needed{"pull_$t->{NAME}"}) {
$needed{"pull_$e->{DATA}->{TYPE}"} = 1;
}
+
$needed{"ett_$e->{DATA}{TYPE}"} = 1;
}
}
@@ -237,6 +252,7 @@ sub NeededTypedef($)
}
if ($t->{DATA}->{TYPE} eq "ENUM") {
+
$needed{"hf_$t->{NAME}"} = {
'name' => $t->{NAME},
'ft' => 'FT_UINT16',
@@ -250,11 +266,14 @@ sub NeededTypedef($)
sub BuildNeeded($)
{
my($interface) = shift;
+
my($data) = $interface->{DATA};
+
foreach my $d (@{$data}) {
($d->{TYPE} eq "FUNCTION") &&
NeededFunction($d);
}
+
foreach my $d (reverse @{$data}) {
($d->{TYPE} eq "TYPEDEF") &&
NeededTypedef($d);
@@ -436,12 +455,12 @@ sub RewriteC($$$)
# Get rid of dcerpc interface structures and functions since
# they are also not very interesting.
-next, if /^static const struct dcerpc_interface_call/ .. /^};/;
-next, if /^static const char \* const [a-z]+_endpoint_strings/ ../^};/;
-next, if /^static const struct dcerpc_endpoint_list/ .. /^};/;
-next, if /^const struct dcerpc_interface_table/ .. /^};/;
-next, if /^static NTSTATUS dcerpc_ndr_[a-z]+_init/ .. /^}/;
-next, if /^NTSTATUS dcerpc_[a-z]+_init/ .. /^}/;
+ next, if /^static const struct dcerpc_interface_call/ .. /^};/;
+ next, if /^static const char \* const [a-z]+_endpoint_strings/ ../^};/;
+ next, if /^static const struct dcerpc_endpoint_list/ .. /^};/;
+ next, if /^const struct dcerpc_interface_table/ .. /^};/;
+ next, if /^static NTSTATUS dcerpc_ndr_[a-z]+_init/ .. /^}/;
+ next, if /^NTSTATUS dcerpc_[a-z]+_init/ .. /^}/;
# Rewrite includes to packet-dcerpc-foo.h instead of ndr_foo.h