Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
main.c
1/**********************************************************************
2
3 main.c -
4
5 $Author$
6 created at: Fri Aug 19 13:19:58 JST 1994
7
8 Copyright (C) 1993-2007 Yukihiro Matsumoto
9
10**********************************************************************/
11
20#undef RUBY_EXPORT
21#include "ruby.h"
22#include "vm_debug.h"
23#ifdef HAVE_LOCALE_H
24#include <locale.h>
25#endif
26#if RUBY_DEVEL && !defined RUBY_DEBUG_ENV
27# define RUBY_DEBUG_ENV 1
28#endif
29#if defined RUBY_DEBUG_ENV && !RUBY_DEBUG_ENV
30# undef RUBY_DEBUG_ENV
31#endif
32
33int
34main(int argc, char **argv)
35{
36#ifdef RUBY_DEBUG_ENV
37 ruby_set_debug_option(getenv("RUBY_DEBUG"));
38#endif
39#ifdef HAVE_LOCALE_H
40 setlocale(LC_CTYPE, "");
41#endif
42
43 ruby_sysinit(&argc, &argv);
44 {
46 ruby_init();
47 return ruby_run_node(ruby_options(argc, argv));
48 }
49}
int ruby_run_node(void *n)
Runs the given compiled source and exits this process.
Definition: eval.c:312
#define RUBY_INIT_STACK
A convenience macro to call ruby_init_stack().
Definition: interpreter.h:131
void ruby_init(void)
Calls ruby_setup() and check error.
Definition: eval.c:98
void * ruby_options(int argc, char **argv)
Processes command line arguments and compiles the Ruby source to execute.
Definition: eval.c:109
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition: ruby.c:2783