Ruby
3.4.0dev (2024-11-05 revision 348a53415339076afc4a02fcd09f3ae36e9c4c61)
|
A part of the implementation of ruby(1) command. More...
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... | |
A part of the implementation of ruby(1) command.
Other programs that embed Ruby interpreter do not always need to use these functions.
#define RUBY_INIT_STACK |
A convenience macro to call ruby_init_stack().
Must be placed just after variable declarations.
Definition at line 131 of file interpreter.h.
int ruby_executable_node | ( | void * | n, |
int * | status | ||
) |
Checks the return value of ruby_options().
ruby_options() sometimes returns a special value to indicate this process should immediately exit. This function checks if the case. Also stores the exit status that the caller have to pass to exit(3) into *status
.
[in] | n | A return value of ruby_options(). |
[out] | status | Pointer to the exit status of this process. |
0 | The given value is such a special value. |
otherwise | The given opaque pointer is actually a compiled source. |
Definition at line 294 of file eval.c.
Referenced by ruby_run_node().
void ruby_init | ( | void | ) |
Calls ruby_setup() and check error.
Prints errors and calls exit(3) if an error occurred.
void* ruby_options | ( | int | argc, |
char ** | argv | ||
) |
Processes command line arguments and compiles the Ruby source to execute.
This function does:
ruby(1)
-e
or stdin
, and[in] | argc | Process main's argc . |
[in] | argv | Process main's argv . |
int ruby_run_node | ( | void * | n | ) |
void ruby_show_copyright | ( | void | ) |
void ruby_show_version | ( | void | ) |
void ruby_sysinit | ( | int * | argc, |
char *** | argv | ||
) |
Initializes the process for libruby.
This function assumes this process is ruby(1)
and it has just started. Usually programs that embed CRuby interpreter may not call this function, and may do their own initialization.
[in] | argc | Pointer to process main's argc . |
[in] | argv | Pointer to process main's argv . |
argc
and argv
cannot be NULL
.