summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-09-13 09:06:50 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-10-26 11:20:19 +0200
commitd5e4707e98f3613acebb9d0de7e6f944f0b1efaf (patch)
tree94503d261eaba9a0aee515da653fd572f4c37a9d /pidl
parent36385711f7a891a3d24db6ff8b594a43ff071f8b (diff)
downloadsamba-d5e4707e98f3613acebb9d0de7e6f944f0b1efaf.tar.gz
pidl:NDR: add ReturnTypeElement() helper function
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/NDR.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm
index 2e48c2a70b3..4659e312691 100644
--- a/pidl/lib/Parse/Pidl/NDR.pm
+++ b/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) = @_;