diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-02-13 12:38:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:48 -0500 |
commit | ff6e58a7c4da70880276aad482820b0d17be635b (patch) | |
tree | 7627c7bcd3c5ff08df8165ae4a00a0e930f35423 /source4/build/pidl/header.pm | |
parent | ffa5c91d0fd63c789bb7d73cb91f50841fb4f503 (diff) | |
download | samba-ff6e58a7c4da70880276aad482820b0d17be635b.tar.gz samba-ff6e58a7c4da70880276aad482820b0d17be635b.tar.bz2 samba-ff6e58a7c4da70880276aad482820b0d17be635b.zip |
r5376: ORPC is NDR specific, so move it to ndr.pm.
Get rid of register_enum/register_bitmap, etc. (use list of
types in ndr.pm instead)
(This used to be commit efc2e41b8df3a0171cca57291929fb63760c1662)
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r-- | source4/build/pidl/header.pm | 49 |
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}) { |