1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

pidl: added a new type dnsp_name

This is a name type used in DNS where each DNS component maps to a
length byte followed by the string

We want these to map to a char *, which is why we need to do this in
PIDL
This commit is contained in:
Andrew Tridgell 2010-05-11 07:09:05 +02:00
parent 1a701914fd
commit a41dffcb6a
3 changed files with 9 additions and 1 deletions

View File

@ -74,7 +74,8 @@ my $scalar_alignment = {
'COMRESULT' => 4,
'nbt_string' => 4,
'wrepl_nbt_name' => 4,
'ipv4address' => 4
'ipv4address' => 4,
'dnsp_name' => 1
};
sub GetElementLevelTable($$)

View File

@ -883,6 +883,11 @@ sub ConvertObjectFromPythonData($$$$$$;$)
return;
}
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "dnsp_name") {
$self->pidl("$target = PyString_AsString($cvar);");
return;
}
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "NTSTATUS") {
$self->pidl("$target = NT_STATUS(PyInt_AsLong($cvar));");
@ -1018,6 +1023,7 @@ sub ConvertScalarToPython($$$)
# Not yet supported
if ($ctypename eq "string_array") { return "PyCObject_FromTallocPtr($cvar)"; }
if ($ctypename eq "ipv4address") { return "PyString_FromString($cvar)"; }
if ($ctypename eq "dnsp_name") { return "PyString_FromString($cvar)"; }
if ($ctypename eq "pointer") {
return "PyCObject_FromTallocPtr($cvar)";
}

View File

@ -57,6 +57,7 @@ my %scalars = (
"nbt_string" => "const char *",
"wrepl_nbt_name"=> "struct nbt_name *",
"ipv4address" => "const char *",
"dnsp_name" => "const char *",
);
my %aliases = (