1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r2183: Tidy up naming of ethereal fields. The field names are taken from the

structure elements with underscores replaced with spaces and words
capitalised.

Fix small buglet where we confuse the name of the interface with the name
of the idl file.

Just discovered security descriptors don't display property anymore.  )-:
(This used to be commit a6f830cfec)
This commit is contained in:
Tim Potter 2004-09-02 11:54:13 +00:00 committed by Gerald (Jerry) Carter
parent 3a899d9a92
commit c6dd8f9c9a

View File

@ -292,9 +292,9 @@ sub ParseArrayPull($$$)
}
if (util::is_scalar_type($e->{TYPE})) {
pidl "\t\tndr_pull_array_$e->{TYPE}(ndr, $ndr_flags, tree, \"$e->{NAME}\", hf_$e->{NAME}_$e->{TYPE}, $var_prefix$e->{NAME}, $size);\n";
pidl "\t\tndr_pull_array_$e->{TYPE}(ndr, $ndr_flags, tree, \"" . field2name($e->{NAME}) . "\", hf_$e->{NAME}_$e->{TYPE}, $var_prefix$e->{NAME}, $size);\n";
} else {
pidl "\t\tndr_pull_array(ndr, $ndr_flags, tree, \"$e->{NAME}\", (void **)$var_prefix$e->{NAME}, sizeof($var_prefix$e->{NAME}\[0]), $size, (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE});\n";
pidl "\t\tndr_pull_array(ndr, $ndr_flags, tree, \"" . field2name($e->{NAME}) . "\", (void **)$var_prefix$e->{NAME}, sizeof($var_prefix$e->{NAME}\[0]), $size, (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE});\n";
}
pidl "\t}\n";
@ -379,7 +379,7 @@ sub ParseElementPullScalar($$$)
} elsif (util::is_builtin_type($e->{TYPE})) {
pidl "\tndr_pull_$e->{TYPE}(ndr, tree, hf_$e->{NAME}_$e->{TYPE}, $cprefix$var_prefix$e->{NAME});\n";
} else {
pidl "\tndr_pull_$e->{TYPE}(ndr, $ndr_flags, get_subtree(tree, \"$e->{NAME}\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
pidl "\tndr_pull_$e->{TYPE}(ndr, $ndr_flags, get_subtree(tree, \"" . field2name($e->{NAME}) . "\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
}
end_flags($e);
@ -430,9 +430,9 @@ sub ParseElementPullBuffer($$$)
} elsif (util::is_builtin_type($e->{TYPE})) {
pidl "\t\tndr_pull_$e->{TYPE}(ndr, tree, hf_$e->{NAME}_$e->{TYPE}, $cprefix$var_prefix$e->{NAME});\n";
} elsif ($e->{POINTERS}) {
pidl "\t\tndr_pull_$e->{TYPE}(ndr, NDR_SCALARS|NDR_BUFFERS, get_subtree(tree, \"$e->{NAME}\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
pidl "\t\tndr_pull_$e->{TYPE}(ndr, NDR_SCALARS|NDR_BUFFERS, get_subtree(tree, \"" . field2name($e->{NAME}) . "\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
} else {
pidl "\t\tndr_pull_$e->{TYPE}(ndr, $ndr_flags, get_subtree(tree, \"$e->{NAME}\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
pidl "\t\tndr_pull_$e->{TYPE}(ndr, $ndr_flags, get_subtree(tree, \"" . field2name($e->{NAME}) . "\", ndr, ett_$e->{TYPE}), $cprefix$var_prefix$e->{NAME});\n";
}
if (util::need_wire_pointer($e)) {
@ -831,6 +831,19 @@ sub type2base($)
return "BASE_NONE";
}
# Convert a IDL structure field name (e.g access_mask) to a prettier
# string like 'Access Mask'.
sub field2name($)
{
my($field) = shift;
$field =~ s/_/ /g; # Replace underscores with spaces
$field =~ s/(\w+)/\u\L$1/g; # Capitalise each word
return $field;
}
sub NeededFunction($)
{
my $fn = shift;
@ -841,7 +854,7 @@ sub NeededFunction($)
if (util::is_scalar_type($e->{TYPE})) {
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => $e->{NAME},
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft' => type2ft($e->{TYPE}),
'base' => type2base($e->{TYPE})
@ -871,7 +884,7 @@ sub NeededTypedef($)
if (util::is_scalar_type($e->{TYPE})) {
$needed{"hf_$e->{NAME}_$e->{TYPE}"} = {
'name' => $e->{NAME},
'name' => field2name($e->{NAME}),
'type' => $e->{TYPE},
'ft' => type2ft($e->{TYPE}),
'base' => type2base($e->{TYPE})
@ -944,8 +957,6 @@ sub ParseHeader($$)
pidl "/* parser auto-generated by pidl */\n\n";
pidl "#include \"ndr_$module.h\"\n\n";
foreach my $x (@{$idl}) {
if ($x->{TYPE} eq "INTERFACE") {
foreach my $d (@{$x->{DATA}}) {