Ruby 4.1.0dev (2026-01-07 revision 7d4983803887a45c311ab954de4527333b976500)
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"
23#include "ruby/internal/value.h"
26#include "ruby/st.h"
27
28extern "C++" {
29
30#ifdef HAVE_NULLPTR
31#include <cstddef>
32#endif
33
37namespace ruby {
38
40namespace backward {
41
54namespace cxxanyargs {
55
56typedef VALUE type(ANYARGS);
57typedef void void_type(ANYARGS);
58typedef int int_type(ANYARGS);
60
63
64RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
72inline void
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);
78}
79
80RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
81inline void
83{
84 rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
86}
87
88RUBY_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
96#ifdef HAVE_NULLPTR
97inline void
98rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, std::nullptr_t e)
99{
101}
102
103RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
104inline void
105rb_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);
109}
110
111inline void
112rb_define_virtual_variable(const char *q, std::nullptr_t w, rb_gvar_setter_t *e)
113{
115}
116
117RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
118inline void
119rb_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);
123}
124#endif
125
126RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
135inline void
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
143RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
144inline void
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
151RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
152inline void
153rb_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
161rb_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
166RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
167inline void
168rb_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
175rb_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
180RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
181inline void
182rb_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
193RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
205rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
206{
207 rb_block_call_func_t u = reinterpret_cast<rb_block_call_func_t>(t);
208 return ::rb_block_call(q, w, e, r, u, y);
209}
210
211#ifdef HAVE_NULLPTR
212inline VALUE
213rb_block_call(VALUE q, ID w, int e, const VALUE *r, std::nullptr_t t, VALUE y)
214{
215 return ::rb_block_call(q, w, e, r, t, y);
216}
217#endif
218
219RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
234{
235 typedef VALUE func1_t(VALUE);
236 typedef VALUE func2_t(VALUE, VALUE);
237 func1_t *t = reinterpret_cast<func1_t*>(q);
238 func2_t *y = reinterpret_cast<func2_t*>(e);
239 return ::rb_rescue(t, w, y, r);
240}
241
242RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
257rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
258{
259 typedef VALUE func1_t(VALUE);
260 typedef VALUE func2_t(VALUE, VALUE);
261 func1_t *t = reinterpret_cast<func1_t*>(q);
262 func2_t *y = reinterpret_cast<func2_t*>(e);
263 va_list ap;
264 va_start(ap, r);
265 VALUE ret = ::rb_vrescue2(t, w, y, r, ap);
266 va_end(ap);
267 return ret;
268}
269
270RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
284{
285 typedef VALUE func1_t(VALUE);
286 func1_t *t = reinterpret_cast<func1_t*>(q);
287 func1_t *y = reinterpret_cast<func1_t*>(e);
288 return ::rb_ensure(t, w, y, r);
289}
290
291RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
304rb_catch(const char *q, type *w, VALUE e)
305{
306 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
307 return ::rb_catch(q, r, e);
308}
309
310#ifdef HAVE_NULLPTR
311inline VALUE
312rb_catch(const char *q, std::nullptr_t w, VALUE e)
313{
314 return ::rb_catch(q, w, e);
315}
316#endif
317
318RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
332{
333 rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
334 return ::rb_catch_obj(q, r, e);
335}
336
340
341RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
352{
353 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
354 return ::rb_fiber_new(e, w);
355}
356
357RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
368{
369 rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
370 return ::rb_proc_new(e, w);
371}
372
373RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
384{
385 typedef VALUE ptr_t(void*);
386 ptr_t *e = reinterpret_cast<ptr_t*>(q);
387 return ::rb_thread_create(e, w);
388}
389
393
394RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
404inline int
405st_foreach(st_table *q, int_type *w, st_data_t e)
406{
407 st_foreach_callback_func *r =
408 reinterpret_cast<st_foreach_callback_func*>(w);
409 return ::st_foreach(q, r, e);
410}
411
412RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
422inline int
423st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
424{
425 st_foreach_check_callback_func *t =
426 reinterpret_cast<st_foreach_check_callback_func*>(w);
427 return ::st_foreach_check(q, t, e, 0);
428}
429
430RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
438inline void
440{
441 st_foreach_callback_func *r =
442 reinterpret_cast<st_foreach_callback_func*>(w);
443 ::st_foreach_safe(q, r, e);
444}
445
446RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
454inline void
456{
457 st_foreach_callback_func *r =
458 reinterpret_cast<st_foreach_callback_func*>(w);
459 ::rb_hash_foreach(q, r, e);
460}
461
462RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
470inline void
472{
473 st_foreach_callback_func *r =
474 reinterpret_cast<st_foreach_callback_func*>(w);
475 ::rb_ivar_foreach(q, r, e);
476}
477
479
487namespace define_method {
488
490typedef VALUE notimpl_type(int, const VALUE *, VALUE, VALUE);
491
495template<typename T, void (*F)(VALUE klass, T mid, type *func, int arity)>
496struct driver {
497
501 template<int N, typename U>
502 struct engine {
503
504 /* :TODO: Following deprecation attribute renders tons of warnings (one
505 * per every method definitions), which is annoying. Of course
506 * annoyance is the core feature of deprecation warnings... But that
507 * could be too much, especially when the warnings happen inside of
508 * machine-generated programs. And SWIG is known to do such thing.
509 * The new (granular) API was introduced in API version 2.7. As of
510 * this writing the version is 2.8. Let's warn this later, some time
511 * during 3.x. Hopefully codes in old (ANYARGS-ed) format should be
512 * less than now. */
513#if (RUBY_API_VERSION_MAJOR * 100 + RUBY_API_VERSION_MINOR) >= 301
514 RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
515#endif
518 static inline void
519 define(VALUE klass, T mid, type func)
520 {
521 F(klass, mid, func, N);
522 }
523
528 static inline void
529 define(VALUE klass, T mid, U func)
530 {
531 F(klass, mid, reinterpret_cast<type *>(func), N);
532 }
533
535 static inline void
536 define(VALUE klass, T mid, notimpl_type func)
537 {
538 F(klass, mid, reinterpret_cast<type *>(func), N);
539 }
540 };
541
543 template<int N, bool = false> struct specific : public engine<N, type *> {};
544 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)> {};
545 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)> {};
546 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)> {};
547 template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
548 template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
549 template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
550 template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
551 template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
552 template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
553 template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
554 template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
555 template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
556 template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
557 template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
558 template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
559 template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
560 template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
561 using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
562 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); }
563 };
564 template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
566};
567
568/* We could perhaps merge this struct into the one above using variadic
569 * template parameters if we could assume C++11, but sadly we cannot. */
571template<typename T, void (*F)(T mid, type func, int arity)>
572struct driver0 {
573
577 template<int N, typename U>
578 struct engine {
579 RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
582 static inline void
583 define(T mid, type func)
584 {
585 F(mid, func, N);
586 }
587
591 static inline void
592 define(T mid, U func)
593 {
594 F(mid, reinterpret_cast<type *>(func), N);
595 }
596
599 static inline void
600 define(T mid, notimpl_type func)
601 {
602 F(mid, reinterpret_cast<type *>(func), N);
603 }
604 };
605
607 template<int N, bool = false> struct specific : public engine<N, type *> {};
608 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)> {};
609 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)> {};
610 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)> {};
611 template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
612 template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
613 template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
614 template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
615 template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
616 template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
617 template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
618 template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
619 template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
620 template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
621 template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
622 template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
623 template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
624 template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
625 using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
626 static inline void define(T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(m, reinterpret_cast<type *>(f), -1); }
627 };
628 template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
630};
631
632struct rb_define_method : public driver <const char *, ::rb_define_method> {};
633struct rb_define_method_id : public driver <ID, ::rb_define_method_id> {};
634struct rb_define_private_method : public driver <const char *, ::rb_define_private_method> {};
635struct rb_define_protected_method : public driver <const char *, ::rb_define_protected_method> {};
636struct rb_define_singleton_method : public driver <const char *, ::rb_define_singleton_method> {};
637struct rb_define_module_function : public driver <const char *, ::rb_define_module_function> {};
638struct rb_define_global_function : public driver0<const char *, ::rb_define_global_function> {};
639
643#define rb_define_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_method::specific<arity>::define(klass, mid, func)
644
646#define rb_define_method_id(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_method_id::specific<arity>::define(klass, mid, func)
647
650#define rb_define_private_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_private_method::specific<arity>::define(klass, mid, func)
651
654#define rb_define_protected_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_protected_method::specific<arity>::define(klass, mid, func)
655
658#define rb_define_singleton_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_singleton_method::specific<arity>::define(klass, mid, func)
659
662#define rb_define_module_function(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_module_function::specific<arity>::define(klass, mid, func)
663
668#define rb_define_global_function(mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_global_function::specific<arity>::define(mid, func)
669
670}}}}}
671
672using namespace ruby::backward::cxxanyargs;
673#endif // RUBY_BACKWARD_CXXANYARGS_HPP
VALUE rb_vrescue2(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2, va_list args)
Identical to rb_rescue2(), except it takes va_list instead of variadic number of arguments.
Definition eval.c:1050
Public APIs related to rb_cClass/rb_cModule.
Public APIs related to rb_cFiber.
Public APIs related to rb_cHash.
#define st_foreach_safe
Just another name of rb_st_foreach_safe.
Definition hash.h:51
Public APIs related to rb_cProc.
Public APIs related to rb_cThread.
Public APIs related to names inside of a Ruby program.
Public APIs related to rb_cRubyVM.
Creation and modification of Ruby methods.
Declares rb_define_variable().
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
Type that represents a global variable setter function.
Definition variable.h:46
VALUE rb_gvar_getter_t(ID id, VALUE *data)
Type that represents a global variable getter function.
Definition variable.h:37
Block related APIs.
rb_block_call_func * rb_block_call_func_t
Shorthand type that represents an iterator-written-in-C function pointer.
Definition iterator.h:88
VALUE notimpl_type(int, const VALUE *, VALUE, VALUE)
Type of rb_f_notimplement().
Provides ANYARGS deprecation warnings.
VALUE onearg_type(VALUE)
Single-argumented function type.
VALUE rb_catch_obj(VALUE q, type *w, VALUE e)
An equivalent of Kernel#catch.
VALUE rb_catch(const char *q, type *w, VALUE e)
An equivalent of Kernel#catch.
void rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
Define a function-backended global variable.
VALUE rb_thread_create(type *q, void *w)
Creates a rb_cThread instance.
int int_type(ANYARGS)
ANYARGS-ed function type, int variant.
void void_type(ANYARGS)
ANYARGS-ed function type, void variant.
VALUE rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
Call a method with a block.
VALUE rb_proc_new(type *q, VALUE w)
Creates a rb_cProc instance.
VALUE type(ANYARGS)
ANYARGS-ed function type.
VALUE rb_fiber_new(type *q, VALUE w)
Creates a rb_cFiber instance.
void rb_hash_foreach(VALUE q, int_type *w, VALUE e)
Iteration over the given hash.
void rb_define_virtual_variable(const char *q, type *w, void_type *e)
Define a function-backended global variable.
void rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
Iteration over each instance variable of the object.
VALUE rb_rescue2(type *q, VALUE w, type *e, VALUE r,...)
An equivalent of rescue clause.
VALUE rb_rescue(type *q, VALUE w, type *e, VALUE r)
An equivalent of rescue clause.
VALUE rb_ensure(type *q, VALUE w, type *e, VALUE r)
An equivalent of ensure clause.
The main namespace.
#define inline
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.
Definition defines.h:91
Defines old _.
#define ANYARGS
Functions declared using this macro take arbitrary arguments, including void.
Definition stdarg.h:64
static void define(T mid, type func)
Defines Kernel::mid as func, whose arity is N.
static void define(T mid, notimpl_type func)
Defines Kernel::mid as func, whose arity is N.
static void define(T mid, U func)
Defines Kernel::mid as func, whose arity is N.
Template metaprogramming to generate function prototypes.
static void define(VALUE klass, T mid, type func)
Defines klass::mid as func, whose arity is N.
static void define(VALUE klass, T mid, U func)
Defines klass::mid as func, whose arity is N.
static void define(VALUE klass, T mid, notimpl_type func)
Defines klass::mid as func, whose arity is N.
Template metaprogramming to generate function prototypes.
Dispatches appropriate driver for rb_define_global_function.
Dispatches appropriate driver for rb_define_method_id.
Dispatches appropriate driver for rb_define_method.
Dispatches appropriate driver for rb_define_module_function.
Dispatches appropriate driver for rb_define_private_method.
Dispatches appropriate driver for rb_define_protected_method.
Dispatches appropriate driver for rb_define_singleton_method.
Definition st.h:79
Definition dtoa.c:309
Defines VALUE and ID.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40