Ruby: include/ruby/backward/cxxanyargs.hpp Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

cxxanyargs.hpp
Go to the documentation of this file.
1#ifndef RUBY_BACKWARD_CXXANYARGS_HPP //-*-C++-*-vi:ft=cpp
2#define RUBY_BACKWARD_CXXANYARGS_HPP
13#include "ruby/internal/config.h"
14#include "ruby/internal/intern/class.h"
15#include "ruby/internal/intern/cont.h"
16#include "ruby/internal/intern/hash.h"
17#include "ruby/internal/intern/proc.h"
18#include "ruby/internal/intern/thread.h"
19#include "ruby/internal/intern/variable.h"
20#include "ruby/internal/intern/vm.h"
21#include "ruby/internal/iterator.h"
22#include "ruby/internal/method.h"
23#include "ruby/internal/value.h"
24#include "ruby/internal/variable.h"
25#include "ruby/backward/2/stdarg.h"
26#include "ruby/st.h"
27
28extern "C++" {
29
30#ifdef HAVE_NULLPTR
31#include <cstddef>
32#endif
33
37 namespace ruby {
38
40 namespace backward {
41
54 namespace cxxanyargs {
55
56 typedef VALUE type(ANYARGS);
57 typedef void void_type(ANYARGS);
58 typedef int int_type(ANYARGS);
59 typedef VALUE onearg_type(VALUE);
60
63
64 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
72inline void
73rb_define_virtual_variable(const char *q, type *w, void_type *e)
74{
75 rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
76 rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
77 ::rb_define_virtual_variable(q, r, t);
78}
79
80 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
81inline void
82 rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, void_type *e)
83{
84 rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
85 ::rb_define_virtual_variable(q, w, t);
86}
87
88 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
89inline void
90 rb_define_virtual_variable(const char *q, type *w, rb_gvar_setter_t *e)
91{
92 rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
93 ::rb_define_virtual_variable(q, r, e);
94}
95
96#ifdef HAVE_NULLPTR
97inline void
98 rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, std::nullptr_t e)
99{
100 ::rb_define_virtual_variable(q, w, e);
101}
102
103 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
104inline void
105 rb_define_virtual_variable(const char *q, type *w, std::nullptr_t e)
106{
107 rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t *>(w);
108 ::rb_define_virtual_variable(q, r, e);
109}
110
111inline void
112 rb_define_virtual_variable(const char *q, std::nullptr_t w, rb_gvar_setter_t *e)
113{
114 ::rb_define_virtual_variable(q, w, e);
115}
116
117 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
118inline void
119 rb_define_virtual_variable(const char *q, std::nullptr_t w, void_type *e)
120{
121 rb_gvar_setter_t *r = reinterpret_cast<rb_gvar_setter_t *>(e);
122 ::rb_define_virtual_variable(q, w, r);
123}
124#endif
125
126 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
135inline void
136rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
137{
138 rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
139 rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
140 ::rb_define_hooked_variable(q, w, t, y);
141}
142
143 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
144inline void
145 rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, void_type *r)
146{
147 rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
148 ::rb_define_hooked_variable(q, w, e, y);
149}
150
151 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
152inline void
153 rb_define_hooked_variable(const char *q, VALUE *w, type *e, rb_gvar_setter_t *r)
154{
155 rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
156 ::rb_define_hooked_variable(q, w, t, r);
157}
158
159#ifdef HAVE_NULLPTR
160inline void
161 rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, std::nullptr_t r)
162{
163 ::rb_define_hooked_variable(q, w, e, r);
164}
165
166 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
167inline void
168 rb_define_hooked_variable(const char *q, VALUE *w, type *e, std::nullptr_t r)
169{
170 rb_gvar_getter_t *y = reinterpret_cast<rb_gvar_getter_t *>(e);
171 ::rb_define_hooked_variable(q, w, y, r);
172}
173
174inline void
175 rb_define_hooked_variable(const char *q, VALUE *w, std::nullptr_t e, rb_gvar_setter_t *r)
176{
177 ::rb_define_hooked_variable(q, w, e, r);
178}
179
180 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
181inline void
182 rb_define_hooked_variable(const char *q, VALUE *w, std::nullptr_t e, void_type *r)
183{
184 rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t *>(r);
185 ::rb_define_hooked_variable(q, w, e, y);
186}
187#endif
188
192
193 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
203inline VALUE
204rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
205{
206 rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
207 return ::rb_iterate(q, w, t, r);
208}
209
210#ifdef HAVE_NULLPTR
211inline VALUE
212 rb_iterate(onearg_type *q, VALUE w, std::nullptr_t e, VALUE r)
213{
214 return ::rb_iterate(q, w, e, r);
215}
216#endif
217
218 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
229inline VALUE
230rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
231{
232 rb_block_call_func_t u = reinterpret_cast<rb_block_call_func_t>(t);
233 return ::rb_block_call(q, w, e, r, u, y);
234}
235
236#ifdef HAVE_NULLPTR
237inline VALUE
238 rb_block_call(VALUE q, ID w, int e, const VALUE *r, std::nullptr_t t, VALUE y)
239{
240 return ::rb_block_call(q, w, e, r, t, y);
241}
242#endif
243
244 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
257inline VALUE
258rb_rescue(type *q, VALUE w, type *e, VALUE r)
259{
260 typedef VALUE func1_t(VALUE);
261 typedef VALUE func2_t(VALUE, VALUE);
262 func1_t *t = reinterpret_cast<func1_t*>(q);
263 func2_t *y = reinterpret_cast<func2_t*>(e);
264 return ::rb_rescue(t, w, y, r);
265}
266
267 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
281inline VALUE
282rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
283{
284 typedef VALUE func1_t(VALUE);
285 typedef VALUE func2_t(VALUE, VALUE);
286 func1_t *t = reinterpret_cast<func1_t*>(q);
287 func2_t *y = reinterpret_cast<func2_t*>(e);
288 va_list ap;
289 va_start(ap, r);
290 VALUE ret = ::rb_vrescue2(t, w, y, r, ap);
291 va_end(ap);
292 return ret;
293}
294
295 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
307inline VALUE
308rb_ensure(type *q, VALUE w, type *e, VALUE r)
309{
310 typedef VALUE func1_t(VALUE);
311 func1_t *t = reinterpret_cast<func1_t*>(q);
312 func1_t *y = reinterpret_cast<func1_t*>(e);
313 return ::rb_ensure(t, w, y, r);
314}
315
316 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
328inline VALUE
329rb_catch(const char *q, type *w, VALUE e)
330{
331 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
332 return ::rb_catch(q, r, e);
333}
334
335#ifdef HAVE_NULLPTR
336inline VALUE
337 rb_catch(const char *q, std::nullptr_t w, VALUE e)
338{
339 return ::rb_catch(q, w, e);
340}
341#endif
342
343 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
355inline VALUE
356rb_catch_obj(VALUE q, type *w, VALUE e)
357{
358 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
359 return ::rb_catch_obj(q, r, e);
360}
361
365
366 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
375inline VALUE
376rb_fiber_new(type *q, VALUE w)
377{
378 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
379 return ::rb_fiber_new(e, w);
380}
381
382 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
391inline VALUE
392rb_proc_new(type *q, VALUE w)
393{
394 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
395 return ::rb_proc_new(e, w);
396}
397
398 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
407inline VALUE
408rb_thread_create(type *q, void *w)
409{
410 typedef VALUE ptr_t(void*);
411 ptr_t *e = reinterpret_cast<ptr_t*>(q);
412 return ::rb_thread_create(e, w);
413}
414
418
419 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
429inline int
430 st_foreach(st_table *q, int_type *w, st_data_t e)
431{
432 st_foreach_callback_func *r =
433 reinterpret_cast<st_foreach_callback_func*>(w);
434 return ::st_foreach(q, r, e);
435}
436
437 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
447inline int
448 st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
449{
450 st_foreach_check_callback_func *t =
451 reinterpret_cast<st_foreach_check_callback_func*>(w);
452 return ::st_foreach_check(q, t, e, 0);
453}
454
455 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
463inline void
464 st_foreach_safe(st_table *q, int_type *w, st_data_t e)
465{
466 st_foreach_callback_func *r =
467 reinterpret_cast<st_foreach_callback_func*>(w);
468 ::st_foreach_safe(q, r, e);
469}
470
471 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
479inline void
480rb_hash_foreach(VALUE q, int_type *w, VALUE e)
481{
482 st_foreach_callback_func *r =
483 reinterpret_cast<st_foreach_callback_func*>(w);
484 ::rb_hash_foreach(q, r, e);
485}
486
487 RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
495inline void
496rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
497{
498 st_foreach_callback_func *r =
499 reinterpret_cast<st_foreach_callback_func*>(w);
500 ::rb_ivar_foreach(q, r, e);
501}
502
504
512 namespace define_method {
513
515 typedef VALUE notimpl_type(int, const VALUE *, VALUE, VALUE);
516
520template<typename T, void (*F)(VALUE klass, T mid, type *func, int arity)>
521 struct driver {
522
526 template<int N, typename U>
527 struct engine {
528
529 /* :TODO: Following deprecation attribute renders tons of warnings (one
530 * per every method definitions), which is annoying. Of course
531 * annoyance is the core feature of deprecation warnings... But that
532 * could be too much, especially when the warnings happen inside of
533 * machine-generated programs. And SWIG is known to do such thing.
534 * The new (granular) API was introduced in API version 2.7. As of
535 * this writing the version is 2.8. Let's warn this later, some time
536 * during 3.x. Hopefully codes in old (ANYARGS-ed) format should be
537 * less than now. */
538#if (RUBY_API_VERSION_MAJOR * 100 + RUBY_API_VERSION_MINOR) >= 301
539 RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
540#endif
543 static inline void
544 define(VALUE klass, T mid, type func)
545 {
546 F(klass, mid, func, N);
547 }
548
553 static inline void
554 define(VALUE klass, T mid, U func)
555 {
556 F(klass, mid, reinterpret_cast<type *>(func), N);
557 }
558
560 static inline void
561 define(VALUE klass, T mid, notimpl_type func)
562 {
563 F(klass, mid, reinterpret_cast<type *>(func), N);
564 }
565 };
566
568 template<int N, bool = false> struct specific : public engine<N, type *> {};
569 template<bool b> struct specific<15, b> : public engine<15, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
570 template<bool b> struct specific<14, b> : public engine<14, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
571 template<bool b> struct specific<13, b> : public engine<13, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
572 template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
573 template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
574 template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
575 template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
576 template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
577 template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
578 template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
579 template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
580 template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
581 template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
582 template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
583 template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
584 template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
585 template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
586 using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
587 static inline void define(VALUE c, T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(c, m, reinterpret_cast<type *>(f), -1); }
588 };
589 template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
591};
592
593/* We could perhaps merge this struct into the one above using variadic
594 * template parameters if we could assume C++11, but sadly we cannot. */
595template<typename T, void (*F)(T mid, type func, int arity)>
596 struct driver0 {
597 template<int N, typename U>
598 struct engine {
599 RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
600 static inline void
601 define(T mid, type func)
602 {
603 F(mid, func, N);
604 }
605 static inline void
606 define(T mid, U func)
607 {
608 F(mid, reinterpret_cast<type *>(func), N);
609 }
610 static inline void
611 define(T mid, notimpl_type func)
612 {
613 F(mid, reinterpret_cast<type *>(func), N);
614 }
615 };
617 template<int N, bool = false> struct specific : public engine<N, type *> {};
618 template<bool b> struct specific<15, b> : public engine<15, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
619 template<bool b> struct specific<14, b> : public engine<14, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
620 template<bool b> struct specific<13, b> : public engine<13, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
621 template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
622 template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
623 template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
624 template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
625 template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
626 template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
627 template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
628 template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
629 template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
630 template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
631 template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
632 template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
633 template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
634 template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
635 using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
636 static inline void define(T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(m, reinterpret_cast<type *>(f), -1); }
637 };
638 template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
640};
641
642 struct rb_define_method : public driver <const char *, ::rb_define_method> {};
643 struct rb_define_method_id : public driver <ID, ::rb_define_method_id> {};
644 struct rb_define_private_method : public driver <const char *, ::rb_define_private_method> {};
645 struct rb_define_protected_method : public driver <const char *, ::rb_define_protected_method> {};
646 struct rb_define_singleton_method : public driver <const char *, ::rb_define_singleton_method> {};
647 struct rb_define_module_function : public driver <const char *, ::rb_define_module_function> {};
648 struct rb_define_global_function : public driver0<const char *, ::rb_define_global_function> {};
649
653#define rb_define_method(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_method::specific<arity>::define(klass, mid, func)
654
656#define rb_define_method_id(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_method_id::specific<arity>::define(klass, mid, func)
657
660#define rb_define_private_method(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_private_method::specific<arity>::define(klass, mid, func)
661
664#define rb_define_protected_method(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_protected_method::specific<arity>::define(klass, mid, func)
665
668#define rb_define_singleton_method(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_singleton_method::specific<arity>::define(klass, mid, func)
669
672#define rb_define_module_function(klass, mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_module_function::specific<arity>::define(klass, mid, func)
673
678#define rb_define_global_function(mid, func, arity) ruby::backward::cxxanyargs::define_method::rb_define_global_function::specific<arity>::define(mid, func)
679
680}}}}}
681
682using namespace ruby::backward::cxxanyargs;
683#endif // RUBY_BACKWARD_CXXANYARGS_HPP
RUBY_CXX_DEPRECATED
#define RUBY_CXX_DEPRECATED(mseg)
Definition: attributes.h:79
T
unsigned char T
Definition: cls_uchar_va.c:10
N
#define N
Definition: crc32.c:57
rb_vrescue2
VALUE rb_vrescue2(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2, va_list args)
An equivalent of rescue clause.
Definition: eval.c:1006
config.h
Thin wrapper to ruby/config.h.
class.h
Public APIs related to rb_cClass/rb_cModule.
cont.h
Public APIs related to rb_cFiber.
hash.h
Public APIs related to rb_cHash.
st_foreach_safe
#define st_foreach_safe
Definition: hash.h:31
proc.h
Public APIs related to rb_cProc.
thread.h
Public APIs related to rb_cThread.
variable.h
Public APIs related to names inside of a Ruby program.
vm.h
Public APIs related to rb_cRubyVM.
method.h
Creation and modification of Ruby methods.
variable.h
C-function backended Ruby-global variables.
rb_gvar_setter_t
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
Definition: variable.h:30
rb_gvar_getter_t
VALUE rb_gvar_getter_t(ID id, VALUE *data)
Definition: variable.h:29
iterator.h
Block related APIs.
rb_block_call_func_t
rb_block_call_func * rb_block_call_func_t
Definition: iterator.h:34
F
#define F(x, y, z)
ruby::backward::cxxanyargs::define_method::notimpl_type
VALUE notimpl_type(int, const VALUE *, VALUE, VALUE)
Type of rb_f_notimplement().
Definition: cxxanyargs.hpp:515
ruby::backward::cxxanyargs
Provides ANYARGS deprecation warnings.
Definition: cxxanyargs.hpp:54
ruby::backward::cxxanyargs::onearg_type
VALUE onearg_type(VALUE)
Single-argumented function type.
Definition: cxxanyargs.hpp:59
ruby::backward::cxxanyargs::rb_catch_obj
VALUE rb_catch_obj(VALUE q, type *w, VALUE e)
An equivalent of Kernel#catch.
Definition: cxxanyargs.hpp:356
ruby::backward::cxxanyargs::rb_catch
VALUE rb_catch(const char *q, type *w, VALUE e)
An equivalent of Kernel#catch.
Definition: cxxanyargs.hpp:329
ruby::backward::cxxanyargs::rb_define_hooked_variable
void rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
Define a function-backended global variable.
Definition: cxxanyargs.hpp:136
ruby::backward::cxxanyargs::rb_thread_create
VALUE rb_thread_create(type *q, void *w)
Creates a rb_cThread instance.
Definition: cxxanyargs.hpp:408
ruby::backward::cxxanyargs::int_type
int int_type(ANYARGS)
ANYARGS-ed function type, int variant.
Definition: cxxanyargs.hpp:58
ruby::backward::cxxanyargs::void_type
void void_type(ANYARGS)
ANYARGS-ed function type, void variant.
Definition: cxxanyargs.hpp:57
ruby::backward::cxxanyargs::rb_block_call
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:230
ruby::backward::cxxanyargs::rb_proc_new
VALUE rb_proc_new(type *q, VALUE w)
Creates a rb_cProc instance.
Definition: cxxanyargs.hpp:392
ruby::backward::cxxanyargs::rb_iterate
VALUE rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
Old way to implement iterators.
Definition: cxxanyargs.hpp:204
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:56
ruby::backward::cxxanyargs::rb_fiber_new
VALUE rb_fiber_new(type *q, VALUE w)
Creates a rb_cFiber instance.
Definition: cxxanyargs.hpp:376
ruby::backward::cxxanyargs::rb_hash_foreach
void rb_hash_foreach(VALUE q, int_type *w, VALUE e)
Iteration over the given hash.
Definition: cxxanyargs.hpp:480
ruby::backward::cxxanyargs::rb_define_virtual_variable
void rb_define_virtual_variable(const char *q, type *w, void_type *e)
Define a function-backended global variable.
Definition: cxxanyargs.hpp:73
ruby::backward::cxxanyargs::rb_ivar_foreach
void rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
Iteration over each instance variable of the object.
Definition: cxxanyargs.hpp:496
ruby::backward::cxxanyargs::rb_rescue2
VALUE rb_rescue2(type *q, VALUE w, type *e, VALUE r,...)
An equivalent of rescue clause.
Definition: cxxanyargs.hpp:282
ruby::backward::cxxanyargs::rb_rescue
VALUE rb_rescue(type *q, VALUE w, type *e, VALUE r)
An equivalent of rescue clause.
Definition: cxxanyargs.hpp:258
ruby::backward::cxxanyargs::rb_ensure
VALUE rb_ensure(type *q, VALUE w, type *e, VALUE r)
An equivalent of ensure clause.
Definition: cxxanyargs.hpp:308
ruby
The main namespace.
Definition: cxxanyargs.hpp:37
argc
int argc
Definition: ruby.c:240
argv
char ** argv
Definition: ruby.c:241
f
#define f
st.h
st_data_t
unsigned long st_data_t
Definition: st.h:22
st_foreach_check_callback_func
int st_foreach_check_callback_func(st_data_t, st_data_t, st_data_t, int)
Definition: st.h:138
st_foreach
#define st_foreach
Definition: st.h:142
st_foreach_check
#define st_foreach_check
Definition: st.h:144
st_foreach_callback_func
int st_foreach_callback_func(st_data_t, st_data_t, st_data_t)
Definition: st.h:137
stdarg.h
Defines old _.
ANYARGS
#define ANYARGS
Definition: stdarg.h:42
const
#define const
Definition: strftime.c:108
ruby::backward::cxxanyargs::define_method::driver0::engine
Definition: cxxanyargs.hpp:598
ruby::backward::cxxanyargs::define_method::driver0::engine::define
static void define(T mid, type func)
Definition: cxxanyargs.hpp:601
ruby::backward::cxxanyargs::define_method::driver0::engine::define
static void define(T mid, notimpl_type func)
Definition: cxxanyargs.hpp:611
ruby::backward::cxxanyargs::define_method::driver0::engine::define
static void define(T mid, U func)
Definition: cxxanyargs.hpp:606
ruby::backward::cxxanyargs::define_method::driver0
Definition: cxxanyargs.hpp:596
ruby::backward::cxxanyargs::define_method::driver::engine
Defines a method.
Definition: cxxanyargs.hpp:527
ruby::backward::cxxanyargs::define_method::driver::engine::define
static void define(VALUE klass, T mid, type func)
Defines klass::mid as func, whose arity is N.
Definition: cxxanyargs.hpp:544
ruby::backward::cxxanyargs::define_method::driver::engine::define
static void define(VALUE klass, T mid, U func)
Defines klass::mid as func, whose arity is N.
Definition: cxxanyargs.hpp:554
ruby::backward::cxxanyargs::define_method::driver::engine::define
static void define(VALUE klass, T mid, notimpl_type func)
Defines klass::mid as func, whose arity is N.
Definition: cxxanyargs.hpp:561
ruby::backward::cxxanyargs::define_method::driver
Template metaprogramming to generate function prototypes.
Definition: cxxanyargs.hpp:521
ruby::backward::cxxanyargs::define_method::rb_define_global_function
Dispatches appropriate driver for rb_define_global_function.
Definition: cxxanyargs.hpp:648
ruby::backward::cxxanyargs::define_method::rb_define_method_id
Dispatches appropriate driver for rb_define_method_id.
Definition: cxxanyargs.hpp:643
ruby::backward::cxxanyargs::define_method::rb_define_method
Dispatches appropriate driver for rb_define_method.
Definition: cxxanyargs.hpp:642
ruby::backward::cxxanyargs::define_method::rb_define_module_function
Dispatches appropriate driver for rb_define_module_function.
Definition: cxxanyargs.hpp:647
ruby::backward::cxxanyargs::define_method::rb_define_private_method
Dispatches appropriate driver for rb_define_private_method.
Definition: cxxanyargs.hpp:644
ruby::backward::cxxanyargs::define_method::rb_define_protected_method
Dispatches appropriate driver for rb_define_protected_method.
Definition: cxxanyargs.hpp:645
ruby::backward::cxxanyargs::define_method::rb_define_singleton_method
Dispatches appropriate driver for rb_define_singleton_method.
Definition: cxxanyargs.hpp:646
st_table
Definition: st.h:79
t
#define t
Definition: symbol.c:253
U
Definition: dtoa.c:302
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39