From 0dd7f645a4d6a1c7cc6a5fb1f82d12546dd5a40c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 20 Feb 2005 21:45:51 +0000 Subject: r5477: - Move some more of the typelist stuff out of ndr.pm - Remember INTERFACEs as well (they can be types in DCOM) (This used to be commit d914cd1804636eb1a34805d48c18e016835e973b) --- source4/build/pidl/ndr.pm | 1 - source4/build/pidl/pidl.pl | 5 +++++ source4/build/pidl/typelist.pm | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'source4/build/pidl') diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm index 185067e526..da2086e765 100644 --- a/source4/build/pidl/ndr.pm +++ b/source4/build/pidl/ndr.pm @@ -2092,7 +2092,6 @@ sub LoadInterface($) foreach my $d (@{$x->{DATA}}) { if (($d->{TYPE} eq "DECLARE") or ($d->{TYPE} eq "TYPEDEF")) { - typelist::addType($d); if ($d->{DATA}->{TYPE} eq "STRUCT" or $d->{DATA}->{TYPE} eq "UNION") { CheckPointerTypes($d->{DATA}, $x->{PROPERTIES}->{pointer_default}); } diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index 514421e690..eedbb91d4e 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -23,6 +23,7 @@ use stub; use ndr; use eparser; use validator; +use typelist; use util; use template; use swig; @@ -138,6 +139,10 @@ sub process_file($) print IdlDump::Dump($pidl); } + if ($opt_header || $opt_parser) { + typelist::LoadIdl($pidl); + } + if ($opt_header) { my($header) = util::ChangeExtension($output, ".h"); util::FileSave($header, IdlHeader::Parse($pidl)); diff --git a/source4/build/pidl/typelist.pm b/source4/build/pidl/typelist.pm index 66a8a41dd2..f1ece68d8d 100644 --- a/source4/build/pidl/typelist.pm +++ b/source4/build/pidl/typelist.pm @@ -132,6 +132,21 @@ sub mapType($) die("Unknown type $dt->{DATA}->{TYPE}"); } +sub LoadIdl($) +{ + my $idl = shift; + + foreach my $x (@{$idl}) { + next if $x->{TYPE} ne "INTERFACE"; + addType($x); + foreach my $y (@{$x->{DATA}}) { + addType($y) if ( + $y->{TYPE} eq "TYPEDEF" + or $y->{TYPE} eq "DECLARE"); + } + } +} + RegisterPrimitives(); -- cgit