Ruby
2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
|
Go to the documentation of this file.
43 static VALUE rb_cNilClass_to_s;
44 static VALUE rb_cTrueClass_to_s;
45 static VALUE rb_cFalseClass_to_s;
51 #define id_match idEqTilde
52 #define id_inspect idInspect
53 #define id_init_copy idInitialize_copy
54 #define id_init_clone idInitialize_clone
55 #define id_init_dup idInitialize_dup
56 #define id_const_missing idConst_missing
57 #define id_to_f idTo_f
59 #define CLASS_OR_MODULE_P(obj) \
60 (!SPECIAL_CONST_P(obj) && \
61 (BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE))
251 ROBJECT(dest)->as.heap.ivptr = 0;
252 ROBJECT(dest)->as.heap.numiv = 0;
253 ROBJECT(dest)->as.heap.iv_index_tbl = 0;
338 int kwfreeze = freeze_opt(
argc,
argv);
339 if (!special_object_p(
obj))
340 return mutable_obj_clone(
obj, kwfreeze);
341 return immutable_obj_clone(
obj, kwfreeze);
348 int kwfreeze = freeze_opt(
argc,
argv);
349 return immutable_obj_clone(
obj, kwfreeze);
355 static ID keyword_ids[1];
359 if (!keyword_ids[0]) {
375 immutable_obj_clone(
VALUE obj,
int kwfreeze)
384 mutable_obj_clone(
VALUE obj,
int kwfreeze)
386 VALUE clone, singleton;
396 init_copy(clone,
obj);
412 if (special_object_p(
obj))
return obj;
413 return mutable_obj_clone(
obj,
Qtrue);
424 if (special_object_p(
obj)) {
502 if (
obj == orig)
return obj;
648 class_or_module_required(
VALUE c)
677 c = class_or_module_required(c);
696 c = class_or_module_required(c);
715 cl = class_or_module_required(cl);
716 c = class_or_module_required(c);
968 return rb_obj_dummy();
974 return rb_obj_dummy();
987 rb_warning(
"Object#tainted? is deprecated and will be removed in Ruby 3.2.");
1001 rb_warning(
"Object#taint is deprecated and will be removed in Ruby 3.2.");
1016 rb_warning(
"Object#untaint is deprecated and will be removed in Ruby 3.2.");
1030 rb_warning(
"Object#untrusted? is deprecated and will be removed in Ruby 3.2.");
1044 rb_warning(
"Object#untrust is deprecated and will be removed in Ruby 3.2.");
1059 rb_warning(
"Object#trust is deprecated and will be removed in Ruby 3.2.");
1070 rb_warning(
"rb_obj_infect is deprecated and will be removed in Ruby 3.2.");
1085 rb_bug(
"special consts should be frozen.");
1152 return rb_cNilClass_to_s;
1235 return rb_cTrueClass_to_s;
1312 return rb_cFalseClass_to_s;
1500 VALUE refined_class, defined_at;
1516 refined_class = rb_refinement_module_get_refined_class(
klass);
1517 if (!
NIL_P(refined_class)) {
1522 CONST_ID(id_defined_at,
"__defined_at__");
1584 if (class_search_ancestor(
arg,
mod)) {
1646 return rb_mod_ge(
mod,
arg);
1721 rb_mod_initialize(
VALUE module)
1731 rb_mod_initialize_clone(
VALUE clone,
VALUE orig)
1788 RCLASS_SET_SUPER(
klass, super);
1791 rb_mod_initialize(
klass);
1837 return class_call_alloc_func(allocator,
klass);
1844 return class_call_alloc_func(allocator,
klass);
1860 rb_undefined_alloc(
klass);
1898 return rb_class_alloc(
klass);
2006 static const char bad_instance_name[] =
"`%1$s' is not allowed as an instance variable name";
2007 static const char bad_class_name[] =
"`%1$s' is not allowed as a class variable name";
2008 static const char bad_const_name[] =
"wrong constant name %1$s";
2009 static const char bad_attr_name[] =
"invalid attribute name `%1$s'";
2010 #define wrong_constant_name bad_const_name
2013 #define id_for_var(obj, name, type) id_for_setter(obj, name, type, bad_##type##_name)
2015 #define id_for_setter(obj, name, type, message) \
2016 check_setter_id(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))
2019 int (*valid_id_p)(
ID),
int (*valid_name_p)(
VALUE),
2020 const char *message,
size_t message_len)
2025 if (
id ? !valid_id_p(
id) : !valid_name_p(
name)) {
2039 rb_is_attr_id(
ID id)
2084 rb_warning(
"optional boolean argument is obsoleted");
2185 const char *pbeg, *p, *
path, *pend;
2209 if (p >= pend || !*p) {
2214 if (p + 2 < pend && p[0] ==
':' && p[1] ==
':') {
2224 while (p < pend && *p !=
':') p++;
2226 if (pbeg == p)
goto wrong_name;
2231 if (p < pend && p[0] ==
':') {
2232 if (p + 2 >= pend || p[1] !=
':')
goto wrong_name;
2268 else if (beglen == 0) {
2355 const char *pbeg, *p, *
path, *pend;
2379 if (p >= pend || !*p) {
2384 if (p + 2 < pend && p[0] ==
':' && p[1] ==
':') {
2394 while (p < pend && *p !=
':') p++;
2396 if (pbeg == p)
goto wrong_name;
2401 if (p < pend && p[0] ==
':') {
2402 if (p + 2 >= pend || p[1] !=
':')
goto wrong_name;
2430 if (p == pend)
return Qtrue;
2433 else if (beglen == 0) {
2436 if (p == pend)
return Qtrue;
2442 if (p == pend)
return Qtrue;
2508 const char *pbeg, *p, *
path, *pend;
2518 if (!
id)
return Qnil;
2532 if (p >= pend || !*p) {
2537 if (p + 2 < pend && p[0] ==
':' && p[1] ==
':') {
2547 while (p < pend && *p !=
':') p++;
2549 if (pbeg == p)
goto wrong_name;
2554 if (p < pend && p[0] ==
':') {
2555 if (p + 2 >= pend || p[1] !=
':')
goto wrong_name;
2803 static const struct conv_method_tbl {
2804 const char method[6];
2806 } conv_method_names[] = {
2807 #define M(n) {#n, (unsigned short)idTo_##n}
2821 #define IMPLICIT_CONVERSIONS 7
2824 conv_method_index(
const char *method)
2826 static const char prefix[] =
"to_";
2828 if (
strncmp(prefix, method,
sizeof(prefix)-1) == 0) {
2829 const char *
const meth = &method[
sizeof(prefix)-1];
2832 if (conv_method_names[
i].method[0] == meth[0] &&
2833 strcmp(conv_method_names[
i].method, meth) == 0) {
2838 return numberof(conv_method_names);
2842 convert_type_with_id(
VALUE val,
const char *tname,
ID method,
int raise,
int index)
2850 "no implicit conversion of" :
"can't convert";
2851 const char *cname =
NIL_P(val) ?
"nil" :
2852 val ==
Qtrue ?
"true" :
2853 val ==
Qfalse ?
"false" :
2867 convert_type(
VALUE val,
const char *tname,
const char *method,
int raise)
2869 int i = conv_method_index(method);
2872 return convert_type_with_id(val, tname, m,
raise,
i);
2878 conversion_mismatch(
VALUE val,
const char *tname,
const char *method,
VALUE result)
2905 v = convert_type(val, tname, method,
TRUE);
2907 conversion_mismatch(val, tname, method,
v);
2919 v = convert_type_with_id(val, tname, method,
TRUE, -1);
2947 v = convert_type(val, tname, method,
FALSE);
2950 conversion_mismatch(val, tname, method,
v);
2963 v = convert_type_with_id(val, tname, method,
FALSE, -1);
2971 #define try_to_int(val, mid, raise) \
2972 convert_type_with_id(val, "Integer", mid, raise, -1)
2976 rb_to_integer(
VALUE val,
const char *method,
ID mid)
2983 conversion_mismatch(val,
"Integer", method,
v);
3005 v = convert_type(val,
"Integer", method,
FALSE);
3023 return rb_to_integer(val,
"to_int",
idTo_int);
3045 rb_check_to_i(
VALUE val)
3054 rb_convert_to_integer(
VALUE val,
int base,
int raise_exception)
3060 if (base != 0)
goto arg_error;
3067 if (base != 0)
goto arg_error;
3073 else if (
NIL_P(val)) {
3074 if (base != 0)
goto arg_error;
3075 if (!raise_exception)
return Qnil;
3082 if (!raise_exception)
return Qnil;
3090 if (!raise_exception) {
3096 return rb_to_integer(val,
"to_i",
idTo_i);
3108 return rb_convert_to_integer(val, 0,
TRUE);
3131 return default_value;
3134 #define opts_exception_p(opts) rb_opts_exception_p((opts), TRUE)
3177 if (!
NIL_P(vbase)) {
3196 rb_cstr_to_dbl_raise(
const char *p,
int badcheck,
int raise,
int *
error)
3201 const char *ellipsis =
"";
3203 enum {max_width = 20};
3204 #define OutOfRange() ((end - p > max_width) ? \
3205 (w = max_width, ellipsis = "...") : \
3206 (w = (int)(end - p), ellipsis = ""))
3212 if (!badcheck && p[0] ==
'0' && (p[1] ==
'x' || p[1] ==
'X')) {
3219 rb_warning(
"Float %.*s%s out of range", w, p, ellipsis);
3240 int dot_seen =
FALSE;
3242 switch (*p) {
case '+':
case '-': prev = *
n++ = *p++;}
3245 while (*++p ==
'0');
3247 while (p < end &&
n < e) prev = *
n++ = *p++;
3252 if (badcheck)
goto bad;
3257 if (e == init_e && (prev ==
'e' || prev ==
'E' || prev ==
'p' || prev ==
'P')) {
3258 e =
buf +
sizeof(
buf) - 1;
3260 switch (*p) {
case '+':
case '-': prev = *
n++ = *p++;}
3263 while (*++p ==
'0');
3270 if (badcheck)
goto bad;
3274 else if (prev ==
'.' ? dot_seen++ : !
ISDIGIT(prev)) {
3275 if (badcheck)
goto bad;
3278 if (
n < e) *
n++ = prev;
3283 if (!badcheck && p[0] ==
'0' && (p[1] ==
'x' || p[1] ==
'X')) {
3290 rb_warning(
"Float %.*s%s out of range", w, p, ellipsis);
3294 if (!end || p == end)
goto bad;
3295 while (*end &&
ISSPACE(*end)) end++;
3321 return rb_cstr_to_dbl_raise(p, badcheck,
TRUE,
NULL);
3325 rb_str_to_dbl_raise(
VALUE str,
int badcheck,
int raise,
int *
error)
3351 ret = rb_cstr_to_dbl_raise(s, badcheck,
raise,
error);
3373 return rb_str_to_dbl_raise(
str, badcheck,
TRUE,
NULL);
3377 #define fix2dbl_without_to_f(x) (double)FIX2LONG(x)
3378 #define big2dbl_without_to_f(x) rb_big2dbl(x)
3379 #define int2dbl_without_to_f(x) \
3380 (FIXNUM_P(x) ? fix2dbl_without_to_f(x) : big2dbl_without_to_f(x))
3381 #define num2dbl_without_to_f(x) \
3382 (FIXNUM_P(x) ? fix2dbl_without_to_f(x) : \
3383 RB_TYPE_P(x, T_BIGNUM) ? big2dbl_without_to_f(x) : \
3384 (Check_Type(x, T_FLOAT), RFLOAT_VALUE(x)))
3385 static inline double
3386 rat2dbl_without_to_f(
VALUE x)
3390 return num2dbl_without_to_f(num) / num2dbl_without_to_f(den);
3393 #define special_const_to_float(val, pre, post) \
3396 rb_raise_static(rb_eTypeError, pre "nil" post); \
3398 rb_raise_static(rb_eTypeError, pre "true" post); \
3400 rb_raise_static(rb_eTypeError, pre "false" post); \
3405 conversion_to_float(
VALUE val)
3407 special_const_to_float(val,
"can't convert ",
" into Float");
3411 implicit_conversion_to_float(
VALUE val)
3413 special_const_to_float(val,
"no implicit conversion to float from ",
"");
3417 to_float(
VALUE *valp,
int raise_exception)
3422 *valp =
DBL2NUM(fix2dbl_without_to_f(val));
3428 else if (raise_exception) {
3429 conversion_to_float(val);
3438 *valp =
DBL2NUM(big2dbl_without_to_f(val));
3441 *valp =
DBL2NUM(rat2dbl_without_to_f(val));
3451 convert_type_to_float_protected(
VALUE val)
3457 rb_convert_to_float(
VALUE val,
int raise_exception)
3459 switch (to_float(&val, raise_exception)) {
3463 if (!raise_exception) {
3465 double x = rb_str_to_dbl_raise(val,
TRUE, raise_exception, &e);
3474 if (!raise_exception) {
3476 VALUE result =
rb_protect(convert_type_to_float_protected, val, &state);
3495 return rb_convert_to_float(val,
TRUE);
3527 numeric_to_float(
VALUE val)
3544 switch (to_float(&val,
TRUE)) {
3548 return numeric_to_float(val);
3581 return fix2dbl_without_to_f(val);
3584 return rb_float_flonum_value(val);
3587 conversion_to_float(val);
3593 return rb_float_noflonum_value(val);
3596 return big2dbl_without_to_f(val);
3600 return rat2dbl_without_to_f(val);
3604 val = numeric_to_float(val);
3620 return fix2dbl_without_to_f(val);
3623 return rb_float_flonum_value(val);
3626 implicit_conversion_to_float(val);
3632 return rb_float_noflonum_value(val);
3634 return big2dbl_without_to_f(val);
3636 return rat2dbl_without_to_f(val);
3770 dig_basic_p(
VALUE obj,
struct dig_method *cache)
3773 if (
klass != cache->klass) {
3774 cache->klass =
klass;
3777 return cache->basic;
3793 struct dig_method hash = {
Qnil}, ary = {
Qnil}, strt = {
Qnil};
3800 if (dig_basic_p(
obj, &hash)) {
3806 if (dig_basic_p(
obj, &ary)) {
3812 if (dig_basic_p(
obj, &strt)) {
4262 #define rb_intern(str) rb_intern_const(str)
int rb_is_const_name(VALUE name)
void Init_class_hierarchy(void)
ALWAYS_INLINE(static VALUE rb_to_integer(VALUE val, const char *method, ID mid))
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
VALUE rb_str_concat(VALUE, VALUE)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
const char * rb_id2name(ID)
int rb_is_const_id(ID id)
VALUE rb_check_convert_type_with_id(VALUE, int, const char *, ID)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
void rb_include_module(VALUE klass, VALUE module)
VALUE rb_mod_remove_const(VALUE, VALUE)
VALUE rb_cTrueClass
TrueClass class.
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
MJIT_FUNC_EXPORTED VALUE rb_class_inherited(VALUE super, VALUE klass)
Calls Class::inherited.
VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2)
int rb_const_defined(VALUE, ID)
#define RB_PASS_CALLED_KEYWORDS
int rb_opts_exception_p(VALUE opts, int default_value)
VALUE rb_struct_lookup(VALUE s, VALUE idx)
void rb_gc_register_mark_object(VALUE obj)
VALUE rb_Hash(VALUE val)
Equivalent to Kernel#Hash in Ruby.
VALUE rb_mod_class_variables(int, const VALUE *, VALUE)
void rb_warn(const char *fmt,...)
int rb_block_given_p(void)
Determines if the current method is given a block.
void rb_warning(const char *fmt,...)
VALUE rb_immutable_obj_clone(int, VALUE *, VALUE)
VALUE rb_equal_opt(VALUE obj1, VALUE obj2)
VALUE rb_const_source_location_at(VALUE, ID)
RUBY_EXTERN VALUE rb_cNumeric
#define RBASIC_CLEAR_CLASS(obj)
VALUE rb_str_escape(VALUE str)
VALUE rb_cvar_defined(VALUE, ID)
rb_alloc_func_t rb_get_alloc_func(VALUE)
MJIT_FUNC_EXPORTED bool rb_warning_category_enabled_p(rb_warning_category_t category)
VALUE rb_mod_constants(int, const VALUE *, VALUE)
VALUE rb_dbl2big(double d)
int rb_empty_keyword_given_p(void)
VALUE rb_attr_get(VALUE, ID)
VALUE rb_class_superclass(VALUE klass)
Returns the superclass of klass.
VALUE rb_class_new_instance_kw(int argc, const VALUE *argv, VALUE klass, int kw_splat)
VALUE rb_hash_aref(VALUE hash, VALUE key)
double rb_cstr_to_dbl(const char *p, int badcheck)
Parses a string representation of a floating point number.
void rb_obj_infect(VALUE victim, VALUE carrier)
Does nothing.
rb_encoding * rb_default_external_encoding(void)
VALUE rb_obj_as_string(VALUE)
VALUE rb_module_new(void)
VALUE rb_mod_init_copy(VALUE clone, VALUE orig)
#define wrong_constant_name
#define RB_TYPE_P(obj, type)
#define rb_intern_const(str)
rb_encoding * rb_enc_get(VALUE obj)
#define rb_enc_asciicompat(enc)
VALUE rb_obj_hash(VALUE obj)
void rb_obj_call_init_kw(VALUE obj, int argc, const VALUE *argv, int kw_splat)
VALUE rb_rational_num(VALUE rat)
VALUE rb_check_convert_type(VALUE val, int type, const char *tname, const char *method)
Tries to convert an object into another type.
VALUE rb_obj_untrusted(VALUE obj)
call-seq: obj.untrusted? -> false
#define RUBY_DTRACE_CREATE_HOOK(name, arg)
VALUE rb_rational_den(VALUE rat)
#define CLASS_OR_MODULE_P(obj)
int rb_bool_expected(VALUE obj, const char *flagname)
VALUE rb_define_module(const char *name)
VALUE rb_const_get_at(VALUE, ID)
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
int rb_is_local_name(VALUE name)
VALUE rb_inspect(VALUE obj)
Convenient wrapper of Object::inspect.
#define RB_PASS_EMPTY_KEYWORDS
MJIT_FUNC_EXPORTED VALUE rb_check_to_array(VALUE ary)
VALUE rb_obj_untaint(VALUE obj)
call-seq: obj.untaint -> obj
VALUE rb_check_string_type(VALUE)
VALUE rb_Float(VALUE val)
Equivalent to Kernel#Float in Ruby.
double rb_str_to_dbl(VALUE str, int badcheck)
Parses a string representation of a floating point number.
void rb_const_set(VALUE, ID, VALUE)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_obj_copy_ivar(VALUE dest, VALUE obj)
FUNC_MINIMIZED(double rb_str_to_dbl(VALUE str, int badcheck))
VALUE rb_Integer(VALUE val)
Equivalent to Kernel#Integer in Ruby.
VALUE rb_eql_opt(VALUE obj1, VALUE obj2)
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn)
RUBY_EXTERN VALUE rb_cRational
RUBY_EXTERN VALUE rb_cInteger
#define id_for_var(obj, name, type)
#define SPECIAL_CONST_P(x)
VALUE rb_cBasicObject
BasicObject class.
#define RBASIC_SET_CLASS(obj, cls)
void rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
Iteration over each instance variable of the object.
int rb_obj_respond_to(VALUE, ID, int)
VALUE rb_cData
Data class.
#define rb_obj_instance_variables(object)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
void rb_undef_method(VALUE klass, const char *name)
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *pstate)
Protects a function call from potential global escapes from the function.
int rb_eql(VALUE obj1, VALUE obj2)
Determines if obj1 and obj2 are equal in terms of Object::eql?.
void rb_cvar_set(VALUE, ID, VALUE)
VALUE rb_obj_taint(VALUE obj)
call-seq: obj.taint -> obj
VALUE rb_obj_untrust(VALUE obj)
call-seq: obj.untrust -> obj
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_ivar_get(VALUE, ID)
VALUE rb_to_float(VALUE val)
Converts a Numeric object into Float.
VALUE rb_obj_class(VALUE obj)
Equivalent to Object#class in Ruby.
VALUE rb_const_missing(VALUE klass, VALUE name)
VALUE rb_mKernel
Kernel module.
#define try_to_int(val, mid, raise)
const typedef OnigEncodingType rb_encoding
#define rb_check_frozen(obj)
VALUE rb_str_intern(VALUE)
VALUE rb_obj_is_instance_of(VALUE obj, VALUE c)
Determines if obj is an instance of c.
VALUE rb_Array(VALUE val)
Equivalent to Kernel#Array in Ruby.
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
VALUE rb_cObject
Object class.
VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound)
VALUE rb_convert_type_with_id(VALUE, int, const char *, ID)
int rb_const_defined_from(VALUE, ID)
void rb_singleton_class_attached(VALUE klass, VALUE obj)
Attach a object to a singleton class.
VALUE rb_check_to_integer(VALUE val, const char *method)
Tries to convert val into Integer.
VALUE rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
st_index_t rb_ivar_count(VALUE)
VALUE rb_obj_freeze(VALUE obj)
Make the object unmodifiable.
#define RBASIC_CLASS(obj)
void rb_copy_generic_ivar(VALUE, VALUE)
VALUE rb_f_sprintf(int, const VALUE *)
VALUE rb_mod_remove_cvar(VALUE, VALUE)
VALUE rb_obj_frozen_p(VALUE obj)
Determines if the object is frozen.
void rb_gc_copy_finalizer(VALUE dest, VALUE obj)
#define IMPLICIT_CONVERSIONS
#define StringValuePtr(v)
VALUE rb_class_boot(VALUE super)
A utility function that wraps class_alloc.
VALUE rb_mod_included_modules(VALUE mod)
int rb_is_instance_id(ID id)
VALUE rb_cModule
Module class.
VALUE rb_const_get_from(VALUE, ID)
VALUE rb_to_int(VALUE val)
Converts val into Integer.
VALUE rb_class_get_superclass(VALUE klass)
Returns the superclass of klass The return value might be an iclass of a module, unlike rb_class_supe...
const char * rb_class2name(VALUE)
VALUE rb_check_to_int(VALUE val)
Tries to convert val into Integer.
void rb_invalid_str(const char *str, const char *type)
rb_encoding * rb_default_internal_encoding(void)
VALUE rb_obj_dup(VALUE obj)
Equivalent to Object#dup in Ruby.
VALUE rb_obj_trust(VALUE obj)
call-seq: obj.trust -> obj
VALUE rb_fstring_new(const char *ptr, long len)
#define CONST_ID(var, str)
VALUE rb_class_search_ancestor(VALUE klass, VALUE super)
VALUE rb_check_array_type(VALUE ary)
VALUE rb_yield_values2(int n, const VALUE *argv)
void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj)
VALUE rb_check_hash_type(VALUE hash)
VALUE rb_extract_keywords(VALUE *orighash)
VALUE rb_const_source_location(VALUE, ID)
unsigned char buf[MIME_BUF_SIZE]
VALUE rb_str_append(VALUE, VALUE)
void rb_bug(const char *fmt,...)
MJIT_FUNC_EXPORTED VALUE rb_false(VALUE obj)
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
void rb_define_global_const(const char *, VALUE)
VALUE rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
VALUE rb_obj_init_dup_clone(VALUE obj, VALUE orig)
Default implementation of #initialize_dup and #initialize_clone.
VALUE rb_sprintf(const char *format,...)
VALUE rb_cFalseClass
FalseClass class.
VALUE rb_str_subseq(VALUE, long, long)
VALUE rb_obj_alloc(VALUE klass)
Allocates an instance of klass.
char str[HTML_ESCAPE_MAX_LEN+1]
VALUE rb_convert_type(VALUE val, int type, const char *tname, const char *method)
Converts an object into another type.
int rb_is_const_sym(VALUE sym)
#define MEMCPY(p1, p2, type, n)
VALUE rb_mod_module_exec(int, const VALUE *, VALUE)
VALUE(* rb_alloc_func_t)(VALUE)
VALUE rb_ivar_defined(VALUE, ID)
VALUE rb_obj_init_copy(VALUE obj, VALUE orig)
Default implementation of #initialize_copy.
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc)
double rb_num2dbl(VALUE val)
Converts a Numeric object to double.
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
const char * rb_obj_classname(VALUE)
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
int rb_is_local_id(ID id)
VALUE rb_make_metaclass(VALUE obj, VALUE unused)
VALUE rb_String(VALUE val)
Equivalent to Kernel#String in Ruby.
#define rb_name_err_raise_str(mesg, recv, name)
VALUE rb_cClass
Class class.
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
void rb_deprecate_constant(VALUE mod, const char *name)
#define MJIT_FUNC_EXPORTED
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
VALUE rb_str_catf(VALUE str, const char *format,...)
#define opts_exception_p(opts)
VALUE rb_obj_remove_instance_variable(VALUE, VALUE)
VALUE rb_class_name(VALUE)
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
#define rb_usascii_str_new2
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates and initializes an instance of klass.
VALUE rb_cvar_get(VALUE, ID)
VALUE rb_ivar_set(VALUE, ID, VALUE)
#define RGENGC_WB_PROTECTED_OBJECT
#define rb_intern_str(string)
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj)
int rb_const_defined_at(VALUE, ID)
VALUE rb_ary_at(VALUE ary, VALUE pos)
VALUE rb_mod_include_p(VALUE mod, VALUE mod2)
VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type)
Fills common (RBasic) fields in obj.
#define RB_INTEGER_TYPE_P(obj)
int rb_enc_str_asciionly_p(VALUE)
#define NEWOBJ_OF(obj, type, klass, flags)
VALUE rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
@ RB_WARN_CATEGORY_DEPRECATED
double rb_num_to_dbl(VALUE val)
#define rb_name_err_raise(mesg, recv, name)
void rb_undef_alloc_func(VALUE)
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
VALUE rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_mod_const_missing(VALUE klass, VALUE name)
VALUE rb_any_to_s(VALUE obj)
Default implementation of #to_s.
VALUE rb_cNilClass
NilClass class.
VALUE rb_obj_reveal(VALUE obj, VALUE klass)
Make a hidden object visible again.
void rb_attr(VALUE, ID, int, int, int)
VALUE rb_obj_is_kind_of(VALUE obj, VALUE c)
Determines if obj is a kind of c.
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define RB_FLOAT_TYPE_P(obj)
VALUE rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
VALUE rb_obj_tainted(VALUE obj)
call-seq: obj.tainted? -> false
VALUE rb_obj_clone(VALUE obj)
Almost same as Object::clone.
VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg, int kw_splat)
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
VALUE rb_mod_ancestors(VALUE mod)
rb_encoding * rb_usascii_encoding(void)
VALUE rb_check_to_float(VALUE val)
Tries to convert an object into Float.
VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception)
VALUE rb_class_inherited_p(VALUE mod, VALUE arg)
Determines if mod inherits arg.
void rb_check_inheritable(VALUE super)
Ensures a class can be derived from super.
VALUE rb_class_real(VALUE cl)
Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions.
VALUE rb_equal(VALUE obj1, VALUE obj2)
Same as Object#===, case equality.
VALUE rb_const_get(VALUE, ID)