* throw.c: Doc fixes; rearranged.
[bpt/guile.git] / libguile / struct.h
index 19189aa..e076a8a 100644 (file)
 
 \f
 
+/* Number of words with negative index */
+#define scm_struct_n_extra_words 3
+
 /* These are how the initial words of a vtable are allocated. */
+#define scm_struct_i_ptr -3    /* start of block (see alloc_struct) */
 #define scm_struct_i_n_words -2        /* How many words allocated to this struct? */
 #define scm_struct_i_tag -1    /* A unique tag for this type.. */
 #define scm_struct_i_layout 0  /* A symbol describing the physical arrangement of this type. */
 #define SCM_STRUCT_VTABLE_DATA(X)      ((SCM *)(SCM_CAR(X) - 1))
 #define SCM_STRUCT_LAYOUT(X)           (SCM_STRUCT_VTABLE_DATA(X)[scm_struct_i_layout])
 #define SCM_STRUCT_VTABLE(X)           (SCM_STRUCT_VTABLE_DATA(X)[scm_struct_i_vtable])
+/* Efficiency is important in the following macro, since it's used in GC */
+#define SCM_LAYOUT_TAILP(X)            (((X) & 32) == 0) /* R, W or O */
 
 
 \f
-#ifdef __STDC__
-extern SCM scm_make_struct_layout (SCM fields);
-extern SCM scm_struct_p (SCM x);
-extern SCM scm_struct_vtable_p (SCM x);
-extern SCM scm_make_struct (SCM vtable, SCM tail_array_size, SCM init);
-extern SCM scm_make_vtable_vtable (SCM extra_fields, SCM tail_array_size, SCM init);
-extern SCM scm_struct_ref (SCM handle, SCM pos);
-extern SCM scm_struct_set_x (SCM handle, SCM pos, SCM val);
-extern SCM scm_struct_vtable (SCM handle);
-extern SCM scm_struct_vtable_tag (SCM handle);
-extern void scm_init_struct (void);
-
-#else /* STDC */
-extern SCM scm_make_struct_layout ();
-extern SCM scm_struct_p ();
-extern SCM scm_struct_vtable_p ();
-extern SCM scm_make_struct ();
-extern SCM scm_make_vtable_vtable ();
-extern SCM scm_struct_ref ();
-extern SCM scm_struct_set_x ();
-extern SCM scm_struct_vtable ();
-extern SCM scm_struct_vtable_tag ();
-extern void scm_init_struct ();
-
-#endif /* STDC */
-
-
-
-
-
-
 
+extern SCM scm_make_struct_layout SCM_P ((SCM fields));
+extern SCM scm_struct_p SCM_P ((SCM x));
+extern SCM scm_struct_vtable_p SCM_P ((SCM x));
+extern SCM scm_make_struct SCM_P ((SCM vtable, SCM tail_array_size, SCM init));
+extern SCM scm_make_vtable_vtable SCM_P ((SCM extra_fields, SCM tail_array_size, SCM init));
+extern SCM scm_struct_ref SCM_P ((SCM handle, SCM pos));
+extern SCM scm_struct_set_x SCM_P ((SCM handle, SCM pos, SCM val));
+extern SCM scm_struct_vtable SCM_P ((SCM handle));
+extern SCM scm_struct_vtable_tag SCM_P ((SCM handle));
+extern void scm_init_struct SCM_P ((void));
 
 #endif  /* STRUCTH */