Ruby: include/ruby/internal/iterator.h Source File

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

iterator.h
Go to the documentation of this file.
1#ifndef RBIMPL_ITERATOR_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ITERATOR_H
23#include "ruby/internal/attr/noreturn.h"
24#include "ruby/internal/dllexport.h"
25#include "ruby/internal/value.h"
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29#define RB_BLOCK_CALL_FUNC_STRICT 1
30#define RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG 1
31#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg) \
32 VALUE yielded_arg, VALUE callback_arg, int argc, const VALUE *argv, VALUE blockarg
33 typedef VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg));
34 typedef rb_block_call_func *rb_block_call_func_t;
35
36 VALUE rb_each(VALUE);
37 VALUE rb_yield(VALUE);
38 VALUE rb_yield_values(int n, ...);
39 VALUE rb_yield_values2(int n, const VALUE *argv);
40 VALUE rb_yield_values_kw(int n, const VALUE *argv, int kw_splat);
41 VALUE rb_yield_splat(VALUE);
42 VALUE rb_yield_splat_kw(VALUE, int);
43 VALUE rb_yield_block(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)); /* rb_block_call_func */
44int rb_keyword_given_p(void);
45int rb_block_given_p(void);
46void rb_need_block(void);
47 VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
48 VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
49 VALUE rb_block_call_kw(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE,int);
50 VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
51 VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
52 VALUE rb_vrescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,va_list);
53 VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
54 VALUE rb_catch(const char*,rb_block_call_func_t,VALUE);
55 VALUE rb_catch_obj(VALUE,rb_block_call_func_t,VALUE);
56
57 RBIMPL_ATTR_NORETURN()
58void rb_throw(const char*,VALUE);
59
60 RBIMPL_ATTR_NORETURN()
61void rb_throw_obj(VALUE,VALUE);
62
63 RBIMPL_SYMBOL_EXPORT_END()
64
65#endif /* RBIMPL_ITERATOR_H */
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_need_block
void rb_need_block(void)
Declares that the current method needs a block.
Definition: eval.c:961
rb_block_given_p
int rb_block_given_p(void)
Determines if the current method is given a block.
Definition: eval.c:935
rb_rescue2
VALUE rb_rescue2(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE, VALUE), VALUE,...)
An equivalent of rescue clause.
Definition: eval.c:991
rb_rescue
VALUE rb_rescue(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE, VALUE), VALUE)
An equivalent of rescue clause.
Definition: eval.c:1080
rb_ensure
VALUE rb_ensure(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE), VALUE)
An equivalent to ensure clause.
Definition: eval.c:1148
RB_BLOCK_CALL_FUNC_ARGLIST
#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)
Definition: iterator.h:31
rb_vrescue2
VALUE rb_vrescue2(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE, VALUE), VALUE, va_list)
An equivalent of rescue clause.
Definition: eval.c:1006
rb_block_call_kw
VALUE rb_block_call_kw(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE, int)
Definition: vm_eval.c:1584
rb_catch
VALUE rb_catch(const char *, rb_block_call_func_t, VALUE)
Definition: vm_eval.c:2385
rb_iterate
VALUE rb_iterate(VALUE(*)(VALUE), VALUE, rb_block_call_func_t, VALUE)
Definition: vm_eval.c:1544
rb_yield_values
VALUE rb_yield_values(int n,...)
Definition: vm_eval.c:1353
rb_throw
void rb_throw(const char *, VALUE)
Definition: vm_eval.c:2315
rb_yield_values2
VALUE rb_yield_values2(int n, const VALUE *argv)
Definition: vm_eval.c:1375
rb_yield_values_kw
VALUE rb_yield_values_kw(int n, const VALUE *argv, int kw_splat)
Definition: vm_eval.c:1381
rb_block_call_func_t
rb_block_call_func * rb_block_call_func_t
Definition: iterator.h:34
rb_yield_block
VALUE rb_yield_block(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
rb_throw_obj
void rb_throw_obj(VALUE, VALUE)
Definition: vm_eval.c:2290
rb_block_call_func
VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
Definition: iterator.h:33
rb_each
VALUE rb_each(VALUE)
Definition: vm_eval.c:1639
rb_yield_splat
VALUE rb_yield_splat(VALUE)
Definition: vm_eval.c:1387
rb_yield_splat_kw
VALUE rb_yield_splat_kw(VALUE, int)
Definition: vm_eval.c:1400
rb_block_call
VALUE rb_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE)
Definition: vm_eval.c:1570
rb_yield
VALUE rb_yield(VALUE)
Definition: vm_eval.c:1341
rb_keyword_given_p
int rb_keyword_given_p(void)
Definition: eval.c:948
rb_catch_obj
VALUE rb_catch_obj(VALUE, rb_block_call_func_t, VALUE)
Definition: vm_eval.c:2427
noreturn.h
Defines RBIMPL_ATTR_NORETURN.
RBIMPL_ATTR_NORETURN
#define RBIMPL_ATTR_NORETURN()
Wraps (or simulates) [[noreturn]]
Definition: noreturn.h:38
argv
char ** argv
Definition: ruby.c:241
const
#define const
Definition: strftime.c:108
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39