From e87adacc43eb1f68d0d32b03ced62ae0caabebc9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Aug 2007 10:54:11 +0000 Subject: r24484: pass down $ndr tree instead of the $pidl tree to Samba4/Header.pm metze (This used to be commit 212e8ec8d51b75fdfed5ae1ea228133811186a72) --- source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 25 +++++++++++-------------- source4/pidl/pidl | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'source4/pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 3cf86f769e..650b6f51ab 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -351,17 +351,16 @@ sub HeaderInterface($) pidl "#ifndef _HEADER_$interface->{NAME}\n"; pidl "#define _HEADER_$interface->{NAME}\n\n"; - foreach my $d (@{$interface->{DATA}}) { - next if ($d->{TYPE} ne "CONST"); + foreach my $d (@{$interface->{CONSTS}}) { HeaderConst($d); } - foreach my $d (@{$interface->{DATA}}) { - HeaderTypedef($d) if ($d->{TYPE} eq "TYPEDEF"); - HeaderStruct($d, $d->{NAME}) if ($d->{TYPE} eq "STRUCT"); - HeaderUnion($d, $d->{NAME}) if ($d->{TYPE} eq "UNION"); - HeaderEnum($d, $d->{NAME}) if ($d->{TYPE} eq "ENUM"); - HeaderBitmap($d, $d->{NAME}) if ($d->{TYPE} eq "BITMAP"); + foreach my $d (@{$interface->{TYPES}}) { + HeaderTypedef($d->{ORIGINAL}) if ($d->{TYPE} eq "TYPEDEF"); + HeaderStruct($d->{ORIGINAL}, $d->{NAME}) if ($d->{TYPE} eq "STRUCT"); + HeaderUnion($d->{ORIGINAL}, $d->{NAME}) if ($d->{TYPE} eq "UNION"); + HeaderEnum($d->{ORIGINAL}, $d->{NAME}) if ($d->{TYPE} eq "ENUM"); + HeaderBitmap($d->{ORIGINAL}, $d->{NAME}) if ($d->{TYPE} eq "BITMAP"); pidl ";\n\n" if ($d->{TYPE} eq "BITMAP" or $d->{TYPE} eq "STRUCT" or $d->{TYPE} eq "TYPEDEF" or @@ -369,10 +368,8 @@ sub HeaderInterface($) $d->{TYPE} eq "ENUM"); } - foreach my $d (@{$interface->{DATA}}) { - next if ($d->{TYPE} ne "FUNCTION"); - - HeaderFunction($d); + foreach my $d (@{$interface->{FUNCTIONS}}) { + HeaderFunction($d->{ORIGINAL}); } pidl "#endif /* _HEADER_$interface->{NAME} */\n"; @@ -382,7 +379,7 @@ sub HeaderInterface($) # parse a parsed IDL into a C header sub Parse($) { - my($idl) = shift; + my($ndr) = shift; $tab_depth = 0; $res = ""; @@ -394,7 +391,7 @@ sub Parse($) pidl "#include \n"; pidl "\n"; - foreach (@{$idl}) { + foreach (@{$ndr}) { ($_->{TYPE} eq "INTERFACE") && HeaderInterface($_); ($_->{TYPE} eq "IMPORT") && HeaderImport(@{$_->{PATHS}}); ($_->{TYPE} eq "INCLUDE") && HeaderInclude(@{$_->{PATHS}}); diff --git a/source4/pidl/pidl b/source4/pidl/pidl index 5ce9b0f004..108292b790 100755 --- a/source4/pidl/pidl +++ b/source4/pidl/pidl @@ -619,7 +619,7 @@ sub process_file($) my $gen_header = ($opt_header or "$outputdir/$basename.h"); if (defined($opt_header)) { require Parse::Pidl::Samba4::Header; - FileSave($gen_header, Parse::Pidl::Samba4::Header::Parse($pidl)); + FileSave($gen_header, Parse::Pidl::Samba4::Header::Parse($ndr)); } my $h_filename = "$outputdir/ndr_$basename.h"; -- cgit