version 1.1 | | version 1.2 |
---|
| | |
typedef struct { | | typedef struct { |
PyObject_HEAD | | PyObject_HEAD |
object *obj; | | object *obj; |
| | int valid; |
| | object *del_event; |
} Crossfire_Object; | | } Crossfire_Object; |
extern PyTypeObject Crossfire_ObjectType; | | extern PyTypeObject Crossfire_ObjectType; |
| | |
typedef struct { | | typedef struct { |
PyObject_HEAD | | PyObject_HEAD |
object *obj; | | object *obj; |
| | int valid; |
| | object *del_event; |
} Crossfire_Player; | | } Crossfire_Player; |
extern PyTypeObject Crossfire_PlayerType; | | extern PyTypeObject Crossfire_PlayerType; |
| | |
| | #define EXISTCHECK( ob ) \ |
| | { \ |
| | if (!ob || ((ob)->valid == 0)) { \ |
| | PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \ |
| | return NULL; \ |
| | } } |
| | |
| | #define EXISTCHECK_INT( ob ) \ |
| | { \ |
| | if (!ob || ((ob)->valid == 0)) { \ |
| | PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \ |
| | return -1; \ |
| | } } |
| | |
#endif /* CFPYTHON_OBJECT_H */ | | #endif /* CFPYTHON_OBJECT_H */ |