summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-11-30 22:22:15 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-11-30 23:26:56 +0100
commite8aa266c97d7f5175f657f1b8d2c995bf879ae3d (patch)
tree4827fd9ecfa1edb1944aa432d3ee13c70fadd181
parent783264e97c5230063abc601bc7f90c752141a9d6 (diff)
downloadsamba-e8aa266c97d7f5175f657f1b8d2c995bf879ae3d.tar.gz
samba-e8aa266c97d7f5175f657f1b8d2c995bf879ae3d.tar.bz2
samba-e8aa266c97d7f5175f657f1b8d2c995bf879ae3d.zip
talloc: Add talloc object.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Tue Nov 30 23:26:56 CET 2010 on sn-devel-104
-rw-r--r--lib/talloc/pytalloc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index 96a6122a36..7bdebb0425 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -74,11 +74,26 @@ static PyMethodDef talloc_methods[] = {
{ NULL }
};
+static PyTypeObject TallocObject_Type = {
+ .tp_name = "talloc.Object",
+ .tp_basicsize = sizeof(py_talloc_Object),
+ .tp_dealloc = (destructor)py_talloc_dealloc,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_repr = py_talloc_default_repr,
+ .tp_compare = py_talloc_default_cmp,
+};
+
void inittalloc(void)
{
PyObject *m;
+ if (PyType_Ready(&TallocObject_Type) < 0)
+ return;
+
m = Py_InitModule3("talloc", talloc_methods, "Debug utilities for talloc-wrapped objects.");
if (m == NULL)
return;
+
+ Py_INCREF(&TallocObject_Type);
+ PyModule_AddObject(m, "Object", (PyObject *)&TallocObject_Type);
}