diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-02-28 13:25:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:00 -0500 |
commit | 5ba8169109253c96f71e0e039b1c0b7a1056eab0 (patch) | |
tree | 575fe0e0904e7596a5d1d02691fcdc733a28cd87 /source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | |
parent | c2003743256bc0312c5360821d501591039dafcd (diff) | |
download | samba-5ba8169109253c96f71e0e039b1c0b7a1056eab0.tar.gz samba-5ba8169109253c96f71e0e039b1c0b7a1056eab0.tar.bz2 samba-5ba8169109253c96f71e0e039b1c0b7a1056eab0.zip |
r21584: Support for tagged types has landed!
It's now possible to use "struct foo" without a typedef in IDL files.
echo_info4 is the first type that's been converted.
(This used to be commit 3ac68e858df9b53cf5e0a84741916214a53b3121)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Header.pm')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 11ecc17001..2eddf22b05 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -57,7 +57,11 @@ sub HeaderElement($) if (has_property($element, "represent_as")) { pidl mapTypeName($element->{PROPERTIES}->{represent_as})." "; } else { - HeaderType($element, $element->{TYPE}, ""); + if (ref($element->{TYPE}) eq "HASH") { + HeaderType($element, $element->{TYPE}, $element->{TYPE}->{NAME}); + } else { + HeaderType($element, $element->{TYPE}, ""); + } pidl " "; my $numstar = $element->{POINTERS}; if ($numstar >= 1) { @@ -90,14 +94,14 @@ sub HeaderElement($) sub HeaderStruct($$) { my($struct,$name) = @_; - pidl "struct $name {\n"; + pidl "struct $name"; + return if (not defined($struct->{ELEMENTS})); + pidl " {\n"; $tab_depth++; my $el_count=0; - if (defined $struct->{ELEMENTS}) { - foreach (@{$struct->{ELEMENTS}}) { - HeaderElement($_); - $el_count++; - } + foreach (@{$struct->{ELEMENTS}}) { + HeaderElement($_); + $el_count++; } if ($el_count == 0) { # some compilers can't handle empty structures @@ -174,7 +178,9 @@ sub HeaderUnion($$) my($union,$name) = @_; my %done = (); - pidl "union $name {\n"; + pidl "union $name"; + return if (not defined($union->{ELEMENTS})); + pidl " {\n"; $tab_depth++; foreach my $e (@{$union->{ELEMENTS}}) { if ($e->{TYPE} ne "EMPTY") { |