aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-09-24 18:33:56 -0700
committerGuy Harris <guy@alum.mit.edu>2017-09-25 01:34:49 +0000
commitf6d956cf92366e47470b63d366eb03ae26aa034a (patch)
treec1f1fcba99683cef23709b97e6d821d348fbb580
parent9ab7b538f0ccd2b1cd35689cff4c280e18a97e7d (diff)
pidl:NDR: add ReturnTypeElement() helper function
Pick up change from Samba: commit d5e4707e98f3613acebb9d0de7e6f944f0b1efaf Author: Stefan Metzmacher <metze@samba.org> Date: Tue Sep 13 09:06:50 2016 +0200 pidl:NDR: add ReturnTypeElement() helper function Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Change-Id: I3f4c8fb9b18ee10b031d9c58209d1c6c45bbec63 Reviewed-on: https://code.wireshark.org/review/23691 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--tools/pidl/lib/Parse/Pidl/NDR.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/NDR.pm b/tools/pidl/lib/Parse/Pidl/NDR.pm
index 2e48c2a70b..4659e31269 100644
--- a/tools/pidl/lib/Parse/Pidl/NDR.pm
+++ b/tools/pidl/lib/Parse/Pidl/NDR.pm
@@ -35,7 +35,7 @@ use vars qw($VERSION);
$VERSION = '0.01';
@ISA = qw(Exporter);
@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsPipe ContainsString);
-@EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
+@EXPORT_OK = qw(GetElementLevelTable ParseElement ReturnTypeElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
use strict;
use Parse::Pidl qw(warning fatal);
@@ -805,6 +805,25 @@ sub ParseFunction($$$$)
};
}
+sub ReturnTypeElement($)
+{
+ my ($fn) = @_;
+
+ return undef unless defined($fn->{RETURN_TYPE});
+
+ my $e = {
+ "NAME" => "result",
+ "TYPE" => $fn->{RETURN_TYPE},
+ "PROPERTIES" => undef,
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [],
+ "FILE" => $fn->{FILE},
+ "LINE" => $fn->{LINE},
+ };
+
+ return ParseElement($e, 0, 0);
+}
+
sub CheckPointerTypes($$)
{
my ($s,$default) = @_;