Ruby
2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
|
Go to the documentation of this file.
30 # include <AvailabilityMacros.h>
39 #define EXIT_SUCCESS 0
43 #define WIFEXITED(status) 1
47 #define WEXITSTATUS(status) (status)
57 static VALUE rb_mWarning;
58 static VALUE rb_cWarningBuffer;
67 #define defined_error(name, num) if (err == (num)) return (name);
68 #define undefined_error(name)
69 #include "known_errors.inc"
71 #undef undefined_error
76 err_position_0(
char *
buf,
long len,
const char *file,
int line)
90 err_vcatf(
VALUE str,
const char *pre,
const char *file,
int line,
110 err_vcatf(mesg,
NULL, fn, line,
fmt, args);
125 err_vcatf(mesg,
NULL, fn, line,
fmt, args);
131 static unsigned int warning_disabled_categories = (
136 rb_warning_category_mask(
VALUE category)
161 warning_disabled_categories &= ~
mask;
162 warning_disabled_categories |=
mask & ~bits;
168 return !(warning_disabled_categories & (1
U << category));
208 unsigned int mask = rb_warning_category_mask(category);
209 unsigned int disabled = warning_disabled_categories;
214 warning_disabled_categories = disabled;
259 rb_warning_warn(rb_mWarning,
str);
267 err_vcatf(
str,
"warning: ", file, line,
fmt, args);
280 str = warn_vsprintf(
NULL, file, line,
fmt, args);
282 rb_write_warning_str(
str);
295 str = warn_vsprintf(
NULL, file, line,
fmt, args);
297 rb_write_warning_str(
str);
305 return warn_vsprintf(enc, file, line,
fmt, args);
308 #define with_warning_string(mesg, enc, fmt) \
310 va_list args; va_start(args, fmt); \
311 mesg = warning_string(enc, fmt, args); \
319 rb_write_warning_str(mesg);
329 rb_write_warning_str(mesg);
340 rb_write_warning_str(mesg);
359 rb_write_warning_str(mesg);
372 VALUE mesg = warning_string(0,
fmt, args);
376 if (suggest)
rb_str_catf(mesg,
"; use %s instead", suggest);
378 rb_write_warning_str(mesg);
382 end_with_asciichar(
VALUE str,
int c)
408 if (!
NIL_P(uplevel)) {
414 if (!
NIL_P(location)) {
418 if (
argc > 1 || !
NIL_P(uplevel) || !end_with_asciichar(
str,
'\n')) {
420 if (
NIL_P(uplevel)) {
423 else if (
NIL_P(location) ||
436 if (
exc == rb_mWarning) {
441 rb_write_warning_str(
str);
447 #define MAX_BUG_REPORTERS 0x100
449 static struct bug_reporters {
450 void (*func)(
FILE *out,
void *data);
454 static int bug_reporters_size;
459 struct bug_reporters *reporter;
463 reporter = &bug_reporters[bug_reporters_size++];
464 reporter->func = func;
465 reporter->data = data;
471 #define REPORT_BUG_BUFSIZ 256
473 bug_report_file(
const char *file,
int line)
477 int len = err_position_0(
buf,
sizeof(
buf), file, line);
490 bug_important_message(
FILE *out,
const char *
const msg,
size_t len)
492 const char *
const endmsg = msg +
len;
497 static const char red[] =
"\033[;31;1;7m";
498 static const char green[] =
"\033[;32;7m";
499 static const char reset[] =
"\033[m";
500 const char *e =
strchr(p,
'\n');
501 const int w = (
int)(e - p);
503 int i = (
int)(e - p);
504 fputs(*p ==
' ' ? green : red, out);
506 for (;
i < w; ++
i)
fputc(
' ', out);
509 }
while ((p = e + 1) < endmsg && (e =
strchr(p,
'\n')) != 0 && e > p + 1);
511 fwrite(p, 1, endmsg - p, out);
515 preface_dump(
FILE *out)
517 #if defined __APPLE__
518 static const char msg[] =
""
519 "-- Crash Report log information "
520 "--------------------------------------------\n"
521 " See Crash Report log file under the one of following:\n"
522 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
523 " * ~/Library/Logs/CrashReporter\n"
524 " * /Library/Logs/CrashReporter\n"
526 " * ~/Library/Logs/DiagnosticReports\n"
527 " * /Library/Logs/DiagnosticReports\n"
528 " for more details.\n"
529 "Don't forget to include the above Crash Report log file in bug reports.\n"
531 const size_t msglen =
sizeof(msg) - 1;
533 const char *msg =
NULL;
534 const size_t msglen = 0;
536 bug_important_message(out, msg, msglen);
540 postscript_dump(
FILE *out)
542 #if defined __APPLE__
543 static const char msg[] =
""
546 "\n""Don't forget to include the Crash Report log file under\n"
547 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
550 "DiagnosticReports directory in bug reports.\n"
553 const size_t msglen =
sizeof(msg) - 1;
555 const char *msg =
NULL;
556 const size_t msglen = 0;
558 bug_important_message(out, msg, msglen);
566 fputs(
"[BUG] ", out);
574 const char *cmd =
getenv(
"RUBY_ON_BUG");
579 snprintf(
buf,
sizeof(
buf),
"Launching RUBY_ON_BUG command failed.");
585 #define bug_report_begin(out, fmt) do { \
587 va_start(args, fmt); \
588 bug_report_begin_valist(out, fmt, args); \
593 bug_report_end(
FILE *out)
598 for (
i=0;
i<bug_reporters_size;
i++) {
599 struct bug_reporters *reporter = &bug_reporters[
i];
600 (*reporter->func)(out, reporter->data);
603 postscript_dump(out);
606 #define report_bug(file, line, fmt, ctx) do { \
607 FILE *out = bug_report_file(file, line); \
609 bug_report_begin(out, fmt); \
610 rb_vm_bugreport(ctx); \
611 bug_report_end(out); \
615 #define report_bug_valist(file, line, fmt, ctx, args) do { \
616 FILE *out = bug_report_file(file, line); \
618 bug_report_begin_valist(out, fmt, args); \
619 rb_vm_bugreport(ctx); \
620 bug_report_end(out); \
628 #if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80
629 _set_abort_behavior( 0, _CALL_REPORTFAULT);
638 const char *file =
NULL;
653 const char *file =
NULL;
662 if (default_sighandler) default_sighandler(
sig);
672 rb_bug(
"%s: errno == 0 (NOERROR)", mesg);
674 const char *errno_str = rb_strerrno(errno_arg);
686 #define write_or_abort(fd, str, len) (write((fd), (str), (len)) < 0 ? abort() : (void)0)
687 #define WRITE_CONST(fd,str) write_or_abort((fd),(str),sizeof(str) - 1)
696 if (errno_arg == 0) {
700 const char *errno_str = rb_strerrno(errno_arg);
703 errno_str =
"undefined errno";
721 fprintf(out,
"Assertion Failed: %s:%d:", file, line);
730 static const char builtin_types[][10] = {
766 if ((
unsigned int)t >=
numberof(builtin_types))
return 0;
767 name = builtin_types[t];
773 builtin_class_name(
VALUE x)
801 const char *etype = builtin_class_name(x);
810 #define UNDEF_LEAKED "undef leaked to the Ruby space"
813 unexpected_type(
VALUE x,
int xt,
int t)
819 const char *cname = builtin_class_name(x);
821 mesg =
rb_sprintf(
"wrong argument type %s (expected %s)",
828 else if (xt >
T_MASK && xt <= 0x3f) {
829 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given, probably comes"
830 " from extension library for ruby 1.8)", t, xt);
833 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given)", t, xt);
849 unexpected_type(x, xt, t);
860 unexpected_type(x,
TYPE(x), t);
867 if (child == parent)
return 1;
883 #undef rb_typeddata_is_instance_of
887 return rb_typeddata_is_instance_of_inline(
obj, data_type);
897 etype = builtin_class_name(
obj);
945 static VALUE rb_eNOERROR;
948 #define id_cause ruby_static_id_cause
949 static ID id_message, id_backtrace;
950 static ID id_key, id_args, id_Errno, id_errno, id_i_path;
951 static ID id_receiver, id_recv, id_iseq, id_local_variables;
952 static ID id_private_call_p, id_top, id_bottom;
954 #define id_bt_locations idBt_locations
955 #define id_mesg idMesg
956 #define id_name idName
958 #undef rb_exc_new_cstr
1003 return exc_init(
exc,
arg);
1025 if (
argc == 0)
return self;
1026 if (
argc == 1 &&
self ==
argv[0])
return self;
1068 exc_s_to_tty_p(
VALUE self)
1095 enum {kw_highlight, kw_order, kw_max_};
1096 static ID kw[kw_max_];
1102 #define INIT_KW(n) kw[kw_##n] = rb_intern_const(#n)
1108 switch (args[kw_highlight]) {
1111 "highlight: %+"PRIsVALUE, args[kw_highlight]);
1112 case Qundef: args[kw_highlight] =
Qnil;
break;
1115 if (args[kw_order] ==
Qundef) {
1116 args[kw_order] =
Qnil;
1120 if (
id == id_bottom) args[kw_order] =
Qtrue;
1121 else if (
id == id_top) args[kw_order] =
Qfalse;
1233 ID mid = id_backtrace;
1241 info = exc_backtrace(
exc);
1248 return rb_check_backtrace(info);
1274 rb_check_backtrace(
VALUE bt)
1277 static const char err[] =
"backtrace must be Array of String";
1314 return exc_set_backtrace(
exc, bt);
1333 try_convert_to_exception(
VALUE obj)
1350 VALUE mesg, backtrace;
1370 backtrace = exc_backtrace(
obj);
1412 if (
NIL_P(status)) {
1416 #if EXIT_SUCCESS != 0
1462 if (
NIL_P(status_val))
1497 keywords[0] = id_receiver;
1500 err_init_recv(
self, values[0]);
1512 #define frozen_err_receiver name_err_receiver
1551 err_init_recv(
exc, recv);
1576 keywords[0] = id_receiver;
1580 name_err_init_attr(
self, values[0],
name);
1589 exc_init(
exc, rb_name_err_mesg_new(mesg, recv, method));
1590 return name_err_init_attr(
exc, recv, method);
1597 return name_err_init(
exc, mesg, recv, method);
1608 name_err_name(
VALUE self)
1624 name_err_local_variables(
VALUE self)
1665 VALUE args, options;
1671 return nometh_err_init_attr(
self, args, priv);
1678 name_err_init(
exc, mesg, recv, method);
1679 return nometh_err_init_attr(
exc, args, priv);
1691 name_err_mesg_mark(
void *p)
1697 #define name_err_mesg_free RUBY_TYPED_DEFAULT_FREE
1700 name_err_mesg_memsize(
const void *p)
1710 name_err_mesg_memsize,
1760 VALUE c, s, d = 0, args[4];
1761 int state = 0, singleton = 0;
1764 #define FAKE_CSTR(v, str) rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)
1806 return name_err_mesg_to_str(
obj);
1824 name_err_receiver(
VALUE self)
1829 if (recv !=
Qundef)
return recv;
1848 nometh_err_args(
VALUE self)
1861 nometh_err_private_call_p(
VALUE self)
1882 key_err_receiver(
VALUE self)
1887 if (recv !=
Qundef)
return recv;
1899 key_err_key(
VALUE self)
1934 if (!
NIL_P(options)) {
1938 keywords[0] = id_receiver;
1939 keywords[1] = id_key;
2003 set_syserr(
int n,
const char *
name)
2015 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
2063 #if !defined(_WIN32)
2090 else err =
"unknown error";
2114 syserr_errno(
VALUE self)
2698 raise_loaderror(
Qnil, mesg);
2710 raise_loaderror(
path, mesg);
2717 "%"PRIsVALUE"() function is unimplemented on this machine",
2743 make_errno_exc(
const char *mesg)
2749 rb_bug(
"rb_sys_fail(%s) - errno == 0", mesg ? mesg :
"");
2755 make_errno_exc_str(
VALUE mesg)
2760 if (!mesg) mesg =
Qnil;
2763 rb_bug(
"rb_sys_fail_str(%s) - errno == 0", s);
2806 #ifdef RUBY_FUNCTION_NAME_STRING
2808 rb_sys_fail_path_in(
const char *func_name,
VALUE path)
2813 rb_syserr_fail_path_in(func_name,
n,
path);
2817 rb_syserr_fail_path_in(
const char *func_name,
int n,
VALUE path)
2824 if (!func_name) func_name =
"(null)";
2825 rb_bug(
"rb_sys_fail_path_in(%s, %s) - errno == 0",
2845 VALUE exc = make_errno_exc_str(mesg);
2867 syserr_warning(
VALUE mesg,
int err)
2871 rb_write_warning_str(mesg);
2876 rb_sys_warn(
const char *
fmt, ...)
2879 int errno_save =
errno;
2881 syserr_warning(mesg, errno_save);
2888 rb_syserr_warn(
int err,
const char *
fmt, ...)
2892 syserr_warning(mesg,
err);
2901 int errno_save =
errno;
2903 syserr_warning(mesg, errno_save);
2914 syserr_warning(mesg,
err);
2924 int errno_save =
errno;
2926 syserr_warning(mesg, errno_save);
2934 rb_syserr_warning(
int err,
const char *
fmt, ...)
2938 syserr_warning(mesg,
err);
2948 int errno_save =
errno;
2950 syserr_warning(mesg, errno_save);
2961 syserr_warning(mesg,
err);
2972 raise_loaderror(
path, mesg);
3028 #undef rb_check_frozen
3038 rb_warning(
"rb_error_untrusted is deprecated and will be removed in Ruby 3.2.");
3041 #undef rb_check_trusted
3045 rb_warning(
"rb_check_trusted is deprecated and will be removed in Ruby 3.2.");
3059 rb_eNOERROR = set_syserr(0,
"NOERROR");
3060 #define defined_error(name, num) set_syserr((num), (name));
3061 #define undefined_error(name) set_syserr(0, (name));
3062 #include "known_errors.inc"
3063 #undef defined_error
3064 #undef undefined_error
3067 #include "warning.rbinc"
int rb_str_end_with_asciichar(VALUE str, int c)
VALUE rb_io_puts(int, const VALUE *, VALUE)
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_define_class(const char *name, VALUE super)
Defines a top-level class.
VALUE rb_str_vcatf(VALUE, const char *, va_list)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
VALUE rb_exc_new(VALUE etype, const char *ptr, long len)
RUBY_EXTERN VALUE rb_cData
void rb_check_type(VALUE x, int t)
VALUE rb_exc_new_str(VALUE etype, VALUE str)
void rb_warning_category_update(unsigned int mask, unsigned int bits)
#define RB_PASS_CALLED_KEYWORDS
#define report_bug(file, line, fmt, ctx)
void rb_warn(const char *fmt,...)
int rb_bug_reporter_add(void(*func)(FILE *, void *), void *data)
void rb_warning(const char *fmt,...)
ID rb_make_internal_id(void)
char * strchr(char *, char)
RETSIGTYPE(* ruby_sighandler_t)(int)
MJIT_FUNC_EXPORTED bool rb_warning_category_enabled_p(rb_warning_category_t category)
void rb_gc_mark_locations(const VALUE *start, const VALUE *end)
#define RTYPEDDATA_TYPE(v)
void rb_bug_errno(const char *mesg, int errno_arg)
VALUE rb_attr_get(VALUE, ID)
#define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_)
const rb_data_type_t * parent
st_table * st_init_numtable(void)
VALUE rb_equal(VALUE, VALUE)
Same as Object#===, case equality.
rb_encoding * rb_locale_encoding(void)
VALUE rb_obj_as_string(VALUE)
VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE key)
#define RB_TYPE_P(obj, type)
#define rb_intern_const(str)
void st_add_direct(st_table *tab, st_data_t key, st_data_t value)
VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
VALUE rb_enc_vsprintf(rb_encoding *, const char *, va_list)
MJIT_FUNC_EXPORTED void rb_assert_failure(const char *file, int line, const char *name, const char *expr)
VALUE rb_define_module(const char *name)
VALUE rb_call_super(int, const VALUE *)
void rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse)
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE rb_check_string_type(VALUE)
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
void rb_mod_syserr_fail(VALUE mod, int e, const char *mesg)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_check_frozen(VALUE obj)
void rb_loaderror(const char *fmt,...)
void rb_name_error(ID id, const char *fmt,...)
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
int rb_stderr_tty_p(void)
void rb_print_backtrace(void)
int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent)
#define RBASIC_SET_CLASS(obj, cls)
#define name_err_mesg_free
#define REPORT_BUG_BUFSIZ
void rb_fatal(const char *fmt,...)
size_t strlen(const char *)
#define rb_check_frozen_internal(obj)
void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *ctx, const char *fmt,...)
@ RB_WARN_CATEGORY_EXPERIMENTAL
int rb_respond_to(VALUE, ID)
const char * wrap_struct_name
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *pstate)
Protects a function call from potential global escapes from the function.
VALUE rb_eNoMatchingPatternError
VALUE rb_backtrace_to_location_ary(VALUE obj)
VALUE rb_enc_str_new_cstr(const char *, rb_encoding *)
#define RARRAY_LENINT(ary)
void rb_error_frozen(const char *what)
#define with_warning_string(mesg, enc, fmt)
VALUE rb_vsprintf(const char *, va_list)
#define frozen_err_receiver
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_ary_entry(VALUE ary, long offset)
void rb_notimplement(void)
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
#define WRITE_CONST(fd, str)
VALUE rb_str_format(int, const VALUE *, VALUE)
void rb_vraise(VALUE exc, const char *fmt, va_list ap)
void rb_load_fail(VALUE path, const char *err)
void rb_syserr_fail(int e, const char *mesg)
RUBY_EXTERN char * strerror(int)
#define WEXITSTATUS(status)
VALUE rb_backtrace_to_str_ary(VALUE obj)
VALUE rb_syserr_new(int n, const char *mesg)
void rb_sys_enc_warning(rb_encoding *enc, const char *fmt,...)
void rb_must_asciicompat(VALUE)
VALUE rb_iseqw_new(const rb_iseq_t *)
VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv)
ID rb_frame_this_func(void)
The original name of the current method.
void rb_error_untrusted(VALUE obj)
VALUE rb_ec_backtrace_location_ary(rb_execution_context_t *ec, long lev, long n)
VALUE rb_iseqw_local_variables(VALUE iseqval)
void rb_check_trusted(VALUE obj)
void rb_compile_warning(const char *file, int line, const char *fmt,...)
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
const char * rb_builtin_type_name(int t)
VALUE rb_get_message(VALUE exc)
void Init_Exception(void)
void rb_mod_sys_fail(VALUE mod, const char *mesg)
#define RARRAY_AREF(a, i)
#define TypedData_Wrap_Struct(klass, data_type, sval)
void rb_error_frozen_object(VALUE frozen_obj)
void rb_sys_fail(const char *mesg)
const char * rb_source_location_cstr(int *pline)
#define MAX_BUG_REPORTERS
void rb_async_bug_errno(const char *mesg, int errno_arg)
#define RTYPEDDATA_DATA(v)
void rb_str_set_len(VALUE, long)
VALUE rb_syserr_new_str(int n, VALUE arg)
int rb_typeddata_is_instance_of(VALUE obj, const rb_data_type_t *data_type)
void rb_frozen_error_raise(VALUE frozen_obj, const char *fmt,...)
VALUE rb_check_to_int(VALUE)
Tries to convert val into Integer.
VALUE rb_syntax_error_append(VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
void rb_invalid_str(const char *str, const char *type)
void rb_extend_object(VALUE obj, VALUE module)
Extend the object with the module.
void rb_sys_warning(const char *fmt,...)
void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
void rb_mod_syserr_fail_str(VALUE mod, int e, VALUE mesg)
VALUE rb_str_buf_append(VALUE, VALUE)
RUBY_EXTERN VALUE rb_cObject
unsigned char buf[MIME_BUF_SIZE]
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
NORETURN(static void die(void))
#define TypedData_Get_Struct(obj, type, data_type, sval)
#define FAKE_CSTR(v, str)
VALUE rb_str_append(VALUE, VALUE)
void rb_bug(const char *fmt,...)
VALUE rb_exc_new_cstr(VALUE etype, const char *s)
int rb_backtrace_p(VALUE obj)
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
RUBY_EXTERN void rb_write_error_str(VALUE mesg)
int ruby_thread_has_gvl_p(void)
MJIT_FUNC_EXPORTED rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
void rb_warn_deprecated(const char *fmt, const char *suggest,...)
VALUE rb_sprintf(const char *format,...)
void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt,...)
VALUE rb_obj_alloc(VALUE)
Allocates an instance of klass.
char str[HTML_ESCAPE_MAX_LEN+1]
#define RARRAY_CONST_PTR(s)
#define RUBY_TYPED_FREE_IMMEDIATELY
RUBY_EXTERN VALUE rb_cString
void rb_enc_raise(rb_encoding *enc, VALUE exc, const char *fmt,...)
VALUE rb_warning_string(const char *fmt,...)
#define write_or_abort(fd, str, len)
void rb_enc_warn(rb_encoding *enc, const char *fmt,...)
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
const char * rb_obj_classname(VALUE)
void rb_sys_fail_str(VALUE mesg)
void rb_vm_bugreport(const void *)
void rb_name_error_str(VALUE str, const char *fmt,...)
void rb_define_const(VALUE, const char *, VALUE)
VALUE rb_eSystemCallError
VALUE rb_String(VALUE)
Equivalent to Kernel#String in Ruby.
const char ruby_description[]
#define MJIT_FUNC_EXPORTED
void * rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
#define RUBY_EVENT_C_RETURN
void rb_compile_warn(const char *file, int line, const char *fmt,...)
VALUE rb_str_catf(VALUE str, const char *format,...)
VALUE rb_get_backtrace(VALUE exc)
VALUE rb_class_name(VALUE)
VALUE rb_call_super_kw(int, const VALUE *, int)
void rb_check_copyable(VALUE obj, VALUE orig)
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
FUNC_MINIMIZED(static void bug_important_message(FILE *out, const char *const msg, size_t len))
VALUE rb_ivar_set(VALUE, ID, VALUE)
void rb_exc_fatal(VALUE mesg)
Raises a fatal error in the current thread.
char * rb_string_value_ptr(volatile VALUE *)
#define RUBY_EVENT_C_CALL
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
const char * rb_builtin_class_name(VALUE x)
@ RB_WARN_CATEGORY_DEPRECATED
#define rb_fstring_lit(str)
int st_lookup(st_table *tab, st_data_t key, st_data_t *value)
rb_warning_category_t rb_warning_category_from_name(VALUE category)
VALUE rb_str_tmp_new(long)
void rb_loaderror_with_path(VALUE path, const char *fmt,...)
#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)
VALUE rb_any_to_s(VALUE)
Default implementation of #to_s.
void rb_attr(VALUE, ID, int, int, int)
VALUE rb_enc_str_new(const char *, long, rb_encoding *)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
#define report_bug_valist(file, line, fmt, ctx, args)
VALUE type(ANYARGS)
ANYARGS-ed function type.
MJIT_FUNC_EXPORTED VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt)
void rb_unexpected_type(VALUE x, int t)
void rb_mod_sys_fail_str(VALUE mod, VALUE mesg)
VALUE rb_obj_clone(VALUE)
Almost same as Object::clone.
#define WIFEXITED(status)
rb_encoding * rb_usascii_encoding(void)
void rb_syserr_fail_str(int e, VALUE mesg)
VALUE rb_const_get(VALUE, ID)