diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-16 13:48:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-16 13:48:05 +0000 |
commit | c4b7585288095cb9459feb237a9581ba30b850d0 (patch) | |
tree | b6deb6afcad3981759012e2301633446e081724f /source4/build/pidl/parser.pm | |
parent | ea266c0625e04a2dc10d25c2fee7b685965fcd3e (diff) | |
download | samba-c4b7585288095cb9459feb237a9581ba30b850d0.tar.gz samba-c4b7585288095cb9459feb237a9581ba30b850d0.tar.bz2 samba-c4b7585288095cb9459feb237a9581ba30b850d0.zip |
* the beginnings of non-constant fixed arrays
* added relative pointers support
(This used to be commit 4a34a4f29cf8ab79582ce7b503da907df7b4d209)
Diffstat (limited to 'source4/build/pidl/parser.pm')
-rw-r--r-- | source4/build/pidl/parser.pm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index e341d9f216..6037fb3d89 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -198,7 +198,9 @@ sub ParseElementPushScalar($$$) my($ndr_flags) = shift; my $cprefix = util::c_push_prefix($e); - if (my $value = util::has_property($e, "value")) { + if (util::has_property($e, "relative")) { + $res .= "\tNDR_CHECK(ndr_push_relative(ndr, NDR_SCALARS, $var_prefix$e->{NAME}, (ndr_push_const_fn_t) ndr_push_$e->{TYPE}));\n"; + } elsif (my $value = util::has_property($e, "value")) { $res .= "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $value));\n"; } elsif (defined $e->{VALUE}) { $res .= "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $e->{VALUE}));\n"; @@ -301,7 +303,9 @@ sub ParseElementPullScalar($$$) my($ndr_flags) = shift; my $cprefix = util::c_pull_prefix($e); - if (defined $e->{VALUE}) { + if (util::has_property($e, "relative")) { + $res .= "\tNDR_CHECK(ndr_pull_relative(ndr, (const void **)&$var_prefix$e->{NAME}, sizeof(*$var_prefix$e->{NAME}), (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE}));\n"; + } elsif (defined $e->{VALUE}) { $res .= "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $e->{VALUE}));\n"; } elsif (util::need_wire_pointer($e)) { $res .= "\tNDR_CHECK(ndr_pull_uint32(ndr, &_ptr_$e->{NAME}));\n"; @@ -344,7 +348,9 @@ sub ParseElementPushBuffer($$$) $res .= "\tif ($var_prefix$e->{NAME}) {\n"; } - if (util::array_size($e)) { + if (util::has_property($e, "relative")) { + $res .= "\tNDR_CHECK(ndr_push_relative(ndr, NDR_BUFFERS, $cprefix$var_prefix$e->{NAME}, (ndr_push_const_fn_t) ndr_push_$e->{TYPE}));\n"; + } elsif (util::array_size($e)) { ParseArrayPush($e, "r->", "NDR_SCALARS|NDR_BUFFERS"); } elsif (my $switch = util::has_property($e, "switch_is")) { if ($e->{POINTERS}) { @@ -408,6 +414,10 @@ sub ParseElementPullBuffer($$$) return; } + if (util::has_property($e, "relative")) { + return; + } + if (util::need_wire_pointer($e)) { $res .= "\tif ($var_prefix$e->{NAME}) {\n"; } |