From 0dd7f645a4d6a1c7cc6a5fb1f82d12546dd5a40c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 20 Feb 2005 21:45:51 +0000 Subject: [PATCH] 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(-) diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm index 185067e526f..da2086e765c 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 514421e6907..eedbb91d4ec 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 66a8a41dd2d..f1ece68d8d4 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(); -- 2.11.4.GIT