Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Pre-1.9 era evaluator APIs (now considered miscellaneous). More...
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Functions | |
void | rb_exc_raise (VALUE exc) |
Identical to rb_raise(), except it raises the passed exception instance as- is instead of creating new one. | |
void | rb_exc_fatal (VALUE exc) |
Identical to rb_fatal(), except it raises the passed exception instance as- is instead of creating new one. | |
VALUE | rb_f_exit (int argc, const VALUE *argv) |
Identical to rb_exit(), except how arguments are passed. | |
VALUE | rb_f_abort (int argc, const VALUE *argv) |
This is similar to rb_f_exit(). | |
void | rb_interrupt (void) |
Raises an instance of rb_eInterrupt. | |
ID | rb_frame_this_func (void) |
Queries the name of the Ruby level method that is calling this function. | |
void | rb_jump_tag (int state) |
This function is to re-throw global escapes. | |
void | rb_obj_call_init (VALUE obj, int argc, const VALUE *argv) |
Calls initialize method of the passed object with the passed arguments. | |
void | rb_obj_call_init_kw (VALUE, int, const VALUE *, int) |
Identical to rb_obj_call_init(), except you can specify how to handle the last element of the given array. | |
ID | rb_frame_callee (void) |
Identical to rb_frame_this_func(), except it returns the named used to call the method. | |
VALUE | rb_make_exception (int argc, const VALUE *argv) |
Constructs an exception object from the list of arguments, in a manner similar to Ruby's raise. | |
void | rb_set_end_proc (void(*func)(VALUE arg), VALUE arg) |
Registers a function that shall run on process exit. |
Pre-1.9 era evaluator APIs (now considered miscellaneous).
Definition in file eval.h.
This is similar to rb_f_exit().
In fact on some situation it internally calls rb_exit(). But can be very esoteric on occasions.
It takes up to one argument. If an argument is passed, it tries to display that. Otherwise if there is $!, displays that exception instead. It finally raise rb_eSystemExit in both cases.
[in] | argc | Number of objects of argv. |
[in] | argv | Contains at most one string-ish object. |
rb_eArgError | Wrong `argc`. |
rb_eTypeError | No conversion from `argv[0]` to String. |
rb_eSystemExit | Exception representing `EXIT_FAILURE`. |
Identical to rb_exit(), except how arguments are passed.
[in] | argc | Number of objects of argv. |
[in] | argv | Contains at most one of the following:
|
rb_eArgError | Wrong `argc`. |
rb_eSystemExit | Exception representing the exit status. |
ID rb_frame_callee | ( | void | ) |
Identical to rb_frame_this_func(), except it returns the named used to call the method.
0 | There is no method (e.g. toplevel context). |
otherwise | The name of the current method. |
ID rb_frame_this_func | ( | void | ) |
Queries the name of the Ruby level method that is calling this function.
The "name" in this context is the one assigned to the function for the first time (note that methods can have multiple names via aliases).
0 | There is no method (e.g. toplevel context). |
otherwise | The name of the current method. |
Definition at line 1115 of file eval.c.
Referenced by rb_notimplement().
void rb_interrupt | ( | void | ) |
Raises an instance of rb_eInterrupt.
rb_eInterrupt | Always raises this exception. |
void rb_jump_tag | ( | int | state | ) |
This function is to re-throw global escapes.
Such global escapes include exceptions, throw, break, for example.
It makes sense only when used in conjunction with "protect" series APIs e.g. rb_protect(), rb_load_protect(), rb_eval_string_protect(), etc. In case these functions experience global escapes, they fill their opaque state return buffer. You can ignore such escapes. But if you decide otherwise, you have to somehow escape globally again. This function is used for that purpose.
[in] | state | Opaque state of execution. |
Constructs an exception object from the list of arguments, in a manner similar to Ruby's raise.
This function can take:
[in] | argc | Number of objects of argv. |
[in] | argv | 0 up to 3 objects. |
rb_eArgError | Wrong `argc`. |
rb_eTypeError | `argv[0].exception` returned non-exception. |
Calls initialize method of the passed object with the passed arguments.
It also forwards the implicitly passed block to the method.
[in] | obj | Receiver object. |
[in] | argc | Number of objects of argv. |
[in] | argv | Passed as-is to obj.initialize. |
rb_eException | Any exceptions happen inside. |
Identical to rb_obj_call_init(), except you can specify how to handle the last element of the given array.
[in] | obj | Receiver object. |
[in] | argc | Number of objects of argv. |
[in] | argv | Passed as-is to obj.initialize. |
[in] | kw_splat | Handling of keyword parameters:
|
rb_eNoMethodError | No such method. |
rb_eException | Any exceptions happen inside. |
Registers a function that shall run on process exit.
Registered functions run in reverse-chronological order, mixed with syntactic END block and Kernel#at_exit.
[in] | func | Function to run at process exit. |
[in] | arg | Passed as-is to func. |
Definition at line 59 of file eval_jump.c.