diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-06-17 16:29:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:23 -0500 |
commit | cd39847e815bea73b6bcae63541dd36b1715aa6c (patch) | |
tree | 8d32a9a57ec3b27282f5042a9b570c9d7348d805 /source4/build/pidl/ndr.pm | |
parent | 5b19286df08d6cf10654d6e20c323ba44f7d2054 (diff) | |
download | samba-cd39847e815bea73b6bcae63541dd36b1715aa6c.tar.gz samba-cd39847e815bea73b6bcae63541dd36b1715aa6c.tar.bz2 samba-cd39847e815bea73b6bcae63541dd36b1715aa6c.zip |
r7695: Add support for the [string] attribute that works in the traditional sense. Not
used anywhere yet.
(This used to be commit a73a35cfc7b5b92cd95bd0d0fbd64d04acecccf3)
Diffstat (limited to 'source4/build/pidl/ndr.pm')
-rw-r--r-- | source4/build/pidl/ndr.pm | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm index 09e1d2efc1..f866a0ea8e 100644 --- a/source4/build/pidl/ndr.pm +++ b/source4/build/pidl/ndr.pm @@ -48,15 +48,20 @@ sub GetElementLevelTable($) my $is_surrounding = 0; my $is_varying = 0; my $is_conformant = 0; + my $is_string = 0; if ($d eq "*") { $is_conformant = 1; - unless ($size = shift @size_is) { + if ($size = shift @size_is) { + } elsif ((scalar(@size_is) == 0) and util::has_property($e, "string")) { + $is_string = 1; + delete($e->{PROPERTIES}->{string}); + } else { print "$e->{FILE}:$e->{LINE}: Must specify size_is() for conformant array!\n"; exit 1; } - if ($length = shift @length_is) { + if (($length = shift @length_is) or $is_string) { $is_varying = 1; } else { $length = $size; @@ -73,9 +78,8 @@ sub GetElementLevelTable($) SIZE_IS => $size, LENGTH_IS => $length, IS_DEFERRED => "$is_deferred", - # Inline arrays (which are a pidl extension) are never encoded - # as surrounding the struct they're part of IS_SURROUNDING => "$is_surrounding", + IS_ZERO_TERMINATED => "$is_string", IS_VARYING => "$is_varying", IS_CONFORMANT => "$is_conformant", IS_FIXED => (not $is_conformant and util::is_constant($size)), @@ -104,30 +108,43 @@ sub GetElementLevelTable($) # everything that follows will be deferred $is_deferred = 1 if ($e->{PARENT}->{TYPE} ne "FUNCTION"); - my $array_size; + my $array_size = shift @size_is; my $array_length; - if ($array_size = shift @size_is) { - my $is_varying = 0; + my $is_varying; + my $is_conformant; + my $is_string = 0; + if ($array_size) { + $is_conformant = 1; if ($array_length = shift @length_is) { $is_varying = 1; } else { $array_length = $array_size; + $is_varying =0; } + } + + if (scalar(@size_is) == 0 and util::has_property($e, "string")) { + $is_string = 1; + $is_varying = $is_conformant = util::has_property($e, "noheader")?0:1; + delete($e->{PROPERTIES}->{string}); + } + if ($array_size or $is_string) { push (@$order, { TYPE => "ARRAY", + IS_ZERO_TERMINATED => "$is_string", SIZE_IS => $array_size, LENGTH_IS => $array_length, IS_DEFERRED => "$is_deferred", IS_SURROUNDING => 0, IS_VARYING => "$is_varying", - IS_CONFORMANT => 1, + IS_CONFORMANT => "$is_conformant", IS_FIXED => 0, IS_INLINE => 0, }); $is_deferred = 0; - } + } } if (defined(util::has_property($e, "subcontext"))) { |