mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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()
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -227,6 +227,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.
|
||||
*
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -2106,7 +2106,7 @@ mrb_mod_eqq(mrb_state *mrb, mrb_value mod)
|
||||
return mrb_bool_value(eqq);
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
static mrb_value
|
||||
mrb_mod_module_function(mrb_state *mrb, mrb_value mod)
|
||||
{
|
||||
mrb_value *argv;
|
||||
|
||||
+1
-1
@@ -492,7 +492,7 @@ mrb_obj_frozen(mrb_state *mrb, mrb_value self)
|
||||
* <code>Hash</code>. Any hash value that exceeds the capacity of a
|
||||
* <code>Fixnum</code> will be truncated before being used.
|
||||
*/
|
||||
MRB_API mrb_value
|
||||
static mrb_value
|
||||
mrb_obj_hash(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
return mrb_fixnum_value(mrb_obj_id(self));
|
||||
|
||||
+2
-2
@@ -2006,7 +2006,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
|
||||
return result;
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
static mrb_value
|
||||
mrb_str_len_to_inum(mrb_state *mrb, const char *str, mrb_int len, mrb_int base, int badcheck)
|
||||
{
|
||||
const char *p = str;
|
||||
@@ -2174,7 +2174,7 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, mrb_int len, mrb_int base,
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
|
||||
mrb_cstr_to_inum(mrb_state *mrb, const char *str, mrb_int base, mrb_bool badcheck)
|
||||
{
|
||||
return mrb_str_len_to_inum(mrb, str, strlen(str), base, badcheck);
|
||||
}
|
||||
|
||||
+2
-2
@@ -621,7 +621,7 @@ mrb_mod_class_variables(mrb_state *mrb, mrb_value mod)
|
||||
return ary;
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
mrb_value
|
||||
mrb_mod_cv_get(mrb_state *mrb, struct RClass *c, mrb_sym sym)
|
||||
{
|
||||
struct RClass * cls = c;
|
||||
@@ -714,7 +714,7 @@ mrb_cv_set(mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v)
|
||||
mrb_mod_cv_set(mrb, mrb_class_ptr(mod), sym, v);
|
||||
}
|
||||
|
||||
MRB_API mrb_bool
|
||||
mrb_bool
|
||||
mrb_mod_cv_defined(mrb_state *mrb, struct RClass * c, mrb_sym sym)
|
||||
{
|
||||
while (c) {
|
||||
|
||||
Reference in New Issue
Block a user