summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-24 11:42:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:08 -0500
commit85e91438b119f91cc0eb7da0992fadd5d2e47332 (patch)
tree912e705f48bdb00e18c0d48d1dfc5747a9e99e3e /source4/pidl/lib/Parse/Pidl/Samba4
parentb6cae24de839756db87a62213795856c0051b8b9 (diff)
downloadsamba-85e91438b119f91cc0eb7da0992fadd5d2e47332.tar.gz
samba-85e91438b119f91cc0eb7da0992fadd5d2e47332.tar.bz2
samba-85e91438b119f91cc0eb7da0992fadd5d2e47332.zip
r14688: More work on represent_as(): output the right function calls, fix test.
(This used to be commit 7bc72277b37f9d89f6a078e85c14d560fd33a3bb)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm30
1 files changed, 24 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 81e30e1053..feab825a3f 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -676,8 +676,12 @@ sub ParseElementPush($$$$$$)
# Representation type is different from transmit_as
if ($e->{REPRESENTATION_TYPE}) {
- pidl "/* FIXME: Convert from $e->{REPRESENTATION_TYPE} to $e->{TYPE} */";
- pidl "NDR_CHECK(ndr_$e->{REPRESENTATION_TYPE}_to_$e->{TYPE}(FIXME, FIXME));";
+ pidl "{";
+ indent;
+ my $transmit_name = "_transmit_$e->{NAME}";
+ pidl mapType($e->{TYPE}) ." $transmit_name;";
+ pidl "NDR_CHECK(ndr_$e->{REPRESENTATION_TYPE}_to_$e->{TYPE}($var_name, $transmit_name));";
+ $var_name = $transmit_name;
}
start_flags($e);
@@ -690,6 +694,10 @@ sub ParseElementPush($$$$$$)
end_flags($e);
+ if ($e->{REPRESENTATION_TYPE}) {
+ deindent;
+ pidl "}";
+ }
}
#####################################################################
@@ -1064,11 +1072,20 @@ sub ParseElementPull($$$$$$)
my($e,$ndr,$var_prefix,$env,$primitives,$deferred) = @_;
my $var_name = $var_prefix.$e->{NAME};
-
- $var_name = append_prefix($e, $var_name);
+ my $represent_name;
return unless $primitives or ($deferred and ContainsDeferred($e, $e->{LEVELS}[0]));
+ if ($e->{REPRESENTATION_TYPE}) {
+ pidl "{";
+ indent;
+ $represent_name = $var_name;
+ $var_name = "_transmit_$e->{NAME}";
+ pidl mapType($e->{TYPE})." $var_name;";
+ }
+
+ $var_name = append_prefix($e, $var_name);
+
start_flags($e);
ParseElementPullLevel($e,$e->{LEVELS}[0],$ndr,$var_name,$env,$primitives,$deferred);
@@ -1077,8 +1094,9 @@ sub ParseElementPull($$$$$$)
# Representation type is different from transmit_as
if ($e->{REPRESENTATION_TYPE}) {
- pidl "/* FIXME: Convert from $e->{TYPE} to $e->{REPRESENTATION_TYPE} */";
- pidl "NDR_CHECK(ndr_$e->{TYPE}_to_$e->{REPRESENTATION_TYPE}(FIXME, FIXME));";
+ pidl "NDR_CHECK(ndr_$e->{TYPE}_to_$e->{REPRESENTATION_TYPE}($var_name, $represent_name));";
+ deindent;
+ pidl "}";
}
}