diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-02-11 15:49:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:44 -0500 |
commit | 3f68161741e5213d462b491612ba39c56c083f4b (patch) | |
tree | 35b1aac6c4b8c2aa29afb67f9ee14bd24a6fc944 /source4/build | |
parent | 4180eedd6d8a926d7a2f25b14b7a2cad084b44a9 (diff) | |
download | samba-3f68161741e5213d462b491612ba39c56c083f4b.tar.gz samba-3f68161741e5213d462b491612ba39c56c083f4b.tar.bz2 samba-3f68161741e5213d462b491612ba39c56c083f4b.zip |
r5338: More efforts to handle types similarly.
(This used to be commit 95c4f3149925ee71e74ea36fae3a65d2eebf717c)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/eparser.pm | 8 | ||||
-rw-r--r-- | source4/build/pidl/header.pm | 4 | ||||
-rw-r--r-- | source4/build/pidl/idl.pm | 8 | ||||
-rw-r--r-- | source4/build/pidl/idl.yp | 8 | ||||
-rw-r--r-- | source4/build/pidl/ndr.pm | 36 | ||||
-rw-r--r-- | source4/build/pidl/needed.pm | 2 | ||||
-rw-r--r-- | source4/build/pidl/validator.pm | 2 |
7 files changed, 35 insertions, 33 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index dd60ff7729..ee3dcf6158 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -165,7 +165,7 @@ sub NeededFunction($) # Add entries for function arguments - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { $e->{PARENT} = $fn; $needed{"pull_$e->{TYPE}"} = 1; @@ -280,17 +280,17 @@ sub NeededTypedef($) if ($t->{DATA}->{TYPE} eq "UNION") { - for my $e (@{$t->{DATA}->{DATA}}) { + for my $e (@{$t->{DATA}->{ELEMENTS}}) { $e->{PARENT} = $t->{DATA}; if ($e->{TYPE} eq "UNION_ELEMENT") { if ($needed{"pull_$t->{NAME}"}) { - $needed{"pull_$e->{DATA}->{TYPE}"} = 1; + $needed{"pull_$e->{ELEMENTS}->{TYPE}"} = 1; } - $needed{"ett_$e->{DATA}{TYPE}"} = 1; + $needed{"ett_$e->{ELEMENTS}{TYPE}"} = 1; } } diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index fa3e669242..5e60b5a687 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -293,7 +293,7 @@ sub HeaderFunctionInOut($$) my($fn) = shift; my($prop) = shift; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, $prop)) { HeaderElement($e); } @@ -311,7 +311,7 @@ sub HeaderFunctionInOut_needed($$) return 1; } - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, $prop)) { return 1; } diff --git a/source4/build/pidl/idl.pm b/source4/build/pidl/idl.pm index 99db357062..b18215ed34 100644 --- a/source4/build/pidl/idl.pm +++ b/source4/build/pidl/idl.pm @@ -1893,7 +1893,7 @@ sub "NAME" => $_[3], "RETURN_TYPE" => $_[2], "PROPERTIES" => $_[1], - "DATA" => $_[5] + "ELEMENTS" => $_[5] }} ], [#Rule 19 @@ -2385,17 +2385,17 @@ sub parse_idl($$) foreach my $x (@{$idl}) { # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that # for 'object' interfaces - if (defined($x->{PROPERTIES}->{object})) { + if (util::has_property($x, "object")) { foreach my $e (@{$x->{DATA}}) { if($e->{TYPE} eq "FUNCTION") { $e->{PROPERTIES}->{object} = 1; - unshift(@{$e->{DATA}}, + unshift(@{$e->{ELEMENTS}}, { 'NAME' => 'ORPCthis', 'POINTERS' => 0, 'PROPERTIES' => { 'in' => '1' }, 'TYPE' => 'ORPCTHIS' }); - unshift(@{$e->{DATA}}, + unshift(@{$e->{ELEMENTS}}, { 'NAME' => 'ORPCthat', 'POINTERS' => 0, 'PROPERTIES' => { 'out' => '1' }, diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index ae13c29543..4ee1703602 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -82,7 +82,7 @@ function: property_list type identifier '(' element_list2 ')' ';' "NAME" => $_[3], "RETURN_TYPE" => $_[2], "PROPERTIES" => $_[1], - "DATA" => $_[5] + "ELEMENTS" => $_[5] }} ; @@ -376,17 +376,17 @@ sub parse_idl($$) foreach my $x (@{$idl}) { # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that # for 'object' interfaces - if (defined($x->{PROPERTIES}->{object})) { + if (util::has_property($x, "object")) { foreach my $e (@{$x->{DATA}}) { if($e->{TYPE} eq "FUNCTION") { $e->{PROPERTIES}->{object} = 1; - unshift(@{$e->{DATA}}, + unshift(@{$e->{ELEMENTS}}, { 'NAME' => 'ORPCthis', 'POINTERS' => 0, 'PROPERTIES' => { 'in' => '1' }, 'TYPE' => 'ORPCTHIS' }); - unshift(@{$e->{DATA}}, + unshift(@{$e->{ELEMENTS}}, { 'NAME' => 'ORPCthat', 'POINTERS' => 0, 'PROPERTIES' => { 'out' => '1' }, diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm index 02fb46d51b..65881312df 100644 --- a/source4/build/pidl/ndr.pm +++ b/source4/build/pidl/ndr.pm @@ -177,7 +177,7 @@ sub find_sibling($$) } if ($fn->{TYPE} eq "FUNCTION") { - for my $e2 (@{$fn->{DATA}}) { + for my $e2 (@{$fn->{ELEMENTS}}) { if ($e2->{NAME} eq $name) { return $e2; } @@ -340,11 +340,12 @@ sub align_type } if (defined $typedefs{$e}) { - if ($typedefs{$e}->{DATA}->{TYPE} eq "STRUCT" or $typedefs{$e}->{DATA}->{TYPE} eq "UNION") { - return struct_alignment($typedefs{$e}->{DATA}); - } elsif ($typedefs{$e}->{DATA}->{TYPE} eq "ENUM") { + my $dt = $typedefs{$e}->{DATA}; + if ($dt->{TYPE} eq "STRUCT" or $dt->{TYPE} eq "UNION") { + return struct_alignment($dt); + } elsif ($dt->{TYPE} eq "ENUM") { return align_type(util::enum_type_fn(util::get_enum($e))); - } elsif ($typedefs{$e}->{DATA}->{TYPE} eq "BITMAP") { + } elsif ($dt->{TYPE} eq "BITMAP") { return align_type(util::bitmap_type_fn(util::get_bitmap($e))); } } @@ -975,7 +976,7 @@ sub ParseBitmapPull($) ##################################################################### # generate a print function for an bitmap -sub ParseBintmapPrintElement($$) +sub ParseBitmapPrintElement($$) { my($e) = shift; my($bitmap) = shift; @@ -1007,7 +1008,7 @@ sub ParseBitmapPrint($) pidl "\tndr->depth++;\n"; foreach my $e (@{$bitmap->{ELEMENTS}}) { - ParseBintmapPrintElement($e, $bitmap); + ParseBitmapPrintElement($e, $bitmap); } pidl "\tndr->depth--;\n"; @@ -1524,7 +1525,8 @@ sub ParseFunctionPrint($) pidl "\tif (flags & NDR_IN) {\n"; pidl "\t\tndr_print_struct(ndr, \"in\", \"$fn->{NAME}\");\n"; pidl "\tndr->depth++;\n"; - foreach my $e (@{$fn->{DATA}}) { + + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "in")) { ParseElementPrintScalar($e, "r->in."); } @@ -1535,7 +1537,7 @@ sub ParseFunctionPrint($) pidl "\tif (flags & NDR_OUT) {\n"; pidl "\t\tndr_print_struct(ndr, \"out\", \"$fn->{NAME}\");\n"; pidl "\tndr->depth++;\n"; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "out")) { ParseElementPrintScalar($e, "r->out."); } @@ -1589,7 +1591,7 @@ sub ParseFunctionPush($) pidl "\n\tif (!(flags & NDR_IN)) goto ndr_out;\n\n"; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "in")) { ParseFunctionElementPush($e, "in"); } @@ -1598,7 +1600,7 @@ sub ParseFunctionPush($) pidl "\nndr_out:\n"; pidl "\tif (!(flags & NDR_OUT)) goto done;\n\n"; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "out")) { ParseFunctionElementPush($e, "out"); } @@ -1694,7 +1696,7 @@ sub ParseFunctionPull($) pidl $static . "NTSTATUS ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)\n{\n"; # declare any internal pointers we need - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (need_wire_pointer($e)) { pidl "\tuint32_t _ptr_$e->{NAME};\n"; } @@ -1706,14 +1708,14 @@ sub ParseFunctionPull($) # this was a bad idea as it hides bugs, but coping correctly # with initialisation and not wiping ref vars is turning # out to be too tricky (tridge) - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "out")) { pidl "\tZERO_STRUCT(r->out);\n\n"; last; } } - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "in")) { ParseFunctionElementPull($e, "in"); } @@ -1724,7 +1726,7 @@ sub ParseFunctionPull($) } } - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "in")) { CheckArraySizes($e, "r->in."); } @@ -1733,13 +1735,13 @@ sub ParseFunctionPull($) pidl "\nndr_out:\n"; pidl "\tif (!(flags & NDR_OUT)) goto done;\n\n"; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "out")) { ParseFunctionElementPull($e, "out"); } } - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { if (util::has_property($e, "out")) { CheckArraySizes($e, "r->out."); } diff --git a/source4/build/pidl/needed.pm b/source4/build/pidl/needed.pm index b70cb28356..ae8bf7f078 100644 --- a/source4/build/pidl/needed.pm +++ b/source4/build/pidl/needed.pm @@ -16,7 +16,7 @@ sub NeededFunction($) my $fn = shift; $needed{"pull_$fn->{NAME}"} = 1; $needed{"push_$fn->{NAME}"} = 1; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { $e->{PARENT} = $fn; $needed{"pull_$e->{TYPE}"} = 1; $needed{"push_$e->{TYPE}"} = 1; diff --git a/source4/build/pidl/validator.pm b/source4/build/pidl/validator.pm index 775f9b46aa..818611ea46 100644 --- a/source4/build/pidl/validator.pm +++ b/source4/build/pidl/validator.pm @@ -110,7 +110,7 @@ sub ValidFunction($) { my($fn) = shift; - foreach my $e (@{$fn->{DATA}}) { + foreach my $e (@{$fn->{ELEMENTS}}) { $e->{PARENT} = $fn; if (util::has_property($e, "ref") && !$e->{POINTERS}) { fatal "[ref] variables must be pointers ($fn->{NAME}/$e->{NAME})\n"; |