summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorskandhas <[email protected]>2012-12-20 21:33:30 +0800
committerskandhas <[email protected]>2012-12-20 21:33:30 +0800
commita9f1c4593c83194a5a53f856d3b26fc7376b44de (patch)
tree4db9f1791fcde7dbec81bb06708d0a9940dc0f07
parent5a65a7258f2bbd92901531ccafcccb48a5f66f52 (diff)
downloadmruby-a9f1c4593c83194a5a53f856d3b26fc7376b44de.tar.gz
mruby-a9f1c4593c83194a5a53f856d3b26fc7376b44de.zip
add mrb_cv_get
-rw-r--r--include/mruby/variable.h1
-rw-r--r--src/variable.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/mruby/variable.h b/include/mruby/variable.h
index d33a20d5e..8754e8a90 100644
--- a/include/mruby/variable.h
+++ b/include/mruby/variable.h
@@ -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*);
diff --git a/src/variable.c b/src/variable.c
index b4e262f8d..816b703bf 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -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;