Ruby  3.4.0dev (2024-11-22 revision 37a72b0150ec36b4ea27175039afc28c62207b0c)
Data Structures | Namespaces | Macros | Typedefs
cxxanyargs.hpp File Reference

(37a72b0150ec36b4ea27175039afc28c62207b0c)

Provides old prototypes for C++ programs. More...

#include "ruby/internal/config.h"
#include "ruby/internal/intern/class.h"
#include "ruby/internal/intern/cont.h"
#include "ruby/internal/intern/hash.h"
#include "ruby/internal/intern/proc.h"
#include "ruby/internal/intern/thread.h"
#include "ruby/internal/intern/variable.h"
#include "ruby/internal/intern/vm.h"
#include "ruby/internal/iterator.h"
#include "ruby/internal/method.h"
#include "ruby/internal/value.h"
#include "ruby/internal/variable.h"
#include "ruby/backward/2/stdarg.h"
#include "ruby/st.h"
Include dependency graph for cxxanyargs.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ruby::backward::cxxanyargs::define_method::driver< T, F >
 Template metaprogramming to generate function prototypes. More...
 
struct  ruby::backward::cxxanyargs::define_method::driver< T, F >::engine< N, U >
 Defines a method. More...
 
struct  ruby::backward::cxxanyargs::define_method::driver0< T, F >
 Template metaprogramming to generate function prototypes. More...
 
struct  ruby::backward::cxxanyargs::define_method::driver0< T, F >::engine< N, U >
 Defines a method. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_method
 Dispatches appropriate driver for rb_define_method. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_method_id
 Dispatches appropriate driver for rb_define_method_id. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_private_method
 Dispatches appropriate driver for rb_define_private_method. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_protected_method
 Dispatches appropriate driver for rb_define_protected_method. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_singleton_method
 Dispatches appropriate driver for rb_define_singleton_method. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_module_function
 Dispatches appropriate driver for rb_define_module_function. More...
 
struct  ruby::backward::cxxanyargs::define_method::rb_define_global_function
 Dispatches appropriate driver for rb_define_global_function. More...
 

Namespaces

 ruby
 The main namespace.
 
 ruby::backward
 Backwards compatibility layer.
 
 ruby::backward::cxxanyargs
 Provides ANYARGS deprecation warnings.
 
 ruby::backward::cxxanyargs::define_method
 Driver for *_define_method.
 

Macros

#define rb_define_method(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_method::specific<arity>::define(klass, mid, func)
 Defines klass#mid. More...
 
#define rb_define_method_id(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_method_id::specific<arity>::define(klass, mid, func)
 Defines klass#mid. More...
 
#define rb_define_private_method(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_private_method::specific<arity>::define(klass, mid, func)
 Defines klass#mid and makes it private. More...
 
#define rb_define_protected_method(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_protected_method::specific<arity>::define(klass, mid, func)
 Defines klass#mid and makes it protected. More...
 
#define rb_define_singleton_method(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_singleton_method::specific<arity>::define(klass, mid, func)
 Defines klass.mid. More...
 
#define rb_define_module_function(klass, mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_module_function::specific<arity>::define(klass, mid, func)
 Defines klass#mid and makes it a module function. More...
 
#define rb_define_global_function(mid, func, arity)   ::ruby::backward::cxxanyargs::define_method::rb_define_global_function::specific<arity>::define(mid, func)
 Defines rb_mKernel #mid. More...
 

Typedefs

typedef VALUE ruby::backward::cxxanyargs::type(ANYARGS)
 ANYARGS-ed function type. More...
 
typedef void ruby::backward::cxxanyargs::void_type(ANYARGS)
 ANYARGS-ed function type, void variant. More...
 
typedef int ruby::backward::cxxanyargs::int_type(ANYARGS)
 ANYARGS-ed function type, int variant. More...
 
typedef VALUE ruby::backward::cxxanyargs::onearg_type(VALUE)
 Single-argumented function type. More...
 
typedef VALUE ruby::backward::cxxanyargs::define_method::notimpl_type(int, const VALUE *, VALUE, VALUE)
 Type of rb_f_notimplement(). More...
 

Functions

Hooking global variables
void ruby::backward::cxxanyargs::rb_define_virtual_variable (const char *q, type *w, void_type *e)
 Define a function-backended global variable. More...
 
void ruby::backward::cxxanyargs::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 ruby::backward::cxxanyargs::rb_iterate (onearg_type *q, VALUE w, type *e, VALUE r)
 Old way to implement iterators. More...
 
VALUE ruby::backward::cxxanyargs::rb_block_call (VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
 Call a method with a block. More...
 
VALUE ruby::backward::cxxanyargs::rb_rescue (type *q, VALUE w, type *e, VALUE r)
 An equivalent of rescue clause. More...
 
VALUE ruby::backward::cxxanyargs::rb_rescue2 (type *q, VALUE w, type *e, VALUE r,...)
 An equivalent of rescue clause. More...
 
VALUE ruby::backward::cxxanyargs::rb_ensure (type *q, VALUE w, type *e, VALUE r)
 An equivalent of ensure clause. More...
 
VALUE ruby::backward::cxxanyargs::rb_catch (const char *q, type *w, VALUE e)
 An equivalent of Kernel#catch. More...
 
VALUE ruby::backward::cxxanyargs::rb_catch_obj (VALUE q, type *w, VALUE e)
 An equivalent of Kernel#catch. More...
 
Procs, Fibers and Threads
VALUE ruby::backward::cxxanyargs::rb_fiber_new (type *q, VALUE w)
 Creates a rb_cFiber instance. More...
 
VALUE ruby::backward::cxxanyargs::rb_proc_new (type *q, VALUE w)
 Creates a rb_cProc instance. More...
 
VALUE ruby::backward::cxxanyargs::rb_thread_create (type *q, void *w)
 Creates a rb_cThread instance. More...
 
Hash and st_table
int ruby::backward::cxxanyargs::st_foreach (st_table *q, int_type *w, st_data_t e)
 Iteration over the given table. More...
 
int ruby::backward::cxxanyargs::st_foreach_check (st_table *q, int_type *w, st_data_t e, st_data_t)
 Iteration over the given table. More...
 
void ruby::backward::cxxanyargs::st_foreach_safe (st_table *q, int_type *w, st_data_t e)
 Iteration over the given table. More...
 
void ruby::backward::cxxanyargs::rb_hash_foreach (VALUE q, int_type *w, VALUE e)
 Iteration over the given hash. More...
 
void ruby::backward::cxxanyargs::rb_ivar_foreach (VALUE q, int_type *w, VALUE e)
 Iteration over each instance variable of the object. More...
 

Detailed Description

Provides old prototypes for C++ programs.

Author
@shyouhei
Note
DO NOT MODERNISE THIS FILE! As the file name implies it is meant to be a backwards compatibility shim. Please stick to C++ 98 and never use newer features, like constexpr.

Definition in file cxxanyargs.hpp.

Macro Definition Documentation

◆ rb_define_global_function

#define rb_define_global_function (   mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_global_function::specific<arity>::define(mid, func)

Defines rb_mKernel #mid.

Parameters
midName of the defining method.
funcImplementation of #mid.
arityArity of #mid.

Definition at line 695 of file cxxanyargs.hpp.

◆ rb_define_method

#define rb_define_method (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_method::specific<arity>::define(klass, mid, func)

Defines klass#mid.

Parameters
klassWhere the method lives.
midName of the defining method.
funcImplementation of #mid.
arityArity of #mid.

Definition at line 670 of file cxxanyargs.hpp.

◆ rb_define_method_id

#define rb_define_method_id (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_method_id::specific<arity>::define(klass, mid, func)

Defines klass#mid.

Parameters
klassWhere the method lives.
midName of the defining method.
funcImplementation of #mid.
arityArity of #mid.

Definition at line 673 of file cxxanyargs.hpp.

◆ rb_define_module_function

#define rb_define_module_function (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_module_function::specific<arity>::define(klass, mid, func)

Defines klass#mid and makes it a module function.

Parameters
klassWhere the method lives.
midName of the defining method.
funcImplementation of #mid.
arityArity of #mid.

Definition at line 689 of file cxxanyargs.hpp.

◆ rb_define_private_method

#define rb_define_private_method (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_private_method::specific<arity>::define(klass, mid, func)

Defines klass#mid and makes it private.

Parameters
klassWhere the method lives.
midName of the defining method.
funcImplementation of #mid.
arityArity of #mid.

Definition at line 677 of file cxxanyargs.hpp.

◆ rb_define_protected_method

#define rb_define_protected_method (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_protected_method::specific<arity>::define(klass, mid, func)

Defines klass#mid and makes it protected.

Parameters
[out]klassA module or a class.
[in]midName of the function.
[in]funcThe method body.
[in]arityThe number of parameters. See Defining methods.
Note
There are in fact 18 different prototypes for func.
See also
ruby::backward::cxxanyargs::define_method::rb_define_method

Definition at line 681 of file cxxanyargs.hpp.

◆ rb_define_singleton_method

#define rb_define_singleton_method (   klass,
  mid,
  func,
  arity 
)    ::ruby::backward::cxxanyargs::define_method::rb_define_singleton_method::specific<arity>::define(klass, mid, func)

Defines klass.mid.

(klass, mid, func, arity)

Parameters
[out]klassA module or a class.
[in]midName of the function.
[in]funcThe method body.
[in]arityThe number of parameters. See Defining methods.
Note
There are in fact 18 different prototypes for func.
See also
ruby::backward::cxxanyargs::define_method::rb_define_method

Definition at line 685 of file cxxanyargs.hpp.