Method: RCSimCinterface.rcsim_make_refConcat

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_make_refConcat(type, dirV) ⇒ Object

Creating a ref concat C object.



846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 846

VALUE rcsim_make_refConcat(VALUE mod, VALUE type, VALUE dirV) {
    // printf("rcsim_make_refConcat\n");
    /* Allocates the ref concat. */
    RefConcat refConcat = (RefConcat)malloc(sizeof(RefConcatS));
    // printf("refConcat=%p\n",refConcat);
    /* Set it up. */
    refConcat->kind = REF_CONCAT;
    refConcat->owner = NULL;
    value_to_rcsim(TypeS,type,refConcat->type);
    refConcat->num_refs = 0;
    refConcat->refs = NULL;
    refConcat->dir = rb_id2name(SYM2ID(dirV))[0]=='l' ? 0 : 1;
    /* Returns the C ref concat embedded into a ruby VALUE. */
    VALUE res;
    rcsim_to_value(RefConcatS,refConcat,res);
    return res;
}