440 |
scm_t_bits * data; |
scm_t_bits * data; |
441 |
SCM handle; |
SCM handle; |
442 |
|
|
443 |
SCM_VALIDATE_VTABLE (1,vtable); |
SCM_VALIDATE_VTABLE (1, vtable); |
444 |
SCM_VALIDATE_INUM (2,tail_array_size); |
SCM_VALIDATE_INUM (2, tail_array_size); |
445 |
SCM_VALIDATE_REST_ARGUMENT (init); |
SCM_VALIDATE_REST_ARGUMENT (init); |
446 |
|
|
447 |
layout = SCM_PACK (SCM_STRUCT_DATA (vtable) [scm_vtable_index_layout]); |
layout = SCM_PACK (SCM_STRUCT_DATA (vtable) [scm_vtable_index_layout]); |
569 |
char field_type = 0; |
char field_type = 0; |
570 |
|
|
571 |
|
|
572 |
SCM_VALIDATE_STRUCT (1,handle); |
SCM_VALIDATE_STRUCT (1, handle); |
573 |
SCM_VALIDATE_INUM (2,pos); |
SCM_VALIDATE_INUM (2, pos); |
574 |
|
|
575 |
layout = SCM_STRUCT_LAYOUT (handle); |
layout = SCM_STRUCT_LAYOUT (handle); |
576 |
data = SCM_STRUCT_DATA (handle); |
data = SCM_STRUCT_DATA (handle); |
579 |
fields_desc = SCM_SYMBOL_CHARS (layout); |
fields_desc = SCM_SYMBOL_CHARS (layout); |
580 |
n_fields = data[scm_struct_i_n_words]; |
n_fields = data[scm_struct_i_n_words]; |
581 |
|
|
582 |
SCM_ASSERT_RANGE(1,pos, p < n_fields); |
SCM_ASSERT_RANGE(1, pos, p < n_fields); |
583 |
|
|
584 |
if (p * 2 < SCM_SYMBOL_LENGTH (layout)) |
if (p * 2 < SCM_SYMBOL_LENGTH (layout)) |
585 |
{ |
{ |
645 |
char * fields_desc; |
char * fields_desc; |
646 |
char field_type = 0; |
char field_type = 0; |
647 |
|
|
648 |
SCM_VALIDATE_STRUCT (1,handle); |
SCM_VALIDATE_STRUCT (1, handle); |
649 |
SCM_VALIDATE_INUM (2,pos); |
SCM_VALIDATE_INUM (2, pos); |
650 |
|
|
651 |
layout = SCM_STRUCT_LAYOUT (handle); |
layout = SCM_STRUCT_LAYOUT (handle); |
652 |
data = SCM_STRUCT_DATA (handle); |
data = SCM_STRUCT_DATA (handle); |
655 |
fields_desc = SCM_SYMBOL_CHARS (layout); |
fields_desc = SCM_SYMBOL_CHARS (layout); |
656 |
n_fields = data[scm_struct_i_n_words]; |
n_fields = data[scm_struct_i_n_words]; |
657 |
|
|
658 |
SCM_ASSERT_RANGE (1,pos, p < n_fields); |
SCM_ASSERT_RANGE (1, pos, p < n_fields); |
659 |
|
|
660 |
if (p * 2 < SCM_SYMBOL_LENGTH (layout)) |
if (p * 2 < SCM_SYMBOL_LENGTH (layout)) |
661 |
{ |
{ |
708 |
"Return the vtable structure that describes the type of @var{struct}.") |
"Return the vtable structure that describes the type of @var{struct}.") |
709 |
#define FUNC_NAME s_scm_struct_vtable |
#define FUNC_NAME s_scm_struct_vtable |
710 |
{ |
{ |
711 |
SCM_VALIDATE_STRUCT (1,handle); |
SCM_VALIDATE_STRUCT (1, handle); |
712 |
return SCM_STRUCT_VTABLE (handle); |
return SCM_STRUCT_VTABLE (handle); |
713 |
} |
} |
714 |
#undef FUNC_NAME |
#undef FUNC_NAME |
719 |
"Return the vtable tag of the structure @var{handle}.") |
"Return the vtable tag of the structure @var{handle}.") |
720 |
#define FUNC_NAME s_scm_struct_vtable_tag |
#define FUNC_NAME s_scm_struct_vtable_tag |
721 |
{ |
{ |
722 |
SCM_VALIDATE_VTABLE (1,handle); |
SCM_VALIDATE_VTABLE (1, handle); |
723 |
return scm_long2num ((long) SCM_STRUCT_DATA (handle) >> 3); |
return scm_long2num ((long) SCM_STRUCT_DATA (handle) >> 3); |
724 |
} |
} |
725 |
#undef FUNC_NAME |
#undef FUNC_NAME |
758 |
"Return the name of the vtable @var{vtable}.") |
"Return the name of the vtable @var{vtable}.") |
759 |
#define FUNC_NAME s_scm_struct_vtable_name |
#define FUNC_NAME s_scm_struct_vtable_name |
760 |
{ |
{ |
761 |
SCM_VALIDATE_VTABLE (1,vtable); |
SCM_VALIDATE_VTABLE (1, vtable); |
762 |
return SCM_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable))); |
return SCM_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable))); |
763 |
} |
} |
764 |
#undef FUNC_NAME |
#undef FUNC_NAME |
768 |
"Set the name of the vtable @var{vtable} to @var{name}.") |
"Set the name of the vtable @var{vtable} to @var{name}.") |
769 |
#define FUNC_NAME s_scm_set_struct_vtable_name_x |
#define FUNC_NAME s_scm_set_struct_vtable_name_x |
770 |
{ |
{ |
771 |
SCM_VALIDATE_VTABLE (1,vtable); |
SCM_VALIDATE_VTABLE (1, vtable); |
772 |
SCM_VALIDATE_SYMBOL (2,name); |
SCM_VALIDATE_SYMBOL (2, name); |
773 |
SCM_SET_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable)), |
SCM_SET_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable)), |
774 |
name); |
name); |
775 |
return SCM_UNSPECIFIED; |
return SCM_UNSPECIFIED; |