X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fnasal%2Fdata.h;h=4ed0f07c38c13e23dc66e21456cb5822e90feda2;hb=83b4dcb55cea1ba30a1ccfd08b517926672a018b;hp=c350b6574e1191cbc86897f93fb7c884a7b17406;hpb=1786692406214447db12b9d5af5364582af23d3b;p=simgear.git diff --git a/simgear/nasal/data.h b/simgear/nasal/data.h index c350b657..4ed0f07c 100644 --- a/simgear/nasal/data.h +++ b/simgear/nasal/data.h @@ -7,7 +7,7 @@ // What actually gets executed at runtime is a bound FUNC object, // which combines the raw code with a pointer to a CLOSURE chain of // namespaces. -enum { T_STR, T_VEC, T_HASH, T_CODE, T_CLOSURE, T_FUNC, T_CCODE, +enum { T_STR, T_VEC, T_HASH, T_CODE, T_CLOSURE, T_FUNC, T_CCODE, T_GHOST, NUM_NASAL_TYPES }; // V. important that this come last! #define IS_REF(r) ((r).ref.reftag == NASAL_REFTAG) @@ -21,6 +21,7 @@ enum { T_STR, T_VEC, T_HASH, T_CODE, T_CLOSURE, T_FUNC, T_CCODE, #define IS_FUNC(r) (IS_OBJ((r)) && (r).ref.ptr.obj->type == T_FUNC) #define IS_CLOSURE(r) (IS_OBJ((r)) && (r).ref.ptr.obj->type == T_CLOSURE) #define IS_CCODE(r) (IS_OBJ((r)) && (r).ref.ptr.obj->type == T_CCODE) +#define IS_GHOST(r) (IS_OBJ((r)) && (r).ref.ptr.obj->type == T_GHOST) #define IS_CONTAINER(r) (IS_VEC(r)||IS_HASH(r)) #define IS_SCALAR(r) (IS_NUM((r)) || IS_STR((r))) @@ -90,6 +91,12 @@ struct naCCode { naCFunction fptr; }; +struct naGhost { + GC_HEADER; + naGhostType* gtype; + void* ptr; +}; + struct naPool { int type; int elemsz;