mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Move the procedure slots of entities to invisible slots (so that
we can have operator class objects which themselves are entities). * struct.h (scm_struct_i_proc, scm_struct_i_flags, SCM_STRUCTF_ENTITY): New constants. * struct.c, struct.h (scm_alloc_struct): Renamed from alloc_struct and made global. (scm_struct_init): Renamed from init_struct and made global.
This commit is contained in:
parent
a5bfe84db4
commit
f40f662e9c
1 changed files with 5 additions and 0 deletions
|
@ -53,15 +53,18 @@
|
|||
#define scm_struct_n_extra_words 3
|
||||
|
||||
/* These are how the initial words of a vtable are allocated. */
|
||||
#define scm_struct_i_proc -7 /* Optional procedure slots */
|
||||
#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_flags -1 /* Upper 8 bits used as flags */
|
||||
#define scm_vtable_index_layout 0 /* A symbol describing the physical arrangement of this type. */
|
||||
#define scm_vtable_index_vcell 1 /* An opaque word, managed by the garbage collector. */
|
||||
#define scm_vtable_index_vtable 2 /* A pointer to the handle for this vtable. */
|
||||
#define scm_vtable_index_printer 3 /* A printer for this struct type. */
|
||||
#define scm_vtable_offset_user 4 /* Where do user fields start? */
|
||||
|
||||
#define SCM_STRUCTF_ENTITY (1L << 30) /* Indicates presence of proc slots */
|
||||
|
||||
#define SCM_STRUCTP(X) (SCM_TYP3(X) == scm_tc3_cons_gloc)
|
||||
#define SCM_STRUCT_DATA(X) ((SCM*)(SCM_CDR(X)))
|
||||
|
@ -75,6 +78,8 @@
|
|||
|
||||
|
||||
|
||||
extern SCM *scm_alloc_struct SCM_P ((int n_words, int n_extra, char *who));
|
||||
extern void scm_struct_init SCM_P ((SCM handle, int tail_elts, SCM inits));
|
||||
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue