mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
pytalloc: Expose PyTalloc_GetObjectType
This commit is contained in:
@ -32,6 +32,7 @@ typedef struct {
|
|||||||
/* Deallocate a py_talloc_Object */
|
/* Deallocate a py_talloc_Object */
|
||||||
void py_talloc_dealloc(PyObject* self);
|
void py_talloc_dealloc(PyObject* self);
|
||||||
|
|
||||||
|
PyTypeObject *PyTalloc_GetObjectType(void);
|
||||||
int PyTalloc_Check(PyObject *);
|
int PyTalloc_Check(PyObject *);
|
||||||
|
|
||||||
/* Retrieve the pointer for a py_talloc_object. Like talloc_get_type()
|
/* Retrieve the pointer for a py_talloc_object. Like talloc_get_type()
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "pytalloc.h"
|
#include "pytalloc.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static PyTypeObject *Get_TallocType(void)
|
PyTypeObject *PyTalloc_GetObjectType(void)
|
||||||
{
|
{
|
||||||
static PyTypeObject *type = NULL;
|
static PyTypeObject *type = NULL;
|
||||||
PyObject *mod;
|
PyObject *mod;
|
||||||
@ -156,7 +156,7 @@ PyObject *PyString_FromString_check_null(const char *ptr)
|
|||||||
|
|
||||||
int PyTalloc_Check(PyObject *obj)
|
int PyTalloc_Check(PyObject *obj)
|
||||||
{
|
{
|
||||||
PyTypeObject *tp = Get_TallocType();
|
PyTypeObject *tp = PyTalloc_GetObjectType();
|
||||||
|
|
||||||
return PyObject_TypeCheck(obj, tp);
|
return PyObject_TypeCheck(obj, tp);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user