summaryrefslogtreecommitdiff
path: root/source4/build/pidl/ndr.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-15 10:11:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:13 -0500
commitbdc1f52ea471af8ee88c46289d6a998b20638238 (patch)
treec84b1dabae50038aeeb0aeab2cddd181e13d2354 /source4/build/pidl/ndr.pm
parent93e03bd27215a54d79ca996941468d1c33099ff3 (diff)
downloadsamba-bdc1f52ea471af8ee88c46289d6a998b20638238.tar.gz
samba-bdc1f52ea471af8ee88c46289d6a998b20638238.tar.bz2
samba-bdc1f52ea471af8ee88c46289d6a998b20638238.zip
r7604: Bunch of small pidl updates. Mostly removing unused functions,
cleanups and more flexibility (all output options now take an optional filename). (This used to be commit e3496732c66c2f9474fde58bb3930552511cb12a)
Diffstat (limited to 'source4/build/pidl/ndr.pm')
-rw-r--r--source4/build/pidl/ndr.pm54
1 files changed, 14 insertions, 40 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm
index c604d8fe48..09e1d2efc1 100644
--- a/source4/build/pidl/ndr.pm
+++ b/source4/build/pidl/ndr.pm
@@ -160,7 +160,7 @@ sub GetElementLevelTable($)
DATA_TYPE => $e->{TYPE},
IS_DEFERRED => $is_deferred,
CONTAINS_DEFERRED => can_contain_deferred($e),
- IS_SURROUNDING => is_surrounding_string($e)
+ IS_SURROUNDING => 0 #FIXME
});
my $i = 0;
@@ -203,17 +203,6 @@ sub pointer_type($)
return undef;
}
-sub is_surrounding_string($)
-{
- my $e = shift;
-
- return 0; #FIXME
-
- return ($e->{TYPE} eq "string") and ($e->{POINTERS} == 0)
- and util::property_matches($e, "flag", ".*LIBNDR_FLAG_STR_CONFORMANT.*")
- and $e->{PARENT}->{TYPE} ne "FUNCTION";
-}
-
#####################################################################
# work out the correct alignment for a structure or union
sub find_largest_alignment($)
@@ -367,8 +356,7 @@ sub ParseBitmap($)
sub ParseTypedef($$)
{
- my $ndr = shift;
- my $d = shift;
+ my ($ndr,$d) = @_;
my $data;
if ($d->{DATA}->{TYPE} eq "STRUCT" or $d->{DATA}->{TYPE} eq "UNION") {
@@ -379,17 +367,12 @@ sub ParseTypedef($$)
$d->{DATA}->{PROPERTIES} = $d->{PROPERTIES};
}
- if ($d->{DATA}->{TYPE} eq "STRUCT") {
- $data = ParseStruct($d->{DATA});
- } elsif ($d->{DATA}->{TYPE} eq "UNION") {
- $data = ParseUnion($d->{DATA});
- } elsif ($d->{DATA}->{TYPE} eq "ENUM") {
- $data = ParseEnum($d->{DATA});
- } elsif ($d->{DATA}->{TYPE} eq "BITMAP") {
- $data = ParseBitmap($d->{DATA});
- } else {
- die("Unknown data type '$d->{DATA}->{TYPE}'");
- }
+ $data = {
+ STRUCT => \&ParseStruct,
+ UNION => \&ParseUnion,
+ ENUM => \&ParseEnum,
+ BITMAP => \&ParseBitmap
+ }->{$d->{DATA}->{TYPE}}->($d->{DATA});
$data->{ALIGN} = align_type($d->{NAME});
@@ -403,24 +386,19 @@ sub ParseTypedef($$)
sub ParseConst($$)
{
- my $ndr = shift;
- my $d = shift;
+ my ($ndr,$d) = @_;
return $d;
}
sub ParseFunction($$$)
{
- my $ndr = shift;
- my $d = shift;
- my $opnum = shift;
+ my ($ndr,$d,$opnum) = @_;
my @elements = ();
my $rettype = undef;
my $thisopnum = undef;
- CheckPointerTypes($d,
- $ndr->{PROPERTIES}->{pointer_default_top}
- );
+ CheckPointerTypes($d, $ndr->{PROPERTIES}->{pointer_default_top});
if (not defined($d->{PROPERTIES}{noopnum})) {
$thisopnum = ${$opnum};
@@ -534,9 +512,7 @@ sub Parse($)
my $idl = shift;
my @ndr = ();
- foreach my $x (@{$idl}) {
- push @ndr, ParseInterface($x);
- }
+ push(@ndr, ParseInterface($_)) foreach (@{$idl});
return \@ndr;
}
@@ -558,8 +534,7 @@ sub GetNextLevel($$)
sub GetPrevLevel($$)
{
- my $e = shift;
- my $fl = shift;
+ my ($e,$fl) = @_;
my $prev = undef;
foreach my $l (@{$e->{LEVELS}}) {
@@ -572,8 +547,7 @@ sub GetPrevLevel($$)
sub ContainsDeferred($$)
{
- my $e = shift;
- my $l = shift;
+ my ($e,$l) = @_;
do {
return 1 if ($l->{IS_DEFERRED});