diff options
author | Günther Deschner <gd@samba.org> | 2008-03-25 17:38:27 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-03-25 17:42:08 +0100 |
commit | 07251792d4e020217ba23896dc65702853f31939 (patch) | |
tree | 3caf5f5fb64ab7b156ab77dad88b081201029c1e /source4/pidl/lib | |
parent | 5738491674574cd913dac2ad4f3851f4a0189ef4 (diff) | |
download | samba-07251792d4e020217ba23896dc65702853f31939.tar.gz samba-07251792d4e020217ba23896dc65702853f31939.tar.bz2 samba-07251792d4e020217ba23896dc65702853f31939.zip |
Add some more header properties as inline comments to the generated samba3 client.
Guenther
(This used to be commit 8ca4b0b0942564afa70b2e8a6d67d65ea8b75e43)
Diffstat (limited to 'source4/pidl/lib')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index 86b8951026..7a2575b897 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -44,6 +44,36 @@ sub new($) bless($self, $class); } +sub ElementDirection($) +{ + my ($e) = @_; + + return "[in,out]" if (has_property($e, "in") and has_property($e, "out")); + return "[in]" if (has_property($e, "in")); + return "[out]" if (has_property($e, "out")); + return "[in,out]"; +} + +sub HeaderProperties($$) +{ + my($props,$ignores) = @_; + my $ret = ""; + + foreach my $d (keys %{$props}) { + next if (grep(/^$d$/, @$ignores)); + if($props->{$d} ne "1") { + $ret.= "$d($props->{$d}),"; + } else { + $ret.="$d,"; + } + } + + if ($ret) { + return "[" . substr($ret, 0, -1) . "]"; + } +} + + sub ParseFunction($$$) { my ($self, $if, $fn) = @_; @@ -57,7 +87,9 @@ sub ParseFunction($$$) $fn_args .= "struct rpc_pipe_client *cli,\n" . $pad . "TALLOC_CTX *mem_ctx"; foreach (@{$fn->{ELEMENTS}}) { - $fn_args .= ",\n" . $pad . DeclLong($_); + my $dir = ElementDirection($_); + my $prop = HeaderProperties($_->{PROPERTIES}, ["in", "out"]); + $fn_args .= ",\n" . $pad . DeclLong($_) . " /* $dir $prop */"; } if (defined($fn->{RETURN_TYPE}) && ($fn->{RETURN_TYPE} eq "WERROR")) { |