From a41dffcb6a0a2dcb6bbcf3ecbb4a7a1df47d85df Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 11 May 2010 07:09:05 +0200 Subject: 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 --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pidl/lib/Parse/Pidl/Samba4') diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 4c5cc1b378..75aa0a8172 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -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)"; } -- cgit