Skip to content

Instantly share code, notes, and snippets.

@scalone
Created September 18, 2015 16:06
Show Gist options
  • Save scalone/6f74f9da2e4f19edcb52 to your computer and use it in GitHub Desktop.
Save scalone/6f74f9da2e4f19edcb52 to your computer and use it in GitHub Desktop.
static mrb_value
mrb_mrb_eval(mrb_state *mrb, mrb_value self)
{
mrb_state *mrb2=NULL;
mrbc_context *c;
mrb_value code, ret, mrb_ret = mrb_nil_value();
mrb_get_args(mrb, "S", &code);
mrb2 = mrb_open();
c = mrbc_context_new(mrb2);
ret = mrb_load_string_cxt(mrb2, RSTRING_PTR(code), c);
/*...*/
mrb_close(mrb2);
return mrb_ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment