Author: tpot Date: 2005-01-16 01:57:12 +0000 (Sun, 16 Jan 2005) New Revision: 4771
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4771 Log: Fix some indentation. Modified: branches/SAMBA_4_0/source/build/pidl/eparser.pm Changeset: Modified: branches/SAMBA_4_0/source/build/pidl/eparser.pm =================================================================== --- branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-16 01:48:08 UTC (rev 4770) +++ branches/SAMBA_4_0/source/build/pidl/eparser.pm 2005-01-16 01:57:12 UTC (rev 4771) @@ -151,19 +151,25 @@ 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 NeededTypedef($) { my $t = shift; + if (util::has_property($t, "public")) { $needed{"pull_$t->{NAME}"} = 1; } @@ -180,7 +187,9 @@ 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 @@ }; } else { + $needed{"hf_$e->{NAME}_$e->{TYPE}"} = { 'name' => field2name($e->{NAME}), 'type' => $e->{TYPE}, @@ -223,12 +233,17 @@ } 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 @@ } if ($t->{DATA}->{TYPE} eq "ENUM") { + $needed{"hf_$t->{NAME}"} = { 'name' => $t->{NAME}, 'ft' => 'FT_UINT16', @@ -250,11 +266,14 @@ 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 @@ # 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