summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-16 05:59:05 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-16 05:59:05 +0000
commit3d7524c7ae03f2f257c64a8b1f681b798055fff7 (patch)
tree89dbf546c1bf81eb3f62001e0a82136c39102d74 /source4
parent4d48e84ffa6ec206f4bd6872e1f642f5cebc37f3 (diff)
downloadsamba-3d7524c7ae03f2f257c64a8b1f681b798055fff7.tar.gz
samba-3d7524c7ae03f2f257c64a8b1f681b798055fff7.tar.bz2
samba-3d7524c7ae03f2f257c64a8b1f681b798055fff7.zip
added the "subcontext" attribute for auto-handling of user-marshalled
sub-context buffers (This used to be commit 01cc199d78da9e60aa8a279b37fbf8298cf61004)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/idl.gram1
-rw-r--r--source4/build/pidl/parser.pm12
2 files changed, 13 insertions, 0 deletions
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram
index e349a532ff..8cf35676f9 100644
--- a/source4/build/pidl/idl.gram
+++ b/source4/build/pidl/idl.gram
@@ -103,6 +103,7 @@ property: 'unique'
| 'struct_len'
| 'context_handle'
| 'string'
+ | 'subcontext'
| 'byte_count_pointer' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'size_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'length_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 99f3fdf4bb..8eb8ed4deb 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -291,6 +291,12 @@ sub ParseElementPullScalar($$$)
# no scalar component
} elsif (my $switch = util::has_property($e, "switch_is")) {
ParseElementPullSwitch($e, $var_prefix, $ndr_flags, $switch);
+ } elsif (util::has_property($e, "subcontext")) {
+ if (util::is_builtin_type($e->{TYPE})) {
+ $res .= "\tNDR_CHECK(ndr_pull_subcontext_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_fn_t) ndr_pull_$e->{TYPE}));\n";
+ } else {
+ $res .= "\tNDR_CHECK(ndr_pull_subcontext_flags_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_flags_fn_t) ndr_pull_$e->{TYPE}));\n";
+ }
} elsif (util::is_builtin_type($e->{TYPE})) {
$res .= "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $cprefix$var_prefix$e->{NAME}));\n";
} else {
@@ -391,6 +397,12 @@ sub ParseElementPullBuffer($$$)
} else {
ParseElementPullSwitch($e, $var_prefix, "NDR_BUFFERS", $switch);
}
+ } elsif (util::has_property($e, "subcontext")) {
+ if (util::is_builtin_type($e->{TYPE})) {
+ $res .= "\tNDR_CHECK(ndr_pull_subcontext_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_fn_t) ndr_pull_$e->{TYPE}));\n";
+ } else {
+ $res .= "\tNDR_CHECK(ndr_pull_subcontext_flags_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_flags_fn_t) ndr_pull_$e->{TYPE}));\n";
+ }
} elsif (util::is_builtin_type($e->{TYPE})) {
$res .= "\t\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $cprefix$var_prefix$e->{NAME}));\n";
} elsif ($e->{POINTERS}) {