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

Ruby 4.0.6p0 (2026-07-14 revision 03b6d3f8898a28604fe6cb00eae3226b821168f4)

eval.h
Go to the documentation of this file.
1#ifndef RBIMPL_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_EVAL_H
23#include "ruby/internal/dllexport.h"
24#include "ruby/internal/attr/nonnull.h"
25#include "ruby/internal/value.h"
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29 RBIMPL_ATTR_NONNULL(())
70 VALUE rb_eval_string(const char *str);
71
72 RBIMPL_ATTR_NONNULL((1))
101 VALUE rb_eval_string_protect(const char *str, int *state);
102
103 RBIMPL_ATTR_NONNULL((1))
118 VALUE rb_eval_string_wrap(const char *str, int *state);
119
131 VALUE rb_funcall(VALUE recv, ID mid, int n, ...);
132
145 VALUE rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv);
146
164 VALUE rb_funcallv_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat);
165
179 VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv);
180
200 VALUE rb_funcallv_public_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat);
201
207#define rb_funcall2 rb_funcallv
208
214#define rb_funcall3 rb_funcallv_public
215
251 VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
252
273 VALUE rb_funcall_passing_block_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat);
274
298 VALUE rb_funcall_with_block(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE procval);
299
320 VALUE rb_funcall_with_block_kw(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE procval, int kw_splat);
321
331 VALUE rb_call_super(int argc, const VALUE *argv);
332
348 VALUE rb_call_super_kw(int argc, const VALUE *argv, int kw_splat);
349
356 VALUE rb_current_receiver(void);
357
358 RBIMPL_ATTR_NONNULL((2))
385int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values);
386
387 RBIMPL_ATTR_NONNULL(())
401 VALUE rb_extract_keywords(VALUE *orighash);
402
403 RBIMPL_SYMBOL_EXPORT_END()
404
405#endif /* RBIMPL_EVAL_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:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
rb_extract_keywords
VALUE rb_extract_keywords(VALUE *orighash)
Splits a hash into two.
Definition class.c:2903
rb_get_kwargs
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
Keyword argument deconstructor.
Definition class.c:2921
rb_eval_string_wrap
VALUE rb_eval_string_wrap(const char *str, int *state)
Identical to rb_eval_string_protect(), except it evaluates the given string under a module binding in...
Definition vm_eval.c:2128
rb_funcall_passing_block
VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv)
Identical to rb_funcallv_public(), except you can pass the passed block.
Definition vm_eval.c:1180
rb_funcall
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1117
rb_funcallv_kw
VALUE rb_funcallv_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
Identical to rb_funcallv(), except you can specify how to handle the last element of the given array.
Definition vm_eval.c:1084
rb_funcall_with_block
VALUE rb_funcall_with_block(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE procval)
Identical to rb_funcallv_public(), except you can pass a block.
Definition vm_eval.c:1194
rb_eval_string_protect
VALUE rb_eval_string_protect(const char *str, int *state)
Identical to rb_eval_string(), except it avoids potential global escapes.
Definition vm_eval.c:2107
rb_call_super_kw
VALUE rb_call_super_kw(int argc, const VALUE *argv, int kw_splat)
Identical to rb_call_super(), except you can specify how to handle the last element of the given arra...
Definition vm_eval.c:354
rb_funcallv_public
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
Identical to rb_funcallv(), except it only takes public methods into account.
Definition vm_eval.c:1168
rb_current_receiver
VALUE rb_current_receiver(void)
This resembles ruby's self.
Definition vm_eval.c:368
rb_funcall_passing_block_kw
VALUE rb_funcall_passing_block_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
Identical to rb_funcallv_passing_block(), except you can specify how to handle the last element of th...
Definition vm_eval.c:1187
rb_funcall_with_block_kw
VALUE rb_funcall_with_block_kw(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE procval, int kw_splat)
Identical to rb_funcallv_with_block(), except you can specify how to handle the last element of the g...
Definition vm_eval.c:1204
rb_eval_string
VALUE rb_eval_string(const char *str)
Evaluates the given string.
Definition vm_eval.c:2095
rb_call_super
VALUE rb_call_super(int argc, const VALUE *argv)
This resembles ruby's super.
Definition vm_eval.c:362
rb_funcallv_public_kw
VALUE rb_funcallv_public_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
Identical to rb_funcallv_public(), except you can specify how to handle the last element of the given...
Definition vm_eval.c:1174
nonnull.h
Defines RBIMPL_ATTR_NONNULL.
RBIMPL_ATTR_NONNULL
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull)).
Definition nonnull.h:30
value.h
Defines VALUE and ID.
ID
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40