Ruby
2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
|
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;
134 rb_warning_category_mask(
VALUE category)
159 warning_disabled_categories &= ~
mask;
160 warning_disabled_categories |=
mask & ~bits;
166 return !(warning_disabled_categories & (1
U << category));
206 unsigned int mask = rb_warning_category_mask(category);
207 unsigned int disabled = warning_disabled_categories;
212 warning_disabled_categories = disabled;
257 rb_warning_warn(rb_mWarning,
str);
265 err_vcatf(
str,
"warning: ", file, line,
fmt, args);
278 str = warn_vsprintf(
NULL, file, line,
fmt, args);
280 rb_write_warning_str(
str);
293 str = warn_vsprintf(
NULL, file, line,
fmt, args);
295 rb_write_warning_str(
str);
303 return warn_vsprintf(enc, file, line,
fmt, args);
306 #define with_warning_string(mesg, enc, fmt) \
308 va_list args; va_start(args, fmt); \
309 mesg = warning_string(enc, fmt, args); \
317 rb_write_warning_str(mesg);
327 rb_write_warning_str(mesg);
338 rb_write_warning_str(mesg);
357 rb_write_warning_str(mesg);
370 VALUE mesg = warning_string(0,
fmt, args);
374 if (suggest)
rb_str_catf(mesg,
"; use %s instead", suggest);
376 rb_write_warning_str(mesg);
380 end_with_asciichar(
VALUE str,
int c)
406 if (!
NIL_P(uplevel)) {
412 if (!
NIL_P(location)) {
416 if (
argc > 1 || !
NIL_P(uplevel) || !end_with_asciichar(
str,
'\n')) {
418 if (
NIL_P(uplevel)) {
421 else if (
NIL_P(location) ||
434 if (
exc == rb_mWarning) {
439 rb_write_warning_str(
str);
445 #define MAX_BUG_REPORTERS 0x100
447 static struct bug_reporters {
448 void (*func)(
FILE *out,
void *data);
452 static int bug_reporters_size;
457 struct bug_reporters *reporter;
461 reporter = &bug_reporters[bug_reporters_size++];
462 reporter->func = func;
463 reporter->data = data;
469 #define REPORT_BUG_BUFSIZ 256
471 bug_report_file(
const char *file,
int line)
475 int len = err_position_0(
buf,
sizeof(
buf), file, line);
488 bug_important_message(
FILE *out,
const char *
const msg,
size_t len)
490 const char *
const endmsg = msg +
len;
495 static const char red[] =
"\033[;31;1;7m";
496 static const char green[] =
"\033[;32;7m";
497 static const char reset[] =
"\033[m";
498 const char *e =
strchr(p,
'\n');
499 const int w = (
int)(e - p);
501 int i = (
int)(e - p);
502 fputs(*p ==
' ' ? green : red, out);
504 for (;
i < w; ++
i)
fputc(
' ', out);
507 }
while ((p = e + 1) < endmsg && (e =
strchr(p,
'\n')) != 0 && e > p + 1);
509 fwrite(p, 1, endmsg - p, out);
513 preface_dump(
FILE *out)
515 #if defined __APPLE__
516 static const char msg[] =
""
517 "-- Crash Report log information "
518 "--------------------------------------------\n"
519 " See Crash Report log file under the one of following:\n"
520 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
521 " * ~/Library/Logs/CrashReporter\n"
522 " * /Library/Logs/CrashReporter\n"
524 " * ~/Library/Logs/DiagnosticReports\n"
525 " * /Library/Logs/DiagnosticReports\n"
526 " for more details.\n"
527 "Don't forget to include the above Crash Report log file in bug reports.\n"
529 const size_t msglen =
sizeof(msg) - 1;
531 const char *msg =
NULL;
532 const size_t msglen = 0;
534 bug_important_message(out, msg, msglen);
538 postscript_dump(
FILE *out)
540 #if defined __APPLE__
541 static const char msg[] =
""
544 "\n""Don't forget to include the Crash Report log file under\n"
545 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
548 "DiagnosticReports directory in bug reports.\n"
551 const size_t msglen =
sizeof(msg) - 1;
553 const char *msg =
NULL;
554 const size_t msglen = 0;
556 bug_important_message(out, msg, msglen);
564 fputs(
"[BUG] ", out);
572 const char *cmd =
getenv(
"RUBY_ON_BUG");
577 snprintf(
buf,
sizeof(
buf),
"Launching RUBY_ON_BUG command failed.");
583 #define bug_report_begin(out, fmt) do { \
585 va_start(args, fmt); \
586 bug_report_begin_valist(out, fmt, args); \
591 bug_report_end(
FILE *out)
596 for (
i=0;
i<bug_reporters_size;
i++) {
597 struct bug_reporters *reporter = &bug_reporters[
i];
598 (*reporter->func)(out, reporter->data);
601 postscript_dump(out);
604 #define report_bug(file, line, fmt, ctx) do { \
605 FILE *out = bug_report_file(file, line); \
607 bug_report_begin(out, fmt); \
608 rb_vm_bugreport(ctx); \
609 bug_report_end(out); \
613 #define report_bug_valist(file, line, fmt, ctx, args) do { \
614 FILE *out = bug_report_file(file, line); \
616 bug_report_begin_valist(out, fmt, args); \
617 rb_vm_bugreport(ctx); \
618 bug_report_end(out); \
626 #if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80
627 _set_abort_behavior( 0, _CALL_REPORTFAULT);
636 const char *file =
NULL;
651 const char *file =
NULL;
660 if (default_sighandler) default_sighandler(
sig);
670 rb_bug(
"%s: errno == 0 (NOERROR)", mesg);
672 const char *errno_str = rb_strerrno(errno_arg);
684 #define write_or_abort(fd, str, len) (write((fd), (str), (len)) < 0 ? abort() : (void)0)
685 #define WRITE_CONST(fd,str) write_or_abort((fd),(str),sizeof(str) - 1)
694 if (errno_arg == 0) {
698 const char *errno_str = rb_strerrno(errno_arg);
701 errno_str =
"undefined errno";
719 fprintf(out,
"Assertion Failed: %s:%d:", file, line);
728 static const char builtin_types[][10] = {
764 if ((
unsigned int)t >=
numberof(builtin_types))
return 0;
765 name = builtin_types[t];
771 builtin_class_name(
VALUE x)
799 const char *etype = builtin_class_name(x);
808 #define UNDEF_LEAKED "undef leaked to the Ruby space"
811 unexpected_type(
VALUE x,
int xt,
int t)
817 const char *cname = builtin_class_name(x);
819 mesg =
rb_sprintf(
"wrong argument type %s (expected %s)",
826 else if (xt >
T_MASK && xt <= 0x3f) {
827 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given, probably comes"
828 " from extension library for ruby 1.8)", t, xt);
831 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given)", t, xt);
847 unexpected_type(x, xt, t);
858 unexpected_type(x,
TYPE(x), t);
865 if (child == parent)
return 1;
881 #undef rb_typeddata_is_instance_of
885 return rb_typeddata_is_instance_of_inline(
obj, data_type);
895 etype = builtin_class_name(
obj);
943 static VALUE rb_eNOERROR;
946 #define id_cause ruby_static_id_cause
947 static ID id_message, id_backtrace;
948 static ID id_key, id_args, id_Errno, id_errno, id_i_path;
949 static ID id_receiver, id_recv, id_iseq, id_local_variables;
950 static ID id_private_call_p, id_top, id_bottom;
952 #define id_bt_locations idBt_locations
953 #define id_mesg idMesg
954 #define id_name idName
956 #undef rb_exc_new_cstr
1001 return exc_init(
exc,
arg);
1023 if (
argc == 0)
return self;
1024 if (
argc == 1 &&
self ==
argv[0])
return self;
1066 exc_s_to_tty_p(
VALUE self)
1093 enum {kw_highlight, kw_order, kw_max_};
1094 static ID kw[kw_max_];
1100 #define INIT_KW(n) kw[kw_##n] = rb_intern_const(#n)
1106 switch (args[kw_highlight]) {
1109 "highlight: %+"PRIsVALUE, args[kw_highlight]);
1110 case Qundef: args[kw_highlight] =
Qnil;
break;
1113 if (args[kw_order] ==
Qundef) {
1114 args[kw_order] =
Qnil;
1118 if (
id == id_bottom) args[kw_order] =
Qtrue;
1119 else if (
id == id_top) args[kw_order] =
Qfalse;
1231 ID mid = id_backtrace;
1239 info = exc_backtrace(
exc);
1246 return rb_check_backtrace(info);
1272 rb_check_backtrace(
VALUE bt)
1275 static const char err[] =
"backtrace must be Array of String";
1312 return exc_set_backtrace(
exc, bt);
1331 try_convert_to_exception(
VALUE obj)
1348 VALUE mesg, backtrace;
1368 backtrace = exc_backtrace(
obj);
1410 if (
NIL_P(status)) {
1414 #if EXIT_SUCCESS != 0
1460 if (
NIL_P(status_val))
1495 keywords[0] = id_receiver;
1498 err_init_recv(
self, values[0]);
1510 #define frozen_err_receiver name_err_receiver
1549 err_init_recv(
exc, recv);
1574 keywords[0] = id_receiver;
1578 name_err_init_attr(
self, values[0],
name);
1587 exc_init(
exc, rb_name_err_mesg_new(mesg, recv, method));
1588 return name_err_init_attr(
exc, recv, method);
1595 return name_err_init(
exc, mesg, recv, method);
1606 name_err_name(
VALUE self)
1622 name_err_local_variables(
VALUE self)
1663 VALUE args, options;
1669 return nometh_err_init_attr(
self, args, priv);
1676 name_err_init(
exc, mesg, recv, method);
1677 return nometh_err_init_attr(
exc, args, priv);
1689 name_err_mesg_mark(
void *p)
1695 #define name_err_mesg_free RUBY_TYPED_DEFAULT_FREE
1698 name_err_mesg_memsize(
const void *p)
1708 name_err_mesg_memsize,
1758 VALUE c, s, d = 0, args[4];
1759 int state = 0, singleton = 0;
1762 #define FAKE_CSTR(v, str) rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)
1804 return name_err_mesg_to_str(
obj);
1822 name_err_receiver(
VALUE self)
1827 if (recv !=
Qundef)
return recv;
1846 nometh_err_args(
VALUE self)
1859 nometh_err_private_call_p(
VALUE self)
1880 key_err_receiver(
VALUE self)
1885 if (recv !=
Qundef)
return recv;
1897 key_err_key(
VALUE self)
1932 if (!
NIL_P(options)) {
1936 keywords[0] = id_receiver;
1937 keywords[1] = id_key;
2001 set_syserr(
int n,
const char *
name)
2013 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
2061 #if !defined(_WIN32)
2088 else err =
"unknown error";
2112 syserr_errno(
VALUE self)
2696 raise_loaderror(
Qnil, mesg);
2708 raise_loaderror(
path, mesg);
2715 "%"PRIsVALUE"() function is unimplemented on this machine",
2741 make_errno_exc(
const char *mesg)
2747 rb_bug(
"rb_sys_fail(%s) - errno == 0", mesg ? mesg :
"");
2753 make_errno_exc_str(
VALUE mesg)
2758 if (!mesg) mesg =
Qnil;
2761 rb_bug(
"rb_sys_fail_str(%s) - errno == 0", s);
2804 #ifdef RUBY_FUNCTION_NAME_STRING
2806 rb_sys_fail_path_in(
const char *func_name,
VALUE path)
2811 rb_syserr_fail_path_in(func_name,
n,
path);
2815 rb_syserr_fail_path_in(
const char *func_name,
int n,
VALUE path)
2822 if (!func_name) func_name =
"(null)";
2823 rb_bug(
"rb_sys_fail_path_in(%s, %s) - errno == 0",
2843 VALUE exc = make_errno_exc_str(mesg);
2865 syserr_warning(
VALUE mesg,
int err)
2869 rb_write_warning_str(mesg);
2874 rb_sys_warn(
const char *
fmt, ...)
2877 int errno_save =
errno;
2879 syserr_warning(mesg, errno_save);
2886 rb_syserr_warn(
int err,
const char *
fmt, ...)
2890 syserr_warning(mesg,
err);
2899 int errno_save =
errno;
2901 syserr_warning(mesg, errno_save);
2912 syserr_warning(mesg,
err);
2922 int errno_save =
errno;
2924 syserr_warning(mesg, errno_save);
2932 rb_syserr_warning(
int err,
const char *
fmt, ...)
2936 syserr_warning(mesg,
err);
2946 int errno_save =
errno;
2948 syserr_warning(mesg, errno_save);
2959 syserr_warning(mesg,
err);
2970 raise_loaderror(
path, mesg);
3026 #undef rb_check_frozen
3036 rb_warning(
"rb_error_untrusted is deprecated and will be removed in Ruby 3.2.");
3039 #undef rb_check_trusted
3043 rb_warning(
"rb_check_trusted is deprecated and will be removed in Ruby 3.2.");
3057 rb_eNOERROR = set_syserr(0,
"NOERROR");
3058 #define defined_error(name, num) set_syserr((num), (name));
3059 #define undefined_error(name) set_syserr(0, (name));
3060 #include "known_errors.inc"
3061 #undef defined_error
3062 #undef undefined_error
3065 #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,...)
const typedef OnigEncodingType rb_encoding
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 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
#define RARRAY_AREF(a, i)
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)
#define RARRAY_CONST_PTR(a)
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 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)