Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Public APIs related to rb_eException. More...
#include "ruby/internal/attr/format.h"
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
#include "ruby/internal/fl_type.h"
#include "ruby/backward/2/assume.h"
Go to the source code of this file.
Macros | |
#define | UNLIMITED_ARGUMENTS (-1) |
This macro is used in conjunction with rb_check_arity(). | |
#define | rb_exc_new2 rb_exc_new_cstr |
Old name of rb_exc_new_cstr. | |
#define | rb_exc_new3 rb_exc_new_str |
Old name of rb_exc_new_str. | |
#define | rb_check_frozen_internal rb_check_frozen |
#define | rb_check_frozen rb_check_frozen_inline |
Functions | |
VALUE | rb_exc_new (VALUE etype, const char *ptr, long len) |
Creates an instance of the passed exception class. | |
VALUE | rb_exc_new_cstr (VALUE etype, const char *str) |
Identical to rb_exc_new(), except it assumes the passed pointer is a pointer to a C string. | |
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. | |
void | rb_loaderror (const char *fmt,...) |
Raises an instance of rb_eLoadError. | |
void | rb_loaderror_with_path (VALUE path, const char *fmt,...) |
Identical to rb_loaderror(), except it additionally takes which file is unable to load. | |
void | rb_name_error (ID name, const char *fmt,...) |
Raises an instance of rb_eNameError. | |
void | rb_name_error_str (VALUE name, const char *fmt,...) |
Identical to rb_name_error(), except it takes a VALUE instead of ID. | |
void | rb_frozen_error_raise (VALUE recv, const char *fmt,...) |
Raises an instance of rb_eFrozenError. | |
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. | |
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/". | |
void | rb_error_frozen_object (VALUE what) |
Identical to rb_error_frozen(), except it takes arbitrary Ruby object instead of C's string. | |
void | rb_check_frozen (VALUE obj) |
Queries if the passed object is frozen. | |
void | rb_check_copyable (VALUE obj, VALUE orig) |
Ensures that the passed object can be initialize_copy relationship. | |
void | rb_str_modify (VALUE str) |
static void | rb_check_frozen_inline (VALUE obj) |
Just another name of rb_check_frozen. | |
static int | rb_check_arity (int argc, int min, int max) |
Ensures that the passed integer is in the passed range. |
Public APIs related to rb_eException.
Definition in file error.h.
#define rb_check_frozen rb_check_frozen_inline |
#define rb_check_frozen_internal rb_check_frozen |
Does anyone use this? Remain not deleted for compatibility.
#define UNLIMITED_ARGUMENTS (-1) |
This macro is used in conjunction with rb_check_arity().
If you pass it to the function's last (max) argument, that means the function does not check upper limit.
Definition at line 35 of file error.h.
Referenced by rb_check_arity(), rb_f_kill(), and rb_proc_arity().
|
inlinestatic |
Ensures that the passed integer is in the passed range.
When you can use rb_scan_args() that is preferred over this one (powerful, descriptive). But it can have its own application area.
[in] | argc | Arbitrary integer. |
[in] | min | Minimum allowed argv. |
[in] | max | Maximum allowed argv, or UNLIMITED_ARGUMENTS. |
rb_eArgError | `argc` out of range. |
Definition at line 284 of file error.h.
Referenced by rb_ary_aref(), rb_f_abort(), rb_f_exit(), rb_f_kill(), rb_file_s_absolute_path(), rb_file_s_expand_path(), rb_mod_class_variables(), rb_mod_constants(), and rb_obj_singleton_methods().
|
inlinestatic |
Just another name of rb_check_frozen.
Definition at line 253 of file error.h.
Referenced by rb_check_frozen().