summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-25 17:38:27 +0100
committerGünther Deschner <gd@samba.org>2008-03-25 17:42:08 +0100
commit8ca4b0b0942564afa70b2e8a6d67d65ea8b75e43 (patch)
tree7f16b5b2abc7a47d1b27e79842c1480309c4cc3f /source
parent9a1466abbd4115f4a57d794006aca29aa0184ced (diff)
downloadsamba-8ca4b0b0942564afa70b2e8a6d67d65ea8b75e43.tar.gz
samba-8ca4b0b0942564afa70b2e8a6d67d65ea8b75e43.tar.xz
samba-8ca4b0b0942564afa70b2e8a6d67d65ea8b75e43.zip
Add some more header properties as inline comments to the generated samba3 client.
Guenther
Diffstat (limited to 'source')
-rw-r--r--source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
index 86b8951026c..7a2575b8972 100644
--- a/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
+++ b/source/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")) {