From: Stefan Metzmacher Date: Tue, 21 Sep 2010 00:20:14 +0000 (+0200) Subject: pidl/NDR: add ContainsPipe() function X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=commitdiff_plain;h=eaa7ecdda7938e12db94f5ecbb978e5e7bca5f16 pidl/NDR: add ContainsPipe() function metze --- diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index 5ade5c175a1..7b1e0078311 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;