Ruby 3.5.0dev (2025-02-22 revision 412997300569c1853c09813e4924b6df3d7e8669)
interpreter.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERPRETER_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERPRETER_H
26#include "ruby/internal/value.h"
27
29
30
68void ruby_sysinit(int *argc, char ***argv);
69
75void ruby_init(void);
76
92void* ruby_options(int argc, char** argv);
93
107int ruby_executable_node(void *n, int *status);
108
116int ruby_run_node(void *n);
117
118/* version.c */
120void ruby_show_version(void);
121
122#ifndef ruby_show_copyright
124void ruby_show_copyright(void);
125#endif
126
131#define RUBY_INIT_STACK \
132 VALUE variable_in_this_stack_frame; \
133 ruby_init_stack(&variable_in_this_stack_frame);
144void ruby_init_stack(void *addr);
145
158int ruby_setup(void);
159
171int ruby_cleanup(int ex);
172
181void ruby_finalize(void);
182
185void ruby_stop(int);
186
197int ruby_stack_check(void);
198
214size_t ruby_stack_length(VALUE **topnotch);
215
230int ruby_exec_node(void *n);
231
240void ruby_script(const char* name);
241
248void ruby_set_script_name(VALUE name);
249
251void ruby_prog_init(void);
252
261void ruby_set_argv(int argc, char **argv);
262
271void *ruby_process_options(int argc, char **argv);
272
281void ruby_init_loadpath(void);
282
289void ruby_incpush(const char *path);
290
298void ruby_sig_finalize(void);
299
303
304#endif /* RBIMPL_INTERPRETER_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
void ruby_stop(int)
Calls ruby_cleanup() and exits the process.
Definition eval.c:287
int ruby_exec_node(void *n)
Identical to ruby_run_node(), except it returns an opaque execution status.
Definition eval.c:322
int ruby_setup(void)
Initializes the VM and builtin libraries.
Definition eval.c:65
void ruby_finalize(void)
Runs the VM finalization processes.
Definition eval.c:167
void ruby_script(const char *name)
Sets the current script name to this value.
Definition ruby.c:2988
void ruby_set_argv(int argc, char **argv)
Sets argv that ruby understands.
Definition ruby.c:3101
void ruby_set_script_name(VALUE name)
Identical to ruby_script(), except it takes the name as a Ruby String instance.
Definition ruby.c:3000
int ruby_cleanup(int ex)
Destructs the VM.
Definition eval.c:175
size_t ruby_stack_length(VALUE **topnotch)
Queries what Ruby thinks is the machine stack.
Definition gc.c:2159
int ruby_stack_check(void)
Checks for stack overflow.
Definition gc.c:2199
void ruby_init_loadpath(void)
Sets up $LOAD_PATH.
Definition ruby.c:648
void * ruby_process_options(int argc, char **argv)
Identical to ruby_options(), except it raises ruby-level exceptions on failure.
Definition ruby.c:3116
void ruby_prog_init(void)
Defines built-in variables.
Definition ruby.c:3069
void ruby_sig_finalize(void)
Clear signal handlers.
Definition signal.c:1442
void ruby_incpush(const char *path)
Appends the given path to the end of the load path.
Definition ruby.c:489
void ruby_init_stack(void *addr)
Set stack bottom of Ruby implementation.
Definition vm.c:4322
void ruby_init(void)
Calls ruby_setup() and check error.
Definition eval.c:95
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
Definition version.c:263
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition ruby.c:3180
void ruby_show_version(void)
Prints the version information of the CRuby interpreter to stdout.
Definition version.c:249
int ruby_executable_node(void *n, int *status)
Checks the return value of ruby_options().
Definition eval.c:293
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
Defines RBIMPL_ATTR_NORETURN.
#define RBIMPL_ATTR_NORETURN()
Wraps (or simulates) [[noreturn]]
Definition noreturn.h:38
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40