summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-10-12 21:04:19 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-10-12 21:04:19 +0900
commitaf3aecd94fef24844a28c0618994e43975c58cfb (patch)
treed53a36c44680f4644ff9dc98dced786c5116cc9e /include/mruby.h
parent8ab39865d0563cd5191f83cbdc6870734284fcf4 (diff)
parent8e72558bacf1e9c8f5439c677c9282070b913998 (diff)
downloadmruby-af3aecd94fef24844a28c0618994e43975c58cfb.tar.gz
mruby-af3aecd94fef24844a28c0618994e43975c58cfb.zip
Merge pull request #2916 from felixjones/master
mrb_get_mid and mrb_get_argc
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/mruby.h b/include/mruby.h
index fd64a07ec..0db9002b6 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -486,6 +486,18 @@ typedef const char *mrb_args_format;
*/
MRB_API mrb_int mrb_get_args(mrb_state *mrb, mrb_args_format format, ...);
+static inline mrb_sym
+mrb_get_mid(mrb_state *mrb) /* get method symbol */
+{
+ return mrb->c->ci->mid;
+}
+
+static inline int
+mrb_get_argc(mrb_state *mrb) /* get argc */
+{
+ return mrb->c->ci->argc;
+}
+
/* `strlen` for character string literals (use with caution or `strlen` instead)
Adjacent string literals are concatenated in C/C++ in translation phase 6.
If `lit` is not one, the compiler will report a syntax error: