summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-29 13:39:44 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-29 13:39:44 +0000
commitebabbc6cb92f818021f85275130f3c96fdb4f0fb (patch)
tree00482e486923442bb4d45d1e0376d57373cf01a6 /vm_eval.c
parent3c65e0262b6b14b0a6dc901128df4c45bd547c2f (diff)
Doxygen comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/vm_eval.c b/vm_eval.c
index cad6de4494..fa802ad04e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -191,6 +191,20 @@ stack_check(void)
}
}
+/*!
+ * \internal
+ * calls the specified method.
+ *
+ * This function is called by functions in rb_call* family.
+ * \param recv receiver of the method
+ * \param mid an ID that represents the name of the method
+ * \param argc the number of method arguments
+ * \param argv a pointer to an array of method arguments
+ * \param scope
+ * \param self self in the caller. Qundef means the current control frame's self.
+ *
+ * \note \a self is used in order to controlling access to protected methods.
+ */
static inline VALUE
rb_call0(VALUE recv, ID mid, int argc, const VALUE *argv,
call_type scope, VALUE self)
@@ -269,6 +283,18 @@ rb_call0(VALUE recv, ID mid, int argc, const VALUE *argv,
return vm_call0(th, recv, mid, argc, argv, me);
}
+
+/*!
+ * \internal
+ * calls the specified method.
+ *
+ * This function is called by functions in rb_call* family.
+ * \param recv receiver
+ * \param mid an ID that represents the name of the method
+ * \param argc the number of method arguments
+ * \param argv a pointer to an array of method arguments
+ * \param scope
+ */
static inline VALUE
rb_call(VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope)
{
@@ -412,6 +438,14 @@ rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
raise_method_missing(th, argc, argv, obj, call_status | NOEX_MISSING);
}
+/*!
+ * Calls a method
+ * \param recv receiver of the method
+ * \param mid an ID that represents the name of the method
+ * \param args an Array object which contains method arguments
+ *
+ * \pre \a args must refer an Array object.
+ */
VALUE
rb_apply(VALUE recv, ID mid, VALUE args)
{
@@ -424,6 +458,15 @@ rb_apply(VALUE recv, ID mid, VALUE args)
return rb_call(recv, mid, argc, argv, CALL_FCALL);
}
+/*!
+ * Calls a method
+ * \param recv receiver of the method
+ * \param mid an ID that represents the name of the method
+ * \param n the number of arguments
+ * \param ... arbitrary number of method arguments
+ *
+ * \pre each of arguments after \a n must be a VALUE.
+ */
VALUE
rb_funcall(VALUE recv, ID mid, int n, ...)
{
@@ -447,12 +490,28 @@ rb_funcall(VALUE recv, ID mid, int n, ...)
return rb_call(recv, mid, n, argv, CALL_FCALL);
}
+/*!
+ * Calls a method
+ * \param recv receiver of the method
+ * \param mid an ID that represents the name of the method
+ * \param argc the number of arguments
+ * \param argv pointer to an array of method arguments
+ */
VALUE
rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
{
return rb_call(recv, mid, argc, argv, CALL_FCALL);
}
+/*!
+ * Calls a method.
+ *
+ * Same as rb_funcall2 but this function can call only public methods.
+ * \param recv receiver of the method
+ * \param mid an ID that represents the name of the method
+ * \param argc the number of arguments
+ * \param argv pointer to an array of method arguments
+ */
VALUE
rb_funcall3(VALUE recv, ID mid, int argc, const VALUE *argv)
{