diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-03 17:16:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:36:28 -0500 |
commit | 0eea337a6f11c3a86414fbd31b065fc59a481435 (patch) | |
tree | 7876738257f6f36f8d3f5ff9cce814ffcb5332f4 /source4/pidl/lib | |
parent | 1da463cb48f6d97907f2ab11987081ad1650bdc0 (diff) | |
download | samba-0eea337a6f11c3a86414fbd31b065fc59a481435.tar.gz samba-0eea337a6f11c3a86414fbd31b065fc59a481435.tar.bz2 samba-0eea337a6f11c3a86414fbd31b065fc59a481435.zip |
r10006: Insert correct header file.
(This used to be commit dfa45ec1b329ad01daf81beeb31985811ce4f5af)
Diffstat (limited to 'source4/pidl/lib')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba/TDR.pm | 13 |
1 files changed, 8 insertions, 5 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"); |