summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-08-16 10:54:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:57 -0500
commite87adacc43eb1f68d0d32b03ced62ae0caabebc9 (patch)
tree32a70fc4e480b812230304c9a9d9518cf48cce21 /source4/pidl/lib/Parse
parent01e911ff5b30f8284ce2cf7253e85d698c8d875d (diff)
downloadsamba-e87adacc43eb1f68d0d32b03ced62ae0caabebc9.tar.gz
samba-e87adacc43eb1f68d0d32b03ced62ae0caabebc9.tar.bz2
samba-e87adacc43eb1f68d0d32b03ced62ae0caabebc9.zip
r24484: pass down $ndr tree instead of the $pidl tree to Samba4/Header.pm
metze (This used to be commit 212e8ec8d51b75fdfed5ae1ea228133811186a72)
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm25
1 files changed, 11 insertions, 14 deletions
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 <stdint.h>\n";
pidl "\n";
- foreach (@{$idl}) {
+ foreach (@{$ndr}) {
($_->{TYPE} eq "INTERFACE") && HeaderInterface($_);
($_->{TYPE} eq "IMPORT") && HeaderImport(@{$_->{PATHS}});
($_->{TYPE} eq "INCLUDE") && HeaderInclude(@{$_->{PATHS}});