From 719a6bbfede5b124c96f7c84d27e68ac285b073a Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 22 Oct 2010 09:37:38 +0200 Subject: ndr dns: Add simple parser --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 9 +++++++++ 1 file changed, 9 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 cf554f5c0c..f79981e317 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -916,6 +916,11 @@ sub ConvertObjectFromPythonData($$$$$$;$) return; } + if ($actual_ctype->{TYPE} eq "SCALAR" and ($actual_ctype->{NAME} eq "dns_string" or $actual_ctype->{NAME} eq "dns_name")) { + $self->pidl("$target = talloc_strdup($mem_ctx, PyString_AS_STRING($cvar));"); + return; + } + if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "ipv4address") { $self->pidl("$target = PyString_AS_STRING($cvar);"); return; @@ -1094,6 +1099,10 @@ sub ConvertScalarToPython($$$) return "PyString_FromString_check_null($cvar)"; } + if (($ctypename eq "dns_string" or $ctypename eq "dns_name")) { + return "PyString_FromString_check_null($cvar)"; + } + # Not yet supported if ($ctypename eq "string_array") { return "PyCObject_FromTallocPtr($cvar)"; } if ($ctypename eq "ipv4address") { return "PyString_FromString_check_null($cvar)"; } -- cgit