diff options
Diffstat (limited to 'source4/build/pidl')
-rw-r--r-- | source4/build/pidl/TODO | 4 | ||||
-rw-r--r-- | source4/build/pidl/ndr_header.pm | 6 | ||||
-rw-r--r-- | source4/build/pidl/ndr_parser.pm | 30 |
3 files changed, 27 insertions, 13 deletions
diff --git a/source4/build/pidl/TODO b/source4/build/pidl/TODO index d51bd83b04..00f875e00d 100644 --- a/source4/build/pidl/TODO +++ b/source4/build/pidl/TODO @@ -1,7 +1,3 @@ -Implement: - ndr_parser.pm: - - if [charset()] specified, use instead of the for loops (call ndr_pu{ll,sh}_charset() - - True multiple dimension array / strings in arrays support (closely related to things specified above) diff --git a/source4/build/pidl/ndr_header.pm b/source4/build/pidl/ndr_header.pm index 04cd57ad7f..6269320115 100644 --- a/source4/build/pidl/ndr_header.pm +++ b/source4/build/pidl/ndr_header.pm @@ -213,7 +213,11 @@ sub HeaderType($$$) return; } - pidl typelist::mapType($e->{TYPE}); + if (util::has_property($e, "charset")) { + pidl "char"; + } else { + pidl typelist::mapType($e->{TYPE}); + } } ##################################################################### diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm index 4eab424c75..dc3635f6e4 100644 --- a/source4/build/pidl/ndr_parser.pm +++ b/source4/build/pidl/ndr_parser.pm @@ -550,7 +550,11 @@ sub ParseElementPushLevel my $nl = Ndr::GetNextLevel($e, $l); - pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));"; + if (util::has_property($e, "charset")) { + pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), $e->{PROPERTIES}->{charset}));"; + } else { + pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));"; + } return; } } elsif ($l->{TYPE} eq "SWITCH") { @@ -688,8 +692,12 @@ sub ParseElementPrint($$$) } if (is_scalar_array($e, $l)) { - my $nl = Ndr::GetNextLevel($e, $l); - pidl "ndr_print_array_$nl->{DATA_TYPE}(ndr, \"$e->{NAME}\", $var_name, $length);"; + if (util::has_property($e, "charset")) { + pidl "ndr_print_string(ndr, \"$e->{NAME}\", $var_name);"; + } else { + my $nl = Ndr::GetNextLevel($e, $l); + pidl "ndr_print_array_$nl->{DATA_TYPE}(ndr, \"$e->{NAME}\", $var_name, $length);"; + } last; } @@ -844,10 +852,14 @@ sub ParseElementPullLevel } my $nl = Ndr::GetNextLevel($e, $l); - pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));"; - if ($l->{IS_ZERO_TERMINATED}) { - # Make sure last element is zero! - pidl "NDR_CHECK(ndr_check_string_terminator($ndr, $var_name, ndr_get_array_length(ndr, " . get_pointer_to($var_name) . "), sizeof(*$var_name)));"; + if (util::has_property($e, "charset")) { + pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), $e->{PROPERTIES}->{charset}));"; + } else { + pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));"; + if ($l->{IS_ZERO_TERMINATED}) { + # Make sure last element is zero! + pidl "NDR_CHECK(ndr_check_string_terminator($ndr, $var_name, $length, sizeof(*$var_name)));"; + } } return; } @@ -901,7 +913,7 @@ sub ParseElementPullLevel if ($l->{IS_ZERO_TERMINATED}) { # Make sure last element is zero! - pidl "NDR_CHECK(ndr_check_string_terminator($ndr, $var_name, ndr_get_array_length(ndr, " . get_pointer_to($var_name) . "), sizeof(*$var_name)));"; + pidl "NDR_CHECK(ndr_check_string_terminator($ndr, $var_name, $length, sizeof(*$var_name)));"; } } @@ -1867,6 +1879,8 @@ sub AllocateArrayLevel($$$$$) { my ($e,$l,$ndr,$env,$size) = @_; + return if (util::has_property($e, "charset")); + my $var = ParseExpr($e->{NAME}, $env); check_null_pointer($size); |