]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/data.h
Add Nasal Vs. 1.5
[simgear.git] / simgear / nasal / data.h
index c350b6574e1191cbc86897f93fb7c884a7b17406..4ed0f07c38c13e23dc66e21456cb5822e90feda2 100644 (file)
@@ -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;