Ruby  3.4.0dev (2024-11-05 revision 348a53415339076afc4a02fcd09f3ae36e9c4c61)
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 
68 void ruby_sysinit(int *argc, char ***argv);
69 
75 void ruby_init(void);
76 
92 void* ruby_options(int argc, char** argv);
93 
107 int ruby_executable_node(void *n, int *status);
108 
116 int ruby_run_node(void *n);
117 
118 /* version.c */
120 void ruby_show_version(void);
121 
122 #ifndef ruby_show_copyright
124 void 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(void *addr);
145 
158 int ruby_setup(void);
159 
171 int ruby_cleanup(int ex);
172 
181 void ruby_finalize(void);
182 
185 void ruby_stop(int);
186 
197 int ruby_stack_check(void);
198 
214 size_t ruby_stack_length(VALUE **topnotch);
215 
230 int ruby_exec_node(void *n);
231 
240 void ruby_script(const char* name);
241 
248 void ruby_set_script_name(VALUE name);
249 
251 void ruby_prog_init(void);
252 
261 void ruby_set_argv(int argc, char **argv);
262 
271 void *ruby_process_options(int argc, char **argv);
272 
281 void ruby_init_loadpath(void);
282 
289 void ruby_incpush(const char *path);
290 
298 void 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:288
int ruby_exec_node(void *n)
Identical to ruby_run_node(), except it returns an opaque execution status.
Definition: eval.c:323
int ruby_setup(void)
Initializes the VM and builtin libraries.
Definition: eval.c:66
void ruby_finalize(void)
Runs the VM finalization processes.
Definition: eval.c:168
void ruby_script(const char *name)
Sets the current script name to this value.
Definition: ruby.c:3009
void ruby_set_argv(int argc, char **argv)
Sets argv that ruby understands.
Definition: ruby.c:3122
void ruby_set_script_name(VALUE name)
Identical to ruby_script(), except it takes the name as a Ruby String instance.
Definition: ruby.c:3021
int ruby_cleanup(int ex)
Destructs the VM.
Definition: eval.c:176
size_t ruby_stack_length(VALUE **topnotch)
Queries what Ruby thinks is the machine stack.
Definition: gc.c:2001
int ruby_stack_check(void)
Checks for stack overflow.
Definition: gc.c:2041
void ruby_init_loadpath(void)
Sets up $LOAD_PATH.
Definition: ruby.c:669
void * ruby_process_options(int argc, char **argv)
Identical to ruby_options(), except it raises ruby-level exceptions on failure.
Definition: ruby.c:3137
void ruby_prog_init(void)
Defines built-in variables.
Definition: ruby.c:3090
void ruby_sig_finalize(void)
Clear signal handlers.
Definition: signal.c:1437
void ruby_incpush(const char *path)
Appends the given path to the end of the load path.
Definition: ruby.c:510
void ruby_init_stack(void *addr)
Set stack bottom of Ruby implementation.
Definition: vm.c:4305
int ruby_run_node(void *n)
Runs the given compiled source and exits this process.
Definition: eval.c:311
void ruby_init(void)
Calls ruby_setup() and check error.
Definition: eval.c:96
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
Definition: version.c:223
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition: ruby.c:3201
void * ruby_options(int argc, char **argv)
Processes command line arguments and compiles the Ruby source to execute.
Definition: eval.c:109
void ruby_show_version(void)
Prints the version information of the CRuby interpreter to stdout.
Definition: version.c:209
int ruby_executable_node(void *n, int *status)
Checks the return value of ruby_options().
Definition: eval.c:294
RBIMPL_ATTR_NORETURN() void rb_eof_error(void)
Utility function to raise rb_eEOFError.
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition: nonnull.h:27
Defines RBIMPL_ATTR_NORETURN.
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition: value.h:40