diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-11-30 22:22:15 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-11-30 23:26:56 +0100 |
commit | e8aa266c97d7f5175f657f1b8d2c995bf879ae3d (patch) | |
tree | 4827fd9ecfa1edb1944aa432d3ee13c70fadd181 /lib/talloc | |
parent | 783264e97c5230063abc601bc7f90c752141a9d6 (diff) | |
download | samba-e8aa266c97d7f5175f657f1b8d2c995bf879ae3d.tar.gz samba-e8aa266c97d7f5175f657f1b8d2c995bf879ae3d.tar.xz 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
Diffstat (limited to 'lib/talloc')
-rw-r--r-- | lib/talloc/pytalloc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index 96a6122a368..7bdebb04259 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); } |