Ruby  3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
Macros | Functions
interpreter.h File Reference

(892c46283a5ea4179500d951c9d4866c0051f27b)

Interpreter embedding APIs. More...

#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Include dependency graph for interpreter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RUBY_INIT_STACK
 A convenience macro to call ruby_init_stack(). More...
 

Functions

void ruby_sysinit (int *argc, char ***argv)
 Initializes the process for libruby. More...
 
void ruby_init (void)
 Calls ruby_setup() and check error. More...
 
void * ruby_options (int argc, char **argv)
 Processes command line arguments and compiles the Ruby source to execute. More...
 
int ruby_executable_node (void *n, int *status)
 Checks the return value of ruby_options(). More...
 
int ruby_run_node (void *n)
 Runs the given compiled source and exits this process. More...
 
void ruby_show_version (void)
 Prints the version information of the CRuby interpreter to stdout. More...
 
void ruby_show_copyright (void)
 Prints the copyright notice of the CRuby interpreter to stdout. More...
 
void ruby_init_stack (void *addr)
 Set stack bottom of Ruby implementation. More...
 
int ruby_setup (void)
 Initializes the VM and builtin libraries. More...
 
int ruby_cleanup (int ex)
 Destructs the VM. More...
 
void ruby_finalize (void)
 Runs the VM finalization processes. More...
 
void ruby_stop (int)
 Calls ruby_cleanup() and exits the process. More...
 
int ruby_stack_check (void)
 Checks for stack overflow. More...
 
size_t ruby_stack_length (VALUE **topnotch)
 Queries what Ruby thinks is the machine stack. More...
 
int ruby_exec_node (void *n)
 Identical to ruby_run_node(), except it returns an opaque execution status. More...
 
void ruby_script (const char *name)
 Sets the current script name to this value. More...
 
void ruby_set_script_name (VALUE name)
 Identical to ruby_script(), except it takes the name as a Ruby String instance. More...
 
void ruby_prog_init (void)
 Defines built-in variables. More...
 
void ruby_set_argv (int argc, char **argv)
 Sets argv that ruby understands. More...
 
void * ruby_process_options (int argc, char **argv)
 Identical to ruby_options(), except it raises ruby-level exceptions on failure. More...
 
void ruby_init_loadpath (void)
 Sets up $LOAD_PATH. More...
 
void ruby_incpush (const char *path)
 Appends the given path to the end of the load path. More...
 
void ruby_sig_finalize (void)
 Clear signal handlers. More...
 

Detailed Description

Interpreter embedding APIs.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file interpreter.h.