svn commit: samba r24520 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl: . Samba4

metze at samba.org metze at samba.org
Fri Aug 17 13:08:02 GMT 2007


Author: metze
Date: 2007-08-17 13:08:00 +0000 (Fri, 17 Aug 2007)
New Revision: 24520

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24520

Log:
make use of the new ElementStars() and ArrayBrackets()
functions

metze
Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm	2007-08-17 13:07:52 UTC (rev 24519)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm	2007-08-17 13:08:00 UTC (rev 24520)
@@ -10,8 +10,7 @@
 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 @@
 		} 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}) {

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm	2007-08-17 13:07:52 UTC (rev 24519)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm	2007-08-17 13:08:00 UTC (rev 24520)
@@ -7,7 +7,7 @@
 
 require Exporter;
 @ISA = qw(Exporter);
- at EXPORT = qw(is_intree choose_header DeclLong);
+ at 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);



More information about the samba-cvs mailing list