diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-06-15 10:44:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:13 -0500 |
commit | ee2b5ae0eb43e7670763bfb753395e8ec85a23f8 (patch) | |
tree | 29e4bebdf3861509d75baf8c844f50ca1536c2f3 /source4/build | |
parent | bdc1f52ea471af8ee88c46289d6a998b20638238 (diff) | |
download | samba-ee2b5ae0eb43e7670763bfb753395e8ec85a23f8.tar.gz samba-ee2b5ae0eb43e7670763bfb753395e8ec85a23f8.tar.bz2 samba-ee2b5ae0eb43e7670763bfb753395e8ec85a23f8.zip |
r7605: Display properties in header files again.
(This used to be commit 5f37f7a524611ff8227662fd19c37496c83cac7f)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/ndr_header.pm | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/source4/build/pidl/ndr_header.pm b/source4/build/pidl/ndr_header.pm index 1e5500400c..04cd57ad7f 100644 --- a/source4/build/pidl/ndr_header.pm +++ b/source4/build/pidl/ndr_header.pm @@ -31,12 +31,10 @@ sub HeaderProperties($$) my($props,$ignores) = @_; my $ret = ""; - return; - foreach my $d (keys %{$props}) { - next if ($ignores->{$d}); + next if (grep(/^$d$/, @$ignores)); if($props->{$d} ne "1") { - $ret.= "$d(" . $props->{$d} . "),"; + $ret.= "$d($props->{$d}),"; } else { $ret.="$d,"; } @@ -53,9 +51,6 @@ sub HeaderElement($) { my($element) = shift; - if (defined $element->{PROPERTIES}) { - HeaderProperties($element->{PROPERTIES}, {"in" => 1, "out" => 1}); - } pidl tabs(); HeaderType($element, $element->{TYPE}, ""); pidl " "; @@ -68,7 +63,7 @@ sub HeaderElement($) $nl = Ndr::GetNextLevel($element, $nl) if ($nl->{TYPE} eq "SUBCONTEXT"); next if ($nl->{TYPE} eq "DATA" and typelist::scalar_is_reference($nl->{DATA_TYPE})); $prefix .= "*"; - } elsif (($l->{TYPE} eq "ARRAY")) { + } elsif ($l->{TYPE} eq "ARRAY") { my $pl = Ndr::GetPrevLevel($element, $l); next if ($pl and $pl->{TYPE} eq "POINTER"); @@ -85,7 +80,11 @@ sub HeaderElement($) if (defined $element->{ARRAY_LEN}[0] && util::is_constant($element->{ARRAY_LEN}[0])) { pidl "[$element->{ARRAY_LEN}[0]]"; } - pidl ";\n"; + pidl ";"; + if (defined $element->{PROPERTIES}) { + HeaderProperties($element->{PROPERTIES}, ["in", "out"]); + } + pidl "\n"; } ##################################################################### @@ -108,6 +107,9 @@ sub HeaderStruct($$) } $tab_depth--; pidl "}"; + if (defined $struct->{PROPERTIES}) { + HeaderProperties($struct->{PROPERTIES}, []); + } } ##################################################################### @@ -180,9 +182,6 @@ sub HeaderUnion($$) my($union,$name) = @_; my %done = (); - if (defined $union->{PROPERTIES}) { - HeaderProperties($union->{PROPERTIES}, {}); - } pidl "\nunion $name {\n"; $tab_depth++; foreach my $e (@{$union->{ELEMENTS}}) { @@ -195,6 +194,10 @@ sub HeaderUnion($$) } $tab_depth--; pidl "}"; + + if (defined $union->{PROPERTIES}) { + HeaderProperties($union->{PROPERTIES}, []); + } } ##################################################################### @@ -456,9 +459,7 @@ sub Parse($) $res = ""; pidl "/* header auto-generated by pidl */\n\n"; foreach my $x (@{$idl}) { - if ($x->{TYPE} eq "INTERFACE") { - HeaderInterface($x); - } + ($x->{TYPE} eq "INTERFACE") && HeaderInterface($x); } return $res; } |