From eaa7ecdda7938e12db94f5ecbb978e5e7bca5f16 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Sep 2010 02:20:14 +0200 Subject: pidl/NDR: add ContainsPipe() function metze --- pidl/lib/Parse/Pidl/NDR.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'pidl/lib/Parse') diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index 5ade5c175a..7b1e007831 100644 --- a/pidl/lib/Parse/Pidl/NDR.pm +++ b/pidl/lib/Parse/Pidl/NDR.pm @@ -34,7 +34,7 @@ require Exporter; use vars qw($VERSION); $VERSION = '0.01'; @ISA = qw(Exporter); -@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsString); +@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsPipe ContainsString); @EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array); use strict; @@ -853,6 +853,20 @@ sub ContainsDeferred($$) return 0; } +sub ContainsPipe($$) +{ + my ($e,$l) = @_; + + return 1 if ($l->{TYPE} eq "PIPE"); + + while ($l = GetNextLevel($e,$l)) + { + return 1 if ($l->{TYPE} eq "PIPE"); + } + + return 0; +} + sub el_name($) { my $e = shift; -- cgit