Ruby
3.4.0dev (2024-11-22 revision 801e66352e698eb533c535f600d958bc1e07e75e)
|
Data Structures | |
struct | bug_reporters |
struct | path_string |
struct | report_expansion |
struct | name_error_message_struct |
Macros | |
#define | EXIT_SUCCESS 0 |
#define | WIFEXITED(status) 1 |
#define | WEXITSTATUS(status) (status) |
#define | with_warn_vsprintf(enc, file, line, fmt) |
#define | with_warning_string(mesg, enc, fmt) with_warning_string_from(mesg, enc, fmt, fmt) |
#define | with_warning_string_from(mesg, enc, fmt, last_arg) |
#define | MAX_BUG_REPORTERS 0x100 |
#define | REPORT_BUG_BUFSIZ 256 |
#define | bug_report_begin(out, fmt) |
#define | report_bug(file, line, fmt, ctx) |
#define | report_bug_valist(file, line, fmt, ctx, args) |
#define | write_or_abort(fd, str, len) (write((fd), (str), (len)) < 0 ? abort() : (void)0) |
#define | WRITE_CONST(fd, str) write_or_abort((fd),(str),sizeof(str) - 1) |
#define | UNDEF_LEAKED "undef leaked to the Ruby space" |
#define | id_cause ruby_static_id_cause |
#define | id_bt idBt |
#define | id_bt_locations idBt_locations |
#define | id_mesg idMesg |
#define | id_name idName |
#define | frozen_err_receiver name_err_receiver |
#define | ruby_verbose (*rb_ruby_verbose_ptr()) |
This variable controls whether the interpreter is in debug mode. More... | |
#define | ruby_debug (*rb_ruby_debug_ptr()) |
This variable controls whether the interpreter is in debug mode. More... | |
Typedefs | |
typedef struct name_error_message_struct | name_error_message_t |
Enumerations | |
enum | rb_warning_category_t { RB_WARN_CATEGORY_NONE , RB_WARN_CATEGORY_DEPRECATED , RB_WARN_CATEGORY_EXPERIMENTAL , RB_WARN_CATEGORY_PERFORMANCE , RB_WARN_CATEGORY_STRICT_UNUSED_BLOCK , RB_WARN_CATEGORY_DEFAULT_BITS , RB_WARN_CATEGORY_ALL_BITS } |
Warning categories. More... | |
enum | rb_io_wait_readwrite { RB_IO_WAIT_READABLE , RB_IO_WAIT_WRITABLE } |
for rb_readwrite_sys_fail first argument More... | |
Functions | |
VALUE | rb_iseqw_local_variables (VALUE iseqval) |
VALUE | rb_iseqw_new (const rb_iseq_t *) |
int | rb_str_end_with_asciichar (VALUE str, int c) |
static const char * | rb_strerrno (int err) |
static int | err_position_0 (char *buf, long len, const char *file, int line) |
static VALUE | err_vcatf (VALUE str, const char *pre, const char *file, int line, const char *fmt, va_list args) |
static VALUE | syntax_error_with_path (VALUE, VALUE, VALUE *, rb_encoding *) |
VALUE | rb_syntax_error_append (VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args) |
static unsigned int | rb_warning_category_mask (VALUE category) |
rb_warning_category_t | rb_warning_category_from_name (VALUE category) |
static VALUE | rb_warning_category_to_name (rb_warning_category_t category) |
void | rb_warning_category_update (unsigned int mask, unsigned int bits) |
bool | rb_warning_category_enabled_p (rb_warning_category_t category) |
static VALUE | rb_warning_s_aref (VALUE mod, VALUE category) |
static VALUE | rb_warning_s_aset (VALUE mod, VALUE category, VALUE flag) |
static VALUE | rb_warning_s_categories (VALUE mod) |
static VALUE | rb_warning_s_warn (int argc, VALUE *argv, VALUE mod) |
static VALUE | rb_warning_warn (VALUE mod, VALUE str) |
static int | rb_warning_warn_arity (void) |
static VALUE | rb_warn_category (VALUE str, VALUE category) |
static void | rb_write_warning_str (VALUE str) |
static VALUE | warn_vsprintf (rb_encoding *enc, const char *file, int line, const char *fmt, va_list args) |
void | rb_compile_warn (const char *file, int line, const char *fmt,...) |
Identical to rb_compile_warning(), except it reports unless $VERBOSE is nil. More... | |
void | rb_enc_compile_warn (rb_encoding *enc, const char *file, int line, const char *fmt,...) |
void | rb_compile_warning (const char *file, int line, const char *fmt,...) |
Issues a compile-time warning that happens at __file__:__line__ . More... | |
void | rb_enc_compile_warning (rb_encoding *enc, const char *file, int line, const char *fmt,...) |
void | rb_category_compile_warn (rb_warning_category_t cat, const char *file, int line, const char *fmt,...) |
Identical to rb_compile_warn(), except it also accepts category. More... | |
static VALUE | warning_string (rb_encoding *enc, const char *fmt, va_list args) |
void | rb_warn (const char *fmt,...) |
Identical to rb_warning(), except it reports unless $VERBOSE is nil. More... | |
void | rb_category_warn (rb_warning_category_t cat, const char *fmt,...) |
Identical to rb_category_warning(), except it reports unless $VERBOSE is nil. More... | |
void | rb_enc_warn (rb_encoding *enc, const char *fmt,...) |
void | rb_warning (const char *fmt,...) |
Issues a warning. More... | |
void | rb_category_warning (rb_warning_category_t cat, const char *fmt,...) |
Identical to rb_warning(), except it takes additional "category" parameter. More... | |
VALUE | rb_warning_string (const char *fmt,...) |
static bool | deprecation_warning_enabled (void) |
static void | warn_deprecated (VALUE mesg, const char *removal, const char *suggest) |
void | rb_warn_deprecated (const char *fmt, const char *suggest,...) |
void | rb_warn_deprecated_to_remove (const char *removal, const char *fmt, const char *suggest,...) |
static int | end_with_asciichar (VALUE str, int c) |
static VALUE | warning_write (int argc, VALUE *argv, VALUE buf) |
VALUE | rb_ec_backtrace_location_ary (const rb_execution_context_t *ec, long lev, long n, bool skip_internal) |
static VALUE | rb_warn_m (rb_execution_context_t *ec, VALUE exc, VALUE msgs, VALUE uplevel, VALUE category) |
int | rb_bug_reporter_add (void(*func)(FILE *, void *), void *data) |
static bool | path_sep_p (char x) |
static char * | append_pathname (char *p, const char *pe, VALUE str) |
static char * | append_basename (char *p, const char *pe, struct path_string *path, VALUE str) |
static void | finish_report (FILE *out, rb_pid_t pid) |
static char * | expand_report_argument (const char **input_template, struct report_expansion *values, char *buf, size_t size, bool word) |
FILE * | ruby_popen_writer (char *const *argv, rb_pid_t *pid) |
static FILE * | open_report_path (const char *template, char *buf, size_t size, rb_pid_t *pid) |
static FILE * | bug_report_file (const char *file, int line, rb_pid_t *pid) |
FUNC_MINIMIZED (static void bug_important_message(FILE *out, const char *const msg, size_t len)) | |
static void | bug_important_message (FILE *out, const char *const msg, size_t len) |
static void | preface_dump (FILE *out) |
static void | postscript_dump (FILE *out) |
static void | bug_report_begin_valist (FILE *out, const char *fmt, va_list args) |
static void | bug_report_end (FILE *out, rb_pid_t pid) |
void | ruby_set_crash_report (const char *template) |
static void | die (void) |
void | rb_bug_without_die (const char *fmt, va_list args) |
void | rb_bug (const char *fmt,...) |
Interpreter panic switch. More... | |
void | rb_bug_for_fatal_signal (ruby_sighandler_t default_sighandler, int sig, const void *ctx, const char *fmt,...) |
void | rb_bug_errno (const char *msg, int err) |
This is a wrapper of rb_bug() which automatically constructs appropriate message from the passed errno. More... | |
void | rb_async_bug_errno (const char *mesg, int errno_arg) |
void | rb_report_bug_valist (VALUE file, int line, const char *fmt, va_list args) |
void | rb_assert_failure (const char *file, int line, const char *name, const char *expr) |
void | rb_assert_failure_detail (const char *file, int line, const char *name, const char *expr, const char *fmt,...) |
const char * | rb_builtin_type_name (int t) |
static VALUE | displaying_class_of (VALUE x) |
static const char * | builtin_class_name (VALUE x) |
const char * | rb_builtin_class_name (VALUE x) |
static void | unexpected_type (VALUE, int, int) |
void | rb_check_type (VALUE x, int t) |
This was the old implementation of Check_Type(), but they diverged. More... | |
void | rb_unexpected_type (VALUE self, int t) |
Fails with the given object's type incompatibility to the type. More... | |
int | rb_typeddata_inherited_p (const rb_data_type_t *child, const rb_data_type_t *parent) |
Checks for the domestic relationship between the two. More... | |
int | rb_typeddata_is_kind_of (VALUE obj, const rb_data_type_t *data_type) |
Checks if the given object is of given kind. More... | |
int | rb_typeddata_is_instance_of (VALUE obj, const rb_data_type_t *data_type) |
void * | rb_check_typeddata (VALUE obj, const rb_data_type_t *data_type) |
Identical to rb_typeddata_is_kind_of(), except it raises exceptions instead of returning false. More... | |
VALUE | rb_exc_new (VALUE etype, const char *ptr, long len) |
Creates an instance of the passed exception class. More... | |
VALUE | rb_exc_new_cstr (VALUE etype, const char *s) |
Identical to rb_exc_new(), except it assumes the passed pointer is a pointer to a C string. More... | |
VALUE | rb_exc_new_str (VALUE etype, VALUE str) |
Identical to rb_exc_new_cstr(), except it takes a Ruby's string instead of C's. More... | |
static VALUE | exc_init (VALUE exc, VALUE mesg) |
static VALUE | exc_initialize (int argc, VALUE *argv, VALUE exc) |
static VALUE | exc_exception (int argc, VALUE *argv, VALUE self) |
static VALUE | exc_to_s (VALUE exc) |
void | rb_error_write (VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE opt, VALUE highlight, VALUE reverse) |
VALUE | rb_get_message (VALUE exc) |
VALUE | rb_get_detailed_message (VALUE exc, VALUE opt) |
static VALUE | exc_s_to_tty_p (VALUE self) |
static VALUE | check_highlight_keyword (VALUE opt, int auto_tty_detect) |
static VALUE | check_order_keyword (VALUE opt) |
static VALUE | exc_full_message (int argc, VALUE *argv, VALUE exc) |
static VALUE | exc_message (VALUE exc) |
static VALUE | exc_detailed_message (int argc, VALUE *argv, VALUE exc) |
static VALUE | exc_inspect (VALUE exc) |
static VALUE | exc_backtrace (VALUE exc) |
static VALUE | rb_check_backtrace (VALUE) |
VALUE | rb_get_backtrace (VALUE exc) |
static VALUE | exc_backtrace_locations (VALUE exc) |
static VALUE | exc_set_backtrace (VALUE exc, VALUE bt) |
VALUE | rb_exc_set_backtrace (VALUE exc, VALUE bt) |
static VALUE | exc_cause (VALUE exc) |
static VALUE | try_convert_to_exception (VALUE obj) |
static VALUE | exc_equal (VALUE exc, VALUE obj) |
static VALUE | exit_initialize (int argc, VALUE *argv, VALUE exc) |
static VALUE | exit_status (VALUE exc) |
static VALUE | exit_success_p (VALUE exc) |
static VALUE | err_init_recv (VALUE exc, VALUE recv) |
static VALUE | frozen_err_initialize (int argc, VALUE *argv, VALUE self) |
void | rb_name_error (ID id, const char *fmt,...) |
Raises an instance of rb_eNameError. More... | |
void | rb_name_error_str (VALUE str, const char *fmt,...) |
Identical to rb_name_error(), except it takes a VALUE instead of ID. More... | |
static VALUE | name_err_init_attr (VALUE exc, VALUE recv, VALUE method) |
static VALUE | name_err_initialize (int argc, VALUE *argv, VALUE self) |
static VALUE | rb_name_err_mesg_new (VALUE mesg, VALUE recv, VALUE method) |
static VALUE | name_err_init (VALUE exc, VALUE mesg, VALUE recv, VALUE method) |
VALUE | rb_name_err_new (VALUE mesg, VALUE recv, VALUE method) |
static VALUE | name_err_name (VALUE self) |
static VALUE | name_err_local_variables (VALUE self) |
static VALUE | nometh_err_init_attr (VALUE exc, VALUE args, int priv) |
static VALUE | nometh_err_initialize (int argc, VALUE *argv, VALUE self) |
VALUE | rb_nomethod_err_new (VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv) |
static void | name_err_mesg_mark (void *p) |
static void | name_err_mesg_update (void *p) |
static VALUE | rb_name_err_mesg_init (VALUE klass, VALUE mesg, VALUE recv, VALUE name) |
static VALUE | name_err_mesg_alloc (VALUE klass) |
static VALUE | name_err_mesg_init_copy (VALUE obj1, VALUE obj2) |
static VALUE | name_err_mesg_equal (VALUE obj1, VALUE obj2) |
static VALUE | name_err_mesg_receiver_name (VALUE obj) |
static VALUE | name_err_mesg_to_str (VALUE obj) |
static VALUE | name_err_mesg_dump (VALUE obj, VALUE limit) |
static VALUE | name_err_mesg_load (VALUE klass, VALUE str) |
static VALUE | name_err_receiver (VALUE self) |
static VALUE | nometh_err_args (VALUE self) |
static VALUE | nometh_err_private_call_p (VALUE self) |
void | rb_invalid_str (const char *str, const char *type) |
Honestly I don't understand the name, but it raises an instance of rb_eArgError. More... | |
static VALUE | key_err_receiver (VALUE self) |
static VALUE | key_err_key (VALUE self) |
VALUE | rb_key_err_new (VALUE mesg, VALUE recv, VALUE key) |
static VALUE | key_err_initialize (int argc, VALUE *argv, VALUE self) |
static VALUE | no_matching_pattern_key_err_matchee (VALUE self) |
static VALUE | no_matching_pattern_key_err_key (VALUE self) |
static VALUE | no_matching_pattern_key_err_initialize (int argc, VALUE *argv, VALUE self) |
static VALUE | syntax_error_initialize (int argc, VALUE *argv, VALUE self) |
void | rb_free_warning (void) |
static VALUE | setup_syserr (int n, const char *name) |
static VALUE | set_syserr (int n, const char *name) |
static VALUE | get_syserr (int n) |
static VALUE | syserr_initialize (int argc, VALUE *argv, VALUE self) |
static VALUE | syserr_errno (VALUE self) |
static VALUE | syserr_eqq (VALUE self, VALUE exc) |
static VALUE | exception_alloc (VALUE klass) |
static VALUE | exception_dumper (VALUE exc) |
static int | ivar_copy_i (ID key, VALUE val, st_data_t exc) |
void | rb_exc_check_circular_cause (VALUE exc) |
static VALUE | exception_loader (VALUE exc, VALUE obj) |
void | Init_Exception (void) |
void | rb_enc_raise (rb_encoding *enc, VALUE exc, const char *fmt,...) |
Identical to rb_raise(), except it additionally takes an encoding. More... | |
void | rb_vraise (VALUE exc, const char *fmt, va_list ap) |
void | rb_raise (VALUE exc, const char *fmt,...) |
Exception entry point. More... | |
static void | raise_loaderror (VALUE path, VALUE mesg) |
void | rb_loaderror (const char *fmt,...) |
Raises an instance of rb_eLoadError. More... | |
void | rb_loaderror_with_path (VALUE path, const char *fmt,...) |
Identical to rb_loaderror(), except it additionally takes which file is unable to load. More... | |
void | rb_notimplement (void) |
void | rb_fatal (const char *fmt,...) |
Raises the unsung "fatal" exception. More... | |
static VALUE | make_errno_exc (const char *mesg) |
static VALUE | make_errno_exc_str (VALUE mesg) |
VALUE | rb_syserr_new (int err, const char *msg) |
Creates an exception object that represents the given C errno. More... | |
VALUE | rb_syserr_new_str (int n, VALUE arg) |
Identical to rb_syserr_new(), except it takes the message in Ruby's String instead of C's. More... | |
void | rb_syserr_fail (int err, const char *msg) |
Raises appropriate exception that represents a C errno. More... | |
void | rb_syserr_fail_str (int err, VALUE msg) |
Identical to rb_syserr_fail(), except it takes the message in Ruby's String instead of C's. More... | |
void | rb_sys_fail (const char *msg) |
Converts a C errno into a Ruby exception, then raises it. More... | |
void | rb_sys_fail_str (VALUE msg) |
Identical to rb_sys_fail(), except it takes the message in Ruby's String instead of C's. More... | |
static void | rb_mod_exc_raise (VALUE exc, VALUE mod) |
void | rb_mod_sys_fail (VALUE mod, const char *msg) |
Identical to rb_sys_fail(), except it takes additional module to extend the exception object before raising. More... | |
void | rb_mod_sys_fail_str (VALUE mod, VALUE msg) |
Identical to rb_mod_sys_fail(), except it takes the message in Ruby's String instead of C's. More... | |
void | rb_mod_syserr_fail (VALUE mod, int err, const char *msg) |
Identical to rb_mod_sys_fail(), except it does not depend on C global variable errno. More... | |
void | rb_mod_syserr_fail_str (VALUE mod, int err, VALUE msg) |
Identical to rb_mod_syserr_fail(), except it takes the message in Ruby's String instead of C's. More... | |
static void | syserr_warning (VALUE mesg, int err) |
void | rb_sys_warning (const char *fmt,...) |
Identical to rb_sys_fail(), except it does not raise an exception to render a warning instead. More... | |
void | rb_sys_enc_warning (rb_encoding *enc, const char *fmt,...) |
void | rb_syserr_enc_warning (int err, rb_encoding *enc, const char *fmt,...) |
void | rb_load_fail (VALUE path, const char *err) |
void | rb_error_frozen (const char *what) |
Identical to rb_frozen_error_raise(), except its raising exception has a message like "can't modify frozen /what/". More... | |
void | rb_frozen_error_raise (VALUE frozen_obj, const char *fmt,...) |
Raises an instance of rb_eFrozenError. More... | |
static VALUE | inspect_frozen_obj (VALUE obj, VALUE mesg, int recur) |
static VALUE | get_created_info (VALUE obj, int *pline) |
void | rb_error_frozen_object (VALUE frozen_obj) |
Identical to rb_error_frozen(), except it takes arbitrary Ruby object instead of C's string. More... | |
void | rb_warn_unchilled_literal (VALUE obj) |
void | rb_warn_unchilled_symbol_to_s (VALUE obj) |
void | rb_check_frozen (VALUE obj) |
Queries if the passed object is frozen. More... | |
void | rb_check_copyable (VALUE obj, VALUE orig) |
Ensures that the passed object can be initialize_copy relationship. More... | |
void | Init_syserr (void) |
void | rb_exc_raise (VALUE mesg) |
Raises an exception in the current thread. More... | |
void | rb_exc_fatal (VALUE mesg) |
Raises a fatal error in the current thread. More... | |
VALUE | rb_errinfo (void) |
This is the same as $! in Ruby. More... | |
void | rb_set_errinfo (VALUE err) |
Sets the current exception ($! ) to the given value. More... | |
void | rb_readwrite_sys_fail (enum rb_io_wait_readwrite waiting, const char *msg) |
Raises appropriate exception using the parameters. More... | |
void | rb_iter_break (void) |
Breaks from a block. More... | |
void | rb_iter_break_value (VALUE val) |
Identical to rb_iter_break(), except it additionally takes the "value" of this breakage. More... | |
void | rb_exit (int status) |
Terminates the current execution context. More... | |
void | rb_readwrite_syserr_fail (enum rb_io_wait_readwrite waiting, int err, const char *msg) |
Identical to rb_readwrite_sys_fail(), except it does not depend on C global variable errno. More... | |
VALUE | rb_rescue (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2) |
Identical to rb_rescue2(), except it does not take a list of exception classes. More... | |
VALUE | rb_rescue2 (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2,...) |
An equivalent of rescue clause. More... | |
VALUE | rb_vrescue2 (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2, va_list ap) |
Identical to rb_rescue2(), except it takes va_list instead of variadic number of arguments. More... | |
VALUE | rb_ensure (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2) |
An equivalent to ensure clause. More... | |
Variables | |
long | rb_backtrace_length_limit = -1 |
VALUE | rb_eEAGAIN |
VALUE | rb_eEWOULDBLOCK |
VALUE | rb_eEINPROGRESS |
static VALUE | rb_mWarning |
static VALUE | rb_cWarningBuffer |
static ID | id_warn |
static ID | id_category |
static ID | id_deprecated |
static ID | id_experimental |
static ID | id_performance |
static ID | id_strict_unused_block |
static VALUE | sym_category |
static VALUE | sym_highlight |
struct { | |
st_table * id2enum | |
st_table * enum2id | |
} | warning_categories |
const char * | rb_dynamic_description |
static unsigned int | warning_disabled_categories |
static struct bug_reporters | bug_reporters [MAX_BUG_REPORTERS] |
static int | bug_reporters_size |
static const char | PATHSEP_REPLACE = '!' |
static const char * | crash_report |
static const char | builtin_types [][10] |
VALUE | rb_eException |
Mother of all exceptions. More... | |
VALUE | rb_eSystemExit |
SystemExit exception. More... | |
VALUE | rb_eInterrupt |
Interrupt exception. More... | |
VALUE | rb_eSignal |
SignalException exception. More... | |
VALUE | rb_eFatal |
fatal exception. More... | |
VALUE | rb_eStandardError |
StandardError exception. More... | |
VALUE | rb_eRuntimeError |
RuntimeError exception. More... | |
VALUE | rb_eFrozenError |
FrozenError exception. More... | |
VALUE | rb_eTypeError |
TypeError exception. More... | |
VALUE | rb_eArgError |
ArgumentError exception. More... | |
VALUE | rb_eIndexError |
IndexError exception. More... | |
VALUE | rb_eKeyError |
KeyError exception. More... | |
VALUE | rb_eRangeError |
RangeError exception. More... | |
VALUE | rb_eNameError |
NameError exception. More... | |
VALUE | rb_eEncodingError |
EncodingError exception. More... | |
VALUE | rb_eEncCompatError |
Encoding::CompatibilityError exception. More... | |
VALUE | rb_eNoMethodError |
NoMethodError exception. More... | |
VALUE | rb_eSecurityError |
SecurityError exception. More... | |
VALUE | rb_eNotImpError |
NotImplementedError exception. More... | |
VALUE | rb_eNoMemError |
NoMemoryError exception. More... | |
VALUE | rb_cNameErrorMesg |
NameError::Message class. More... | |
VALUE | rb_eNoMatchingPatternError |
NoMatchingPatternError exception. More... | |
VALUE | rb_eNoMatchingPatternKeyError |
NoMatchingPatternKeyError exception. More... | |
VALUE | rb_eScriptError |
ScriptError exception. More... | |
VALUE | rb_eSyntaxError |
SyntaxError exception. More... | |
VALUE | rb_eLoadError |
LoadError exception. More... | |
VALUE | rb_eSystemCallError |
SystemCallError exception. More... | |
VALUE | rb_mErrno |
Errno module. More... | |
static VALUE | rb_eNOERROR |
ID | ruby_static_id_cause |
static ID | id_message |
static ID | id_detailed_message |
static ID | id_backtrace |
static ID | id_key |
static ID | id_matchee |
static ID | id_args |
static ID | id_Errno |
static ID | id_errno |
static ID | id_i_path |
static ID | id_receiver |
static ID | id_recv |
static ID | id_iseq |
static ID | id_local_variables |
static ID | id_private_call_p |
static ID | id_top |
static ID | id_bottom |
static const rb_data_type_t | name_err_mesg_data_type |
static st_table * | syserr_tbl |
VALUE | rb_eException |
Mother of all exceptions. More... | |
VALUE | rb_eStandardError |
StandardError exception. More... | |
VALUE | rb_eSystemExit |
SystemExit exception. More... | |
VALUE | rb_eInterrupt |
Interrupt exception. More... | |
VALUE | rb_eSignal |
SignalException exception. More... | |
VALUE | rb_eFatal |
fatal exception. More... | |
VALUE | rb_eArgError |
ArgumentError exception. More... | |
VALUE | rb_eEOFError |
EOFError exception. More... | |
VALUE | rb_eIndexError |
IndexError exception. More... | |
VALUE | rb_eStopIteration |
StopIteration exception. More... | |
VALUE | rb_eKeyError |
KeyError exception. More... | |
VALUE | rb_eRangeError |
RangeError exception. More... | |
VALUE | rb_eIOError |
IOError exception. More... | |
VALUE | rb_eRuntimeError |
RuntimeError exception. More... | |
VALUE | rb_eFrozenError |
FrozenError exception. More... | |
VALUE | rb_eSecurityError |
SecurityError exception. More... | |
VALUE | rb_eSystemCallError |
SystemCallError exception. More... | |
VALUE | rb_eThreadError |
ThreadError exception. More... | |
VALUE | rb_eTypeError |
TypeError exception. More... | |
VALUE | rb_eZeroDivError |
ZeroDivisionError exception. More... | |
VALUE | rb_eNotImpError |
NotImplementedError exception. More... | |
VALUE | rb_eNoMemError |
NoMemoryError exception. More... | |
VALUE | rb_eNoMethodError |
NoMethodError exception. More... | |
VALUE | rb_eFloatDomainError |
FloatDomainError exception. More... | |
VALUE | rb_eLocalJumpError |
LocalJumpError exception. More... | |
VALUE | rb_eSysStackError |
SystemStackError exception. More... | |
VALUE | rb_eRegexpError |
RegexpError exception. More... | |
VALUE | rb_eEncodingError |
EncodingError exception. More... | |
VALUE | rb_eEncCompatError |
Encoding::CompatibilityError exception. More... | |
VALUE | rb_eNoMatchingPatternError |
NoMatchingPatternError exception. More... | |
VALUE | rb_eNoMatchingPatternKeyError |
NoMatchingPatternKeyError exception. More... | |
VALUE | rb_eScriptError |
ScriptError exception. More... | |
VALUE | rb_eNameError |
NameError exception. More... | |
VALUE | rb_eSyntaxError |
SyntaxError exception. More... | |
VALUE | rb_eLoadError |
LoadError exception. More... | |
VALUE | rb_eMathDomainError |
Math::DomainError exception. More... | |
#define bug_report_begin | ( | out, | |
fmt | |||
) |
#define report_bug | ( | file, | |
line, | |||
fmt, | |||
ctx | |||
) |
#define report_bug_valist | ( | file, | |
line, | |||
fmt, | |||
ctx, | |||
args | |||
) |
#define ruby_debug (*rb_ruby_debug_ptr()) |
This variable controls whether the interpreter is in debug mode.
Setting this to some truthy value is equivalent to passing -d
flag to the interpreter.
Qnil | Interpreter not in debug mode. |
Qfalse | Interpreter not in debug mode. |
otherwise | Interpreter is in debug mode. |
#define ruby_verbose (*rb_ruby_verbose_ptr()) |
This variable controls whether the interpreter is in debug mode.
Setting this to some truthy value is equivalent to passing -W
flag to the interpreter. Setting this to Qfalse is equivalent to passing -W1
flag to the interpreter. Setting this to Qnil is equivalent to passing -W0
flag to the interpreter.
Qnil | Interpreter is quiet. |
Qfalse | Interpreter is kind of chatty. |
otherwise | Interpreter is very verbose. |
#define with_warn_vsprintf | ( | enc, | |
file, | |||
line, | |||
fmt | |||
) |
#define with_warning_string_from | ( | mesg, | |
enc, | |||
fmt, | |||
last_arg | |||
) |
enum rb_io_wait_readwrite |
Warning categories.
A warning issued using this API can be selectively requested / suppressed by the end-users. For instance passing -W:no-deprecated
to the ruby process would suppress those warnings in deprecated category.
void rb_bug | ( | const char * | fmt, |
... | |||
) |
Interpreter panic switch.
Immediate process termination without any synchronisations shall occur. LOTS of internal states, stack traces, and even machine registers are displayed if possible for debugging purposes then.
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
Definition at line 1089 of file error.c.
Referenced by rb_bug_errno(), rb_check_type(), rb_econv_open_opts(), rb_fix2str(), rb_obj_freeze(), rb_str_set_len(), rb_thread_call_with_gvl(), rb_tracearg_object(), rb_tracearg_raised_exception(), rb_tracearg_return_value(), rb_unexpected_type(), and rb_update_max_fd().
void rb_bug_errno | ( | const char * | msg, |
int | err | ||
) |
void rb_category_compile_warn | ( | rb_warning_category_t | cat, |
const char * | file, | ||
int | line, | ||
const char * | fmt, | ||
... | |||
) |
Identical to rb_compile_warn(), except it also accepts category.
[in] | cat | Category e.g. deprecated. |
[in] | file | The path corresponding to Ruby level __FILE__ . |
[in] | line | The number corresponding to Ruby level __LINE__ . |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
void rb_category_warn | ( | rb_warning_category_t | cat, |
const char * | fmt, | ||
... | |||
) |
Identical to rb_category_warning(), except it reports unless $VERBOSE is nil.
[in] | cat | Category e.g. deprecated. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
Definition at line 476 of file error.c.
Referenced by rb_io_print().
void rb_category_warning | ( | rb_warning_category_t | cat, |
const char * | fmt, | ||
... | |||
) |
Identical to rb_warning(), except it takes additional "category" parameter.
[in] | cat | Name of a known category. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
Ensures that the passed object can be initialize_copy
relationship.
When you implement your own one you would better call this at the right beginning of your implementation.
[in] | obj | Destination object. |
[in] | orig | Source object. |
rb_eFrozenError | obj is frozen. |
void rb_check_frozen | ( | VALUE | obj | ) |
Queries if the passed object is frozen.
[in] | obj | Target object to test frozen-ness. |
rb_eFrozenError | It is frozen. |
Definition at line 4061 of file error.c.
Referenced by rb_check_copyable().
void rb_check_type | ( | VALUE | obj, |
int | t | ||
) |
This was the old implementation of Check_Type(), but they diverged.
This one remains for theoretical backwards compatibility. People normally need not use it.
[in] | obj | An object. |
[in] | t | A type. |
rb_eTypeError | obj is not of type t . |
rb_eFatal | obj is corrupt. |
obj
is guaranteed to have type t
. void* rb_check_typeddata | ( | VALUE | obj, |
const rb_data_type_t * | data_type | ||
) |
Identical to rb_typeddata_is_kind_of(), except it raises exceptions instead of returning false.
[in] | obj | An instance of RTypedData. |
[in] | data_type | Expected data type of obj . |
rb_eTypeError | obj is not of data_type . |
obj
holds. obj
's type is guaranteed data_type
. Definition at line 1375 of file error.c.
Referenced by rb_waitpid().
void rb_compile_warn | ( | const char * | file, |
int | line, | ||
const char * | fmt, | ||
... | |||
) |
Identical to rb_compile_warning(), except it reports unless $VERBOSE is nil.
[in] | file | The path corresponding to Ruby level __FILE__ . |
[in] | line | The number corresponding to Ruby level __LINE__ . |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
void rb_compile_warning | ( | const char * | file, |
int | line, | ||
const char * | fmt, | ||
... | |||
) |
Issues a compile-time warning that happens at __file__:__line__
.
Purpose of this function being exposed to CAPI is unclear.
[in] | file | The path corresponding to Ruby level __FILE__ . |
[in] | line | The number corresponding to Ruby level __LINE__ . |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
void rb_enc_raise | ( | rb_encoding * | enc, |
VALUE | exc, | ||
const char * | fmt, | ||
... | |||
) |
Identical to rb_raise(), except it additionally takes an encoding.
[in] | enc | Encoding of the generating exception. |
[in] | exc | A subclass of rb_eException. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
[in] | ... | Contents of the message. |
exc | The specified exception. |
Definition at line 3616 of file error.c.
Referenced by rb_str_format().
An equivalent to ensure
clause.
Calls the function b_proc
with data1
as the argument, then calls e_proc
with data2
when execution terminated.
[in] | b_proc | A function representing begin clause. |
[in,out] | data1 | Passed to b_proc . |
[in] | e_proc | A function representing ensure clause. |
[in,out] | data2 | Passed to e_proc . |
RUBY_Qnil | exception occurred inside of b_proc . |
otherwise | The return value of b_proc . |
Definition at line 1045 of file eval.c.
Referenced by rb_fiber_scheduler_set(), rb_mutex_sleep(), rb_mutex_synchronize(), and rb_thread_fd_select().
VALUE rb_errinfo | ( | void | ) |
void rb_error_frozen | ( | const char * | what | ) |
Identical to rb_frozen_error_raise(), except its raising exception has a message like "can't modify frozen /what/".
[in] | what | What was frozen. |
rb_eFrozenError | Always raises this. |
void rb_error_frozen_object | ( | VALUE | what | ) |
Identical to rb_error_frozen(), except it takes arbitrary Ruby object instead of C's string.
[in] | what | What was frozen. |
rb_eFrozenError | Always raises this. |
Definition at line 3999 of file error.c.
Referenced by rb_check_frozen_inline().
void rb_exc_fatal | ( | VALUE | mesg | ) |
Raises a fatal error in the current thread.
Identical to rb_fatal(), except it raises the passed exception instance as- is instead of creating new one.
Same as rb_exc_raise() but raises a fatal error, which Ruby codes cannot rescue.
Creates an instance of the passed exception class.
[in] | etype | A subclass of rb_eException. |
[in] | ptr | Buffer contains error message. |
[in] | len | Length of ptr , in bytes, not including the terminating NUL character. |
rb_eTypeError | etype is not a class. |
rb_eArgError | len is negative. |
etype
. len
bytes of continuous memory region shall be accessible via ptr
. Definition at line 1446 of file error.c.
Referenced by rb_exc_new_cstr(), and rb_interrupt().
Identical to rb_exc_new(), except it assumes the passed pointer is a pointer to a C string.
[in] | etype | A subclass of rb_eException. |
[in] | str | A C string (becomes an error message). |
rb_eTypeError | etype is not a class. |
etype
. Identical to rb_exc_new_cstr(), except it takes a Ruby's string instead of C's.
[in] | etype | A subclass of rb_eException. |
[in] | str | An instance of rb_cString. |
rb_eTypeError | etype is not a class. |
etype
. Definition at line 1459 of file error.c.
Referenced by rb_error_frozen_object().
void rb_exc_raise | ( | VALUE | mesg | ) |
Raises an exception in the current thread.
Identical to rb_raise(), except it raises the passed exception instance as- is instead of creating new one.
[in] | mesg | an Exception class or an Exception object. |
always | raises an instance of the given exception class or the given Exception object. |
Definition at line 676 of file eval.c.
Referenced by rb_econv_check_error(), rb_enc_raise(), rb_exit(), rb_f_abort(), rb_interrupt(), rb_name_error(), rb_name_error_str(), rb_sys_fail(), rb_sys_fail_str(), rb_syserr_fail(), rb_syserr_fail_str(), and rb_throw_obj().
void rb_exit | ( | int | status | ) |
Terminates the current execution context.
This API is the entry point of a "well-mannered" termination sequence. When called from an extension library, it raises rb_eSystemExit exception. Programs could rescue that exception. Can cancel process exit then. Otherwise, that exception results in a process termination with the status passed to this function.
[in] | status | Exit status, see also exit(3). |
rb_eSystemExit | Exception representing the exit status. |
Definition at line 4451 of file process.c.
Referenced by rb_f_abort(), and rb_thread_kill().
void rb_fatal | ( | const char * | fmt, |
... | |||
) |
Raises the unsung "fatal" exception.
This is considered severe. Nobody can rescue the exception. Once raised, process termination is inevitable. However ensure clauses still run, so that resources are properly cleaned up.
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eFatal | An exception that you cannot rescue. |
void rb_frozen_error_raise | ( | VALUE | recv, |
const char * | fmt, | ||
... | |||
) |
Raises an instance of rb_eFrozenError.
The object can be obtained later using FrozenError#receiver
of the raising exception.
[in] | recv | What is frozen. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eFrozenError | Always raises this. |
Definition at line 3959 of file error.c.
Referenced by rb_thread_local_aset().
void rb_invalid_str | ( | const char * | str, |
const char * | type | ||
) |
Honestly I don't understand the name, but it raises an instance of rb_eArgError.
[in] | str | A message. |
[in] | type | Another message. |
rb_eArgError | Always raises this. |
Definition at line 2654 of file error.c.
Referenced by rb_cstr_to_inum().
void rb_iter_break | ( | void | ) |
Breaks from a block.
Because you are using a CAPI this is not as intuitive as it sounds. In order for this function to properly work, make a rb_block_call_func_t function that calls it internally, and pass that function to rb_block_call().
rb_eLocalJumpError | Called from outside of a block. |
void rb_iter_break_value | ( | VALUE | val | ) |
Identical to rb_iter_break(), except it additionally takes the "value" of this breakage.
It will be the evaluation result of the iterator. This is kind of complicated; you cannot see this as a "return from a block" behaviour. Take a look at this example:
This script outputs 1, 2, 3, and hello. Note that the value passed to break becomes the return value of foo method, not the value of yield. This is confusing, but can be handy on occasions e.g. when you want to bring a local variable out of a block.
[in] | val | The value of the iterator. |
rb_eLocalJumpError | Called from outside of a block. |
void rb_loaderror | ( | const char * | fmt, |
... | |||
) |
Raises an instance of rb_eLoadError.
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eLoadError | Always raises this. |
void rb_loaderror_with_path | ( | VALUE | path, |
const char * | fmt, | ||
... | |||
) |
Identical to rb_loaderror(), except it additionally takes which file is unable to load.
The path can be obtained later using LoadError#path
of the raising exception.
[in] | path | What failed. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eLoadError | Always raises this. |
void rb_mod_sys_fail | ( | VALUE | mod, |
const char * | msg | ||
) |
Identical to rb_sys_fail(), except it takes additional module to extend the exception object before raising.
[in] | mod | A rb_cModule instance. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing errno. |
Identical to rb_mod_sys_fail(), except it takes the message in Ruby's String instead of C's.
[in] | mod | A rb_cModule instance. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing errno. |
void rb_mod_syserr_fail | ( | VALUE | mod, |
int | err, | ||
const char * | msg | ||
) |
Identical to rb_mod_sys_fail(), except it does not depend on C global variable errno.
Pass it explicitly.
[in] | mod | A rb_cModule instance. |
[in] | err | C level errno. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing err . |
Identical to rb_mod_syserr_fail(), except it takes the message in Ruby's String instead of C's.
[in] | mod | A rb_cModule instance. |
[in] | err | C level errno. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing err . |
void rb_name_error | ( | ID | name, |
const char * | fmt, | ||
... | |||
) |
Raises an instance of rb_eNameError.
The name can be obtained later using NameError#name
of the raising exception.
[in] | name | What failed. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eNameError | Always raises this. |
Definition at line 2215 of file error.c.
Referenced by rb_f_untrace_var(), and rb_id_attrset().
void rb_name_error_str | ( | VALUE | name, |
const char * | fmt, | ||
... | |||
) |
Identical to rb_name_error(), except it takes a VALUE instead of ID.
[in] | name | What failed. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
rb_eNameError | Always raises this. |
Definition at line 2230 of file error.c.
Referenced by rb_f_untrace_var(), and rb_id_attrset().
void rb_notimplement | ( | void | ) |
void rb_raise | ( | VALUE | exc, |
const char * | fmt, | ||
... | |||
) |
Exception entry point.
By calling this function the execution of your program gets interrupted to "raise" an exception up to the callee entities. Programs could "rescue" that exception, or could "ensure" some part of them. If nobody cares about such things, the raised exception reaches at the top of execution. This yields abnormal end of the process.
[in] | exc | A subclass of rb_eException. |
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
exc | The specified exception. |
Definition at line 3635 of file error.c.
Referenced by rb_alias(), rb_alias_variable(), rb_ary_resize(), rb_ary_store(), rb_big2long(), rb_big2ulong(), rb_big_pow(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_cmperr(), rb_current_receiver(), rb_define_module_id_under(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_uint_chr(), rb_enc_vsprintf(), rb_error_frozen(), rb_f_global_variables(), rb_fix2str(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_Hash(), rb_integer_unpack(), rb_internal_thread_specific_key_create(), rb_invalid_str(), rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_io_check_initialized(), rb_io_check_writable(), rb_io_descriptor(), rb_io_extract_modeenc(), rb_io_maybe_wait_readable(), rb_io_maybe_wait_writable(), rb_io_modestr_fmode(), rb_io_ungetc(), rb_memory_view_prepare_item_desc(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_mutex_unlock(), rb_notimplement(), rb_num2fix(), rb_num2long(), rb_num_zerodiv(), rb_obj_encoding(), rb_out_of_int(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_reg_onig_match(), rb_reg_prepare_re(), rb_reg_regsub(), rb_set_errinfo(), rb_str_cat(), rb_str_concat(), rb_str_dump(), rb_str_ellipsize(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_set_len(), rb_str_times(), rb_str_unlocktmp(), rb_str_update(), rb_string_value_cstr(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), rb_thread_stop(), rb_thread_wakeup(), rb_time_timespec_new(), rb_tracearg_object(), rb_tracearg_raised_exception(), rb_tracearg_return_value(), rb_tracepoint_enable(), rb_undef(), rb_uv_to_utf8(), rb_yield_splat(), and rb_yield_splat_kw().
void rb_readwrite_sys_fail | ( | enum rb_io_wait_readwrite | waiting, |
const char * | msg | ||
) |
Raises appropriate exception using the parameters.
In Ruby level there are rb_eEAGAINWaitReadable etc. This function maps the given parameter to an appropriate exception class, then raises it.
[in] | waiting | Reason for the IO to wait. |
[in] | msg | Additional message to raise. |
rb_eEAGAINWaitWritable | |
rb_eEWOULDBLOCKWaitWritable | |
rb_eEINPROGRESSWaitWritable | |
rb_eEAGAINWaitReadable | |
rb_eEWOULDBLOCKWaitReadable | |
rb_eEINPROGRESSWaitReadable | |
rb_eSystemCallError |
void rb_readwrite_syserr_fail | ( | enum rb_io_wait_readwrite | waiting, |
int | err, | ||
const char * | msg | ||
) |
Identical to rb_readwrite_sys_fail(), except it does not depend on C global variable errno.
Pass it explicitly.
[in] | waiting | Reason for the IO to wait. |
[in] | err | C level errno. |
[in] | msg | Additional message to raise. |
rb_eEAGAINWaitWritable | |
rb_eEWOULDBLOCKWaitWritable | |
rb_eEINPROGRESSWaitWritable | |
rb_eEAGAINWaitReadable | |
rb_eEWOULDBLOCKWaitReadable | |
rb_eEINPROGRESSWaitReadable | |
rb_eSystemCallError |
Definition at line 14626 of file io.c.
Referenced by rb_readwrite_sys_fail().
Identical to rb_rescue2(), except it does not take a list of exception classes.
This is a shorthand of:
[in] | b_proc | A function which potentially raises an exception. |
[in,out] | data1 | Passed to b_proc . |
[in] | r_proc | A function which rescues an exception in b_proc . |
[in,out] | data2 | The first argument of r_proc . |
b_proc
if no exception occurs, or the return value of r_proc
otherwise. VALUE rb_rescue2 | ( | VALUE(*)(VALUE) | b_proc, |
VALUE | data1, | ||
VALUE(*)(VALUE, VALUE) | r_proc, | ||
VALUE | data2, | ||
... | |||
) |
An equivalent of rescue
clause.
First it calls the function b_proc
with data1
as the argument. If nothing is thrown the function happily returns the return value of b_proc
. When b_proc
raises an exception, and the exception is a kind of one of the given exception classes, it then calls r_proc
with data2
and that exception. If the exception does not match any of them, it propagates.
[in] | b_proc | A function which potentially raises an exception. |
[in,out] | data1 | Passed to b_proc . |
[in] | r_proc | A function which rescues an exception in b_proc . |
[in,out] | data2 | The first argument of r_proc . |
[in] | ... | 1 or more exception classes. Must be terminated by (VALUE)0 |
b_proc
if no exception occurs, or the return value of r_proc
otherwise. Definition at line 945 of file eval.c.
Referenced by rb_rescue().
void rb_set_errinfo | ( | VALUE | err | ) |
Sets the current exception ($!
) to the given value.
[in] | err | An instance of rb_eException, or RUBY_Qnil. |
rb_eTypeError | What is given was neither rb_eException nor RUBY_Qnil. |
err
. This function just assigns the given object to the global variable. void rb_sys_fail | ( | const char * | msg | ) |
Converts a C errno into a Ruby exception, then raises it.
For instance:
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing errno. |
Definition at line 3760 of file error.c.
Referenced by rb_f_kill(), rb_io_wait(), and rb_timespec_now().
void rb_sys_fail_str | ( | VALUE | msg | ) |
Identical to rb_sys_fail(), except it takes the message in Ruby's String instead of C's.
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing errno. |
void rb_sys_warning | ( | const char * | fmt, |
... | |||
) |
Identical to rb_sys_fail(), except it does not raise an exception to render a warning instead.
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
void rb_syserr_fail | ( | int | err, |
const char * | msg | ||
) |
Raises appropriate exception that represents a C errno.
[in] | err | C level errno. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing err . |
Definition at line 3747 of file error.c.
Referenced by rb_fdopen(), and ruby_getcwd().
void rb_syserr_fail_str | ( | int | err, |
VALUE | msg | ||
) |
Identical to rb_syserr_fail(), except it takes the message in Ruby's String instead of C's.
[in] | err | C level errno. |
[in] | msg | Additional message to raise. |
rb_eSystemCallError | An exception representing err . |
Definition at line 3753 of file error.c.
Referenced by rb_f_exec().
VALUE rb_syserr_new | ( | int | err, |
const char * | msg | ||
) |
Creates an exception object that represents the given C errno.
[in] | err | C level errno. |
[in] | msg | Additional message. |
rb_eSystemCallError | An exception for the errno. |
Definition at line 3733 of file error.c.
Referenced by rb_mod_syserr_fail(), and rb_syserr_fail().
Identical to rb_syserr_new(), except it takes the message in Ruby's String instead of C's.
[in] | n | C level errno. |
[in] | arg | Additional message. |
rb_eSystemCallError | An exception for the errno. |
Definition at line 3741 of file error.c.
Referenced by rb_mod_syserr_fail_str(), rb_syserr_fail_str(), and rb_syserr_new().
int rb_typeddata_inherited_p | ( | const rb_data_type_t * | child, |
const rb_data_type_t * | parent | ||
) |
Checks for the domestic relationship between the two.
[in] | child | A data type supposed to be a child of parent . |
[in] | parent | A data type supposed to be a parent of child . |
true | child is a descendent of parent . |
false | Otherwise. |
Definition at line 1348 of file error.c.
Referenced by rb_typeddata_is_kind_of().
int rb_typeddata_is_kind_of | ( | VALUE | obj, |
const rb_data_type_t * | data_type | ||
) |
Checks if the given object is of given kind.
[in] | obj | An instance of RTypedData. |
[in] | data_type | Expected data type of obj . |
true | obj is of data_type . |
false | Otherwise. |
Definition at line 1358 of file error.c.
Referenced by rb_obj_is_fiber(), rb_obj_is_method(), and rb_obj_is_proc().
void rb_unexpected_type | ( | VALUE | self, |
int | t | ||
) |
Fails with the given object's type incompatibility to the type.
It seems this function is visible from extension libraries only because RTYPEDDATA_TYPE() uses it on RUBY_DEBUG. So you can basically ignore it; use some other fine-grained method instead.
[in] | self | The object in question. |
[in] | t | Expected type of the object. |
rb_eTypeError | self not in type t . |
Definition at line 1338 of file error.c.
Referenced by RTYPEDDATA_TYPE().
VALUE rb_vrescue2 | ( | VALUE(*)(VALUE) | b_proc, |
VALUE | data1, | ||
VALUE(*)(VALUE, VALUE) | r_proc, | ||
VALUE | data2, | ||
va_list | ap | ||
) |
Identical to rb_rescue2(), except it takes va_list
instead of variadic number of arguments.
This is exposed to 3rd parties because inline functions use it. Basically you don't have to bother.
[in] | b_proc | A function which potentially raises an exception. |
[in,out] | data1 | Passed to b_proc . |
[in] | r_proc | A function which rescues an exception in b_proc . |
[in,out] | data2 | The first argument of r_proc . |
[in] | ap | 1 or more exception classes. Must be terminated by (VALUE)0 |
b_proc
if no exception occurs, or the return value of r_proc
otherwise. Definition at line 956 of file eval.c.
Referenced by ruby::backward::cxxanyargs::rb_rescue2(), and rb_rescue2().
void rb_warn | ( | const char * | fmt, |
... | |||
) |
Identical to rb_warning(), except it reports unless $VERBOSE is nil.
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
Definition at line 466 of file error.c.
Referenced by rb_complex_pow(), rb_define_const(), rb_enc_find_index(), rb_fdopen(), rb_gc_register_address(), rb_io_extract_encoding_option(), rb_str_format(), and rb_undef().
void rb_warning | ( | const char * | fmt, |
... | |||
) |
Issues a warning.
In ruby, warnings these days are tightly coupled with the rb_mWarning constant and its warn
singleton method. This CAPI is just a thin wrapper of it; everything passed are formatted like what rb_sprintf() does, then passed through to the method. Programs can have their own def Warning.warn
at will to do whatever they want, from ignoring the warnings at all to sinking them to some BigQuery data set via a Fluentd cluster. By default, the method just emits its passed contents to rb_stderr using rb_io_write().
[in] | fmt | Format specifier string compatible with rb_sprintf(). |
Definition at line 497 of file error.c.
Referenced by rb_attr(), rb_big2dbl(), rb_gv_get(), and rb_memory_view_register().
|
static |
VALUE rb_eArgError |
ArgumentError
exception.
Definition at line 1409 of file error.c.
Referenced by rb_big_pow(), rb_cmperr(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_vsprintf(), rb_fix2str(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_integer_unpack(), rb_invalid_str(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_reg_prepare_re(), rb_str_cat(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_times(), rb_string_value_cstr(), rb_time_timespec_new(), rb_tracepoint_enable(), rb_yield_splat(), and rb_yield_splat_kw().
|
extern |
ArgumentError
exception.
Definition at line 1409 of file error.c.
Referenced by rb_big_pow(), rb_cmperr(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_vsprintf(), rb_fix2str(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_integer_unpack(), rb_invalid_str(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_reg_prepare_re(), rb_str_cat(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_times(), rb_string_value_cstr(), rb_time_timespec_new(), rb_tracepoint_enable(), rb_yield_splat(), and rb_yield_splat_kw().
VALUE rb_eEncCompatError |
Encoding::CompatibilityError
exception.
Definition at line 1415 of file error.c.
Referenced by rb_must_asciicompat().
|
extern |
Encoding::CompatibilityError
exception.
Definition at line 1415 of file error.c.
Referenced by rb_must_asciicompat().
VALUE rb_eException |
|
extern |
|
extern |
VALUE rb_eFrozenError |
FrozenError
exception.
Definition at line 1407 of file error.c.
Referenced by rb_error_frozen(), rb_error_frozen_object(), and rb_frozen_error_raise().
|
extern |
FrozenError
exception.
Definition at line 1407 of file error.c.
Referenced by rb_error_frozen(), rb_error_frozen_object(), and rb_frozen_error_raise().
VALUE rb_eIndexError |
IndexError
exception.
Definition at line 1410 of file error.c.
Referenced by rb_ary_resize(), rb_ary_store(), rb_str_ellipsize(), and rb_str_update().
|
extern |
IndexError
exception.
Definition at line 1410 of file error.c.
Referenced by rb_ary_resize(), rb_ary_store(), rb_str_ellipsize(), and rb_str_update().
VALUE rb_eInterrupt |
|
extern |
|
extern |
IOError
exception.
Definition at line 189 of file io.c.
Referenced by rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_io_check_initialized(), rb_io_check_writable(), and rb_io_ungetc().
VALUE rb_eNameError |
NameError
exception.
Definition at line 1413 of file error.c.
Referenced by rb_name_error(), and rb_name_error_str().
|
extern |
NameError
exception.
Definition at line 1413 of file error.c.
Referenced by rb_name_error(), and rb_name_error_str().
VALUE rb_eNoMatchingPatternError |
|
extern |
VALUE rb_eNoMatchingPatternKeyError |
|
extern |
VALUE rb_eNotImpError |
NotImplementedError
exception.
Definition at line 1418 of file error.c.
Referenced by rb_notimplement().
|
extern |
NotImplementedError
exception.
Definition at line 1418 of file error.c.
Referenced by rb_notimplement().
VALUE rb_eRangeError |
RangeError
exception.
Definition at line 1412 of file error.c.
Referenced by rb_big2long(), rb_big2ulong(), rb_enc_uint_chr(), rb_num2fix(), rb_out_of_int(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_str_concat(), and rb_uv_to_utf8().
|
extern |
RangeError
exception.
Definition at line 1412 of file error.c.
Referenced by rb_big2long(), rb_big2ulong(), rb_enc_uint_chr(), rb_num2fix(), rb_out_of_int(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_str_concat(), and rb_uv_to_utf8().
VALUE rb_eRuntimeError |
RuntimeError
exception.
Definition at line 1406 of file error.c.
Referenced by rb_alias_variable(), rb_current_receiver(), rb_memory_view_prepare_item_desc(), rb_reg_regsub(), rb_str_dump(), rb_str_set_len(), rb_str_unlocktmp(), rb_tracearg_object(), rb_tracearg_raised_exception(), and rb_tracearg_return_value().
|
extern |
RuntimeError
exception.
Definition at line 1406 of file error.c.
Referenced by rb_alias_variable(), rb_current_receiver(), rb_memory_view_prepare_item_desc(), rb_reg_regsub(), rb_str_dump(), rb_str_set_len(), rb_str_unlocktmp(), rb_tracearg_object(), rb_tracearg_raised_exception(), and rb_tracearg_return_value().
VALUE rb_eStandardError |
|
extern |
|
extern |
StopIteration
exception.
Definition at line 181 of file enumerator.c.
|
extern |
VALUE rb_eSystemExit |
SystemExit
exception.
Definition at line 1401 of file error.c.
Referenced by rb_exit(), and rb_f_abort().
|
extern |
SystemExit
exception.
Definition at line 1401 of file error.c.
Referenced by rb_exit(), and rb_f_abort().
|
extern |
ThreadError
exception.
Definition at line 934 of file eval.c.
Referenced by rb_internal_thread_specific_key_create(), rb_mutex_unlock(), rb_thread_stop(), and rb_thread_wakeup().
VALUE rb_eTypeError |
TypeError
exception.
Definition at line 1408 of file error.c.
Referenced by rb_alias(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_define_module_id_under(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_Hash(), rb_io_descriptor(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_num2long(), rb_obj_encoding(), rb_set_errinfo(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), and rb_undef().
|
extern |
TypeError
exception.
Definition at line 1408 of file error.c.
Referenced by rb_alias(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_define_module_id_under(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_Hash(), rb_io_descriptor(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_num2long(), rb_obj_encoding(), rb_set_errinfo(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), and rb_undef().
|
extern |
ZeroDivisionError
exception.
Definition at line 200 of file numeric.c.
Referenced by rb_num_zerodiv().
|
static |