Changeset 988 for vendor/current/lib/talloc/pytalloc.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/talloc/pytalloc.h
r740 r988 18 18 */ 19 19 20 #ifndef _PY _TALLOC_H_21 #define _PY _TALLOC_H_20 #ifndef _PYTALLOC_H_ 21 #define _PYTALLOC_H_ 22 22 23 23 #include <Python.h> … … 27 27 PyObject_HEAD 28 28 TALLOC_CTX *talloc_ctx; 29 void *ptr; 30 } py _talloc_Object;29 void *ptr; /* eg the array element */ 30 } pytalloc_Object; 31 31 32 PyTypeObject *PyTalloc_GetObjectType(void); 33 int PyTalloc_Check(PyObject *);32 /* Return the PyTypeObject for pytalloc_Object. Returns a new reference. */ 33 PyTypeObject *pytalloc_GetObjectType(void); 34 34 35 /* Ret rieve the pointer for a py_talloc_object. Like talloc_get_type()36 * but for py_talloc_Objects. */ 35 /* Return the PyTypeObject for pytalloc_BaseObject. Returns a new reference. */ 36 PyTypeObject *pytalloc_GetBaseObjectType(void); 37 37 38 /* FIXME: Call PyErr_SetString(PyExc_TypeError, "expected " __STR(type) ") 39 * when talloc_get_type() returns NULL. */ 40 #define py_talloc_get_type(py_obj, type) (talloc_get_type(py_talloc_get_ptr(py_obj), type)) 38 /* Check whether a specific object is a talloc Object. */ 39 int pytalloc_Check(PyObject *); 41 40 42 #define py_talloc_get_ptr(py_obj) (((py_talloc_Object *)py_obj)->ptr) 43 #define py_talloc_get_mem_ctx(py_obj) ((py_talloc_Object *)py_obj)->talloc_ctx 41 int pytalloc_BaseObject_check(PyObject *); 44 42 45 PyObject *py_talloc_steal_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void *ptr); 46 PyObject *py_talloc_steal(PyTypeObject *py_type, void *ptr); 47 PyObject *py_talloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void *ptr);48 #define py _talloc_reference(py_type, talloc_ptr) py_talloc_reference_ex(py_type, talloc_ptr, talloc_ptr)43 /* Retrieve the pointer for a pytalloc_object. Like talloc_get_type() 44 * but for pytalloc_Objects. */ 45 void *_pytalloc_get_type(PyObject *py_obj, const char *type_name); 46 #define pytalloc_get_type(py_obj, type) ((type *)_pytalloc_get_type((PyObject *)(py_obj), #type)) 49 47 50 #define py_talloc_new(type, typeobj) py_talloc_steal(typeobj, talloc_zero(NULL, type)) 48 void *_pytalloc_get_ptr(PyObject *py_obj); 49 #define pytalloc_get_ptr(py_obj) _pytalloc_get_ptr((PyObject *)(py_obj)) 50 TALLOC_CTX *_pytalloc_get_mem_ctx(PyObject *py_obj); 51 #define pytalloc_get_mem_ctx(py_obj) _pytalloc_get_mem_ctx((PyObject *)(py_obj)) 51 52 52 PyObject *PyCObject_FromTallocPtr(void *); 53 PyObject *pytalloc_steal_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void *ptr); 54 PyObject *pytalloc_steal(PyTypeObject *py_type, void *ptr); 55 PyObject *pytalloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void *ptr); 56 #define pytalloc_reference(py_type, talloc_ptr) pytalloc_reference_ex(py_type, talloc_ptr, talloc_ptr) 53 57 54 PyObject *PyString_FromString_check_null(const char *ptr); 58 #define pytalloc_new(type, typeobj) pytalloc_steal(typeobj, talloc_zero(NULL, type)) 55 59 56 #endif /* _PY_TALLOC_H_ */ 60 #if PY_MAJOR_VERSION < 3 61 PyObject *pytalloc_CObject_FromTallocPtr(void *); 62 #endif 63 64 size_t pytalloc_BaseObject_size(void); 65 66 int pytalloc_BaseObject_PyType_Ready(PyTypeObject *type); 67 68 #endif /* _PYTALLOC_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.