diff options
Diffstat (limited to 'source4/pidl/lib')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Client.pm | 12 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Header.pm | 6 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm | 20 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Server.pm | 10 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Types.pm | 2 |
5 files changed, 31 insertions, 19 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Client.pm index 83762719ea..d79aede138 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Client.pm @@ -25,11 +25,13 @@ sub ParseFunction($$) { 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 @@ sub ParseFunction($$) 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 */"; diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Header.pm index 13f506a7da..1e0e2c7270 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Header.pm @@ -58,7 +58,7 @@ sub ParseFunction($$) 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 @@ sub ParseUnion($$$) { 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 ""; } diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm index 57ee1543ff..9a7c7d2578 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm @@ -143,9 +143,9 @@ sub InitLevel($$$$) } } -sub CreateStruct($$$$) +sub CreateStruct($$$$$) { - my ($fn,$s,$es,$a) = @_; + my ($fn,$ifn, $s,$es,$a) = @_; my $args = ""; foreach (@$es) { @@ -167,10 +167,10 @@ sub CreateStruct($$$$) } } - 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 @@ sub ParseStruct($$$) 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 @@ sub ParseFunction($$) } ); } - 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($) diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Server.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Server.pm index 0372cf1117..3f1f4645a1 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Server.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Server.pm @@ -33,13 +33,17 @@ sub ParseFunction($$) 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;"; diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm index f93e90fe1f..c09246e5a9 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm @@ -268,7 +268,7 @@ sub LoadTypes($) 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) = @_; |