Ruby: internal/proc.h File Reference

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

Functions
proc.h File Reference

Internal header for Proc. More...

`#include "ruby/ruby.h"`
`#include "ruby/st.h"`

Go to the source code of this file.

## Functions
VALUE | rb_proc_location (VALUE self)
st_index_t | rb_hash_proc (st_index_t hash, VALUE proc)
int | rb_block_pair_yield_optimizable (void)
int | rb_block_arity (void)
int | rb_block_min_max_arity (int *max)
VALUE | rb_block_to_s (VALUE self, const struct rb_block *block, const char *additional_info)
VALUE | rb_callable_receiver (VALUE)
VALUE | rb_func_proc_new (rb_block_call_func_t func, VALUE val)
VALUE | rb_func_lambda_new (rb_block_call_func_t func, VALUE val, int min_argc, int max_argc)
VALUE | rb_iseq_location (const struct rb_iseq_struct *iseq)
VALUE | rb_sym_to_proc (VALUE sym)

## Detailed Description

Internal header for Proc.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

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.

Definition in file proc.h.

## Function Documentation

## ◆ rb_block_arity()

int rb_block_arity | ( | void |  | ) |

Definition at line 1193 of file proc.c.

References block_handler_type_proc, block_handler_type_symbol, rb_execution_context_struct::cfp, GetProcPtr, max, rb_block::proc, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), UNLIMITED_ARGUMENTS, and VM_BLOCK_HANDLER_NONE.

## ◆ rb_block_min_max_arity()

int rb_block_min_max_arity | ( | int * | max | ) |

Definition at line 1226 of file proc.c.

References rb_execution_context_struct::cfp, max, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), and VM_BLOCK_HANDLER_NONE.

## ◆ rb_block_pair_yield_optimizable()

int rb_block_pair_yield_optimizable | ( | void |  | ) |

Definition at line 1158 of file proc.c.

References block_handler_type_proc, block_handler_type_symbol, rb_execution_context_struct::cfp, GetProcPtr, max, rb_block::proc, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), and VM_BLOCK_HANDLER_NONE.

## ◆ rb_block_to_s()

VALUE rb_block_to_s | ( | VALUE | self,
|  | const struct rb_block * | block,
|  | const char * | additional_info
| ) |  |

Definition at line 1491 of file proc.c.

References rb_block::as, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_iseq_struct::body, rb_block::captured, rb_captured_block::code, rb_iseq_location_struct::first_lineno, FIX2INT, rb_captured_block::ifunc, rb_captured_block::iseq, rb_iseq_constant_body::location, PRIsVALUE, rb_block::proc, rb_iseq_path(), rb_obj_class(), rb_sprintf(), rb_str_cat_cstr, rb_str_catf(), str, and rb_block::symbol.

## ◆ rb_callable_receiver()

VALUE rb_callable_receiver | ( | VALUE | callable | ) |

Definition at line 2787 of file proc.c.

References Qundef, rb_funcall(), rb_intern(), rb_obj_is_method(), and rb_obj_is_proc().

## ◆ rb_func_lambda_new()

VALUE rb_func_lambda_new | ( | rb_block_call_func_t | func,
|  | VALUE | val,
|  | int | min_argc,
|  | int | max_argc
| ) |  |

Definition at line 742 of file proc.c.

References vm_ifunc::func, rb_cProc, and rb_vm_ifunc_new().

## ◆ rb_func_proc_new()

VALUE rb_func_proc_new | ( | rb_block_call_func_t | func,
|  | VALUE | val
| ) |  |

Definition at line 735 of file proc.c.

References vm_ifunc::func, and rb_cProc.

## ◆ rb_hash_proc()

st_index_t rb_hash_proc | ( | st_index_t | hash,
|  | VALUE | proc
| ) |  |

Definition at line 1433 of file proc.c.

References GetProcPtr, rb_block::proc, and rb_hash_uint.

## ◆ rb_iseq_location()

VALUE rb_iseq_location | ( | const struct rb_iseq_struct * | iseq | ) |

## ◆ rb_proc_location()

VALUE rb_proc_location | ( | VALUE | self | ) |

Definition at line 1387 of file proc.c.

References rb_proc_get_iseq().

Referenced by Init_Proc().

## ◆ rb_sym_to_proc()

VALUE rb_sym_to_proc | ( | VALUE | sym | ) |

Definition at line 1443 of file proc.c.

References id, ID2SYM, rb_block::proc, Qfalse, Qnil, RARRAY_AREF, rb_ary_store(), rb_ary_tmp_new(), rb_cProc, rb_gc_register_mark_object(), sym, and SYM2ID.

Referenced by Init_String(), and rb_vm_bh_to_procval().