summaryrefslogtreecommitdiff
path: root/source4/build/pidl/header.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r--source4/build/pidl/header.pm49
1 files changed, 20 insertions, 29 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 33e7d56208..c49f60ce8b 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -103,8 +103,6 @@ sub HeaderEnum($$)
my($enum) = shift;
my($name) = shift;
- util::register_enum($enum, $name);
-
pidl "\nenum $name {\n";
$tab_depth++;
my $els = \@{$enum->{ELEMENTS}};
@@ -133,8 +131,6 @@ sub HeaderBitmap($$)
my($bitmap) = shift;
my($name) = shift;
- util::register_bitmap($bitmap, $name);
-
pidl "\n/* bitmap $name */\n";
my $els = \@{$bitmap->{ELEMENTS}};
@@ -188,32 +184,27 @@ sub HeaderType($$$)
HeaderUnion($data, $name);
return;
}
+
+ my $dt = $NdrParser::typedefs{$e->{TYPE}}->{DATA};
+
if ($data =~ "string") {
pidl "const char *";
- } elsif (util::is_enum($e->{TYPE})) {
- pidl "enum $data";
- } elsif (util::is_bitmap($e->{TYPE})) {
- my $bitmap = util::get_bitmap($e->{TYPE});
- pidl util::bitmap_type_decl($bitmap);
- } elsif (NdrParser::is_scalar_type($data)) {
- pidl util::map_type($data);
- } elsif (util::has_property($e, "switch_is")) {
- pidl "union $data";
- } else {
+ } elsif (not defined($dt->{TYPE})) {
pidl "struct $data";
- }
-}
-
-#####################################################################
-# parse a declare
-sub HeaderDeclare($)
-{
- my($declare) = shift;
-
- if ($declare->{DATA}->{TYPE} eq "ENUM") {
- util::register_enum($declare, $declare->{NAME});
- } elsif ($declare->{DATA}->{TYPE} eq "BITMAP") {
- util::register_bitmap($declare, $declare->{NAME});
+ } else {
+ if ($dt->{TYPE} eq "ENUM") {
+ pidl "enum $data";
+ } elsif ($dt->{TYPE} eq "BITMAP") {
+ pidl util::bitmap_type_decl($dt);
+ } elsif ($dt->{TYPE} eq "SCALAR") {
+ pidl util::map_type($data);
+ } elsif ($dt->{TYPE} eq "UNION") {
+ pidl "union $data";
+ } elsif ($dt->{TYPE} eq "STRUCT") {
+ pidl "struct $data";
+ } else {
+ print "Unknown data type type $dt->{TYPE}\n";
+ }
}
}
@@ -471,8 +462,6 @@ sub HeaderInterface($)
foreach my $d (@{$data}) {
($d->{TYPE} eq "CONST") &&
HeaderConst($d);
- ($d->{TYPE} eq "DECLARE") &&
- HeaderDeclare($d);
($d->{TYPE} eq "TYPEDEF") &&
HeaderTypedef($d);
($d->{TYPE} eq "TYPEDEF") &&
@@ -496,6 +485,8 @@ sub Parse($)
my($idl) = shift;
$tab_depth = 0;
+ NdrParser::Load($idl);
+
$res = "";
pidl "/* header auto-generated by pidl */\n\n";
foreach my $x (@{$idl}) {