28 # include <AvailabilityMacros.h> 37 #define EXIT_SUCCESS 0 41 #define WIFEXITED(status) 1 45 #define WEXITSTATUS(status) (status) 62 static const char REPORTBUG_MSG[] =
64 "You may have encountered a bug in the Ruby interpreter" \
65 " or extension libraries.\n" \
66 "Bug reports are welcome.\n" \
68 "For details: http://www.ruby-lang.org/bugreport.html\n\n" \
74 #define defined_error(name, num) if (err == (num)) return (name); 75 #define undefined_error(name) 76 #include "known_errors.inc" 78 #undef undefined_error 83 err_position_0(
char *
buf,
long len,
const char *file,
int line)
97 err_vcatf(
VALUE str,
const char *pre,
const char *file,
int line,
98 const char *fmt, va_list args)
117 err_vcatf(mesg,
NULL, fn, line, fmt, args);
132 err_vcatf(mesg,
NULL, fn, line, fmt, args);
142 rb_fatal(
"%s is only for internal use and deprecated; do not use", func);
185 rb_write_warning_str(
VALUE str)
191 warn_vsprintf(
rb_encoding *enc,
const char *file,
int line,
const char *fmt, va_list args)
195 err_vcatf(str,
"warning: ", file, line, fmt, args);
208 str = warn_vsprintf(
NULL, file, line, fmt, args);
210 rb_write_warning_str(str);
223 str = warn_vsprintf(
NULL, file, line, fmt, args);
225 rb_write_warning_str(str);
229 warning_string(
rb_encoding *enc,
const char *fmt, va_list args)
234 return warn_vsprintf(enc,
239 #define with_warning_string(mesg, enc, fmt) \ 241 va_list args; va_start(args, fmt); \ 242 mesg = warning_string(enc, fmt, args); \ 250 rb_write_warning_str(mesg);
260 rb_write_warning_str(mesg);
271 rb_write_warning_str(mesg);
286 rb_enc_warning(
rb_encoding *enc,
const char *fmt, ...)
290 rb_write_warning_str(mesg);
297 end_with_asciichar(
VALUE str,
int c)
326 if (
argc > 1 || !end_with_asciichar(str,
'\n')) {
337 rb_write_warning_str(str);
343 #define MAX_BUG_REPORTERS 0x100 345 static struct bug_reporters {
346 void (*func)(
FILE *out,
void *data);
350 static int bug_reporters_size;
355 struct bug_reporters *reporter;
359 reporter = &bug_reporters[bug_reporters_size++];
360 reporter->func = func;
361 reporter->data = data;
367 #define REPORT_BUG_BUFSIZ 256 369 bug_report_file(
const char *file,
int line)
373 int len = err_position_0(buf,
sizeof(buf), file, line);
375 if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
376 (ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
385 bug_important_message(
FILE *out,
const char *
const msg,
size_t len)
387 const char *
const endmsg = msg +
len;
391 if (isatty(
fileno(out))) {
392 static const char red[] =
"\033[;31;1;7m";
393 static const char green[] =
"\033[;32;7m";
394 static const char reset[] =
"\033[m";
395 const char *e =
strchr(p,
'\n');
396 const int w = (int)(e - p);
398 int i = (int)(e - p);
399 fputs(*p ==
' ' ? green : red, out);
400 fwrite(p, 1, e - p, out);
401 for (; i < w; ++i) fputc(
' ', out);
404 }
while ((p = e + 1) < endmsg && (e =
strchr(p,
'\n')) != 0 && e > p + 1);
406 fwrite(p, 1, endmsg - p, out);
410 preface_dump(
FILE *out)
412 #if defined __APPLE__ 413 static const char msg[] =
"" 414 "-- Crash Report log information " 415 "--------------------------------------------\n" 416 " See Crash Report log file under the one of following:\n" 417 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 418 " * ~/Library/Logs/CrashReporter\n" 419 " * /Library/Logs/CrashReporter\n" 421 " * ~/Library/Logs/DiagnosticReports\n" 422 " * /Library/Logs/DiagnosticReports\n" 423 " for more details.\n" 424 "Don't forget to include the above Crash Report log file in bug reports.\n" 426 const size_t msglen =
sizeof(msg) - 1;
428 const char *msg =
NULL;
429 const size_t msglen = 0;
431 bug_important_message(out, msg, msglen);
435 postscript_dump(
FILE *out)
437 #if defined __APPLE__ 438 static const char msg[] =
"" 441 "\n""Don't forget to include the Crash Report log file under\n" 442 # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 445 "DiagnosticReports directory in bug reports.\n" 448 const size_t msglen =
sizeof(msg) - 1;
450 const char *msg =
NULL;
451 const size_t msglen = 0;
453 bug_important_message(out, msg, msglen);
457 bug_report_begin_valist(
FILE *out,
const char *fmt, va_list args)
461 fputs(
"[BUG] ", out);
469 #define bug_report_begin(out, fmt) do { \ 471 va_start(args, fmt); \ 472 bug_report_begin_valist(out, fmt, args); \ 477 bug_report_end(
FILE *out)
482 for (i=0; i<bug_reporters_size; i++) {
483 struct bug_reporters *reporter = &bug_reporters[i];
484 (*reporter->func)(out, reporter->data);
487 fputs(REPORTBUG_MSG, out);
488 postscript_dump(out);
491 #define report_bug(file, line, fmt, ctx) do { \ 492 FILE *out = bug_report_file(file, line); \ 494 bug_report_begin(out, fmt); \ 495 rb_vm_bugreport(ctx); \ 496 bug_report_end(out); \ 500 #define report_bug_valist(file, line, fmt, ctx, args) do { \ 501 FILE *out = bug_report_file(file, line); \ 503 bug_report_begin_valist(out, fmt, args); \ 504 rb_vm_bugreport(ctx); \ 505 bug_report_end(out); \ 513 #if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80 514 _set_abort_behavior( 0, _CALL_REPORTFAULT);
523 const char *file =
NULL;
538 const char *file =
NULL;
555 rb_bug(
"%s: errno == 0 (NOERROR)", mesg);
557 const char *errno_str = rb_strerrno(errno_arg);
569 #define write_or_abort(fd, str, len) (write((fd), (str), (len)) < 0 ? abort() : (void)0) 570 #define WRITE_CONST(fd,str) write_or_abort((fd),(str),sizeof(str) - 1) 579 if (errno_arg == 0) {
583 const char *errno_str = rb_strerrno(errno_arg);
586 errno_str =
"undefined errno";
606 fprintf(out,
"Assertion Failed: %s:%d:", file, line);
607 if (name) fprintf(out,
"%s:", name);
615 static const char builtin_types[][10] = {
651 if ((
unsigned int)t >=
numberof(builtin_types))
return 0;
652 name = builtin_types[t];
653 if (*name)
return name;
658 builtin_class_name(
VALUE x)
686 const char *etype = builtin_class_name(x);
695 #define UNDEF_LEAKED "undef leaked to the Ruby space" 698 unexpected_type(
VALUE x,
int xt,
int t)
704 const char *cname = builtin_class_name(x);
706 mesg =
rb_sprintf(
"wrong argument type %s (expected %s)",
713 else if (xt >
T_MASK && xt <= 0x3f) {
714 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given, probably comes" 715 " from extension library for ruby 1.8)", t, xt);
718 mesg =
rb_sprintf(
"unknown type 0x%x (0x%x given)", t, xt);
734 unexpected_type(x, xt, t);
745 unexpected_type(x,
TYPE(x), t);
752 if (child == parent)
return 1;
775 etype = builtin_class_name(obj);
821 static VALUE rb_eNOERROR;
823 static ID id_new, id_cause, id_message, id_backtrace;
824 static ID id_name, id_key, id_args, id_Errno, id_errno, id_i_path;
825 static ID id_receiver, id_iseq, id_local_variables;
826 static ID id_private_call_p;
829 #define id_bt_locations idBt_locations 830 #define id_mesg idMesg 831 #define id_status ruby_static_id_status 833 #undef rb_exc_new_cstr 888 exc_exception(
int argc,
VALUE *argv,
VALUE self)
892 if (argc == 0)
return self;
893 if (argc == 1 &&
self == argv[0])
return self;
895 exc_initialize(argc, argv, exc);
926 exc_message(
VALUE exc)
939 exc_inspect(
VALUE exc)
989 exc_backtrace(
VALUE exc)
1006 ID mid = id_backtrace;
1013 info = exc_backtrace(exc);
1033 exc_backtrace_locations(
VALUE exc)
1048 static const char err[] =
"backtrace must be Array of String";
1085 return exc_set_backtrace(exc, bt);
1098 exc_cause(
VALUE exc)
1104 try_convert_to_exception(
VALUE obj)
1121 VALUE mesg, backtrace;
1123 if (exc == obj)
return Qtrue;
1128 obj =
rb_protect(try_convert_to_exception, obj, &state);
1129 if (state || obj ==
Qundef) {
1141 backtrace = exc_backtrace(obj);
1146 if (!
rb_equal(exc_backtrace(exc), backtrace))
1164 exit_initialize(
int argc,
VALUE *argv,
VALUE exc)
1183 if (
NIL_P(status)) {
1187 #if EXIT_SUCCESS != 0 1214 exit_status(
VALUE exc)
1228 exit_success_p(
VALUE exc)
1233 if (
NIL_P(status_val))
1248 va_start(args, fmt);
1263 va_start(args, fmt);
1282 name_err_initialize(
int argc,
VALUE *argv,
VALUE self)
1287 name = (argc > 1) ? argv[--argc] :
Qnil;
1309 name_err_name(
VALUE self)
1325 name_err_local_variables(
VALUE self)
1349 nometh_err_initialize(
int argc,
VALUE *argv,
VALUE self)
1352 VALUE args = (argc > 2) ? argv[--argc] :
Qnil;
1353 name_err_initialize(argc, argv,
self);
1368 name_err_mesg_mark(
void *p)
1374 #define name_err_mesg_free RUBY_TYPED_DEFAULT_FREE 1377 name_err_mesg_memsize(
const void *p)
1387 name_err_mesg_memsize,
1424 if (obj1 == obj2)
return Qtrue;
1439 name_err_mesg_to_str(
VALUE obj)
1448 VALUE c, s, d = 0, args[4];
1449 int state = 0, singleton = 0;
1452 #define FAKE_CSTR(v, str) rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii) 1495 return name_err_mesg_to_str(obj);
1513 name_err_receiver(
VALUE self)
1518 if (recv !=
Qundef)
return recv;
1522 rb_raise(rb_eArgError,
"no receiver is available");
1537 nometh_err_args(
VALUE self)
1543 nometh_err_private_call_p(
VALUE self)
1557 key_err_receiver(
VALUE self)
1562 if (recv !=
Qundef)
return recv;
1563 rb_raise(rb_eArgError,
"no receiver is available");
1567 key_err_key(
VALUE self)
1573 rb_raise(rb_eArgError,
"no key is available");
1595 syntax_error_initialize(
int argc,
VALUE *argv,
VALUE self)
1640 set_syserr(
int n,
const char *
name)
1644 if (!
st_lookup(syserr_tbl, n, &error)) {
1652 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN 1678 if (!
st_lookup(syserr_tbl, n, &error)) {
1681 snprintf(name,
sizeof(name),
"E%03d", n);
1682 error = set_syserr(n, name);
1699 syserr_initialize(
int argc,
VALUE *argv,
VALUE self)
1701 #if !defined(_WIN32) 1705 VALUE mesg, error, func, errmsg;
1708 if (klass == rb_eSystemCallError) {
1712 error = mesg; mesg =
Qnil;
1715 klass = (
VALUE)data;
1718 rb_raise(rb_eTypeError,
"invalid instance type");
1728 else err =
"unknown error";
1753 syserr_errno(
VALUE self)
1774 else if (
self == rb_eSystemCallError)
return Qtrue;
2183 rb_define_method(rb_eException,
"backtrace_locations", exc_backtrace_locations, 0);
2207 rb_define_method(rb_eSyntaxError,
"initialize", syntax_error_initialize, -1);
2213 rb_eNotImpError =
rb_define_class(
"NotImplementedError", rb_eScriptError);
2219 rb_define_method(rb_eNameError,
"local_variables", name_err_local_variables, 0);
2226 rb_define_method(rb_eNoMethodError,
"initialize", nometh_err_initialize, -1);
2228 rb_define_method(rb_eNoMethodError,
"private_call?", nometh_err_private_call_p, 0);
2230 rb_eRuntimeError =
rb_define_class(
"RuntimeError", rb_eStandardError);
2233 rb_eEncodingError =
rb_define_class(
"EncodingError", rb_eStandardError);
2237 rb_eSystemCallError =
rb_define_class(
"SystemCallError", rb_eStandardError);
2238 rb_define_method(rb_eSystemCallError,
"initialize", syserr_initialize, -1);
2276 va_start(args, fmt);
2289 va_start(args, fmt);
2311 va_start(args, fmt);
2314 raise_loaderror(
Qnil, mesg);
2323 va_start(args, fmt);
2326 raise_loaderror(path, mesg);
2333 "%"PRIsVALUE"() function is unimplemented on this machine",
2343 va_start(args, fmt);
2351 make_errno_exc(
const char *mesg)
2357 rb_bug(
"rb_sys_fail(%s) - errno == 0", mesg ? mesg :
"");
2363 make_errno_exc_str(
VALUE mesg)
2368 if (!mesg) mesg =
Qnil;
2371 rb_bug(
"rb_sys_fail_str(%s) - errno == 0", s);
2414 #ifdef RUBY_FUNCTION_NAME_STRING 2416 rb_sys_fail_path_in(
const char *func_name,
VALUE path)
2421 rb_syserr_fail_path_in(func_name, n, path);
2425 rb_syserr_fail_path_in(
const char *func_name,
int n,
VALUE path)
2429 if (!path) path =
Qnil;
2432 if (!func_name) func_name =
"(null)";
2433 rb_bug(
"rb_sys_fail_path_in(%s, %s) - errno == 0",
2445 VALUE exc = make_errno_exc(mesg);
2453 VALUE exc = make_errno_exc_str(mesg);
2475 syserr_warning(
VALUE mesg,
int err)
2479 rb_write_warning_str(mesg);
2484 rb_sys_warn(
const char *fmt, ...)
2487 int errno_save =
errno;
2489 syserr_warning(mesg, errno_save);
2496 rb_syserr_warn(
int err,
const char *fmt, ...)
2500 syserr_warning(mesg, err);
2506 rb_sys_enc_warn(
rb_encoding *enc,
const char *fmt, ...)
2509 int errno_save =
errno;
2511 syserr_warning(mesg, errno_save);
2518 rb_syserr_enc_warn(
int err,
rb_encoding *enc,
const char *fmt, ...)
2522 syserr_warning(mesg, err);
2532 int errno_save =
errno;
2534 syserr_warning(mesg, errno_save);
2542 rb_syserr_warning(
int err,
const char *fmt, ...)
2546 syserr_warning(mesg, err);
2556 int errno_save =
errno;
2558 syserr_warning(mesg, errno_save);
2569 syserr_warning(mesg, err);
2580 raise_loaderror(path, mesg);
2586 rb_raise(rb_eRuntimeError,
"can't modify frozen %s", what);
2608 #undef rb_check_frozen 2620 #undef rb_check_trusted 2643 rb_eNOERROR = set_syserr(0,
"NOERROR");
2644 #define defined_error(name, num) set_syserr((num), (name)); 2645 #define undefined_error(name) set_syserr(0, (name)); 2646 #include "known_errors.inc" 2647 #undef defined_error 2648 #undef undefined_error RUBY_EXTERN VALUE rb_cString
void rb_fatal(const char *fmt,...)
void rb_check_type(VALUE x, int t)
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp)
RUBY_EXTERN VALUE rb_cData
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *pstate)
Protects a function call from potential global escapes from the function.
#define WRITE_CONST(fd, str)
void rb_warn(const char *fmt,...)
void rb_bug(const char *fmt,...)
VALUE rb_ary_entry(VALUE ary, long offset)
#define RUBY_EVENT_C_RETURN
void rb_syserr_fail(int e, const char *mesg)
#define RUBY_TYPED_FREE_IMMEDIATELY
size_t strlen(const char *)
void rb_mod_sys_fail_str(VALUE mod, VALUE mesg)
VALUE rb_check_to_int(VALUE)
Tries to convert val into Integer.
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
void rb_syserr_fail_str(int e, VALUE mesg)
#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)
VALUE rb_fstring_cstr(const char *str)
void rb_raise(VALUE exc, const char *fmt,...)
#define TypedData_Wrap_Struct(klass, data_type, sval)
VALUE rb_backtrace_to_location_ary(VALUE obj)
#define TypedData_Get_Struct(obj, type, data_type, sval)
#define rb_check_frozen_internal(obj)
VALUE rb_exc_new(VALUE etype, const char *ptr, long len)
void rb_check_trusted(VALUE obj)
void rb_must_asciicompat(VALUE)
#define FAKE_CSTR(v, str)
VALUE rb_str_buf_new2(const char *)
VALUE rb_String(VALUE)
Equivalent to Kernel#String in Ruby.
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
void rb_str_set_len(VALUE, long)
#define RBASIC_SET_CLASS(obj, cls)
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
const rb_data_type_t * parent
VALUE rb_exc_new_str(VALUE etype, VALUE str)
VALUE rb_obj_alloc(VALUE)
Allocates an instance of klass.
#define report_bug(file, line, fmt, ctx)
VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
VALUE rb_enc_vsprintf(rb_encoding *, const char *, va_list)
VALUE rb_iseqw_local_variables(VALUE iseqval)
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
void rb_name_error(ID id, const char *fmt,...)
const char * rb_source_loc(int *pline)
VALUE rb_str_tmp_new(long)
VALUE rb_str_buf_append(VALUE, VALUE)
void rb_gc_mark_locations(const VALUE *start, const VALUE *end)
void rb_load_fail(VALUE path, const char *err)
const char * rb_obj_classname(VALUE)
#define WEXITSTATUS(status)
#define name_err_mesg_free
int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
VALUE rb_str_buf_cat(VALUE, const char *, long)
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
VALUE rb_check_backtrace(VALUE bt)
VALUE rb_warning_warn(VALUE mod, VALUE str)
VALUE rb_iseqw_new(const rb_iseq_t *)
VALUE rb_obj_class(VALUE)
call-seq: obj.class -> class
#define RB_TYPE_P(obj, type)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
call-seq: obj.is_a?(class) -> true or false obj.kind_of?(class) -> true or false
VALUE rb_syserr_new(int n, const char *mesg)
VALUE rb_equal(VALUE, VALUE)
call-seq: obj === other -> true or false
VALUE rb_class_name(VALUE)
void rb_bug_context(const void *ctx, const char *fmt,...)
void rb_bug_errno(const char *mesg, int errno_arg)
RUBY_EXTERN VALUE rb_cObject
void rb_async_bug_errno(const char *mesg, int errno_arg)
void rb_attr(VALUE, ID, int, int, int)
#define REPORT_BUG_BUFSIZ
VALUE rb_str_cat2(VALUE, const char *)
VALUE rb_obj_as_string(VALUE)
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
VALUE rb_any_to_s(VALUE)
call-seq: obj.to_s -> string
void rb_invalid_str(const char *str, const char *type)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
void rb_define_const(VALUE, const char *, VALUE)
#define with_warning_string(mesg, enc, fmt)
void rb_compile_warn(const char *file, int line, const char *fmt,...)
void rb_notimplement(void)
const char * rb_builtin_type_name(int t)
#define RUBY_EVENT_C_CALL
void rb_error_frozen(const char *what)
VALUE rb_syserr_new_str(int n, VALUE arg)
int rb_backtrace_p(VALUE obj)
void rb_sys_enc_warning(rb_encoding *enc, const char *fmt,...)
void rb_name_error_str(VALUE str, const char *fmt,...)
void rb_sys_fail(const char *mesg)
VALUE rb_const_get(VALUE, ID)
VALUE rb_backtrace_to_str_ary(VALUE obj)
VALUE rb_sprintf(const char *format,...)
VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt)
VALUE rb_str_format(int, const VALUE *, VALUE)
#define write_or_abort(fd, str, len)
void rb_print_backtrace(void)
VALUE rb_str_vcatf(VALUE, const char *, va_list)
void rb_compile_warning(const char *file, int line, const char *fmt,...)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE rb_ivar_set(VALUE, ID, VALUE)
unsigned char buf[MIME_BUF_SIZE]
rb_encoding * rb_usascii_encoding(void)
void rb_vm_bugreport(const void *)
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
void rb_error_untrusted(VALUE obj)
rb_encoding * rb_locale_encoding(void)
#define EXEC_EVENT_HOOK(th_, flag_, self_, id_, called_id_, klass_, data_)
VALUE rb_eSystemCallError
void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
char * strchr(char *, char)
VALUE rb_io_puts(int, const VALUE *, VALUE)
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
VALUE rb_call_super(int, const VALUE *)
VALUE rb_syntax_error_append(VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
VALUE rb_str_new_cstr(const char *)
void rb_unexpected_type(VALUE x, int t)
void rb_mod_sys_fail(VALUE mod, const char *mesg)
void rb_loaderror_with_path(VALUE path, const char *fmt,...)
const char * rb_builtin_class_name(VALUE x)
int rb_respond_to(VALUE, ID)
register unsigned int len
int rb_str_end_with_asciichar(VALUE str, int c)
FUNC_MINIMIZED(static void bug_important_message(FILE *out, const char *const msg, size_t len))
VALUE rb_get_backtrace(VALUE exc)
#define RARRAY_AREF(a, i)
void rb_mod_syserr_fail_str(VALUE mod, int e, VALUE mesg)
VALUE rb_str_buf_new_cstr(const char *)
#define MAX_BUG_REPORTERS
ID rb_frame_this_func(void)
The original name of the current method.
void rb_extend_object(VALUE obj, VALUE module)
Extend the object with the module.
VALUE rb_str_catf(VALUE str, const char *format,...)
VALUE rb_warning_string(const char *fmt,...)
RUBY_EXTERN char * strerror(int)
void rb_check_copyable(VALUE obj, VALUE orig)
void rb_error_frozen_object(VALUE frozen_obj)
void rb_warning(const char *fmt,...)
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
void rb_assert_failure(const char *file, int line, const char *name, const char *expr)
int rb_method_basic_definition_p(VALUE, ID)
VALUE rb_str_cat_cstr(VALUE, const char *)
void rb_enc_raise(rb_encoding *enc, VALUE exc, const char *fmt,...)
void rb_enc_warn(rb_encoding *enc, const char *fmt,...)
int rb_bug_reporter_add(void(*func)(FILE *, void *), void *data)
VALUE rb_enc_str_new(const char *, long, rb_encoding *)
rb_execution_context_t ec
const lazyenum_funcs * fn
void Init_Exception(void)
#define report_bug_valist(file, line, fmt, ctx, args)
void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt,...)
VALUE rb_source_location(int *pline)
void rb_exc_fatal(VALUE mesg)
Raises a fatal error in the current thread.
#define RTYPEDDATA_DATA(v)
const char * wrap_struct_name
#define rb_intern_const(str)
VALUE rb_define_module(const char *name)
void ruby_deprecated_internal_feature(const char *func)
VALUE rb_vsprintf(const char *, va_list)
#define RTYPEDDATA_TYPE(v)
void rb_sys_fail_str(VALUE mesg)
VALUE rb_exc_new_cstr(VALUE etype, const char *s)
void rb_mod_syserr_fail(VALUE mod, int e, const char *mesg)
VALUE rb_obj_clone(VALUE)
:nodoc Almost same as Object::clone ++
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_str_append(VALUE, VALUE)
void rb_check_frozen(VALUE obj)
void rb_loaderror(const char *fmt,...)
VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE key)
const char ruby_description[]
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
ID rb_make_internal_id(void)
VALUE rb_enc_str_new_cstr(const char *, rb_encoding *)
void rb_sys_warning(const char *fmt,...)
VALUE rb_attr_get(VALUE, ID)
NORETURN(static void die(void))
void * rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
#define WIFEXITED(status)
RUBY_EXTERN void rb_write_error_str(VALUE mesg)
VALUE rb_str_new(const char *, long)
int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent)