16 #include <sys/cygwin.h>
24 #include <sys/types.h>
28 #include <sys/pstat.h>
30 #if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR)
37 #if defined(HAVE_FCNTL_H)
39 #elif defined(HAVE_SYS_FCNTL_H)
40 #include <sys/fcntl.h>
42 #ifdef HAVE_SYS_PARAM_H
43 # include <sys/param.h>
46 # define MAXPATHLEN 1024
55 #define DISABLE_BIT(bit) (1U << disable_##bit)
62 #define DUMP_BIT(bit) (1U << dump_##bit)
99 #define src_encoding_index GET_VM()->src_encoding_index
109 #if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
117 #define forbid_setid(s) forbid_setid((s), opt)
130 static const char *
const usage_msg[] = {
131 "-0[octal] specify record separator (\\0, if no argument)",
132 "-a autosplit mode with -n or -p (splits $_ into $F)",
133 "-c check syntax only",
134 "-Cdirectory cd to directory, before executing your script",
135 "-d set debugging flags (set $DEBUG to true)",
136 "-e 'command' one line of script. Several -e's allowed. Omit [programfile]",
137 "-Eex[:in] specify the default external and internal character encodings",
138 "-Fpattern split() pattern for autosplit (-a)",
139 "-i[extension] edit ARGV files in place (make backup if extension supplied)",
140 "-Idirectory specify $LOAD_PATH directory (may be used more than once)",
141 "-l enable line ending processing",
142 "-n assume 'while gets(); ... end' loop around your script",
143 "-p assume loop like -n but print line also like sed",
144 "-rlibrary require the library, before executing your script",
145 "-s enable some switch parsing for switches after script name",
146 "-S look for the script using PATH environment variable",
147 "-T[level=1] turn on tainting checks",
148 "-v print version number, then turn on verbose mode",
149 "-w turn warnings on for your script",
150 "-W[level=2] set warning level; 0=silence, 1=medium, 2=verbose",
151 "-x[directory] strip off text before #!ruby line and perhaps cd to directory",
152 "--copyright print the copyright",
153 "--version print the version",
156 const char *
const *
p = usage_msg;
158 printf(
"Usage: %s [switches] [--] [programfile] [arguments]\n", name);
160 printf(
" %s\n", *p++);
167 static char *newp, *oldp;
168 static int newl, oldl, notfound;
172 if (!newp && !notfound) {
173 newp =
getenv(
"RUBYLIB_PREFIX");
175 oldp = newp =
strdup(newp);
176 while (*newp && !
ISSPACE(*newp) && *newp !=
';') {
180 while (*newp && (
ISSPACE(*newp) || *newp ==
';')) {
184 if (newl == 0 || oldl == 0) {
185 rb_fatal(
"malformed RUBYLIB_PREFIX");
187 translit_char(newp,
'\\',
'/');
193 if (!newp || l < oldl ||
STRNCASECMP(oldp, s, oldl) != 0) {
199 memcpy(ptr + newl, s + oldl, l - oldl);
200 ptr[l + newl - oldl] = 0;
204 #define rubylib_mangled_path rb_str_new
219 for (s = p; *s && *s != sep; s =
CharNext(s));
227 push_include_cygwin(
const char *path,
VALUE (*filter)(
VALUE))
230 char rubylib[FILENAME_MAX];
239 for (s = p; *s && *s !=
';'; s =
CharNext(s));
251 #ifdef HAVE_CYGWIN_CONV_PATH
252 #define CONV_TO_POSIX_PATH(p, lib) \
253 cygwin_conv_path(CCP_WIN_A_TO_POSIX|CCP_RELATIVE, (p), (lib), sizeof(lib))
255 #define CONV_TO_POSIX_PATH(p, lib) \
256 cygwin_conv_to_posix_path((p), (lib))
258 if (CONV_TO_POSIX_PATH(p, rubylib) == 0)
266 #define push_include push_include_cygwin
301 if (*p ==
'.' && p[1] ==
'/')
312 #if defined _WIN32 || defined __CYGWIN__
313 static HMODULE libruby;
316 DllMain(HINSTANCE dll,
DWORD reason, LPVOID reserved)
318 if (reason == DLL_PROCESS_ATTACH)
324 rb_libruby_handle(
void)
342 ID id_initial_load_path_mark;
345 #if defined LOAD_RELATIVE
346 # if defined HAVE_DLADDR || defined HAVE_CYGWIN_CONV_PATH
347 # define VARIABLE_LIBPATH 1
349 # define VARIABLE_LIBPATH 0
351 # if VARIABLE_LIBPATH
360 #if defined _WIN32 || defined __CYGWIN__
361 # if VARIABLE_LIBPATH
364 GetModuleFileName(libruby, libpath,
MAXPATHLEN);
366 GetModuleFileName(libruby, libpath,
sizeof libpath);
368 #elif defined(__EMX__)
369 _execname(libpath,
sizeof(libpath) - 1);
370 #elif defined(HAVE_DLADDR)
385 #if !VARIABLE_LIBPATH
386 libpath[
sizeof(libpath) - 1] =
'\0';
389 translit_char(libpath,
'\\',
'/');
390 #elif defined __CYGWIN__
392 # if VARIABLE_LIBPATH
393 const int win_to_posix = CCP_WIN_A_TO_POSIX | CCP_RELATIVE;
394 size_t newsize = cygwin_conv_path(win_to_posix, libpath, 0, 0);
398 if (cygwin_conv_path(win_to_posix, libpath, p, newsize) == 0) {
405 char rubylib[FILENAME_MAX];
406 cygwin_conv_to_posix_path(libpath, rubylib);
407 strncpy(libpath, rubylib,
sizeof(libpath));
413 static const char bindir[] =
"/bin";
414 #ifdef LIBDIR_BASENAME
415 static const char libdir[] =
"/"LIBDIR_BASENAME;
417 static const char libdir[] =
"/lib";
419 const ptrdiff_t bindir_len = (ptrdiff_t)
sizeof(bindir) - 1;
420 const ptrdiff_t libdir_len = (ptrdiff_t)
sizeof(libdir) - 1;
422 if (p - libpath >= bindir_len && !
STRCASECMP(p - bindir_len, bindir)) {
426 else if (p - libpath >= libdir_len && !
STRCASECMP(p - libdir_len, libdir)) {
431 #if !VARIABLE_LIBPATH
433 strlcpy(libpath,
".",
sizeof(libpath));
436 baselen = p - libpath;
437 #define PREFIX_PATH() rb_str_new(libpath, baselen)
439 baselen = p - libpath;
442 #define PREFIX_PATH() sopath
445 #define BASEPATH() rb_str_buf_cat(rb_str_buf_new(baselen+len), libpath, baselen)
447 #define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), (path), (len))
449 static const char exec_prefix[] = RUBY_EXEC_PREFIX;
450 #define RUBY_RELATIVE(path, len) rubylib_mangled_path((path), (len))
451 #define PREFIX_PATH() RUBY_RELATIVE(exec_prefix, sizeof(exec_prefix)-1)
453 load_path =
GET_VM()->load_path;
455 if (safe_level == 0) {
464 size_t len =
strlen(paths);
466 rb_ivar_set(path, id_initial_load_path_mark, path);
486 RBASIC(feature)->klass = 0;
537 if (s[1] ==
'-' && s[2] ==
'\0')
542 for (p = s + 1; *
p; p++) {
551 else if (*p !=
'_' && !
ISALNUM(*p)) {
554 rb_str_new2(
"invalid name for global variable - ");
555 if (!(p =
strchr(p,
'='))) {
561 name_error[1] = args[-1];
567 for (p = s + 1; *
p; ++
p) {
590 VALUE argstr, argary;
615 while ((i =
proc_options(argc, argv, opt, envopt)) > 1 && (argc -=
i) > 0) {
631 #define NAME_MATCH_P(name, str, len) \
632 ((len) < (int)sizeof(name) && strncmp((str), (name), (len)) == 0)
634 #define UNSET_WHEN(name, bit, str, len) \
635 if (NAME_MATCH_P((name), (str), (len))) { \
636 *(unsigned int *)arg &= ~(bit); \
640 #define SET_WHEN(name, bit, str, len) \
641 if (NAME_MATCH_P((name), (str), (len))) { \
642 *(unsigned int *)arg |= (bit); \
649 #define UNSET_WHEN_DISABLE(bit) UNSET_WHEN(#bit, DISABLE_BIT(bit), str, len)
653 *(
unsigned int *)arg = 0
U;
656 rb_warn(
"unknown argument for --enable: `%.*s'", len, str);
662 #define SET_WHEN_DISABLE(bit) SET_WHEN(#bit, DISABLE_BIT(bit), str, len)
666 *(
unsigned int *)arg = ~0
U;
669 rb_warn(
"unknown argument for --disable: `%.*s'", len, str);
675 #define SET_WHEN_DUMP(bit) SET_WHEN(#bit, DUMP_BIT(bit), str, len)
684 rb_warn(
"don't know how to dump `%.*s',", len, str);
685 rb_warn(
"but only [version, copyright, usage, yydebug, syntax, parsetree, parsetree_with_comment, insns].");
693 if (!elen) elen =
strlen(e);
704 #define set_internal_encoding_once(opt, e, elen) \
705 set_option_encoding_once("default_internal", &(opt)->intern.enc.name, (e), (elen))
706 #define set_external_encoding_once(opt, e, elen) \
707 set_option_encoding_once("default_external", &(opt)->ext.enc.name, (e), (elen))
708 #define set_source_encoding_once(opt, e, elen) \
709 set_option_encoding_once("source", &(opt)->src.enc.name, (e), (elen))
714 long n, argc0 =
argc;
720 for (argc--, argv++; argc > 0; argc--, argv++) {
721 const char *
const arg = argv[0];
722 if (arg[0] !=
'-' || !arg[1])
729 if (envopt)
goto noenvopt;
735 if (envopt)
goto noenvopt;
739 if (envopt)
goto noenvopt;
751 if (envopt)
goto noenvopt;
794 if (envopt)
goto noenvopt;
800 if (envopt)
goto noenvopt;
807 if (envopt)
goto noenvopt;
812 if (envopt)
goto noenvopt;
819 if (envopt)
goto noenvopt;
826 if (envopt)
goto noenvopt;
856 if (envopt)
goto noenvopt;
862 if (envopt)
goto noenvopt;
865 if (*s && chdir(s) < 0) {
872 if (envopt)
goto noenvopt;
887 if (envopt)
goto noenvopt;
894 if (!*++s && (!--argc || !(s = *++argv))) {
912 enc_name =
"Windows-31J";
917 case 'N':
case 'n':
case 'A':
case 'a':
918 enc_name =
"ASCII-8BIT";
956 if (envopt)
goto noenvopt;
966 else if (v == 0 && numlen >= 2) {
977 if (!s[1] || (s[1] ==
'\r' && !s[2])) {
983 # define is_option_end(c, allow_hyphen) \
984 (!(c) || ((allow_hyphen) && (c) == '-') || (c) == '=')
985 # define check_envopt(name, allow_envopt) \
986 (((allow_envopt) || !envopt) ? (void)0 : \
987 rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --" name))
988 # define need_argument(name, s) \
989 ((*(s)++ ? !*(s) : (!--argc || !((s) = *++argv))) ? \
990 rb_raise(rb_eRuntimeError, "missing argument for --" name) \
992 # define is_option_with_arg(name, allow_hyphen, allow_envopt) \
993 (strncmp((name), s, n = sizeof(name) - 1) == 0 && is_option_end(s[n], (allow_hyphen)) ? \
994 (check_envopt(name, (allow_envopt)), s += n, need_argument(name, s), 1) : 0)
996 if (strcmp(
"copyright", s) == 0) {
997 if (envopt)
goto noenvopt_long;
1000 else if (strcmp(
"debug", s) == 0) {
1014 # define set_encoding_part(type) \
1015 if (!(p = strchr(s, ':'))) { \
1016 set_##type##_encoding_once(opt, s, 0); \
1020 set_##type##_encoding_once(opt, s, p-s); \
1023 if (!*(s = ++p))
break;
1025 if (!*(s = ++p))
break;
1026 #if defined ALLOW_DEFAULT_SOURCE_ENCODING && ALLOW_DEFAULT_SOURCE_ENCODING
1028 if (!*(s = ++p))
break;
1031 (arg[1] ==
'-' ?
"--encoding" :
"-E"), s);
1032 # undef set_encoding_part
1041 #if defined ALLOW_DEFAULT_SOURCE_ENCODING && ALLOW_DEFAULT_SOURCE_ENCODING
1046 else if (strcmp(
"version", s) == 0) {
1047 if (envopt)
goto noenvopt_long;
1050 else if (strcmp(
"verbose", s) == 0) {
1054 else if (strcmp(
"yydebug", s) == 0) {
1055 if (envopt)
goto noenvopt_long;
1061 else if (strcmp(
"help", s) == 0) {
1062 if (envopt)
goto noenvopt_long;
1068 "invalid option --%s (-h will show valid options)", s);
1080 "invalid option -%c (-h will show valid options)",
1081 (
int)(
unsigned char)*s);
1085 "invalid option -\\x%02X (-h will show valid options)",
1086 (
int)(
unsigned char)*s);
1102 # undef is_option_end
1103 # undef check_envopt
1104 # undef need_argument
1105 # undef is_option_with_arg
1110 return argc0 -
argc;
1135 #define rb_progname (GET_VM()->progname)
1150 #define rb_define_readonly_boolean(name, val) \
1151 rb_define_virtual_variable((name), (val) ? true_value : false_value, 0)
1198 rb_f_gsub(argc, argv)
1238 rb_f_chomp(argc, argv)
1277 opt->
src.
enc.name = src_enc_name;
1279 opt->
ext.
enc.name = ext_enc_name;
1305 if (opt->
script[0] ==
'\0') {
1309 char *path =
getenv(
"RUBYPATH");
1328 #if defined DOSISH || defined __CYGWIN__
1341 if (opt->
ext.
enc.name != 0) {
1347 if (opt->
src.
enc.name != 0) {
1351 if (opt->
ext.
enc.index >= 0) {
1373 #if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
1392 #define PREPARE_PARSE_MAIN(expr) do { \
1393 th->parse_in_eval--; \
1394 th->base_block = &env->block; \
1396 th->parse_in_eval++; \
1397 th->base_block = 0; \
1403 if (opt->
src.
enc.index >= 0) {
1431 if (opt->
ext.
enc.index >= 0) {
1448 if (!tree)
return Qfalse;
1459 printf(
"Syntax OK\n");
1532 if (strcmp(fname,
"-") == 0) {
1536 int fd,
mode = O_RDONLY;
1537 #if defined DOSISH || defined __CYGWIN__
1546 if ((fd = open(fname, mode)) < 0) {
1554 CONST_ID(set_encoding,
"set_encoding");
1559 int no_src_enc = !opt->
src.
enc.name;
1560 int no_ext_enc = !opt->
ext.
enc.name;
1566 if (xflag || opt->
xflag) {
1594 goto search_shebang;
1602 if ((p =
strstr(p,
" -")) != 0) {
1609 else if (!
NIL_P(c)) {
1613 if (no_src_enc && opt->
src.
enc.name) {
1617 if (no_ext_enc && opt->
ext.
enc.name) {
1620 if (no_int_enc && opt->
intern.
enc.name) {
1624 else if (!
NIL_P(c)) {
1634 if (opt->
src.
enc.index >= 0) {
1637 else if (f == rb_stdin) {
1666 else if (f != rb_stdin) {
1731 if (uid != euid) opt->
setids |= 1;
1732 if (egid != gid) opt->
setids |= 2;
1733 if (uid && opt->
setids) {
1761 switch (*variable) {
1801 #if defined(USE_DLN_A_OUT)
1805 dln_argv0 = argv[0];
1808 for (i = 0; i <
argc; i++) {
1827 #ifndef HAVE_SETPROCTITLE
1829 extern void ruby_init_setproctitle(
int argc,
char *argv[]);
1830 ruby_init_setproctitle(argc, argv);
1834 return (
void*)(
struct RData*)iseq;
1840 int f0, f1, f2, fds[2];
1846 if (pipe(fds) == 0) {
1855 if (pipe(fds) == 0) {
1857 if (f1 && fds[1] != 1)
1859 if (f2 && fds[1] != 2)
1861 if (fds[1] != 1 && fds[1] != 2)
1876 #if defined(USE_DLN_A_OUT)
#define STRNCASECMP(s1, s2, n)
RUBY_EXTERN VALUE rb_cString
void rb_define_global_const(const char *, VALUE)
#define RSTRING_LEN(string)
static void ruby_init_prelude(void)
static void process_sflag(int *sflag)
VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE *)
static VALUE load_file_internal(VALUE arg)
static VALUE restore_lineno(VALUE lineno)
static void dump_option(const char *str, int len, void *arg)
NODE * rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start)
size_t strlen(const char *)
void rb_update_max_fd(int fd)
#define scan_oct(s, l, e)
void ruby_prog_init(void)
VALUE rb_str_cat(VALUE, const char *, long)
void ruby_each_words(const char *, void(*)(const char *, int, void *), void *)
void ruby_show_version(void)
VALUE rb_ary_shift(VALUE ary)
VALUE rb_parser_end_seen_p(VALUE vparser)
char * dln_find_file_r(const char *, const char *, char *, size_t)
VALUE rb_enc_from_encoding(rb_encoding *encoding)
static VALUE rb_f_chop(void)
RUBY_EXTERN VALUE rb_stdin
void ruby_init_loadpath(void)
rb_encoding * rb_default_internal_encoding(void)
VALUE rb_ary_push(VALUE ary, VALUE item)
#define RSTRING_PTR(string)
static void add_modules(VALUE *req_list, const char *mod)
void rb_raise(VALUE exc, const char *fmt,...)
void ruby_init_loadpath_safe(int safe_level)
static VALUE expand_include_path(VALUE path)
void rb_enc_set_default_external(VALUE encoding)
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
VALUE rb_io_getbyte(VALUE)
VALUE rb_ary_clear(VALUE ary)
static void require_libraries(VALUE *req_list)
#define RARRAY_LEN(ARRAY)
static void disable_option(const char *str, int len, void *arg)
#define PREPARE_PARSE_MAIN(expr)
#define GetEnvPtr(obj, ptr)
static void verbose_setter(VALUE val, ID id, void *data)
VALUE rb_io_write(VALUE, VALUE)
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
struct cmdline_options::@65 ext
VALUE rb_str_tmp_new(long)
struct cmdline_options * opt
static void set_option_encoding_once(const char *type, VALUE *name, const char *e, long elen)
VALUE rb_external_str_new_cstr(const char *)
VALUE rb_parser_set_yydebug(VALUE self, VALUE flag)
const char * rb_obj_classname(VALUE)
VALUE rb_gv_set(const char *, VALUE)
void * rb_load_file(const char *)
void rb_exc_raise(VALUE mesg)
#define set_external_encoding_once(opt, e, elen)
static void fill_standard_fds(void)
VALUE rb_gv_get(const char *)
#define MEMZERO(p, type, n)
static void enable_option(const char *str, int len, void *arg)
VALUE rb_require(const char *)
VALUE rb_lastline_get(void)
rb_encoding * rb_default_external_encoding(void)
RUBY_EXTERN VALUE rb_output_rs
NODE * rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
static void push_include(const char *path, VALUE(*filter)(VALUE))
VALUE rb_class_new_instance(int, VALUE *, VALUE)
void ruby_incpush(const char *)
#define is_option_with_arg(name, allow_hyphen, allow_envopt)
static void init_ids(struct cmdline_options *)
#define RUBY_RELATIVE(path, len)
RUBY_EXTERN VALUE rb_cObject
VALUE rb_parser_encoding(VALUE vparser)
#define SET_WHEN_DUMP(bit)
RUBY_EXTERN char * strstr(const char *, const char *)
void ruby_set_inplace_mode(const char *)
#define GetBindingPtr(obj, ptr)
static VALUE false_value(void)
VALUE rb_str_cat2(VALUE, const char *)
static void moreswitches(const char *s, struct cmdline_options *opt, int envopt)
struct cmdline_options::@65 intern
void ruby_incpush_expand(const char *path)
#define UNSET_WHEN_DISABLE(bit)
void rb_lastline_set(VALUE)
NODE * rb_parser_append_print(VALUE vparser, NODE *node)
VALUE rb_external_str_new(const char *, long)
void rb_gc_register_mark_object(VALUE obj)
unsigned char buf[MIME_BUF_SIZE]
void ruby_push_include(const char *path, VALUE(*filter)(VALUE))
NODE * rb_parser_while_loop(VALUE vparser, NODE *node, int chop, int split)
VALUE rb_str_resize(VALUE, long)
void rb_load_fail(const char *path)
VALUE rb_const_get(VALUE, ID)
VALUE rb_io_fdopen(int, int, const char *)
VALUE rb_reg_new(const char *, long, int)
VALUE rb_funcall2(VALUE, ID, int, const VALUE *)
Calls a method.
VALUE rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath)
static NODE * load_file(VALUE, const char *, int, struct cmdline_options *)
void rb_w32_sysinit(int *argc, char ***argv)
void rb_fatal(const char *fmt,...)
#define rubylib_mangled_path
rb_encoding * rb_usascii_encoding(void)
struct cmdline_options::@65 src
#define set_encoding_part(type)
rb_encoding * rb_locale_encoding(void)
char * strchr(char *, char)
static int opt_enc_index(VALUE enc_name)
#define NAME_MATCH_P(name, str, len)
static int rb_enc_dummy_p(rb_encoding *enc)
register unsigned int len
RUBY_EXTERN size_t strlcpy(char *, const char *, size_t)
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
VALUE rb_str_new_cstr(const char *)
static VALUE uscore_get(void)
VALUE rb_io_ungetbyte(VALUE, VALUE)
static struct cmdline_options * cmdline_options_init(struct cmdline_options *opt)
void rb_define_hooked_variable(const char *, VALUE *, VALUE(*)(ANYARGS), void(*)(ANYARGS))
static void usage(const char *name)
VALUE rb_str_freeze(VALUE)
void rb_gc_set_params(void)
static VALUE opt_W_getter(ID id, void *data)
static VALUE identical_path(VALUE path)
rb_set_safe_level(q->safe_level)
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict)
VALUE rb_parser_dump_tree(NODE *node, int comment)
#define set_source_encoding_once(opt, e, elen)
void * ruby_process_options(int, char **)
#define SET_WHEN_DISABLE(bit)
VALUE rb_file_expand_path(VALUE fname, VALUE dname)
static struct @64 origarg
void ruby_script(const char *)
rb_ivar_set(einfo, ID_at_interp, interp)
void rb_enc_set_default_internal(VALUE encoding)
void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar)
struct rb_encoding_entry * list
void rb_define_variable(const char *, VALUE *)
#define set_internal_encoding_once(opt, e, elen)
#define src_encoding_index
void rb_vm_set_progname(VALUE filename)
const char ruby_initial_load_paths[]
VALUE rb_parser_new(void)
struct parser_params * parser
rb_const_set(self, ID_SUBST_INFO, cbsubst_obj)
return rb_funcall(q->proc, ID_call, 0)
#define StringValuePtr(v)
static char fbuf[MAXPATHLEN]
RUBY_EXTERN int dup2(int, int)
#define STRCASECMP(s1, s2)
void ruby_show_copyright(void)
rb_encoding * rb_ascii8bit_encoding(void)
int rb_enc_find_index(const char *name)
#define CONST_ID(var, str)
RUBY_EXTERN VALUE rb_stdout
void rb_stdio_set_default_encoding(void)
static void version(void)
#define rb_intern_const(str)
VALUE rb_obj_freeze(VALUE)
static VALUE true_value(void)
VALUE rb_define_module(const char *name)
struct cmdline_options::@65::@66 enc
VALUE rb_const_remove(VALUE, ID)
#define rb_define_readonly_boolean(name, val)
static VALUE locale_path(VALUE path)
RUBY_EXTERN void setproctitle(const char *fmt,...)
static VALUE process_options(int argc, char **argv, struct cmdline_options *opt)
VALUE rb_iseq_disasm(VALUE self)
VALUE rb_str_new2(const char *)
void rb_warn(const char *fmt,...)
void ruby_set_argv(int, char **)
char * strrchr(const char *, const char)
rb_encoding * rb_enc_from_index(int index)
static long proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
RUBY_EXTERN VALUE rb_argv0
VALUE rb_str_new(const char *, long)
static void set_arg0(VALUE val, ID id)