Method: RCSimCinterface.rcsim_make_refIndex
- Defined in:
- ext/hruby_sim/hruby_rcsim_build.c
.rcsim_make_refIndex(type, index, ref) ⇒ Object
Creating a ref index C object.
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 |
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 865
VALUE rcsim_make_refIndex(VALUE mod, VALUE type, VALUE index, VALUE ref) {
// printf("rcsim_make_refIndex\n");
/* Allocates the ref index. */
RefIndex refIndex = (RefIndex)malloc(sizeof(RefIndexS));
// printf("refIndex=%p\n",refIndex);
/* Set it up. */
refIndex->kind = REF_INDEX;
refIndex->owner = NULL;
value_to_rcsim(TypeS,type,refIndex->type);
value_to_rcsim(ExpressionS,index,refIndex->index);
value_to_rcsim(ReferenceS,ref,refIndex->ref);
/* Returns the C ref index embedded into a ruby VALUE. */
VALUE res;
rcsim_to_value(RefIndexS,refIndex,res);
return res;
}
|