Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
cxxanyargs.hpp
Go to the documentation of this file.
1#ifndef RUBY_BACKWARD_CXXANYARGS_HPP // -*- C++ -*-
2#define RUBY_BACKWARD_CXXANYARGS_HPP
13
17namespace ruby {
18
20namespace backward {
21
36namespace cxxanyargs {
37
40
42typedef void void_type(ANYARGS);
43
45typedef int int_type(ANYARGS);
46
49
50RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
58inline void
60{
61 rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
62 rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
64}
65
66RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
74inline void
76{
77 rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
79}
80
81RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
89inline void
91{
92 rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
94}
95
96RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
105inline void
107{
108 rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
109 rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
110 ::rb_define_hooked_variable(q, w, t, y);
111}
112
113RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
122inline void
124{
125 rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
126 ::rb_define_hooked_variable(q, w, e, y);
127}
128
129RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
138inline void
140{
141 rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
142 ::rb_define_hooked_variable(q, w, t, r);
143}
144
148
149RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
159inline VALUE
161{
162 rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
163 return ::rb_iterate(q, w, t, r);
164}
165
166RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
177inline VALUE
178rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
179{
180 rb_block_call_func_t u = reinterpret_cast<rb_block_call_func_t>(t);
181 return ::rb_block_call(q, w, e, r, u, y);
182}
183
184RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
197inline VALUE
199{
200 typedef VALUE func1_t(VALUE);
201 typedef VALUE func2_t(VALUE, VALUE);
202 func1_t *t = reinterpret_cast<func1_t*>(q);
203 func2_t *y = reinterpret_cast<func2_t*>(e);
204 return ::rb_rescue(t, w, y, r);
205}
206
207RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
221inline VALUE
222rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
223{
224 typedef VALUE func1_t(VALUE);
225 typedef VALUE func2_t(VALUE, VALUE);
226 func1_t *t = reinterpret_cast<func1_t*>(q);
227 func2_t *y = reinterpret_cast<func2_t*>(e);
228 va_list ap;
229 va_start(ap, r);
230 VALUE ret = ::rb_vrescue2(t, w, y, r, ap);
231 va_end(ap);
232 return ret;
233}
234
235RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
247inline VALUE
249{
250 typedef VALUE func1_t(VALUE);
251 func1_t *t = reinterpret_cast<func1_t*>(q);
252 func1_t *y = reinterpret_cast<func1_t*>(e);
253 return ::rb_ensure(t, w, y, r);
254}
255
256RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
268inline VALUE
269rb_catch(const char *q, type *w, VALUE e)
270{
271 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
272 return ::rb_catch(q, r, e);
273}
274
275RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
287inline VALUE
289{
290 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
291 return ::rb_catch_obj(q, r, e);
292}
293
297
298RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
307inline VALUE
309{
310 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
312}
313
314RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
323inline VALUE
325{
326 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
328}
329
330RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
339inline VALUE
341{
342 typedef VALUE ptr_t(void*);
343 ptr_t *e = reinterpret_cast<ptr_t*>(q);
345}
346
350
351RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
361inline int
363{
365 reinterpret_cast<st_foreach_callback_func*>(w);
366 return ::st_foreach(q, r, e);
367}
368
369RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
379inline int
381{
383 reinterpret_cast<st_foreach_check_callback_func*>(w);
384 return ::st_foreach_check(q, t, e, 0);
385}
386
387RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
395inline void
397{
399 reinterpret_cast<st_foreach_callback_func*>(w);
400 ::st_foreach_safe(q, r, e);
401}
402
403RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
411inline void
413{
415 reinterpret_cast<st_foreach_callback_func*>(w);
416 ::rb_hash_foreach(q, r, e);
417}
418
419RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
427inline void
429{
431 reinterpret_cast<st_foreach_callback_func*>(w);
432 ::rb_ivar_foreach(q, r, e);
433}
434
436}}}
437
438using namespace ruby::backward::cxxanyargs;
439#endif // RUBY_BACKWARD_CXXANYARGS_HPP
Provides ANYARGS deprecation warnings.
Definition: cxxanyargs.hpp:36
VALUE rb_catch_obj(VALUE q, type *w, VALUE e)
An equivalent of Kernel#catch.
Definition: cxxanyargs.hpp:288
VALUE rb_catch(const char *q, type *w, VALUE e)
An equivalent of Kernel#catch.
Definition: cxxanyargs.hpp:269
void rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
Define a function-backended global variable.
Definition: cxxanyargs.hpp:106
VALUE rb_thread_create(type *q, void *w)
Creates a rb_cThread instance.
Definition: cxxanyargs.hpp:340
int int_type(ANYARGS)
ANYARGS-ed function type, int variant.
Definition: cxxanyargs.hpp:45
void void_type(ANYARGS)
ANYARGS-ed function type, void variant.
Definition: cxxanyargs.hpp:42
VALUE rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
Call a method with a block.
Definition: cxxanyargs.hpp:178
VALUE rb_proc_new(type *q, VALUE w)
Creates a rb_cProc instance.
Definition: cxxanyargs.hpp:324
VALUE rb_iterate(VALUE(*q)(VALUE), VALUE w, type *e, VALUE r)
Old way to implement iterators.
Definition: cxxanyargs.hpp:160
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:39
VALUE rb_fiber_new(type *q, VALUE w)
Creates a rb_cFiber instance.
Definition: cxxanyargs.hpp:308
void st_foreach_safe(st_table *q, int_type *w, st_data_t e)
Iteration over the given table.
Definition: cxxanyargs.hpp:396
int st_foreach(st_table *q, int_type *w, st_data_t e)
Iteration over the given table.
Definition: cxxanyargs.hpp:362
void rb_hash_foreach(VALUE q, int_type *w, VALUE e)
Iteration over the given hash.
Definition: cxxanyargs.hpp:412
void rb_define_virtual_variable(const char *q, type *w, void_type *e)
Define a function-backended global variable.
Definition: cxxanyargs.hpp:59
void rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
Iteration over each instance variable of the object.
Definition: cxxanyargs.hpp:428
VALUE rb_rescue2(type *q, VALUE w, type *e, VALUE r,...)
An equivalent of rescue clause.
Definition: cxxanyargs.hpp:222
VALUE rb_rescue(type *q, VALUE w, type *e, VALUE r)
An equivalent of rescue clause.
Definition: cxxanyargs.hpp:198
VALUE rb_ensure(type *q, VALUE w, type *e, VALUE r)
An equivalent of ensure clause.
Definition: cxxanyargs.hpp:248
int st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
Iteration over the given table.
Definition: cxxanyargs.hpp:380
The main namespace.
Definition: cxxanyargs.hpp:17
unsigned long st_data_t
int st_foreach_check_callback_func(st_data_t, st_data_t, st_data_t, int)
VALUE rb_vrescue2(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE, VALUE), VALUE, va_list)
An equivalent of rescue clause.
Definition: eval.c:977
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
unsigned long VALUE
#define va_end(v)
__gnuc_va_list va_list
#define RUBY_CXX_DEPRECATED(msg)
#define va_start(v, l)
rb_block_call_func * rb_block_call_func_t
int st_foreach_callback_func(st_data_t, st_data_t, st_data_t)
VALUE rb_gvar_getter_t(ID id, VALUE *data)
unsigned long ID
#define ANYARGS
int st_foreach(st_table *tab, st_foreach_callback_func *func, st_data_t arg)
Definition: st.c:1717
int st_foreach_check(st_table *tab, st_foreach_check_callback_func *func, st_data_t arg, st_data_t never ATTRIBUTE_UNUSED)
Definition: st.c:1725
#define const
Definition: strftime.c:103