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

Ruby 3.3.5p100 (2024-09-03 revision ef084cc8f4958c1b6e4ead99136631bef6d8ddba)

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 >
| 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
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)
| Defines klass#mid.
#define | rb_define_method_id(klass, mid, func, arity)
| Defines klass#mid.
#define | rb_define_private_method(klass, mid, func, arity)
| Defines klass#mid and makes it private.
#define | rb_define_protected_method(klass, mid, func, arity)
| Defines klass#mid and makes it protected.
#define | rb_define_singleton_method(klass, mid, func, arity)
| Defines klass.mid.
#define | rb_define_module_function(klass, mid, func, arity)
| Defines klass#mid and makes it a module function.
#define | rb_define_global_function(mid, func, arity)
| Defines rb_mKernel #mid.

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

## 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.
void | ruby::backward::cxxanyargs::rb_define_hooked_variable (const char *q, VALUE *w, type *e, void_type *r)
| Define a function-backended global variable.
Exceptions and tag jumps
VALUE | ruby::backward::cxxanyargs::rb_iterate (onearg_type *q, VALUE w, type *e, VALUE r)
| Old way to implement iterators.
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.
VALUE | ruby::backward::cxxanyargs::rb_rescue (type *q, VALUE w, type *e, VALUE r)
| An equivalent of `rescue` clause.
VALUE | ruby::backward::cxxanyargs::rb_rescue2 (type *q, VALUE w, type *e, VALUE r,...)
| An equivalent of `rescue` clause.
VALUE | ruby::backward::cxxanyargs::rb_ensure (type *q, VALUE w, type *e, VALUE r)
| An equivalent of `ensure` clause.
VALUE | ruby::backward::cxxanyargs::rb_catch (const char *q, type *w, VALUE e)
| An equivalent of `Kernel#catch`.
VALUE | ruby::backward::cxxanyargs::rb_catch_obj (VALUE q, type *w, VALUE e)
| An equivalent of `Kernel#catch`.
Procs, Fibers and Threads
VALUE | ruby::backward::cxxanyargs::rb_fiber_new (type *q, VALUE w)
| Creates a rb_cFiber instance.
VALUE | ruby::backward::cxxanyargs::rb_proc_new (type *q, VALUE w)
| Creates a rb_cProc instance.
VALUE | ruby::backward::cxxanyargs::rb_thread_create (type *q, void *w)
| Creates a rb_cThread instance.
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.
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.
void | ruby::backward::cxxanyargs::st_foreach_safe (st_table *q, int_type *w, st_data_t e)
| Iteration over the given table.
void | ruby::backward::cxxanyargs::rb_hash_foreach (VALUE q, int_type *w, VALUE e)
| Iteration over the given hash.
void | ruby::backward::cxxanyargs::rb_ivar_foreach (VALUE q, int_type *w, VALUE e)
| Iteration over each instance variable of the object.

## 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 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 )

Value:
::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 695 of file cxxanyargs.hpp.

## ◆ rb_define_method

#define rb_define_method | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 670 of file cxxanyargs.hpp.

Referenced by Init_class_hierarchy(), and rb_define_singleton_method().

## ◆ rb_define_method_id

#define rb_define_method_id | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 673 of file cxxanyargs.hpp.

## ◆ rb_define_module_function

#define rb_define_module_function | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 689 of file cxxanyargs.hpp.

Referenced by rb_define_global_function(), and ruby_prog_init().

## ◆ rb_define_private_method

#define rb_define_private_method | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 677 of file cxxanyargs.hpp.

Referenced by rb_define_module_function().

## ◆ rb_define_protected_method

#define rb_define_protected_method | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 681 of file cxxanyargs.hpp.

## ◆ rb_define_singleton_method

#define rb_define_singleton_method | ( |  | klass,
|  |  | mid,
|  |  | func,
|  |  | arity )

Value:
::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 685 of file cxxanyargs.hpp.

Referenced by rb_define_module_function().