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

Ruby 3.3.5p100 (2024-09-03 revision ef084cc8f4958c1b6e4ead99136631bef6d8ddba)

interpreter.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERPRETER_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERPRETER_H
23#include "ruby/internal/attr/noreturn.h"
24#include "ruby/internal/attr/nonnull.h"
25#include "ruby/internal/dllexport.h"
26#include "ruby/internal/value.h"
27
28 RBIMPL_SYMBOL_EXPORT_BEGIN()
29
30
51 RBIMPL_ATTR_NONNULL(())
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);
144 void ruby_init_stack(volatile VALUE *addr);
145
158int ruby_setup(void);
159
171int ruby_cleanup(int ex);
172
181void ruby_finalize(void);
182
183 RBIMPL_ATTR_NORETURN()
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
302 RBIMPL_SYMBOL_EXPORT_END()
303
304#endif /* RBIMPL_INTERPRETER_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
ruby_stop
void ruby_stop(int)
Calls ruby_cleanup() and exits the process.
Definition eval.c:296
ruby_exec_node
int ruby_exec_node(void *n)
Identical to ruby_run_node(), except it returns an opaque execution status.
Definition eval.c:332
ruby_setup
int ruby_setup(void)
Initializes the VM and builtin libraries.
Definition eval.c:66
ruby_finalize
void ruby_finalize(void)
Runs the VM finalization processes.
Definition eval.c:172
ruby_init_stack
void ruby_init_stack(volatile VALUE *addr)
Set stack bottom of Ruby implementation.
ruby_script
void ruby_script(const char *name)
Sets the current script name to this value.
Definition ruby.c:2869
ruby_set_argv
void ruby_set_argv(int argc, char **argv)
Sets argv that ruby understands.
Definition ruby.c:2982
ruby_set_script_name
void ruby_set_script_name(VALUE name)
Identical to ruby_script(), except it takes the name as a Ruby String instance.
Definition ruby.c:2881
ruby_cleanup
int ruby_cleanup(int ex)
Destructs the VM.
Definition eval.c:180
ruby_stack_length
size_t ruby_stack_length(VALUE **topnotch)
Queries what Ruby thinks is the machine stack.
Definition gc.c:6506
ruby_stack_check
int ruby_stack_check(void)
Checks for stack overflow.
Definition gc.c:6546
ruby_init_loadpath
void ruby_init_loadpath(void)
Sets up $LOAD_PATH.
Definition ruby.c:679
ruby_process_options
void * ruby_process_options(int argc, char **argv)
Identical to ruby_options(), except it raises ruby-level exceptions on failure.
Definition ruby.c:2997
ruby_prog_init
void ruby_prog_init(void)
Defines built-in variables.
Definition ruby.c:2950
ruby_sig_finalize
void ruby_sig_finalize(void)
Clear signal handlers.
Definition signal.c:1433
ruby_incpush
void ruby_incpush(const char *path)
Appends the given path to the end of the load path.
Definition ruby.c:522
ruby_init
void ruby_init(void)
Calls ruby_setup() and check error.
Definition eval.c:99
ruby_show_copyright
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
Definition version.c:211
ruby_sysinit
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition ruby.c:3057
ruby_show_version
void ruby_show_version(void)
Prints the version information of the CRuby interpreter to stdout.
Definition version.c:197
ruby_executable_node
int ruby_executable_node(void *n, int *status)
Checks the return value of ruby_options().
Definition eval.c:302
nonnull.h
Defines RBIMPL_ATTR_NONNULL.
RBIMPL_ATTR_NONNULL
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
noreturn.h
Defines RBIMPL_ATTR_NORETURN.
RBIMPL_ATTR_NORETURN
#define RBIMPL_ATTR_NORETURN()
Wraps (or simulates) [[noreturn]]
Definition noreturn.h:38
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40