diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-08-17 13:08:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:02:08 -0500 |
commit | 95d4e550bd66cefe19396387ad52fb3cec5d0b64 (patch) | |
tree | 85929b000d44b804f99cc60d7fe5a8c1c7826063 /source4/pidl/lib/Parse/Pidl | |
parent | 3e3e5f85ddb407615e5d6a73fc5ec11acac4108e (diff) | |
download | samba-95d4e550bd66cefe19396387ad52fb3cec5d0b64.tar.gz samba-95d4e550bd66cefe19396387ad52fb3cec5d0b64.tar.bz2 samba-95d4e550bd66cefe19396387ad52fb3cec5d0b64.zip |
r24520: make use of the new ElementStars() and ArrayBrackets()
functions
metze
(This used to be commit fad5af2f2069993b7284e74a177b78a4b4798383)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4.pm | 2 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 31 |
2 files changed, 4 insertions, 29 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4.pm b/source4/pidl/lib/Parse/Pidl/Samba4.pm index ebe74d488d..347d288cee 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4.pm @@ -7,7 +7,7 @@ package Parse::Pidl::Samba4; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(is_intree choose_header DeclLong); +@EXPORT = qw(is_intree choose_header NumStars ElementStars ArrayBrackets DeclLong); use Parse::Pidl::Util qw(has_property is_constant); use Parse::Pidl::NDR qw(GetNextLevel); diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 9d8b521a49..7deb3ca331 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -10,8 +10,7 @@ use strict; use Parse::Pidl qw(fatal); use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference); use Parse::Pidl::Util qw(has_property is_constant); -use Parse::Pidl::NDR qw(GetNextLevel); -use Parse::Pidl::Samba4 qw(is_intree); +use Parse::Pidl::Samba4 qw(is_intree ElementStars ArrayBrackets); use vars qw($VERSION); $VERSION = '0.01'; @@ -64,34 +63,10 @@ sub HeaderElement($) } else { HeaderType($element, $element->{TYPE}, ""); } - pidl " "; - my $numstar = 0; - foreach my $l (@{$element->{LEVELS}}) { - next unless ($l->{TYPE} eq "POINTER"); - - my $nl = GetNextLevel($element, $l); - next if (defined($nl) and $nl->{TYPE} eq "ARRAY"); - - $numstar++; - } - if ($numstar >= 1) { - $numstar-- if (scalar_is_reference($element->{TYPE})); - } - foreach my $l (@{$element->{LEVELS}}) { - next unless ($l->{TYPE} eq "ARRAY"); - next if ($l->{IS_FIXED}) and - not has_property($element, "charset"); - $numstar++; - } - pidl "*" foreach (1..$numstar); + pidl " ".ElementStars($element); } pidl $element->{NAME}; - foreach my $l (@{$element->{LEVELS}}) { - next unless ($l->{TYPE} eq "ARRAY"); - next unless ($l->{IS_FIXED} and - not has_property($element, "charset")); - pidl "[$l->{SIZE_IS}]"; - } + pidl ArrayBrackets($element); pidl ";"; if (defined $element->{PROPERTIES}) { |