Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Provides ANYARGS deprecation warnings. More...
Namespaces | |
define_method | |
Driver for *_define_method. | |
Typedefs | |
typedef VALUE | type(ANYARGS) |
ANYARGS-ed function type. More... | |
typedef void | void_type(ANYARGS) |
ANYARGS-ed function type, void variant. More... | |
typedef int | int_type(ANYARGS) |
ANYARGS-ed function type, int variant. More... | |
typedef VALUE | onearg_type(VALUE) |
Single-argumented function type. More... | |
Functions | |
Hooking global variables | |
void | rb_define_virtual_variable (const char *q, type *w, void_type *e) |
Define a function-backended global variable. More... | |
void | rb_define_hooked_variable (const char *q, VALUE *w, type *e, void_type *r) |
Define a function-backended global variable. More... | |
Exceptions and tag jumps | |
VALUE | rb_iterate (onearg_type *q, VALUE w, type *e, VALUE r) |
Old way to implement iterators. More... | |
VALUE | rb_block_call (VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y) |
Call a method with a block. More... | |
VALUE | rb_rescue (type *q, VALUE w, type *e, VALUE r) |
An equivalent of rescue clause. More... | |
VALUE | rb_rescue2 (type *q, VALUE w, type *e, VALUE r,...) |
An equivalent of rescue clause. More... | |
VALUE | rb_ensure (type *q, VALUE w, type *e, VALUE r) |
An equivalent of ensure clause. More... | |
VALUE | rb_catch (const char *q, type *w, VALUE e) |
An equivalent of Kernel#catch . More... | |
VALUE | rb_catch_obj (VALUE q, type *w, VALUE e) |
An equivalent of Kernel#catch . More... | |
Procs, Fibers and Threads | |
VALUE | rb_fiber_new (type *q, VALUE w) |
Creates a rb_cFiber instance. More... | |
VALUE | rb_proc_new (type *q, VALUE w) |
Creates a rb_cProc instance. More... | |
VALUE | rb_thread_create (type *q, void *w) |
Creates a rb_cThread instance. More... | |
Hash and st_table | |
int | st_foreach (st_table *q, int_type *w, st_data_t e) |
Iteration over the given table. More... | |
int | st_foreach_check (st_table *q, int_type *w, st_data_t e, st_data_t) |
Iteration over the given table. More... | |
void | st_foreach_safe (st_table *q, int_type *w, st_data_t e) |
Iteration over the given table. More... | |
void | rb_hash_foreach (VALUE q, int_type *w, VALUE e) |
Iteration over the given hash. More... | |
void | rb_ivar_foreach (VALUE q, int_type *w, VALUE e) |
Iteration over each instance variable of the object. More... | |
Provides ANYARGS deprecation warnings.
In C, ANYARGS means there is no function prototype. Literally anything, even including nothing, can be a valid ANYARGS. So passing a correctly prototyped function pointer to an ANYARGS-ed function parameter is valid, at the same time passing an ANYARGS-ed function pointer to a granular typed function parameter is also valid. However on the other hand in C++, ANYARGS doesn't actually mean any number of arguments. C++'s ANYARGS means variadic number of arguments. This is incompatible with ordinal, correct function prototypes.
Luckily, function prototypes being distinct each other means they can be overloaded. We can provide a compatibility layer for older Ruby APIs which used to have ANYARGS. This namespace includes such attempts.
typedef int ruby::backward::cxxanyargs::int_type(ANYARGS) |
ANYARGS-ed function type, int variant.
Definition at line 58 of file cxxanyargs.hpp.
Single-argumented function type.
Definition at line 59 of file cxxanyargs.hpp.
ANYARGS-ed function type.
Definition at line 56 of file cxxanyargs.hpp.
typedef void ruby::backward::cxxanyargs::void_type(ANYARGS) |
ANYARGS-ed function type, void variant.
Definition at line 57 of file cxxanyargs.hpp.
|
inline |
Call a method with a block.
[in] | q | The self. |
[in] | w | The method. |
[in] | e | The # of elems of r |
[in] | r | The arguments. |
[in] | t | What is to be yielded. |
[in] | y | Passed to t |
q#w(*r,&t)
Definition at line 232 of file cxxanyargs.hpp.
An equivalent of Kernel#catch
.
[in] | q | The "tag" string. |
[in] | w | A function that can throw. |
[in] | e | Passed to w . |
q
can be a nullptr but makes no sense to pass nullptr tow
. Definition at line 331 of file cxxanyargs.hpp.
An equivalent of Kernel#catch
.
[in] | q | The "tag" object. |
[in] | w | A function that can throw. |
[in] | e | Passed to w . |
w
. Definition at line 358 of file cxxanyargs.hpp.
|
inline |
Define a function-backended global variable.
[in] | q | Name of the variable. |
[in] | w | Variable storage. |
[in] | e | Getter function. |
[in] | r | Setter function. |
Definition at line 136 of file cxxanyargs.hpp.
|
inline |
Define a function-backended global variable.
[in] | q | Name of the variable. |
[in] | w | Getter function. |
[in] | e | Setter function. |
Definition at line 73 of file cxxanyargs.hpp.
An equivalent of ensure
clause.
[in] | q | A function that can raise. |
[in] | w | Passed to q . |
[in] | e | A function that ensures. |
[in] | r | Passed to e . |
q
. e
. Definition at line 310 of file cxxanyargs.hpp.
Creates a rb_cFiber instance.
[in] | q | The fiber body. |
[in] | w | Passed to q . |
q
. Definition at line 378 of file cxxanyargs.hpp.
Iteration over the given hash.
[in] | q | A hash to scan. |
[in] | w | A function to iterate. |
[in] | e | Passed to w . |
w
. Definition at line 482 of file cxxanyargs.hpp.
|
inline |
Old way to implement iterators.
[in] | q | A function that can yield. |
[in] | w | Passed to q . |
[in] | e | What is to be yielded. |
[in] | r | Passed to e . |
q
. e
can be nullptr. Definition at line 205 of file cxxanyargs.hpp.
Iteration over each instance variable of the object.
[in] | q | An object. |
[in] | w | A function to iterate. |
[in] | e | Passed to w . |
w
. Definition at line 498 of file cxxanyargs.hpp.
Creates a rb_cProc instance.
[in] | q | The proc body. |
[in] | w | Passed to q . |
q
. Definition at line 394 of file cxxanyargs.hpp.
An equivalent of rescue
clause.
[in] | q | A function that can raise. |
[in] | w | Passed to q . |
[in] | e | A function that cleans-up. |
[in] | r | Passed to e . |
q
if no exception occurs, or the return value of e
if otherwise. e
can be nullptr. Definition at line 260 of file cxxanyargs.hpp.
An equivalent of rescue
clause.
[in] | q | A function that can raise. |
[in] | w | Passed to q . |
[in] | e | A function that cleans-up. |
[in] | r | Passed to e . |
[in] | ... | 0-terminated list of subclass of rb_eException. |
q
if no exception occurs, or the return value of e
if otherwise. e
can be nullptr. Definition at line 284 of file cxxanyargs.hpp.
Creates a rb_cThread instance.
[in] | q | The thread body. |
[in] | w | Passed to q . |
q
. Definition at line 410 of file cxxanyargs.hpp.
Iteration over the given table.
[in] | q | A table to scan. |
[in] | w | A function to iterate. |
[in] | e | Passed to w . |
0 | Always returns 0. |
w
. Definition at line 432 of file cxxanyargs.hpp.
Referenced by rb_clear_constant_cache_for_id(), rb_econv_asciicompat_encoding(), rb_mark_hash(), rb_mark_set(), rb_mark_tbl(), and rb_sym_all_symbols().
|
inline |
Iteration over the given table.
[in] | q | A table to scan. |
[in] | w | A function to iterate. |
[in] | e | Passed to w . |
0 | Successful end of iteration. |
1 | Element removed during traversing. |
w
. Definition at line 450 of file cxxanyargs.hpp.
Iteration over the given table.
[in] | q | A table to scan. |
[in] | w | A function to iterate. |
[in] | e | Passed to w . |
w
. Definition at line 466 of file cxxanyargs.hpp.