Method: RCSimCinterface.rcsim_make_timeRepeat
- Defined in:
- ext/hruby_sim/hruby_rcsim_build.c
.rcsim_make_timeRepeat(numberV, statementV) ⇒ Object
Creating a time repeat C object.
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 574 VALUE rcsim_make_timeRepeat(VALUE mod, VALUE numberV, VALUE statementV) { // printf("rcsim_make_timeRepeat\n"); fflush(stdout); /* Allocates the time repeat. */ TimeRepeat timeRepeat = (TimeRepeat)malloc(sizeof(TimeRepeatS)); // printf("timeRepeat=%p\n",timeRepeat); fflush(stdout); /* Set it up. */ timeRepeat->kind = TIME_REPEAT; timeRepeat->owner = NULL; /* Get and set the number of repeatition. */ long long number; number = NUM2LL(numberV); // printf("number=%lld\n",number); fflush(stdout); timeRepeat->number = number; /* Get and set the statement. */ value_to_rcsim(StatementS,statementV,timeRepeat->statement); /* Returns the C time wait embedded into a ruby VALUE. */ VALUE res; rcsim_to_value(TimeRepeatS,timeRepeat,res); return res; } |