1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

pytalloc: Make py_talloc_default_repr private (now exposed by talloc.Object).

This commit is contained in:
Jelmer Vernooij 2010-12-01 00:07:11 +01:00
parent a9fb47b5d6
commit 4f0436f107
3 changed files with 12 additions and 15 deletions

View File

@ -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),

View File

@ -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 *);

View File

@ -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.
*/