summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-19 10:41:52 +0100
committerGünther Deschner <gd@samba.org>2015-07-07 14:05:28 +0200
commit856c9aa503877251313885b6192286ce9b7d5059 (patch)
treeb6995a98cdeab2b4d51258538a1d4aa16e73bf5d /pidl
parent16952dc7a420d2e3b4994229171580f1608d020d (diff)
downloadsamba-856c9aa503877251313885b6192286ce9b7d5059.tar.gz
pidl:Samba3/ServerNDR: add pidl_reset() and pidl_return() helper functions
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm7
1 files 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;