diff options
-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; } |