Ruby: include/ruby/internal/intern/cont.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

cont.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_CONT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_CONT_H
23#include "ruby/internal/dllexport.h"
24#include "ruby/internal/value.h"
25#include "ruby/internal/iterator.h"
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29/* cont.c */
30
31
39 VALUE rb_fiber_new(rb_block_call_func_t func, VALUE callback_obj);
40
61 VALUE rb_fiber_new_storage(rb_block_call_func_t func, VALUE callback_obj, VALUE storage);
62
69 VALUE rb_fiber_current(void);
70
80 VALUE rb_fiber_alive_p(VALUE fiber);
81
89 VALUE rb_obj_is_fiber(VALUE obj);
90
139 VALUE rb_fiber_resume(VALUE fiber, int argc, const VALUE *argv);
140
156 VALUE rb_fiber_resume_kw(VALUE fiber, int argc, const VALUE *argv, int kw_splat);
157
184 VALUE rb_fiber_yield(int argc, const VALUE *argv);
185
199 VALUE rb_fiber_yield_kw(int argc, const VALUE *argv, int kw_splat);
200
238 VALUE rb_fiber_transfer(VALUE fiber, int argc, const VALUE *argv);
239
255 VALUE rb_fiber_transfer_kw(VALUE fiber, int argc, const VALUE *argv, int kw_splat);
256
278 VALUE rb_fiber_raise(VALUE fiber, int argc, const VALUE *argv);
279
280 RBIMPL_SYMBOL_EXPORT_END()
281
282#endif /* RBIMPL_INTERN_CONT_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_fiber_transfer_kw
VALUE rb_fiber_transfer_kw(VALUE fiber, int argc, const VALUE *argv, int kw_splat)
Identical to rb_fiber_transfer(), except you can specify how to handle the last element of the given ...
Definition cont.c:3141
rb_fiber_new_storage
VALUE rb_fiber_new_storage(rb_block_call_func_t func, VALUE callback_obj, VALUE storage)
Creates a Fiber instance from a C-backended block with the specified storage.
Definition cont.c:2340
rb_fiber_raise
VALUE rb_fiber_raise(VALUE fiber, int argc, const VALUE *argv)
Identical to rb_fiber_resume() but instead of resuming normal execution of the passed fiber,...
Definition cont.c:3179
rb_fiber_current
VALUE rb_fiber_current(void)
Queries the fiber which is calling this function.
Definition cont.c:2605
rb_fiber_yield_kw
VALUE rb_fiber_yield_kw(int argc, const VALUE *argv, int kw_splat)
Identical to rb_fiber_yield(), except you can specify how to handle the last element of the given arr...
Definition cont.c:2907
rb_fiber_transfer
VALUE rb_fiber_transfer(VALUE fiber, int argc, const VALUE *argv)
Transfers control to another fiber, resuming it from where it last stopped or starting it if it was n...
Definition cont.c:2730
rb_fiber_resume_kw
VALUE rb_fiber_resume_kw(VALUE fiber, int argc, const VALUE *argv, int kw_splat)
Identical to rb_fiber_resume(), except you can specify how to handle the last element of the given ar...
Definition cont.c:2895
rb_fiber_alive_p
VALUE rb_fiber_alive_p(VALUE fiber)
Queries the liveness of the passed fiber.
Definition cont.c:2935
rb_fiber_new
VALUE rb_fiber_new(rb_block_call_func_t func, VALUE callback_obj)
Creates a Fiber instance from a C-backended block.
Definition cont.c:2346
rb_obj_is_fiber
VALUE rb_obj_is_fiber(VALUE obj)
Queries if an object is a fiber.
Definition cont.c:1168
rb_fiber_yield
VALUE rb_fiber_yield(int argc, const VALUE *argv)
Yields the control back to the point where the current fiber was resumed.
Definition cont.c:2913
rb_fiber_resume
VALUE rb_fiber_resume(VALUE fiber, int argc, const VALUE *argv)
Resumes the execution of the passed fiber, either from the point at which the last rb_fiber_yield() w...
Definition cont.c:2901
iterator.h
Block related APIs.
rb_block_call_func_t
rb_block_call_func * rb_block_call_func_t
Shorthand type that represents an iterator-written-in-C function pointer.
Definition iterator.h:88
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40