Skip to content

Commit

Permalink
add mrb_cv_get
Browse files Browse the repository at this point in the history
  • Loading branch information
skandhas committed Dec 20, 2012
1 parent 5a65a72 commit a9f1c45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/mruby/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mrb_value mrb_obj_iv_inspect(mrb_state*, struct RObject*);
mrb_sym mrb_class_sym(mrb_state *mrb, struct RClass *c, struct RClass *outer);
mrb_value mrb_mod_class_variables(mrb_state*, mrb_value);
mrb_value mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym);
mrb_value mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym);

/* GC functions */
void mrb_gc_mark_gv(mrb_state*);
Expand Down
6 changes: 6 additions & 0 deletions src/variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,12 @@ mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym)
return mrb_nil_value();
}

mrb_value
mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym)
{
return mrb_mod_cv_get(mrb, mrb_class_ptr(mod), sym);
}

mrb_value
mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
{
Expand Down

0 comments on commit a9f1c45

Please sign in to comment.