Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Functions
proc.h File Reference

Public APIs related to rb_cProc. More...

#include "ruby/internal/dllexport.h"
#include "ruby/internal/iterator.h"
#include "ruby/internal/value.h"

Go to the source code of this file.

Functions

VALUE rb_block_proc (void)
 
VALUE rb_block_lambda (void)
 
VALUE rb_proc_new (rb_block_call_func_t, VALUE)
 
VALUE rb_obj_is_proc (VALUE)
 
VALUE rb_proc_call (VALUE, VALUE)
 
VALUE rb_proc_call_kw (VALUE, VALUE, int)
 
VALUE rb_proc_call_with_block (VALUE, int argc, const VALUE *argv, VALUE)
 
VALUE rb_proc_call_with_block_kw (VALUE, int argc, const VALUE *argv, VALUE, int)
 
int rb_proc_arity (VALUE)
 
VALUE rb_proc_lambda_p (VALUE)
 
VALUE rb_binding_new (void)
 
VALUE rb_obj_method (VALUE, VALUE)
 
VALUE rb_obj_is_method (VALUE)
 
VALUE rb_method_call (int, const VALUE *, VALUE)
 
VALUE rb_method_call_kw (int, const VALUE *, VALUE, int)
 
VALUE rb_method_call_with_block (int, const VALUE *, VALUE, VALUE)
 
VALUE rb_method_call_with_block_kw (int, const VALUE *, VALUE, VALUE, int)
 
int rb_mod_method_arity (VALUE, ID)
 
int rb_obj_method_arity (VALUE, ID)
 
VALUE rb_protect (VALUE(*)(VALUE), VALUE, int *)
 Protects a function call from potential global escapes from the function. More...
 

Detailed Description

Public APIs related to rb_cProc.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file proc.h.

Function Documentation

◆ rb_binding_new()

VALUE rb_binding_new ( void  )

Definition at line 364 of file proc.c.

References rb_execution_context_struct::cfp, and rb_vm_make_binding().

Referenced by Init_VM().

◆ rb_block_lambda()

VALUE rb_block_lambda ( void  )

Definition at line 845 of file proc.c.

References FALSE, rb_cProc, and TRUE.

◆ rb_block_proc()

VALUE rb_block_proc ( void  )

Definition at line 826 of file proc.c.

References FALSE, and rb_cProc.

Referenced by rb_f_trace_var(), rb_method_call(), and rb_method_call_kw().

◆ rb_method_call()

VALUE rb_method_call ( int  argc,
const VALUE argv,
VALUE  method 
)

Definition at line 2398 of file proc.c.

References argc, argv, Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block().

◆ rb_method_call_kw()

VALUE rb_method_call_kw ( int  argc,
const VALUE argv,
VALUE  method,
int  kw_splat 
)

Definition at line 2391 of file proc.c.

References argc, argv, Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block_kw().

◆ rb_method_call_with_block()

VALUE rb_method_call_with_block ( int  argc,
const VALUE argv,
VALUE  method,
VALUE  passed_procval 
)

Definition at line 2434 of file proc.c.

References argc, argv, rb_method_call_with_block_kw(), and RB_NO_KEYWORDS.

Referenced by rb_method_call().

◆ rb_method_call_with_block_kw()

VALUE rb_method_call_with_block_kw ( int  argc,
const VALUE argv,
VALUE  method,
VALUE  passed_procval,
int  kw_splat 
)

◆ rb_mod_method_arity()

int rb_mod_method_arity ( VALUE  mod,
ID  id 
)

Definition at line 2773 of file proc.c.

References METHOD::me, mod, and rb_method_entry_arity().

Referenced by rb_obj_method_arity().

◆ rb_obj_is_method()

VALUE rb_obj_is_method ( VALUE  m)

Definition at line 1590 of file proc.c.

References Qfalse, Qtrue, and rb_typeddata_is_kind_of().

Referenced by rb_callable_receiver(), and rb_econv_prepare_options().

◆ rb_obj_is_proc()

VALUE rb_obj_is_proc ( VALUE  proc)

◆ rb_obj_method()

VALUE rb_obj_method ( VALUE  obj,
VALUE  vid 
)

Definition at line 1992 of file proc.c.

References FALSE.

Referenced by Init_Proc().

◆ rb_obj_method_arity()

int rb_obj_method_arity ( VALUE  obj,
ID  id 
)

Definition at line 2781 of file proc.c.

References CLASS_OF, and rb_mod_method_arity().

◆ rb_proc_arity()

int rb_proc_arity ( VALUE  self)

Definition at line 1126 of file proc.c.

References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, max, and UNLIMITED_ARGUMENTS.

◆ rb_proc_call()

VALUE rb_proc_call ( VALUE  self,
VALUE  args 
)

◆ rb_proc_call_kw()

VALUE rb_proc_call_kw ( VALUE  self,
VALUE  args,
int  kw_splat 
)

◆ rb_proc_call_with_block()

VALUE rb_proc_call_with_block ( VALUE  self,
int  argc,
const VALUE argv,
VALUE  passed_procval 
)

◆ rb_proc_call_with_block_kw()

VALUE rb_proc_call_with_block_kw ( VALUE  self,
int  argc,
const VALUE argv,
VALUE  passed_procval,
int  kw_splat 
)

Definition at line 1001 of file proc.c.

References argc, argv, GetProcPtr, RB_GC_GUARD, rb_vm_invoke_proc(), and rb_captured_block::self.

◆ rb_proc_lambda_p()

VALUE rb_proc_lambda_p ( VALUE  procval)

Definition at line 275 of file proc.c.

References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.

Referenced by Init_Proc().

◆ rb_proc_new()

VALUE rb_proc_new ( rb_block_call_func_t  func,
VALUE  val 
)

Definition at line 3145 of file proc.c.

References ruby::backward::cxxanyargs::rb_iterate().