summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-24 01:03:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:08 -0500
commitb6cae24de839756db87a62213795856c0051b8b9 (patch)
tree2020f5b9f45acf2b0208db86e833e2bd158be576 /source4/pidl/lib/Parse/Pidl
parent311d6f47c85282925932b3a7326e66679be9451f (diff)
downloadsamba-b6cae24de839756db87a62213795856c0051b8b9.tar.gz
samba-b6cae24de839756db87a62213795856c0051b8b9.tar.bz2
samba-b6cae24de839756db87a62213795856c0051b8b9.zip
r14687: Start working on support for represent_as() and transmit_as() as
an alternative to subcontext() (This used to be commit 744402160d5f994f5440553bb726e95a13033a83)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm23
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm1
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm15
3 files changed, 35 insertions, 4 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index a709abba10..1d5059bfb5 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -2,7 +2,7 @@
# Samba4 NDR info tree generator
# Copyright tridge@samba.org 2000-2003
# Copyright tpot@samba.org 2001
-# Copyright jelmer@samba.org 2004-2005
+# Copyright jelmer@samba.org 2004-2006
# released under the GNU GPL
=pod
@@ -258,6 +258,8 @@ sub GetElementLevelTable($)
push (@$order, {
TYPE => "DATA",
+ CONVERT_TO => has_property($e, ""),
+ CONVERT_FROM => has_property($e, ""),
DATA_TYPE => $e->{TYPE},
IS_DEFERRED => $is_deferred,
CONTAINS_DEFERRED => can_contain_deferred($e),
@@ -319,8 +321,8 @@ sub find_largest_alignment($)
$a = 4;
} elsif (has_property($e, "subcontext")) {
$a = 1;
- } elsif (has_property($e, "represent_as")) {
- $a = align_type($e->{PROPERTIES}->{represent_as});
+ } elsif (has_property($e, "transmit_as")) {
+ $a = align_type($e->{PROPERTIES}->{transmit_as});
} else {
$a = align_type($e->{TYPE});
}
@@ -368,6 +370,7 @@ sub ParseElement($)
TYPE => $e->{TYPE},
PROPERTIES => $e->{PROPERTIES},
LEVELS => GetElementLevelTable($e),
+ REPRESENTATION_TYPE => $e->{PROPERTIES}->{represent_as},
ALIGN => align_type($e->{TYPE}),
ORIGINAL => $e
};
@@ -796,6 +799,7 @@ my %property_list = (
"default" => ["ELEMENT"],
"represent_as" => ["ELEMENT"],
+ "transmit_as" => ["ELEMENT"],
# subcontext
"subcontext" => ["ELEMENT"],
@@ -900,6 +904,19 @@ sub ValidElement($)
}
}
+
+ if (has_property($e, "subcontext") and has_property($e, "represent_as")) {
+ fatal($e, el_name($e) . " : subcontext() and represent_as() can not be used on the same element");
+ }
+
+ if (has_property($e, "subcontext") and has_property($e, "transmit_as")) {
+ fatal($e, el_name($e) . " : subcontext() and transmit_as() can not be used on the same element");
+ }
+
+ if (has_property($e, "represent_as") and has_property($e, "transmit_as")) {
+ fatal($e, el_name($e) . " : represent_as() and transmit_as() can not be used on the same element");
+ }
+
if (defined (has_property($e, "subcontext_size")) and not defined(has_property($e, "subcontext"))) {
fatal($e, el_name($e) . " : subcontext_size() on non-subcontext element");
}
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
index f19f4df319..ace1e79672 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
@@ -1,6 +1,7 @@
###################################################
# client calls generator
# Copyright tridge@samba.org 2003
+# Copyright jelmer@samba.org 2005-2006
# released under the GNU GPL
package Parse::Pidl::Samba4::NDR::Client;
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index bc7e4ce545..81e30e1053 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2,7 +2,7 @@
# Samba4 NDR parser generator for IDL structures
# Copyright tridge@samba.org 2000-2003
# Copyright tpot@samba.org 2001
-# Copyright jelmer@samba.org 2004-2005
+# Copyright jelmer@samba.org 2004-2006
# released under the GNU GPL
package Parse::Pidl::Samba4::NDR::Parser;
@@ -674,6 +674,12 @@ sub ParseElementPush($$$$$$)
return unless $primitives or ($deferred and ContainsDeferred($e, $e->{LEVELS}[0]));
+ # 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));";
+ }
+
start_flags($e);
if (my $value = has_property($e, "value")) {
@@ -683,6 +689,7 @@ sub ParseElementPush($$$$$$)
ParseElementPushLevel($e, $e->{LEVELS}[0], $ndr, $var_name, $env, $primitives, $deferred);
end_flags($e);
+
}
#####################################################################
@@ -1067,6 +1074,12 @@ sub ParseElementPull($$$$$$)
ParseElementPullLevel($e,$e->{LEVELS}[0],$ndr,$var_name,$env,$primitives,$deferred);
end_flags($e);
+
+ # 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));";
+ }
}
#####################################################################