diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-02-20 20:35:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:10:49 -0500 |
commit | 73477e05dec40e44f78a8673f79b627e904fd696 (patch) | |
tree | 4a97be690e5fb2ded0179012041d03a2dff4024f /source4/build/pidl/header.pm | |
parent | 595228c4c3a724e8ed257f78d48e24f6575cd366 (diff) | |
download | samba-73477e05dec40e44f78a8673f79b627e904fd696.tar.gz samba-73477e05dec40e44f78a8673f79b627e904fd696.tar.bz2 samba-73477e05dec40e44f78a8673f79b627e904fd696.zip |
r5475: Move some existing and new type information functions to typelist.pm
(This used to be commit 280df525380d06d67ce33938c4760807d5466966)
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r-- | source4/build/pidl/header.pm | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index efcd2dbb45..803916a79c 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -60,8 +60,7 @@ sub HeaderElement($) pidl tabs(); HeaderType($element, $element->{TYPE}, ""); pidl " "; - if ($element->{POINTERS} && - $element->{TYPE} ne "string") { + if ($element->{POINTERS} && $element->{TYPE} ne "string") { my($n) = $element->{POINTERS}; for (my($i)=$n; $i > 0; $i--) { pidl "*"; @@ -91,10 +90,10 @@ sub HeaderStruct($$) $tab_depth++; my $el_count=0; if (defined $struct->{ELEMENTS}) { - foreach my $e (@{$struct->{ELEMENTS}}) { - HeaderElement($e); - $el_count++; - } + foreach my $e (@{$struct->{ELEMENTS}}) { + HeaderElement($e); + $el_count++; + } } if ($el_count == 0) { # some compilers can't handle empty structures @@ -195,30 +194,7 @@ sub HeaderType($$$) return; } - my $dt; - if (my $t = typelist::getType($e->{TYPE})) { - $dt = $t->{DATA}; - } - - if ($data =~ "string") { - pidl "const char *"; - } elsif (not defined($dt->{TYPE})) { - pidl "struct $data"; - } 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"; - } - } + pidl typelist::mapType($e); } ##################################################################### @@ -334,7 +310,7 @@ sub HeaderFunction($) HeaderFunctionInOut($fn, "out"); if ($fn->{RETURN_TYPE} && $fn->{RETURN_TYPE} ne "void") { tabs(); - pidl util::map_type($fn->{RETURN_TYPE}) . " result;\n"; + pidl typelist::mapScalarType($fn->{RETURN_TYPE}) . " result;\n"; } $tab_depth--; tabs(); |