1#ifndef PyObjC_OBJC_POINTER_H 2#define PyObjC_OBJC_POINTER_H 3 4/* Python wrapper around C pointer 5 * 6 * NOTE: This class is almost never used, pointers in method interfaces are, 7 * or should be, treated differently and I've yet to run into a Cocoa structure 8 * that contains pointers. 9 */ 10 11typedef struct 12{ 13 PyObject_VAR_HEAD 14 15 void *ptr; 16 PyObject *type; 17 char contents[1]; 18} PyObjCPointer; 19 20extern PyTypeObject PyObjCPointer_Type; 21 22#define PyObjCPointer_Check(o) (Py_TYPE(o) == &PyObjCPointer_Type) 23 24extern PyObjCPointer *PyObjCPointer_New(void *ptr, const char *type); 25#define PyObjCPointer_Ptr(obj) (((PyObjCPointer*)(obj))->ptr) 26 27#endif /* PyObjC_OBJC_POINTER_H */ 28