summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-19 10:38:30 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:50 +0900
commitcaee1f68a200d9df1831c4cf0e1954482c317474 (patch)
treee2417d71bdda57a90497bc3a25dd7dcfaeffc11f /include/mruby.h
parenta4302524d06c2b63617285286dcf41b5a45baf75 (diff)
downloadmruby-caee1f68a200d9df1831c4cf0e1954482c317474.tar.gz
mruby-caee1f68a200d9df1831c4cf0e1954482c317474.zip
Change the return type of `mrb_check_intern()` and friends.
They used to return `mrb_value` but now return `mrb_sym` for consistency with other `intern` functions. If symbols are not defined, `check` functions return `0`, instead of `nil` in the past. It causes API incompatibility but I believe few people use those functions out of the core, and those changes are very easy to handle, hopefully.
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 959d1ac6d..4ac26bfe9 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -1097,9 +1097,10 @@ MRB_API mrb_sym mrb_intern(mrb_state*,const char*,size_t);
MRB_API mrb_sym mrb_intern_static(mrb_state*,const char*,size_t);
#define mrb_intern_lit(mrb, lit) mrb_intern_static(mrb, (lit ""), mrb_strlen_lit(lit))
MRB_API mrb_sym mrb_intern_str(mrb_state*,mrb_value);
-MRB_API mrb_value mrb_check_intern_cstr(mrb_state*,const char*);
-MRB_API mrb_value mrb_check_intern(mrb_state*,const char*,size_t);
-MRB_API mrb_value mrb_check_intern_str(mrb_state*,mrb_value);
+/* mrb_check_intern series functions returns 0 if the symbol is not defined */
+MRB_API mrb_sym mrb_check_intern_cstr(mrb_state*,const char*);
+MRB_API mrb_sym mrb_check_intern(mrb_state*,const char*,size_t);
+MRB_API mrb_sym mrb_check_intern_str(mrb_state*,mrb_value);
MRB_API const char *mrb_sym_name(mrb_state*,mrb_sym);
MRB_API const char *mrb_sym_name_len(mrb_state*,mrb_sym,mrb_int*);
MRB_API const char *mrb_sym_dump(mrb_state*,mrb_sym);