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 int PyObjCPointer_RaiseException; 21 22extern PyTypeObject PyObjCPointer_Type; 23 24#define PyObjCPointer_Check(o) (Py_TYPE(o) == &PyObjCPointer_Type) 25 26extern PyObjCPointer *PyObjCPointer_New(void *ptr, const char *type); 27#define PyObjCPointer_Ptr(obj) (((PyObjCPointer*)(obj))->ptr) 28 29#endif /* PyObjC_OBJC_POINTER_H */ 30