summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/NDR
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-08-15 06:08:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:51 -0500
commit645e87281c78f944fd6fe2ae52c6e0f058c665ff (patch)
tree507d531b6432c5123a043925bad7925d2ee86a23 /source4/pidl/lib/Parse/Pidl/Samba4/NDR
parent2b3161d8de92528be192f593256e97ec9658f88b (diff)
downloadsamba-645e87281c78f944fd6fe2ae52c6e0f058c665ff.tar.gz
samba-645e87281c78f944fd6fe2ae52c6e0f058c665ff.tar.bz2
samba-645e87281c78f944fd6fe2ae52c6e0f058c665ff.zip
r24446: We only need one genric GenerateFunctionInEnv
function metze (This used to be commit 0c5be644ba13c68b7378a6ae9dcd314018ece25d)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index b65df06884..73ff28eed0 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -243,30 +243,34 @@ sub EnvSubstituteValue($$)
return $env;
}
-sub GenerateFunctionInEnv($)
+sub GenerateFunctionInEnv($;$)
{
- my $fn = shift;
+ my ($fn, $base) = @_;
my %env;
+ $base = "r->" unless defined($base);
+
foreach my $e (@{$fn->{ELEMENTS}}) {
if (grep (/in/, @{$e->{DIRECTION}})) {
- $env{$e->{NAME}} = "r->in.$e->{NAME}";
+ $env{$e->{NAME}} = $base."in.$e->{NAME}";
}
}
return \%env;
}
-sub GenerateFunctionOutEnv($)
+sub GenerateFunctionOutEnv($;$)
{
- my $fn = shift;
+ my ($fn, $base) = @_;
my %env;
+ $base = "r->" unless defined($base);
+
foreach my $e (@{$fn->{ELEMENTS}}) {
if (grep (/out/, @{$e->{DIRECTION}})) {
- $env{$e->{NAME}} = "r->out.$e->{NAME}";
+ $env{$e->{NAME}} = $base."out.$e->{NAME}";
} elsif (grep (/in/, @{$e->{DIRECTION}})) {
- $env{$e->{NAME}} = "r->in.$e->{NAME}";
+ $env{$e->{NAME}} = $base."in.$e->{NAME}";
}
}