Renamed package to ion1, and made it conflict with package 'ion'.
[ion1.git] / src / obj.h
blob2c382b8c64101a44a0516f4321350fba85ce730b
1 /*
2 * ion/obj.h
4 * Copyright (c) Tuomo Valkonen 1999-2001.
5 * See the included file LICENSE for details.
6 */
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) \
19 struct STRU##_struct
21 #define INTROBJ(OBJ) INTRSTRUCT(OBJ)
22 #define DECLOBJ(OBJ) extern WObjDescr OBJDESCR(OBJ); DECLSTRUCT(OBJ)
24 INTROBJ(WObj)
25 INTRSTRUCT(WObjDescr)
27 extern bool wobj_is(const WObj *obj, const WObjDescr *descr);
28 extern const void *wobj_cast(const WObj *obj, const WObjDescr *descr);
30 DECLOBJ(WObj){
31 WObjDescr *obj_type;
34 #endif /* INCLUDED_WOBJ_H */