Ruby: goruby.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
goruby.c File Reference
`#include "main.c"`

Go to the source code of this file.

## Macros
#define | ruby_options goruby_options
#define | ruby_run_node goruby_run_node

## Functions
void | Init_golf (void)
void * | ruby_options (int argc, char **argv)
| Processes command line arguments and compiles the Ruby source to execute. More...
int | ruby_run_node (void *)
| Runs the given compiled source and exits this process. More...
void | ruby_init_ext (const char *name, void(*init)(void))
void * | goruby_options (int argc, char **argv)
int | goruby_run_node (void *arg)

## Macro Definition Documentation

## ◆ ruby_options

#define ruby_options goruby_options

Definition at line 2 of file goruby.c.

## ◆ ruby_run_node

#define ruby_run_node goruby_run_node

Definition at line 3 of file goruby.c.

## Function Documentation

## ◆ goruby_options()

void * goruby_options | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 29 of file goruby.c.

References argc, argv, dup2(), NULL, ruby_options, and write().

## ◆ goruby_run_node()

int goruby_run_node | ( | void * | arg | ) |

Definition at line 57 of file goruby.c.

References EXIT_FAILURE, EXIT_SUCCESS, NIL_P, Qtrue, rb_protect(), and ruby_run_node.

## ◆ Init_golf()

void Init_golf | ( | void |  | ) |

## ◆ ruby_init_ext()

void ruby_init_ext | ( | const char * | name,
|  | void(*)(void) | init
| ) |  |

Definition at line 1220 of file load.c.

References name, rb_provided(), and st_update.

## ◆ ruby_options()

void * ruby_options | ( | int | argc,
|  | char ** | argv
| ) |  |

Processes command line arguments and compiles the Ruby source to execute.

This function does:

- Processes the given command line flags and arguments for ruby(1)
- compiles the source code from the given argument, -e or stdin, and
- returns the compiled source as an opaque pointer to an internal data structure

Returns
  an opaque pointer to the compiled source or an internal special value.

See also
  ruby_executable_node().

Definition at line 129 of file eval.c.

## ◆ ruby_run_node()

int ruby_run_node | ( | void * | n | ) |

Runs the given compiled source and exits this process.

Return values

  0 | if successfully run the source
  non-zero | if an error occurred.

Definition at line 366 of file eval.c.