summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-03-26 10:23:52 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-03-26 10:23:52 +0900
commitc2660b8111cd6cd98a41aa257c503cbd3a7cf881 (patch)
tree24821c5131ec3819fc83c3668b06ce2214b52689 /include
parenta5a6b51126875e578ef1834c8af06141934df7dd (diff)
downloadmruby-c2660b8111cd6cd98a41aa257c503cbd3a7cf881.tar.gz
mruby-c2660b8111cd6cd98a41aa257c503cbd3a7cf881.zip
Fix missing `MRB_API` prefix for functions below; clse #4267
Functions to add prototypes to headers: * mrb_ary_splice() * mrb_notimplement() * mrb_vformat() * mrb_cstr_to_dbl() * mrb_cstr_to_inum() Functions to be made `static` (`MRB_API` was not needed): * mrb_mod_module_function() * mrb_obj_hash() * mrb_str_len_to_inum() Functions to remove `MRB_API` from definitions (referenced from within `libmruby`): * mrb_mod_cv_defined() * mrb_mod_cv_get() * mrb_f_send()
Diffstat (limited to 'include')
-rw-r--r--include/mruby.h5
-rw-r--r--include/mruby/array.h16
-rw-r--r--include/mruby/error.h2
-rw-r--r--include/mruby/string.h2
4 files changed, 24 insertions, 1 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 9792d7482..f2c800eec 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -708,6 +708,9 @@ MRB_API struct RClass * mrb_module_get(mrb_state *mrb, const char *name);
* @return [struct RClass *] A reference to the module.
*/
MRB_API struct RClass * mrb_module_get_under(mrb_state *mrb, struct RClass *outer, const char *name);
+/* a function to raise NotImplementedError with current method name */
+MRB_API void mrb_notimplement(mrb_state*);
+/* a function to be replacement of unimplemented method */
MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value);
/**
@@ -1143,6 +1146,8 @@ MRB_API void mrb_warn(mrb_state *mrb, const char *fmt, ...);
MRB_API mrb_noreturn void mrb_bug(mrb_state *mrb, const char *fmt, ...);
MRB_API void mrb_print_backtrace(mrb_state *mrb);
MRB_API void mrb_print_error(mrb_state *mrb);
+/* function for `raisef` formatting */
+MRB_API mrb_value mrb_vformat(mrb_state *mrb, const char *format, va_list ap);
/* macros to get typical exception objects
note:
diff --git a/include/mruby/array.h b/include/mruby/array.h
index 2457f68f2..2e6951c0d 100644
--- a/include/mruby/array.h
+++ b/include/mruby/array.h
@@ -228,6 +228,22 @@ MRB_API mrb_value mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item
MRB_API mrb_value mrb_ary_entry(mrb_value ary, mrb_int offset);
/*
+ * Replace subsequence of an array.
+ *
+ * Equivalent to:
+ *
+ * ary.shift
+ *
+ * @param mrb The mruby state reference.
+ * @param self The array from which the value will be shifted.
+ * @param head Beginning position of a replacement subsequence.
+ * @param len Length of a replacement subsequence.
+ * @param rpl The array of replacement elements.
+ * @return The receiver array.
+ */
+MRB_API mrb_value mrb_ary_splice(mrb_state *mrb, mrb_value self, mrb_int head, mrb_int len, mrb_value rpl);
+
+/*
* Shifts the first element from the array.
*
* Equivalent to:
diff --git a/include/mruby/error.h b/include/mruby/error.h
index 1587795fc..237c701ad 100644
--- a/include/mruby/error.h
+++ b/include/mruby/error.h
@@ -29,7 +29,7 @@ MRB_API mrb_value mrb_exc_backtrace(mrb_state *mrb, mrb_value exc);
MRB_API mrb_value mrb_get_backtrace(mrb_state *mrb);
MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_value args, const char *fmt, ...);
-/* declaration for fail method */
+/* declaration for `fail` method */
MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value);
struct RBreak {
diff --git a/include/mruby/string.h b/include/mruby/string.h
index 6fe0556b0..0b90debec 100644
--- a/include/mruby/string.h
+++ b/include/mruby/string.h
@@ -352,7 +352,9 @@ MRB_API mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str);
MRB_API mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self);
MRB_API mrb_value mrb_str_to_inum(mrb_state *mrb, mrb_value str, mrb_int base, mrb_bool badcheck);
+MRB_API mrb_value mrb_cstr_to_inum(mrb_state *mrb, const char *s, mrb_int base, mrb_bool badcheck);
MRB_API double mrb_str_to_dbl(mrb_state *mrb, mrb_value str, mrb_bool badcheck);
+MRB_API double mrb_cstr_to_dbl(mrb_state *mrb, const char *s, mrb_bool badcheck);
/*
* Returns a converted string type.