Permalink
Browse files

add mrb_cv_get

  • Loading branch information...
1 parent 5a65a72 commit a9f1c4593c83194a5a53f856d3b26fc7376b44de @skandhas skandhas committed Dec 20, 2012
Showing with 7 additions and 0 deletions.
  1. +1 −0 include/mruby/variable.h
  2. +6 −0 src/variable.c
View
@@ -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*);
View
@@ -690,6 +690,12 @@ 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)
+{
+ return mrb_mod_cv_get(mrb, mrb_class_ptr(mod), sym);
+}
+
+mrb_value
mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
{
struct RClass *c = mrb->ci->proc->target_class;

0 comments on commit a9f1c45

Please sign in to comment.