summaryrefslogtreecommitdiff
path: root/libguile/struct.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-08-29 11:37:29 -0700
committerAndy Wingo <wingo@pobox.com>2010-08-29 11:41:42 -0700
commita2220d7ea406eed83b5225cc7babbe9a4949643b (patch)
treef18f67c63924440b17470423fca1b193e7071e5e /libguile/struct.h
parentc89920a71ff1d2201c5af8780feaa936faf2c7a3 (diff)
downloadguile-a2220d7ea406eed83b5225cc7babbe9a4949643b.tar.gz
add flag to vtables to indicate that their layout is valid
* libguile/struct.h (SCM_VTABLE_FLAG_VALIDATED): New flag, indicates that the layout of a vtable has been validated. The other flags have been renumbered. * libguile/struct.c (scm_i_struct_inherit_vtable_magic): Set the VALIDATED flag if everything goes through. (scm_struct_vtable_p): If the struct should be a vtable but isn't validated, throw an error. (scm_make_vtable_vtable): Validate the incoming user_fields layout bit. Set the VALIDATED flag. (scm_c_make_structv): Add a comment about the case in which we delay scm_i_struct_inherit_vtable_magic.
Diffstat (limited to 'libguile/struct.h')
-rw-r--r--libguile/struct.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/libguile/struct.h b/libguile/struct.h
index d2a05af2a..7a4d63521 100644
--- a/libguile/struct.h
+++ b/libguile/struct.h
@@ -102,22 +102,22 @@
struct's vtable has the
setter flag set. */
-#define SCM_VTABLE_FLAG_VTABLE (1L << 0) /* instances of this vtable are themselves vtables? */
-#define SCM_VTABLE_FLAG_APPLICABLE_VTABLE (1L << 1) /* instances of this vtable are applicable vtables? */
-#define SCM_VTABLE_FLAG_APPLICABLE (1L << 2) /* instances of this vtable are applicable? */
-#define SCM_VTABLE_FLAG_SETTER_VTABLE (1L << 3) /* instances of this vtable are applicable-with-setter vtables? */
-#define SCM_VTABLE_FLAG_SETTER (1L << 4) /* instances of this vtable are applicable-with-setters? */
-#define SCM_VTABLE_FLAG_SIMPLE (1L << 5) /* instances of this vtable have only "p" fields */
-#define SCM_VTABLE_FLAG_SIMPLE_RW (1L << 6) /* instances of this vtable have only "pw" fields */
-#define SCM_VTABLE_FLAG_SMOB_0 (1L << 7)
-#define SCM_VTABLE_FLAG_GOOPS_0 (1L << 8)
-#define SCM_VTABLE_FLAG_GOOPS_1 (1L << 9)
-#define SCM_VTABLE_FLAG_GOOPS_2 (1L << 10)
-#define SCM_VTABLE_FLAG_GOOPS_3 (1L << 11)
-#define SCM_VTABLE_FLAG_GOOPS_4 (1L << 12)
-#define SCM_VTABLE_FLAG_GOOPS_5 (1L << 13)
-#define SCM_VTABLE_FLAG_GOOPS_6 (1L << 14)
-#define SCM_VTABLE_FLAG_GOOPS_7 (1L << 15)
+#define SCM_VTABLE_FLAG_VALIDATED (1L << 0) /* the layout of this vtable been validated? */
+#define SCM_VTABLE_FLAG_VTABLE (1L << 1) /* instances of this vtable are themselves vtables? */
+#define SCM_VTABLE_FLAG_APPLICABLE_VTABLE (1L << 2) /* instances of this vtable are applicable vtables? */
+#define SCM_VTABLE_FLAG_APPLICABLE (1L << 3) /* instances of this vtable are applicable? */
+#define SCM_VTABLE_FLAG_SETTER_VTABLE (1L << 4) /* instances of this vtable are applicable-with-setter vtables? */
+#define SCM_VTABLE_FLAG_SETTER (1L << 5) /* instances of this vtable are applicable-with-setters? */
+#define SCM_VTABLE_FLAG_SIMPLE (1L << 6) /* instances of this vtable have only "p" fields */
+#define SCM_VTABLE_FLAG_SIMPLE_RW (1L << 7) /* instances of this vtable have only "pw" fields */
+#define SCM_VTABLE_FLAG_RESERVED_0 (1L << 8)
+#define SCM_VTABLE_FLAG_RESERVED_1 (1L << 9)
+#define SCM_VTABLE_FLAG_RESERVED_2 (1L << 10)
+#define SCM_VTABLE_FLAG_SMOB_0 (1L << 11)
+#define SCM_VTABLE_FLAG_GOOPS_0 (1L << 12)
+#define SCM_VTABLE_FLAG_GOOPS_1 (1L << 13)
+#define SCM_VTABLE_FLAG_GOOPS_2 (1L << 14)
+#define SCM_VTABLE_FLAG_GOOPS_3 (1L << 15)
#define SCM_VTABLE_USER_FLAG_SHIFT 16
typedef void (*scm_t_struct_finalize) (SCM obj);