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

Ruby 3.4.7p58 (2025-10-08 revision 7a5688e2a27668e48f8d6ff4af5b2208b98a2f5e)

Macros | Functions
interpreter.h File Reference

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"`

Go to the source code of this file.

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

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

## Detailed Description

Interpreter embedding APIs.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

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.