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

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

Data Structures | Namespaces | Macros | Typedefs
cxxanyargs.hpp File Reference

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"`

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 >
struct | ruby::backward::cxxanyargs::define_method::driver0< T, F >::engine< N, U >
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
namespace | ruby
| The main namespace.
namespace | ruby::backward
| Backwards compatibility layer.
namespace | ruby::backward::cxxanyargs
| Provides ANYARGS deprecation warnings.
namespace | 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

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Note
  DO NOT MODERNIZE 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

  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 678 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 653 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 656 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 672 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 660 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 664 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

  klass | Where the method lives.
  mid | Name of the defining method.
  func | Implementation of #mid.
  arity | Arity of #mid.

Definition at line 668 of file cxxanyargs.hpp.