Method: RCSimCinterface.rcsim_make_stringE

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_make_stringE(strV) ⇒ Object

Creating a character string C object.


903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 903

VALUE rcsim_make_stringE(VALUE mod, VALUE strV) {
    // printf("rcsim_make_stringE\n");
    /* Allocates the string. */
    StringE stringE = (StringE)malloc(sizeof(StringES));
    // printf("stringE=%p\n",stringE);
    /* Set it up. */
    stringE->kind = STRINGE;
    stringE->owner = NULL;
    stringE->str   = strdup(StringValueCStr(strV));
    /* Returns the C character string embedded into a ruby VALUE. */
    VALUE res;
    rcsim_to_value(StringES,stringE,res);
    return res;
}