summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Typelist.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-12-22 01:51:38 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-12-22 01:51:38 +0100
commit2c58c9497cb6a15d03626864585f0437949ee6f6 (patch)
tree85a267c746e06f3cde94dc91c12aa53e7ab08b4a /pidl/lib/Parse/Pidl/Typelist.pm
parent9a7c64f1dce7560c94df99c45eb5c75903cf0e6b (diff)
downloadsamba-2c58c9497cb6a15d03626864585f0437949ee6f6.tar.gz
samba-2c58c9497cb6a15d03626864585f0437949ee6f6.tar.bz2
samba-2c58c9497cb6a15d03626864585f0437949ee6f6.zip
Import types from other Python mechanisms using the Python import mechanism, to ensure they are initialized.
Diffstat (limited to 'pidl/lib/Parse/Pidl/Typelist.pm')
-rw-r--r--pidl/lib/Parse/Pidl/Typelist.pm23
1 files changed, 14 insertions, 9 deletions
diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm
index c5c458ac6b..0e3fd8de44 100644
--- a/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/pidl/lib/Parse/Pidl/Typelist.pm
@@ -177,6 +177,7 @@ sub RegisterScalars()
addType({
NAME => $_,
TYPE => "TYPEDEF",
+ BASEFILE => "<builtin>",
DATA => {
TYPE => "SCALAR",
NAME => $_
@@ -266,9 +267,10 @@ sub mapTypeName($)
return mapType($dt, $dt->{NAME});
}
-sub LoadIdl($)
+sub LoadIdl($;$)
{
- my ($idl) = @_;
+ my $idl = shift;
+ my $basename = shift;
foreach my $x (@{$idl}) {
next if $x->{TYPE} ne "INTERFACE";
@@ -277,16 +279,19 @@ sub LoadIdl($)
addType({
NAME => $x->{NAME},
TYPE => "TYPEDEF",
- DATA => $x
+ DATA => $x,
+ BASEFILE => $basename,
}) if (has_property($x, "object"));
foreach my $y (@{$x->{DATA}}) {
- addType($y) if (
- $y->{TYPE} eq "TYPEDEF"
- or $y->{TYPE} eq "UNION"
- or $y->{TYPE} eq "STRUCT"
- or $y->{TYPE} eq "ENUM"
- or $y->{TYPE} eq "BITMAP");
+ if ($y->{TYPE} eq "TYPEDEF"
+ or $y->{TYPE} eq "UNION"
+ or $y->{TYPE} eq "STRUCT"
+ or $y->{TYPE} eq "ENUM"
+ or $y->{TYPE} eq "BITMAP") {
+ $y->{BASEFILE} = $basename;
+ addType($y);
+ }
}
}
}