1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-04 05:18:06 +03:00

r7729: Small fixes to the charset stuff.

(This used to be commit 5122b9f608)
This commit is contained in:
Jelmer Vernooij 2005-06-18 16:31:48 +00:00 committed by Gerald (Jerry) Carter
parent 0dde0612b4
commit 327a9ac650
4 changed files with 27 additions and 14 deletions

View File

@ -10,6 +10,12 @@ package Ndr;
use strict;
use pidl::typelist;
sub nonfatal($$)
{
my ($e,$s) = @_;
warn ("$e->{FILE}:$e->{LINE}: Warning: $s\n");
}
#####################################################################
# return a table describing the order in which the parts of an element
# should be parsed
@ -172,6 +178,19 @@ sub GetElementLevelTable($)
});
}
if (scalar(@size_is) > 0) {
nonfatal($e, "size_is() on non-array element");
}
if (scalar(@length_is) > 0) {
nonfatal($e, "length_is() on non-array element");
}
if (util::has_property($e, "string")) {
nonfatal($e, "string() attribute on non-array element");
}
push (@$order, {
TYPE => "DATA",
DATA_TYPE => $e->{TYPE},

View File

@ -529,7 +529,7 @@ sub ParseElementPushLevel
my $nl = Ndr::GetNextLevel($e, $l);
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}));";
pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
}
@ -831,7 +831,7 @@ sub ParseElementPullLevel
my $nl = Ndr::GetNextLevel($e, $l);
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}));";
pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
if ($l->{IS_ZERO_TERMINATED}) {

View File

@ -12,15 +12,13 @@ use strict;
# signal a fatal validation error
sub fatal($$)
{
my $pos = shift;
my $s = shift;
my ($pos,$s) = @_;
die("$pos->{FILE}:$pos->{LINE}:$s\n");
}
sub nonfatal($$)
{
my $pos = shift;
my $s = shift;
my ($pos,$s) = @_;
warn ("$pos->{FILE}:$pos->{LINE}:warning:$s\n");
}
@ -46,8 +44,7 @@ sub el_name($)
# find a sibling var in a structure
sub find_sibling($$)
{
my($e) = shift;
my($name) = shift;
my($e,$name) = @_;
my($fn) = $e->{PARENT};
if ($name =~ /\*(.*)/) {
@ -61,7 +58,6 @@ sub find_sibling($$)
return undef;
}
my %property_list = (
# interface
"helpstring" => ["INTERFACE", "FUNCTION"],
@ -140,8 +136,7 @@ my %property_list = (
# check for unknown properties
sub ValidProperties($$)
{
my $e = shift;
my $t = shift;
my ($e,$t) = @_;
return unless defined $e->{PROPERTIES};
@ -172,7 +167,6 @@ sub mapToScalar($)
return undef;
}
#####################################################################
# parse a struct
sub ValidElement($)

View File

@ -34,8 +34,8 @@ interface rpcecho
/* test strings */
void echo_TestCall (
[in,string,charset(CH_UTF16)] uint16 *s1,
[out,string,charset(CH_UTF16)] uint16 *s2
[in,string,charset(UTF16)] uint16 *s1,
[out,string,charset(UTF16)] uint16 *s2
);