summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba/TDR.pm13
-rwxr-xr-xsource4/pidl/pidl2
2 files changed, 9 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba/TDR.pm b/source4/pidl/lib/Parse/Pidl/Samba/TDR.pm
index b9bfd83e41..aa41e9419c 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba/TDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba/TDR.pm
@@ -60,7 +60,7 @@ sub ParserElement($$$)
if (has_property($e, "charset")) {
fatal($e,"charset() on non-array element") unless (defined($e->{ARRAY_LEN}) and scalar(@{$e->{ARRAY_LEN}}) > 0);
- my $len = @{$e->{ARRAY_LEN}}[0];
+ my $len = ParseExpr(@{$e->{ARRAY_LEN}}[0], $env);
if ($len eq "*") { $len = "-1"; }
pidl "TDR_CHECK(tdr_$t\_charset(tdr$name, &v->$e->{NAME}, $len, sizeof($e->{TYPE}_t), CH_$e->{PROPERTIES}->{charset}));";
return;
@@ -112,6 +112,7 @@ sub ParserStruct($$$$)
}
my %env = map { $_->{NAME} => "v->$_->{NAME}" } @{$e->{ELEMENTS}};
+ $env{"this"} = "v";
ParserElement($_, $t, \%env) foreach (@{$e->{ELEMENTS}});
if ($t eq "print") {
@@ -215,6 +216,7 @@ sub Parser($$)
pidl "/* autogenerated by pidl */";
pidl "#include \"includes.h\"";
pidl "#include \"$hdrname\"";
+ pidl "";
foreach (@$idl) { ParserInterface($_) if ($_->{TYPE} eq "INTERFACE"); }
return $ret;
}
@@ -226,8 +228,6 @@ sub HeaderInterface($$)
pidl "#ifndef __TDR_$x->{NAME}_HEADER__";
pidl "#define __TDR_$x->{NAME}_HEADER__";
- pidl "#include \"$outputdir/$x->{NAME}.h\"";
-
foreach my $e (@{$x->{DATA}}) {
next unless ($e->{TYPE} eq "TYPEDEF");
next unless has_property($e, "public");
@@ -251,11 +251,14 @@ sub HeaderInterface($$)
pidl "#endif /* __TDR_$x->{NAME}_HEADER__ */";
}
-sub Header($$)
+sub Header($$$)
{
- my ($idl,$outputdir) = @_;
+ my ($idl,$outputdir,$basename) = @_;
$ret = "";
pidl "/* Generated by pidl */";
+
+ pidl "#include \"$outputdir/$basename.h\"";
+ pidl "";
foreach (@$idl) {
HeaderInterface($_, $outputdir) if ($_->{TYPE} eq "INTERFACE");
diff --git a/source4/pidl/pidl b/source4/pidl/pidl
index c68ea6c121..89c6194257 100755
--- a/source4/pidl/pidl
+++ b/source4/pidl/pidl
@@ -339,7 +339,7 @@ $dcom
if (defined($opt_tdr_header)) {
require Parse::Pidl::Samba::TDR;
- FileSave($tdr_header, Parse::Pidl::Samba::TDR::Header($pidl, $outputdir));
+ FileSave($tdr_header, Parse::Pidl::Samba::TDR::Header($pidl, $outputdir,$basename));
}
if ($opt_template) {