1
0
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:
Jelmer Vernooij
2010-12-01 00:01:51 +01:00
parent 3bff03723d
commit 5891e9863c
2 changed files with 3 additions and 2 deletions

View File

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

View File

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