$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);
my $is_string = 0;
my $is_fixed = 0;
my $is_inline = 0;
+ my $is_to_null = 0;
if ($d eq "*") {
$is_conformant = 1;
delete($e->{PROPERTIES}->{string});
}
+ if (has_property($e, "to_null")) {
+ $is_to_null = 1;
+ }
+
push (@$order, {
TYPE => "ARRAY",
SIZE_IS => $size,
IS_VARYING => $is_varying,
IS_CONFORMANT => $is_conformant,
IS_FIXED => $is_fixed,
- IS_INLINE => $is_inline
+ IS_INLINE => $is_inline,
+ IS_TO_NULL => $is_to_null
});
}
};
}
+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
};
}
if (property_matches($e, "flag", ".*STR_NULLTERM.*")) {
return 1;
}
+ if (exists($e->{LEVELS}) and $e->{LEVELS}->[0]->{TYPE} eq "ARRAY" and
+ ($e->{LEVELS}->[0]->{IS_FIXED} or $e->{LEVELS}->[0]->{IS_INLINE}) and
+ has_property($e, "charset"))
+ {
+ return 1;
+ }
+
foreach my $l (@{$e->{LEVELS}}) {
return 1 if ($l->{TYPE} eq "ARRAY" and $l->{IS_ZERO_TERMINATED});
}
+ if (property_matches($e, "charset", ".*DOS.*")) {
+ return 1;
+ }
return 0;
}
"noprint" => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP", "ELEMENT", "PIPE"],
"nopython" => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
"todo" => ["FUNCTION"],
+ "skip" => ["ELEMENT"],
+ "skip_noinit" => ["ELEMENT"],
# union
"switch_is" => ["ELEMENT"],
"noheader" => ["ELEMENT"],
"charset" => ["ELEMENT"],
"length_is" => ["ELEMENT"],
+ "to_null" => ["ELEMENT"],
);
#####################################################################