svn commit: samba r10717 - in
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3: .
jelmer at samba.org
jelmer at samba.org
Tue Oct 4 19:38:36 GMT 2005
Author: jelmer
Date: 2005-10-04 19:38:35 +0000 (Tue, 04 Oct 2005)
New Revision: 10717
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10717
Log:
Another bunch of small updates. All generated files except parse_dfs.c
compile now when generated from Samba4's dfs.idl.
Modified:
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Client.pm
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Header.pm
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Parser.pm
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Server.pm
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Types.pm
Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Client.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Client.pm 2005-10-04 18:24:21 UTC (rev 10716)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Client.pm 2005-10-04 19:38:35 UTC (rev 10717)
@@ -25,11 +25,13 @@
{
my ($if,$fn) = @_;
- my $args = "";
+ my $inargs = "";
my $defargs = "";
foreach (@{$fn->{ELEMENTS}}) {
$defargs .= ", " . DeclLong($_);
- $args .= ", $_->{NAME}";
+ if (grep(/in/, @{$_->{DIRECTION}})) {
+ $inargs .= ", $_->{NAME}";
+ }
}
my $uif = uc($if->{NAME});
@@ -47,13 +49,13 @@
pidl "";
pidl "/* Marshall data and send request */";
pidl "";
- pidl "init_$if->{NAME}_q_$fn->{NAME}(&q$args);";
+ pidl "init_$if->{NAME}_q_$fn->{NAME}(&q$inargs);";
pidl "";
pidl "CLI_DO_RPC(cli, mem_ctx, PI_$uif, $ufn,";
pidl "\tq, r,";
pidl "\tqbuf, rbuf, ";
- pidl "\t$if->{NAME}_q_$fn->{NAME},";
- pidl "\t$if->{NAME}_r_$fn->{NAME},";
+ pidl "\t$if->{NAME}_io_q_$fn->{NAME},";
+ pidl "\t$if->{NAME}_io_r_$fn->{NAME},";
pidl "\tNT_STATUS_UNSUCCESSFUL);";
pidl "";
pidl "/* Return result */";
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Header.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Header.pm 2005-10-04 18:24:21 UTC (rev 10716)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Header.pm 2005-10-04 19:38:35 UTC (rev 10717)
@@ -58,7 +58,7 @@
my @in = ();
my @out = ();
- foreach (@{$_->{ELEMENTS}}) {
+ foreach (@{$fn->{ELEMENTS}}) {
push (@in, $_) if (grep(/in/, @{$_->{DIRECTION}}));
push (@out, $_) if (grep(/out/, @{$_->{DIRECTION}}));
}
@@ -93,10 +93,10 @@
{
my ($if,$u,$n) = @_;
- pidl "typedef union {";
+ pidl "typedef union $if->{NAME}_$n {";
#FIXME: What about elements that require more then one variable?
ParseElement($_) foreach (@{$u->{ELEMENTS}});
- pidl "} $n;";
+ pidl "} ".uc($if->{NAME}."_".$n) .";";
pidl "";
}
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Parser.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Parser.pm 2005-10-04 18:24:21 UTC (rev 10716)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Parser.pm 2005-10-04 19:38:35 UTC (rev 10717)
@@ -143,9 +143,9 @@
}
}
-sub CreateStruct($$$$)
+sub CreateStruct($$$$$)
{
- my ($fn,$s,$es,$a) = @_;
+ my ($fn,$ifn, $s,$es,$a) = @_;
my $args = "";
foreach (@$es) {
@@ -167,10 +167,10 @@
}
}
- pidl "BOOL init_$fn($s *v$args)";
+ pidl "BOOL $ifn($s *v$args)";
pidl "{";
indent;
- pidl "DEBUG(5,(\"init_$fn\\n\"));";
+ pidl "DEBUG(5,(\"$ifn\\n\"));";
pidl "";
# Call init for all arguments
foreach (@$es) {
@@ -215,7 +215,7 @@
my $fn = "$if->{NAME}_io_$n";
my $sn = uc("$if->{NAME}_$n");
- CreateStruct($fn, $sn, $s->{ELEMENTS}, $s->{ALIGN});
+ CreateStruct($fn, "init_$if->{NAME}_$n", $sn, $s->{ELEMENTS}, $s->{ALIGN});
}
sub ParseUnion($$$)
@@ -282,8 +282,14 @@
} );
}
- CreateStruct("$if->{NAME}_io_q_$fn->{NAME}", uc("$if->{NAME}_q_$fn->{NAME}"), \@in, 0);
- CreateStruct("$if->{NAME}_io_r_$fn->{NAME}", uc("$if->{NAME}_r_$fn->{NAME}"), \@out, 0);
+ CreateStruct("$if->{NAME}_io_q_$fn->{NAME}",
+ "init_$if->{NAME}_q_$fn->{NAME}",
+ uc("$if->{NAME}_q_$fn->{NAME}"),
+ \@in, 0);
+ CreateStruct("$if->{NAME}_io_r_$fn->{NAME}",
+ "init_$if->{NAME}_r_$fn->{NAME}",
+ uc("$if->{NAME}_r_$fn->{NAME}"),
+ \@out, 0);
}
sub ParseInterface($)
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Server.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Server.pm 2005-10-04 18:24:21 UTC (rev 10716)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Server.pm 2005-10-04 19:38:35 UTC (rev 10717)
@@ -33,13 +33,17 @@
indent;
pidl uc("$if->{NAME}_q_$fn->{NAME}") . " q_u;";
pidl uc("$if->{NAME}_r_$fn->{NAME}") . " r_u;";
- pidl "prs_struct *data = &p->in_data.data";
- pidl "prs_struct *rdata = &p->out_data.rdata";
+ pidl "prs_struct *data = &p->in_data.data;";
+ pidl "prs_struct *rdata = &p->out_data.rdata;";
pidl "";
pidl "if (!$if->{NAME}_io_q_$fn->{NAME}(\"\", &q_u, data, 0))";
pidl "\treturn False;";
pidl "";
- pidl "r_u.status = _$fn->{NAME}(p, &q_u, &r_u);";
+ if ($fn->{RETURN_TYPE}) {
+ pidl "r_u.status = _$fn->{NAME}(p, &q_u, &r_u);";
+ } else {
+ pidl "_$fn->{NAME}(p, &q_u, &r_u);";
+ }
pidl "";
pidl "if (!$if->{NAME}_io_r_$fn->{NAME}(\"\", &r_u, rdata, 0))";
pidl "\treturn False;";
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Types.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Types.pm 2005-10-04 18:24:21 UTC (rev 10716)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/Types.pm 2005-10-04 19:38:35 UTC (rev 10717)
@@ -268,7 +268,7 @@
DECL => uc("$if->{NAME}_$td->{NAME}"),
INIT => sub {
my ($e,$l,$n,$v) = @_;
- return "init_$td->{NAME}(&$n/*FIXME:OTHER ARGS*/);";
+ return "$n = $v;";
},
DISSECT => sub {
my ($e,$l,$n) = @_;
More information about the samba-cvs
mailing list