Ruby: main.c Source File

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

main.c
Go to the documentation of this file.
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#ifdef RUBY_DEBUG_ENV
33#include <stdlib.h>
34#endif
35
36int
37 main(int argc, char **argv)
38{
39#ifdef RUBY_DEBUG_ENV
40 ruby_set_debug_option(getenv("RUBY_DEBUG"));
41#endif
42#ifdef HAVE_LOCALE_H
43 setlocale(LC_CTYPE, "");
44#endif
45
46 ruby_sysinit(&argc, &argv);
47 {
48 RUBY_INIT_STACK;
49 ruby_init();
50 return ruby_run_node(ruby_options(argc, argv));
51 }
52}
main
int main(void)
Definition: closure_fn0.c:49
ruby_set_debug_option
void ruby_set_debug_option(const char *str)
Definition: debug.c:259
ruby_run_node
#define ruby_run_node
Definition: goruby.c:3
ruby_options
#define ruby_options
Definition: goruby.c:2
RUBY_INIT_STACK
#define RUBY_INIT_STACK
A convenience macro to call ruby_init_stack().
Definition: interpreter.h:59
ruby_init
void ruby_init(void)
Calls ruby_setup() and check error.
Definition: eval.c:108
ruby_sysinit
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition: ruby.c:2655
ruby.h
argc
int argc
Definition: ruby.c:240
argv
char ** argv
Definition: ruby.c:241
vm_debug.h
getenv
#define getenv(name)
Definition: win32.c:80