summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-24 12:40:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:09 -0500
commit5d9ea9170d2e0fd816285bd460de05f800ce26e8 (patch)
tree9f04b7c484217473abeece2f0039e44eb7b9b2cd /source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
parent6ba19b57290d7a625e0939563160eec0c419a91a (diff)
downloadsamba-5d9ea9170d2e0fd816285bd460de05f800ce26e8.tar.gz
samba-5d9ea9170d2e0fd816285bd460de05f800ce26e8.tar.bz2
samba-5d9ea9170d2e0fd816285bd460de05f800ce26e8.zip
r14690: Support represent_as in headers, enable represent_as() test (which works now)
(This used to be commit 31e847a0844a6871befc6091e813ae017cd6e4b4)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Header.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm38
1 files changed, 20 insertions, 18 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index e082a74fc4..6fb3ee2eec 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -55,19 +55,23 @@ sub HeaderElement($)
my($element) = shift;
pidl tabs();
- HeaderType($element, $element->{TYPE}, "");
- pidl " ";
- my $numstar = $element->{POINTERS};
- if ($numstar >= 1) {
- $numstar-- if Parse::Pidl::Typelist::scalar_is_reference($element->{TYPE});
- }
- foreach (@{$element->{ARRAY_LEN}})
- {
- next if is_constant($_) and
- not has_property($element, "charset");
- $numstar++;
+ if (has_property($element, "represent_as")) {
+ pidl mapType($element->{PROPERTIES}->{represent_as})." ";
+ } else {
+ HeaderType($element, $element->{TYPE}, "");
+ pidl " ";
+ my $numstar = $element->{POINTERS};
+ if ($numstar >= 1) {
+ $numstar-- if Parse::Pidl::Typelist::scalar_is_reference($element->{TYPE});
+ }
+ foreach (@{$element->{ARRAY_LEN}})
+ {
+ next if is_constant($_) and
+ not has_property($element, "charset");
+ $numstar++;
+ }
+ pidl "*" foreach (1..$numstar);
}
- pidl "*" foreach (1..$numstar);
pidl $element->{NAME};
foreach (@{$element->{ARRAY_LEN}}) {
next unless (is_constant($_) and
@@ -91,8 +95,8 @@ sub HeaderStruct($$)
$tab_depth++;
my $el_count=0;
if (defined $struct->{ELEMENTS}) {
- foreach my $e (@{$struct->{ELEMENTS}}) {
- HeaderElement($e);
+ foreach (@{$struct->{ELEMENTS}}) {
+ HeaderElement($_);
$el_count++;
}
}
@@ -237,10 +241,8 @@ sub HeaderFunctionInOut($$)
{
my($fn,$prop) = @_;
- foreach my $e (@{$fn->{ELEMENTS}}) {
- if (has_property($e, $prop)) {
- HeaderElement($e);
- }
+ foreach (@{$fn->{ELEMENTS}}) {
+ HeaderElement($_) if (has_property($_, $prop));
}
}