From 856c9aa503877251313885b6192286ce9b7d5059 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Mar 2014 10:41:52 +0100 Subject: [PATCH] pidl:Samba3/ServerNDR: add pidl_reset() and pidl_return() helper functions Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index 1bb0e3382bb..bae84af0671 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -24,6 +24,8 @@ $VERSION = '0.01'; my $res; my $res_hdr; my $tabs = ""; +sub pidl_reset() { $res=""; $res_hdr="", $tabs=""; } +sub pidl_return() { my $s = $res; my $h = $res_hdr; pidl_reset(); return ($s, $h) } sub indent() { $tabs.="\t"; } sub deindent() { $tabs = substr($tabs, 1); } sub pidl($) { my ($txt) = @_; $res .= $txt?$tabs.(shift)."\n":"\n"; } @@ -297,8 +299,7 @@ sub Parse($$$) { my($ndr,$header,$ndr_header) = @_; - $res = ""; - $res_hdr = ""; + pidl_reset(); pidl "/*"; pidl " * Unix SMB/CIFS implementation."; @@ -315,7 +316,7 @@ sub Parse($$$) ParseInterface($_) if ($_->{TYPE} eq "INTERFACE"); } - return ($res, $res_hdr); + return pidl_return(); } 1; -- 2.11.4.GIT