From 4f0436f107422826f93d194370b256b6d278502f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 1 Dec 2010 00:07:11 +0100 Subject: pytalloc: Make py_talloc_default_repr private (now exposed by talloc.Object). --- lib/talloc/pytalloc.c | 12 ++++++++++++ lib/talloc/pytalloc.h | 3 --- lib/talloc/pytalloc_util.c | 12 ------------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index 7bdebb0425..b1f2afb8d5 100644 --- a/lib/talloc/pytalloc.c +++ b/lib/talloc/pytalloc.c @@ -74,6 +74,18 @@ static PyMethodDef talloc_methods[] = { { NULL } }; +/** + * Default (but only slightly more useful than the default) implementation of Repr(). + */ +static PyObject *py_talloc_default_repr(PyObject *obj) +{ + py_talloc_Object *talloc_obj = (py_talloc_Object *)obj; + PyTypeObject *type = (PyTypeObject*)PyObject_Type(obj); + + return PyString_FromFormat("<%s talloc object at 0x%p>", + type->tp_name, talloc_obj->ptr); +} + static PyTypeObject TallocObject_Type = { .tp_name = "talloc.Object", .tp_basicsize = sizeof(py_talloc_Object), diff --git a/lib/talloc/pytalloc.h b/lib/talloc/pytalloc.h index 128208e3f8..1561576d34 100644 --- a/lib/talloc/pytalloc.h +++ b/lib/talloc/pytalloc.h @@ -50,9 +50,6 @@ PyObject *py_talloc_steal(PyTypeObject *py_type, void *ptr); PyObject *py_talloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void *ptr); #define py_talloc_reference(py_type, talloc_ptr) py_talloc_reference_ex(py_type, talloc_ptr, talloc_ptr) -/* Sane default implementation of reprfunc. */ -PyObject *py_talloc_default_repr(PyObject *py_obj); - #define py_talloc_new(type, typeobj) py_talloc_steal(typeobj, talloc_zero(NULL, type)) PyObject *PyCObject_FromTallocPtr(void *); diff --git a/lib/talloc/pytalloc_util.c b/lib/talloc/pytalloc_util.c index d6a8da2e59..d285f01531 100644 --- a/lib/talloc/pytalloc_util.c +++ b/lib/talloc/pytalloc_util.c @@ -108,18 +108,6 @@ PyObject *py_talloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, voi return (PyObject *)ret; } -/** - * Default (but only slightly more useful than the default) implementation of Repr(). - */ -PyObject *py_talloc_default_repr(PyObject *obj) -{ - py_talloc_Object *talloc_obj = (py_talloc_Object *)obj; - PyTypeObject *type = (PyTypeObject*)PyObject_Type(obj); - - return PyString_FromFormat("<%s talloc object at 0x%p>", - type->tp_name, talloc_obj->ptr); -} - /** * Default (but only slightly more useful than the default) implementation of cmp. */ -- cgit