4 * Copyright (c) Tuomo Valkonen 1999-2001.
5 * See the included file LICENSE for details.
8 #ifndef INCLUDED_WOBJ_H
9 #define INCLUDED_WOBJ_H
11 #define OBJDESCR(TYPE) TYPE##_objdescr
13 #define WOBJ_IS(OBJ, TYPE) wobj_is((WObj*)OBJ, &OBJDESCR(TYPE))
14 #define WOBJ_CAST(OBJ, TYPE) (TYPE*)wobj_cast((WObj*)OBJ, &OBJDESCR(TYPE))
16 #define INTRSTRUCT(STRU) \
17 struct STRU##_struct; typedef struct STRU##_struct STRU;
18 #define DECLSTRUCT(STRU) \
21 #define INTROBJ(OBJ) INTRSTRUCT(OBJ)
22 #define DECLOBJ(OBJ) extern WObjDescr OBJDESCR(OBJ); DECLSTRUCT(OBJ)
27 extern bool wobj_is(const WObj
*obj
, const WObjDescr
*descr
);
28 extern const void *wobj_cast(const WObj
*obj
, const WObjDescr
*descr
);
34 #endif /* INCLUDED_WOBJ_H */