summaryrefslogtreecommitdiff
path: root/source4/build/pidl/eth_parser.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-05-27 14:01:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:07 -0500
commitaba7014e41b120e8c4bac5d5dab91655b46a2175 (patch)
tree0475f32f8cd5ee498f9863ac1687864048fbd0a7 /source4/build/pidl/eth_parser.pm
parent49791818610cecd877eb5b865cb6cefa90e92ba0 (diff)
downloadsamba-aba7014e41b120e8c4bac5d5dab91655b46a2175.tar.gz
samba-aba7014e41b120e8c4bac5d5dab91655b46a2175.tar.bz2
samba-aba7014e41b120e8c4bac5d5dab91655b46a2175.zip
r7022: Add support for parsing definitions of multi-dimension arrays.
This will also be required for supporting parsing pointers to arrays and arrays of pointers simultaneously. (This used to be commit a34f848b02a6e8284d62532a792a5136e846fe8f)
Diffstat (limited to 'source4/build/pidl/eth_parser.pm')
-rw-r--r--source4/build/pidl/eth_parser.pm80
1 files changed, 13 insertions, 67 deletions
diff --git a/source4/build/pidl/eth_parser.pm b/source4/build/pidl/eth_parser.pm
index a2e1bf051c..d0a4ae7c66 100644
--- a/source4/build/pidl/eth_parser.pm
+++ b/source4/build/pidl/eth_parser.pm
@@ -29,43 +29,19 @@ sub NeededFunction($$)
}
# for Ethereal
- if (Ndr::is_scalar_type($e->{TYPE})) {
-
- if (defined($e->{ARRAY_LEN}) or
- util::has_property($e, "size_is")) {
-
- # Array of scalar types
-
- $needed->{"hf_$fn->{NAME}_$e->{NAME}_array"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => "FT_BYTES",
- 'base' => elementbase($e)
- };
-
- } else {
- $needed->{"hf_$fn->{NAME}_$e->{NAME}"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => type2ft($e->{TYPE}),
- 'base' => elementbase($e)
- };
- }
- } else {
- $needed->{"hf_$fn->{NAME}_$e->{NAME}"} = {
+ $needed->{"hf_$fn->{NAME}_$e->{NAME}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft' => type2ft($e->{TYPE}),
'base' => elementbase($e)
- };
- $needed->{"hf_$e->{TYPE}"} = {
+ };
+ $needed->{"hf_$e->{TYPE}"} = {
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft' => type2ft($e->{TYPE}),
'base' => elementbase($e)
- };
- $needed->{"ett_$e->{TYPE}"} = 1;
- }
+ };
+ $needed->{"ett_$e->{TYPE}"} = 1;
}
# Add entry for return value
@@ -97,43 +73,13 @@ sub NeededTypedef($$)
$needed->{"pull_$e->{TYPE}"} = 1;
}
- if (Ndr::is_scalar_type($e->{TYPE})) {
- if (defined($e->{ARRAY_LEN}) or
- util::has_property($e, "size_is")) {
-
- # Arrays of scalar types are FT_BYTES
-
- $needed->{"hf_$t->{NAME}_$e->{NAME}_array"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => "FT_BYTES",
- 'base' => elementbase($e)
- };
-
- } else {
- $needed->{"hf_$t->{NAME}_$e->{NAME}"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => type2ft($e->{TYPE}),
- 'base' => elementbase($e)
- };
- }
-
- $e->{PARENT} = $t->{DATA};
-
- if ($needed->{"pull_$t->{NAME}"}) {
- $needed->{"pull_$e->{TYPE}"} = 1;
- }
-
- } else {
- $needed->{"hf_$t->{NAME}_$e->{NAME}"} = {
- 'name' => field2name($e->{NAME}),
- 'type' => $e->{TYPE},
- 'ft' => type2ft($e->{TYPE}),
- 'base' => elementbase($e)
- };
- $needed->{"ett_$e->{TYPE}"} = 1;
- }
+ $needed->{"hf_$t->{NAME}_$e->{NAME}"} = {
+ 'name' => field2name($e->{NAME}),
+ 'type' => $e->{TYPE},
+ 'ft' => type2ft($e->{TYPE}),
+ 'base' => elementbase($e)
+ };
+ $needed->{"ett_$e->{TYPE}"} = 1;
}
}
@@ -1319,7 +1265,7 @@ sub RegisterInterfaceHandoff($)
indent;
pidl "dcerpc_init_uuid(proto_dcerpc_pidl_$x->{NAME}, ett_dcerpc_$x->{NAME},";
pidl "\t&uuid_dcerpc_$x->{NAME}, ver_dcerpc_$x->{NAME},";
- pidl "\tdcerpc_dissectors, hf_opnum);";
+ pidl "\tdcerpc_dissectors, hf_$x->{NAME}_opnum);";
deindent;
pidl "}";
}