summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-03 00:35:29 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-03 00:35:29 +0200
commitc5449c929841817ac76197b4fc8c6792b9dc3204 (patch)
treee55bfb9bfb58087a44081d5cd812f6d5fdef58c4
parent804aaad526419e2be9101190bbccf95152f1d4b4 (diff)
downloadsamba-c5449c929841817ac76197b4fc8c6792b9dc3204.tar.gz
samba-c5449c929841817ac76197b4fc8c6792b9dc3204.tar.bz2
samba-c5449c929841817ac76197b4fc8c6792b9dc3204.zip
pidl: Factor out generation of interface type name.
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index e9956d32d9..64ddf4a925 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -712,12 +712,13 @@ sub Interface($$$)
$docstring = $signature;
}
- $self->pidl("static PyTypeObject $interface->{NAME}_InterfaceType = {");
+ my $if_typename = "$interface->{NAME}_InterfaceType";
+
+ $self->pidl("static PyTypeObject $if_typename = {");
$self->indent;
$self->pidl("PyObject_HEAD_INIT(NULL) 0,");
$self->pidl(".tp_name = \"$basename.$interface->{NAME}\",");
$self->pidl(".tp_basicsize = sizeof(dcerpc_InterfaceObject),");
- $self->pidl(".tp_base = &dcerpc_InterfaceType,");
$self->pidl(".tp_doc = $docstring,");
$self->pidl(".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,");
$self->pidl(".tp_new = interface_$interface->{NAME}_new,");
@@ -726,8 +727,8 @@ sub Interface($$$)
$self->pidl("");
- $self->register_module_typeobject($interface->{NAME}, "&$interface->{NAME}_InterfaceType");
- $self->register_module_readycode(["if (!PyInterface_AddNdrRpcMethods(&$interface->{NAME}_InterfaceType, py_ndr_$interface->{NAME}\_methods))", "\treturn;", ""]);
+ $self->register_module_typeobject($interface->{NAME}, "&$if_typename");
+ $self->register_module_readycode(["if (!PyInterface_AddNdrRpcMethods(&$if_typename, py_ndr_$interface->{NAME}\_methods))", "\treturn;", ""]);
}
$self->pidl_hdr("\n");