Ruby  2.5.0dev(2017-10-22revision60238)
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 
12 #undef RUBY_EXPORT
13 #include "ruby.h"
14 #include "vm_debug.h"
15 #ifdef HAVE_LOCALE_H
16 #include <locale.h>
17 #endif
18 #if RUBY_DEVEL && !defined RUBY_DEBUG_ENV
19 # define RUBY_DEBUG_ENV 1
20 #endif
21 #if defined RUBY_DEBUG_ENV && !RUBY_DEBUG_ENV
22 # undef RUBY_DEBUG_ENV
23 #endif
24 #ifdef RUBY_DEBUG_ENV
25 #include <stdlib.h>
26 #endif
27 
28 int
29 main(int argc, char **argv)
30 {
31 #ifdef RUBY_DEBUG_ENV
32  ruby_set_debug_option(getenv("RUBY_DEBUG"));
33 #endif
34 #ifdef HAVE_LOCALE_H
35  setlocale(LC_CTYPE, "");
36 #endif
37 
38  ruby_sysinit(&argc, &argv);
39  {
41  ruby_init();
42  return ruby_run_node(ruby_options(argc, argv));
43  }
44 }
void ruby_init(void)
Calls ruby_setup() and check error.
Definition: eval.c:76
int argc
Definition: ruby.c:187
#define ruby_run_node
Definition: goruby.c:3
void ruby_set_debug_option(const char *str)
Definition: debug.c:215
#define ruby_options
Definition: goruby.c:2
#define getenv(name)
Definition: win32.c:71
#define RUBY_INIT_STACK
A convenience macro to call ruby_init_stack().
Definition: ruby.h:2502
void ruby_sysinit(int *argc, char ***argv)
Initializes the process for libruby.
Definition: ruby.c:2296
int main(int argc, char **argv)
Definition: main.c:29
char ** argv
Definition: ruby.c:188