diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-08-25 11:12:16 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-08-28 10:59:20 +0200 |
commit | 831611e221d82b8074727fb8e948d0cbe3eb6f0a (patch) | |
tree | f2859ac5df39d00c4f4c32d1ccc9492c657b2fad | |
parent | 94faf0ccbe061681de0a529b5cfd61da10d5226a (diff) | |
download | samba-831611e221d82b8074727fb8e948d0cbe3eb6f0a.tar.gz samba-831611e221d82b8074727fb8e948d0cbe3eb6f0a.tar.bz2 samba-831611e221d82b8074727fb8e948d0cbe3eb6f0a.zip |
pidl:Samba4/NDR/Client: support argument based stubs for [in,out,string]
metze
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 9be7641799..bd2616a799 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -366,8 +366,20 @@ sub ParseOutputArgument($$$$$$) my $copy_len_var = "_copy_len_$e->{NAME}"; $self->pidl("size_t $copy_len_var;"); - unless (defined($l->{SIZE_IS})) { - fatal($e->{ORIGINAL}, "no size known for [out] array `$e->{NAME}'"); + if (not defined($l->{SIZE_IS})) { + if (not $l->{IS_ZERO_TERMINATED}) { + fatal($e->{ORIGINAL}, "no size known for [out] array `$e->{NAME}'"); + } + if (has_property($e, "charset")) { + $avail_len = "ndr_charset_length($in_var, CH_UNIX)"; + $needed_len = "ndr_charset_length($out_var, CH_UNIX)"; + } else { + $avail_len = "ndr_string_length($in_var, sizeof(*$in_var))"; + $needed_len = "ndr_string_length($out_var, sizeof(*$out_var))"; + } + $in_size_is = ""; + $out_size_is = ""; + $out_length_is = ""; } else { $in_size_is = ParseExpr($l->{SIZE_IS}, $in_env, $e->{ORIGINAL}); $out_size_is = ParseExpr($l->{SIZE_IS}, $out_env, $e->{ORIGINAL}); @@ -744,6 +756,9 @@ sub ParseFunction($$$) $e->{LEVELS}[1]->{DATA_TYPE} eq "string") { $reason = "is a pointer to type 'string'"; } elsif ($e->{LEVELS}[1]->{TYPE} eq "ARRAY" and + $e->{LEVELS}[1]->{IS_ZERO_TERMINATED}) { + next; + } elsif ($e->{LEVELS}[1]->{TYPE} eq "ARRAY" and not defined($e->{LEVELS}[1]->{SIZE_IS})) { $reason = "is a pointer to an unsized array"; } else { |