$VERSION = '0.01';
@ISA = qw(Exporter);
@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsPipe ContainsString);
-@EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
+@EXPORT_OK = qw(GetElementLevelTable ParseElement ReturnTypeElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
use strict;
use Parse::Pidl qw(warning fatal);
DATA_TYPE => $e->{TYPE},
IS_DEFERRED => $is_deferred,
CONTAINS_DEFERRED => can_contain_deferred($e->{TYPE}),
+ CONTAINS_NON_FIXED => can_contain_non_fixed($e->{TYPE}),
IS_SURROUNDING => 0 #FIXME
});
return 0;
}
+sub can_contain_non_fixed($)
+{
+ sub can_contain_non_fixed($);
+ my ($type) = @_;
+
+ return 1 if can_contain_deferred($type);
+
+ $type = getType($type);
+
+ return 0 if (is_fixed_size_scalar($type));
+
+ return can_contain_non_fixed($type->{DATA}) if ($type->{TYPE} eq "TYPEDEF");
+
+ return 0 unless defined($type->{ELEMENTS});
+
+ foreach (@{$type->{ELEMENTS}}) {
+ return 1 if ($_->{POINTERS});
+ return 1 if (can_contain_non_fixed ($_->{TYPE}));
+ }
+
+ return 0;
+}
sub pointer_type($)
{
my $e = shift;
};
}
+sub ReturnTypeElement($)
+{
+ my ($fn) = @_;
+
+ return undef unless defined($fn->{RETURN_TYPE});
+
+ my $e = {
+ "NAME" => "result",
+ "TYPE" => $fn->{RETURN_TYPE},
+ "PROPERTIES" => undef,
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [],
+ "FILE" => $fn->{FILE},
+ "LINE" => $fn->{LINE},
+ };
+
+ return ParseElement($e, 0, 0);
+}
+
sub CheckPointerTypes($$)
{
my ($s,$default) = @_;
FUNCTIONS => \@functions,
CONSTS => \@consts,
TYPES => \@types,
- ENDPOINTS => \@endpoints
+ ENDPOINTS => \@endpoints,
+ ORIGINAL => $idl
};
}
"nopython" => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
"todo" => ["FUNCTION"],
"skip" => ["ELEMENT"],
+ "skip_noinit" => ["ELEMENT"],
# union
"switch_is" => ["ELEMENT"],