1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

r10717: Another bunch of small updates. All generated files except parse_dfs.c

compile now when generated from Samba4's dfs.idl.
(This used to be commit 2b315b1942e77640eca8e0a3347b2a9ed1920f6a)
This commit is contained in:
Jelmer Vernooij 2005-10-04 19:38:35 +00:00 committed by Gerald (Jerry) Carter
parent eea74cde05
commit 9879bc6aa6
5 changed files with 31 additions and 19 deletions

View File

@ -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 */";

View File

@ -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 "";
}

View File

@ -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($)

View File

@ -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 "";
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;";

View File

@ -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) = @_;