Method: RCSimCinterface.rcsim_make_select

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_make_select(type, sel) ⇒ Object

Creating a select C object.



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 808

VALUE rcsim_make_select(VALUE mod, VALUE type, VALUE sel) {
    // printf("rcsim_make_select\n");
    /* Allocates the select. */
    Select select = (Select)malloc(sizeof(SelectS));
    // printf("select=%p\n",select);
    /* Set it up. */
    select->kind = SELECT;
    select->owner = NULL;
    value_to_rcsim(TypeS,type,select->type);
    value_to_rcsim(ExpressionS,sel,select->select);
    select->num_choices = 0;
    select->choices = NULL;
    /* Returns the C select embedded into a ruby VALUE. */
    VALUE res;
    rcsim_to_value(SelectS,select,res);
    return res;
}