Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/thread.h"
#include "eval_intern.h"
#include "dln.h"
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include "ruby/util.h"
Go to the source code of this file.
Data Structures | |
struct | ruby_cmdline_options |
struct | load_file_arg |
Macros | |
#define | MAXPATHLEN 1024 |
#define | O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) |
#define | DISABLE_RUBYGEMS 0 |
#define | DEFAULT_RUBYGEMS_ENABLED "enabled" |
#define | COMMA , |
#define | FEATURE_BIT(bit) (1U << feature_##bit) |
#define | EACH_FEATURES(X, SEP) |
#define | EACH_DEBUG_FEATURES(X, SEP) |
#define | AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */ |
#define | DEFINE_FEATURE(bit) feature_##bit |
#define | DEFINE_DEBUG_FEATURE(bit) feature_debug_##bit |
#define | DEBUG_BIT(bit) (1U << feature_debug_##bit) |
#define | DUMP_BIT(bit) (1U << dump_##bit) |
#define | DEFINE_DUMP(bit) dump_##bit |
#define | EACH_DUMPS(X, SEP) |
#define | src_encoding_index GET_VM()->src_encoding_index |
#define | forbid_setid(s) forbid_setid((s), opt) |
#define | M(shortopt, longopt, desc) |
#define | SHOW(m) show_usage_line((m).str, (m).namelen, (m).secondlen, help) |
#define | rubylib_path_new rb_str_new |
#define | UTF8_PATH 0 |
#define | IF_UTF8_PATH(t, f) f |
#define | INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index") |
#define | RUBY_RELATIVE(path, len) rubylib_path_new((path), (len)) |
#define | PREFIX_PATH() RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) |
#define | NAME_MATCH_P(name, str, len) ((len) < (int)sizeof(name) && name_match_p((name), (str), (len))) |
#define | UNSET_WHEN(name, bit, str, len) |
#define | SET_WHEN(name, bit, str, len) |
#define | LITERAL_NAME_ELEMENT(name) #name |
#define | SET_FEATURE(bit) if (NAME_MATCH_P(#bit, str, len)) {mask = FEATURE_BIT(bit); goto found;} |
#define | SET_WHEN_DEBUG(bit) SET_WHEN(#bit, DEBUG_BIT(bit), str, len) |
#define | SET_WHEN_DUMP(bit) SET_WHEN(#bit, DUMP_BIT(bit), str, len) |
#define | set_internal_encoding_once(opt, e, elen) set_option_encoding_once("default_internal", &(opt)->intern.enc.name, (e), (elen)) |
#define | set_external_encoding_once(opt, e, elen) set_option_encoding_once("default_external", &(opt)->ext.enc.name, (e), (elen)) |
#define | set_source_encoding_once(opt, e, elen) set_option_encoding_once("source", &(opt)->src.enc.name, (e), (elen)) |
#define | is_option_end(c, allow_hyphen) (!(c) || ((allow_hyphen) && (c) == '-') || (c) == '=') |
#define | check_envopt(name, allow_envopt) |
#define | need_argument(name, s, needs_arg, next_arg) |
#define | is_option_with_arg(name, allow_hyphen, allow_envopt) is_option_with_optarg(name, allow_hyphen, allow_envopt, Qtrue, Qtrue) |
#define | is_option_with_optarg(name, allow_hyphen, allow_envopt, needs_arg, next_arg) |
#define | set_encoding_part(type) |
#define | rb_progname (GET_VM()->progname) |
#define | rb_orig_progname (GET_VM()->orig_progname) |
#define | rb_define_readonly_boolean(name, val) rb_define_virtual_variable((name), (val) ? true_value : false_value, 0) |
#define | SET_COMPILE_OPTION(h, o, name) |
#define | MODE_TO_LOAD (O_RDONLY) |
Typedefs | |
typedef struct ruby_cmdline_options | ruby_cmdline_options_t |
Enumerations | |
enum | feature_flag_bits { EACH_FEATURES =(DEFINE_FEATURE, COMMA), feature_debug_flag_first, feature_debug_flag_begin = feature_debug_flag_first - 1, EACH_DEBUG_FEATURES =(DEFINE_DEBUG_FEATURE, COMMA), feature_flag_count } |
enum | dump_flag_bits { dump_version_v, EACH_DUMPS =(DEFINE_DUMP, COMMA), dump_exit_bits } |
enum | { COMPILATION_FEATURES, DEFAULT_FEATURES } |
Functions | |
char * | getenv () |
static void | init_ids (ruby_cmdline_options_t *) |
static ruby_cmdline_options_t * | cmdline_options_init (ruby_cmdline_options_t *opt) |
static NODE * | load_file (VALUE, VALUE, int, ruby_cmdline_options_t *) |
static void | forbid_setid (const char *, ruby_cmdline_options_t *) |
static void | show_usage_line (const char *str, unsigned int namelen, unsigned int secondlen, int help) |
static void | usage (const char *name, int help) |
static void | push_include (const char *path, VALUE(*filter)(VALUE)) |
void | ruby_push_include (const char *path, VALUE(*filter)(VALUE)) |
static VALUE | identical_path (VALUE path) |
static VALUE | locale_path (VALUE path) |
void | ruby_incpush (const char *path) |
static VALUE | expand_include_path (VALUE path) |
void | ruby_incpush_expand (const char *path) |
void | ruby_init_loadpath_safe (int safe_level) |
void | ruby_init_loadpath (void) |
static void | add_modules (VALUE *req_list, const char *mod) |
static void | require_libraries (VALUE *req_list) |
static const struct rb_block * | toplevel_context (rb_binding_t *bind) |
static void | process_sflag (int *sflag) |
static long | proc_options (long argc, char **argv, ruby_cmdline_options_t *opt, int envopt) |
static void | moreswitches (const char *s, ruby_cmdline_options_t *opt, int envopt) |
static int | name_match_p (const char *name, const char *str, size_t len) |
static void | feature_option (const char *str, int len, void *arg, const unsigned int enable) |
static void | enable_option (const char *str, int len, void *arg) |
static void | disable_option (const char *str, int len, void *arg) |
static void | debug_option (const char *str, int len, void *arg) |
static void | dump_option (const char *str, int len, void *arg) |
static void | set_option_encoding_once (const char *type, VALUE *name, const char *e, long elen) |
static void | ruby_init_prelude (void) |
static int | opt_enc_index (VALUE enc_name) |
static VALUE | false_value (void) |
static VALUE | true_value (void) |
static VALUE | uscore_get (void) |
static VALUE | rb_f_sub (int argc, VALUE *argv) |
static VALUE | rb_f_gsub (int argc, VALUE *argv) |
static VALUE | rb_f_chop (void) |
static VALUE | rb_f_chomp (int argc, VALUE *argv) |
static VALUE | process_options (int argc, char **argv, ruby_cmdline_options_t *opt) |
static void | warn_cr_in_shebang (const char *str, long len) |
static VALUE | load_file_internal (VALUE argp_v) |
static VALUE | open_load_file (VALUE fname_v, int *xflag) |
static VALUE | restore_load_file (VALUE arg) |
void * | rb_load_file (const char *fname) |
void * | rb_load_file_str (VALUE fname_v) |
void * | rb_parser_load_file (VALUE parser, VALUE fname_v) |
static VALUE | proc_argv0 (VALUE process) |
static VALUE | proc_setproctitle (VALUE process, VALUE title) |
static void | set_arg0 (VALUE val, ID id) |
static VALUE | external_str_new_cstr (const char *p) |
void | ruby_script (const char *name) |
Sets the current script name to this value. More... | |
void | ruby_set_script_name (VALUE name) |
Sets the current script name to this value. More... | |
static void | verbose_setter (VALUE val, ID id, void *data) |
static VALUE | opt_W_getter (ID id, void *data) |
void | ruby_prog_init (void) |
Defines built-in variables. More... | |
void | ruby_set_argv (int argc, char **argv) |
void * | ruby_process_options (int argc, char **argv) |
static void | fill_standard_fds (void) |
void | ruby_sysinit (int *argc, char ***argv) |
Initializes the process for ruby(1). More... | |
Variables | |
struct { | |
int argc | |
char ** argv | |
} | origarg |
VALUE | rb_argv0 |
#define AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */ |
#define check_envopt | ( | name, | |
allow_envopt | |||
) |
#define DEFAULT_RUBYGEMS_ENABLED "enabled" |
#define DUMP_BIT | ( | bit | ) | (1U << dump_##bit) |
Definition at line 93 of file ruby.c.
Referenced by load_file_internal(), proc_options(), and process_options().
#define EACH_DEBUG_FEATURES | ( | X, | |
SEP | |||
) |
Definition at line 77 of file ruby.c.
Referenced by debug_option().
#define EACH_DUMPS | ( | X, | |
SEP | |||
) |
#define EACH_FEATURES | ( | X, | |
SEP | |||
) |
Definition at line 68 of file ruby.c.
Referenced by feature_option().
#define FEATURE_BIT | ( | bit | ) | (1U << feature_##bit) |
Definition at line 67 of file ruby.c.
Referenced by process_options().
#define forbid_setid | ( | s | ) | forbid_setid((s), opt) |
Definition at line 180 of file ruby.c.
Referenced by cmdline_options_init(), load_file_internal(), proc_options(), and process_options().
Definition at line 415 of file ruby.c.
Referenced by process_options().
#define INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index") |
Definition at line 461 of file ruby.c.
Referenced by process_options(), and ruby_init_loadpath_safe().
#define is_option_end | ( | c, | |
allow_hyphen | |||
) | (!(c) || ((allow_hyphen) && (c) == '-') || (c) == '=') |
#define is_option_with_arg | ( | name, | |
allow_hyphen, | |||
allow_envopt | |||
) | is_option_with_optarg(name, allow_hyphen, allow_envopt, Qtrue, Qtrue) |
Referenced by proc_options().
#define is_option_with_optarg | ( | name, | |
allow_hyphen, | |||
allow_envopt, | |||
needs_arg, | |||
next_arg | |||
) |
Referenced by proc_options().
Definition at line 798 of file ruby.c.
Referenced by debug_option(), dump_option(), and feature_option().
#define M | ( | shortopt, | |
longopt, | |||
desc | |||
) |
Referenced by usage().
#define MAXPATHLEN 1024 |
Definition at line 45 of file ruby.c.
Referenced by process_options(), and ruby_init_loadpath_safe().
#define MODE_TO_LOAD (O_RDONLY) |
Referenced by open_load_file().
#define NAME_MATCH_P | ( | name, | |
str, | |||
len | |||
) | ((len) < (int)sizeof(name) && name_match_p((name), (str), (len))) |
Definition at line 783 of file ruby.c.
Referenced by feature_option().
#define need_argument | ( | name, | |
s, | |||
needs_arg, | |||
next_arg | |||
) |
#define PREFIX_PATH | ( | ) | RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) |
Referenced by ruby_init_loadpath_safe().
#define rb_define_readonly_boolean | ( | name, | |
val | |||
) | rb_define_virtual_variable((name), (val) ? true_value : false_value, 0) |
Definition at line 1346 of file ruby.c.
Referenced by process_options().
#define rb_orig_progname (GET_VM()->orig_progname) |
Definition at line 1331 of file ruby.c.
Referenced by proc_argv0(), ruby_script(), and ruby_set_script_name().
#define rb_progname (GET_VM()->progname) |
Definition at line 1330 of file ruby.c.
Referenced by process_options(), ruby_process_options(), ruby_prog_init(), ruby_script(), ruby_set_script_name(), and set_arg0().
#define RUBY_RELATIVE | ( | path, | |
len | |||
) | rubylib_path_new((path), (len)) |
Referenced by ruby_init_loadpath_safe().
#define rubylib_path_new rb_str_new |
Definition at line 270 of file ruby.c.
Referenced by push_include().
#define SET_COMPILE_OPTION | ( | h, | |
o, | |||
name | |||
) |
Referenced by process_options().
#define set_encoding_part | ( | type | ) |
Referenced by proc_options().
#define set_external_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("default_external", &(opt)->ext.enc.name, (e), (elen)) |
Definition at line 891 of file ruby.c.
Referenced by proc_options().
#define SET_FEATURE | ( | bit | ) | if (NAME_MATCH_P(#bit, str, len)) {mask = FEATURE_BIT(bit); goto found;} |
Referenced by feature_option().
#define set_internal_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("default_internal", &(opt)->intern.enc.name, (e), (elen)) |
Definition at line 889 of file ruby.c.
Referenced by proc_options().
#define set_source_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("source", &(opt)->src.enc.name, (e), (elen)) |
Definition at line 893 of file ruby.c.
Referenced by proc_options().
Referenced by debug_option().
Referenced by dump_option().
#define SHOW | ( | m | ) | show_usage_line((m).str, (m).namelen, (m).secondlen, help) |
Referenced by usage().
#define src_encoding_index GET_VM()->src_encoding_index |
Definition at line 149 of file ruby.c.
Referenced by cmdline_options_init(), load_file_internal(), and process_options().
typedef struct ruby_cmdline_options ruby_cmdline_options_t |
anonymous enum |
enum dump_flag_bits |
enum feature_flag_bits |
Definition at line 613 of file ruby.c.
References list, rb_ary_new(), rb_ary_push(), rb_str_new2, RBASIC_CLEAR_CLASS, and ruby_cmdline_options::req_list.
Referenced by proc_options().
|
static |
Definition at line 167 of file ruby.c.
References DEFAULT_FEATURES, ruby_cmdline_options::enc, ruby_cmdline_options::ext, ruby_cmdline_options::features, forbid_setid, init_ids(), ruby_cmdline_options::intern, load_file(), MEMZERO, ruby_cmdline_options::src, and src_encoding_index.
Referenced by rb_load_file_str(), rb_parser_load_file(), and ruby_process_options().
|
static |
Definition at line 854 of file ruby.c.
References EACH_DEBUG_FEATURES, list, LITERAL_NAME_ELEMENT, rb_warn(), SET_WHEN_DEBUG, and strlen().
Referenced by proc_options().
|
static |
|
static |
Definition at line 864 of file ruby.c.
References EACH_DUMPS, list, LITERAL_NAME_ELEMENT, rb_warn(), SET_WHEN_DUMP, and strlen().
Referenced by proc_options().
|
static |
Definition at line 360 of file ruby.c.
References Qnil, rb_file_expand_path(), and RSTRING_PTR.
Referenced by ruby_incpush_expand(), and ruby_init_loadpath_safe().
Definition at line 2068 of file ruby.c.
References NULL, rb_default_external_encoding(), rb_external_str_new_cstr(), and rb_utf8_str_new_cstr().
Referenced by ruby_script(), and ruby_set_argv().
|
static |
Definition at line 801 of file ruby.c.
References EACH_FEATURES, list, LITERAL_NAME_ELEMENT, NAME_MATCH_P, rb_eRuntimeError, rb_exc_new_str(), rb_exc_raise(), rb_sprintf(), rb_str_cat_cstr(), rb_warn(), SET_FEATURE, and strlen().
Referenced by disable_option(), and enable_option().
|
static |
|
static |
Definition at line 2120 of file ruby.c.
References rb_eSecurityError, rb_raise(), ruby_cmdline_options::safe_level, and ruby_cmdline_options::setids.
char* getenv | ( | ) |
Referenced by process_options(), and ruby_init_loadpath_safe().
Definition at line 342 of file ruby.c.
Referenced by ruby_init_loadpath_safe().
|
static |
Definition at line 2104 of file ruby.c.
References getegid(), geteuid(), getgid(), getuid(), ruby_cmdline_options::safe_level, and ruby_cmdline_options::setids.
Referenced by cmdline_options_init().
|
static |
Definition at line 1978 of file ruby.c.
References load_file_arg::f, load_file_arg::fname, load_file_internal(), open_load_file(), load_file_arg::opt, load_file_arg::parser, rb_ensure(), rb_str_encode_ospath(), restore_load_file(), ruby_cmdline_options::script, load_file_arg::script, and load_file_arg::xflag.
Referenced by cmdline_options_init(), process_options(), rb_load_file_str(), and rb_parser_load_file().
Definition at line 1752 of file ruby.c.
References CONST_ID, ruby_cmdline_options::dump, DUMP_BIT, ruby_cmdline_options::enc, ruby_cmdline_options::ext, f, load_file_arg::f, FALSE, load_file_arg::fname, forbid_setid, INT2FIX, ruby_cmdline_options::intern, len, moreswitches(), NIL_P, load_file_arg::opt, opt_enc_index(), load_file_arg::parser, Qnil, rb_ascii8bit_encoding(), rb_enc_associate(), rb_enc_from_encoding(), rb_enc_from_index(), rb_funcall(), rb_io_close(), rb_io_getbyte(), rb_io_gets(), rb_io_ungetbyte(), rb_loaderror(), rb_locale_encoding(), rb_parser_compile_file_path(), rb_parser_compile_string_path(), rb_parser_encoding(), rb_parser_end_seen_p(), rb_stdin, rb_str_new(), rb_str_new2, rb_str_new_cstr(), rb_utf8_encoding(), ruby_cmdline_options::req_list, require_libraries(), RSTRING_GETMEM, ruby_engine, ruby_set_script_name(), ruby_cmdline_options::script, load_file_arg::script, ruby_cmdline_options::script_name, ruby_cmdline_options::src, src_encoding_index, strstr(), warn_cr_in_shebang(), ruby_cmdline_options::warning, ruby_cmdline_options::xflag, and load_file_arg::xflag.
Referenced by load_file().
Definition at line 347 of file ruby.c.
References rb_enc_associate(), and rb_locale_encoding().
Referenced by ruby_incpush().
|
static |
Definition at line 719 of file ruby.c.
References argc, argv, ISSPACE, len, memcpy, proc_options(), rb_str_cat(), rb_str_resize(), rb_str_tmp_new(), RSTRING_LEN, RSTRING_PTR, and strlen().
Referenced by load_file_internal(), and process_options().
Definition at line 766 of file ruby.c.
References ISALNUM, ruby_cmdline_options::name, and TOLOWER.
Definition at line 1875 of file ruby.c.
References errno, f, F_SETFL, fcntl(), load_file_arg::fname, isdirsep, MODE_TO_LOAD, O_BINARY, rb_cloexec_open(), rb_gc_for_fd(), rb_io_fdopen(), rb_load_fail(), rb_stdin, rb_thread_wait_fd(), rb_update_max_fd(), RSTRING_LEN, ruby_is_fd_loadable(), strerror(), StringValueCStr, and STRNCASECMP.
Referenced by load_file().
|
static |
Definition at line 1316 of file ruby.c.
References rb_enc_dummy_p(), rb_enc_find_index(), rb_enc_from_index(), rb_eRuntimeError, rb_raise(), and RSTRING_PTR.
Referenced by load_file_internal(), and process_options().
Definition at line 2026 of file ruby.c.
References rb_orig_progname.
Referenced by ruby_prog_init().
|
static |
Definition at line 897 of file ruby.c.
References add_modules(), argc, argv, debug_option(), disable_option(), ruby_cmdline_options::do_line, ruby_cmdline_options::do_loop, ruby_cmdline_options::do_print, ruby_cmdline_options::do_search, ruby_cmdline_options::do_split, ruby_cmdline_options::dump, DUMP_BIT, dump_option(), ruby_cmdline_options::e_script, enable_option(), ruby_cmdline_options::enc, enc_name(), ruby_cmdline_options::ext, ruby_cmdline_options::features, forbid_setid, is_option_with_arg, is_option_with_optarg, ISPRINT, Qfalse, Qnil, Qtrue, rb_eRuntimeError, rb_fatal(), rb_fs, rb_output_rs, rb_raise(), rb_reg_new(), rb_rs, rb_str_cat2(), rb_str_new(), rb_str_new2, ruby_cmdline_options::req_list, ruby_debug, ruby_each_words(), ruby_incpush_expand(), ruby_set_inplace_mode(), ruby_verbose, ruby_cmdline_options::safe_level, scan_oct, ruby_cmdline_options::script, set_encoding_part, set_external_encoding_once, set_internal_encoding_once, set_source_encoding_once, ruby_cmdline_options::sflag, ruby_cmdline_options::src, strlen(), TRUE, usage(), ruby_cmdline_options::verbose, version, ruby_cmdline_options::warning, ruby_cmdline_options::xflag, and yydebug.
Referenced by moreswitches(), process_options(), and process_sflag().
Definition at line 2049 of file ruby.c.
References RSTRING_LENINT, RSTRING_PTR, setproctitle(), and StringValue.
Referenced by ruby_prog_init(), and set_arg0().
|
static |
Definition at line 1438 of file ruby.c.
References COMPILATION_FEATURES, DEFAULT_FEATURES, dln_find_file_r, ruby_cmdline_options::do_line, ruby_cmdline_options::do_loop, ruby_cmdline_options::do_print, ruby_cmdline_options::do_search, ruby_cmdline_options::do_split, ruby_cmdline_options::dump, DUMP_BIT, dump_exit_bits, ruby_cmdline_options::e_script, ruby_cmdline_options::enc, ruby_cmdline_options::ext, FEATURE_BIT, ruby_cmdline_options::features, forbid_setid, GET_VM, GetBindingPtr, getenv(), IF_UTF8_PATH, Init_enc(), Init_ext(), INITIAL_LOAD_PATH_MARK, ruby_cmdline_options::intern, load_file(), mark(), MAXPATHLEN, moreswitches(), opt_enc_index(), origarg, PATH_ENV, proc_options(), process_sflag(), Qfalse, Qnil, Qtrue, RARRAY_AREF, RARRAY_ASET, RARRAY_LEN, rb_attr_get(), rb_cISeq, rb_cObject, rb_const_get(), rb_default_internal_encoding(), rb_define_global_function(), rb_define_module(), rb_define_readonly_boolean, rb_enc_associate(), rb_enc_from_encoding(), rb_enc_from_index(), rb_enc_set_default_external(), rb_enc_set_default_internal(), rb_f_chomp(), rb_f_chop(), rb_f_gsub(), rb_f_sub(), rb_funcallv, rb_hash_new(), rb_intern, rb_intern_const, rb_io_flush(), rb_io_write(), rb_iseq_disasm(), rb_iseq_new_main(), rb_ivar_set(), rb_locale_encoding(), rb_obj_freeze(), rb_parser_append_print(), rb_parser_compile_string(), rb_parser_dump_tree(), rb_parser_new(), rb_parser_set_context(), rb_parser_set_yydebug(), rb_parser_while_loop(), rb_progname, rb_realpath_internal(), rb_set_safe_level(), rb_stdio_set_default_encoding(), rb_stdout, rb_str_conv_enc(), rb_str_dup(), rb_str_new_cstr(), rb_utf8_encoding(), rb_warning(), ruby_cmdline_options::req_list, require_libraries(), RSTRING_PTR, ruby_gc_set_params(), ruby_init_loadpath_safe(), ruby_init_prelude(), ruby_set_argv(), ruby_set_script_name(), ruby_show_copyright, ruby_show_version(), ruby_cmdline_options::safe_level, ruby_cmdline_options::script, ruby_cmdline_options::script_name, SET_COMPILE_OPTION, ruby_cmdline_options::sflag, ruby_cmdline_options::src, src_encoding_index, toplevel_context(), TRUE, usage(), ruby_cmdline_options::verbose, version, vm_block_iseq(), ruby_cmdline_options::xflag, and yydebug.
Referenced by ruby_process_options().
|
static |
Definition at line 653 of file ruby.c.
References argc, argv, FALSE, ISALNUM, proc_options(), Qtrue, RARRAY_CONST_PTR, RARRAY_LEN, rb_argv, rb_ary_shift(), rb_class_new_instance(), rb_eNameError, rb_exc_raise(), rb_gv_set(), rb_str_cat(), rb_str_cat2(), rb_str_new2, strchr(), StringValuePtr, and TRUE.
Referenced by process_options().
Definition at line 273 of file ruby.c.
References buf, CharNext, GET_VM, len, PATH_SEP_CHAR, rb_ary_push(), rb_str_new(), rb_str_resize(), RSTRING_PTR, and rubylib_path_new.
Referenced by ruby_push_include().
Definition at line 1430 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
|
static |
Definition at line 1410 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
Definition at line 1392 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
Definition at line 1373 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
void* rb_load_file | ( | const char * | fname | ) |
Definition at line 1992 of file ruby.c.
References rb_load_file_str(), and rb_str_new_cstr().
void* rb_load_file_str | ( | VALUE | fname_v | ) |
Definition at line 1999 of file ruby.c.
References cmdline_options_init(), load_file(), load_file_arg::opt, and rb_parser_new().
Referenced by rb_load_file().
Definition at line 2007 of file ruby.c.
References cmdline_options_init(), load_file(), and load_file_arg::opt.
Referenced by rb_load_internal0().
|
static |
Definition at line 628 of file ruby.c.
References CONST_ID, list, OBJ_FREEZE, RARRAY_LEN, rb_ary_shift(), rb_cString, rb_default_external_encoding(), rb_enc_associate(), rb_funcallv, rb_vm_top_self(), RBASIC_SET_CLASS_RAW, ruby_cmdline_options::req_list, and require.
Referenced by load_file_internal(), and process_options().
Definition at line 1951 of file ruby.c.
References f, load_file_arg::f, Qnil, rb_define_global_const(), rb_io_close(), rb_stdin, and load_file_arg::script.
Referenced by load_file().
void ruby_incpush_expand | ( | const char * | path | ) |
Definition at line 371 of file ruby.c.
References expand_include_path(), ruby_push_include(), and TRUE.
Referenced by proc_options().
void ruby_init_loadpath_safe | ( | int | safe_level | ) |
Definition at line 464 of file ruby.c.
References expand_include_path(), GET_VM, getenv(), identical_path(), INITIAL_LOAD_PATH_MARK, L, len, MAXPATHLEN, NULL, PREFIX_PATH, rb_ary_push(), rb_ascii8bit_encoding(), rb_cObject, rb_const_set(), rb_enc_path_last_separator(), rb_fatal(), rb_intern_const, rb_ivar_set(), rb_obj_freeze(), rb_str_modify_expand(), rb_str_new(), rb_str_resize(), rb_str_set_len(), rb_utf8_str_new(), RSTRING_EMBED_LEN_MAX, RSTRING_PTR, ruby_exec_prefix, ruby_initial_load_paths, ruby_push_include(), RUBY_RELATIVE, strlcpy(), strlen(), STRNCASECMP, and strrchr().
Referenced by process_options(), and ruby_init_loadpath().
|
static |
Definition at line 1309 of file ruby.c.
References Init_prelude(), rb_cObject, rb_const_remove(), and rb_intern_const.
Referenced by process_options().
Definition at line 334 of file ruby.c.
References push_include().
Referenced by ruby_incpush(), ruby_incpush_expand(), and ruby_init_loadpath_safe().
Definition at line 2059 of file ruby.c.
References origarg, proc_setproctitle(), rb_eRuntimeError, rb_mProcess, rb_progname, rb_raise(), and rb_str_new_frozen().
Referenced by ruby_prog_init().
|
static |
Definition at line 874 of file ruby.c.
References INT2FIX, PRIsVALUE, rb_eRuntimeError, rb_funcall(), rb_intern, rb_raise(), rb_str_new(), and strlen().
|
static |
|
static |
Definition at line 647 of file ruby.c.
References rb_binding_t::block.
Referenced by process_options().
|
static |
Definition at line 200 of file ruby.c.
References DEFAULT_RUBYGEMS_ENABLED, M, numberof, and SHOW.
Referenced by proc_options(), and process_options().
|
static |
Definition at line 1350 of file ruby.c.
References NIL_P, rb_eTypeError, rb_lastline_get(), rb_obj_classname(), rb_raise(), RB_TYPE_P, and T_STRING.
Referenced by rb_f_chomp(), rb_f_chop(), rb_f_gsub(), and rb_f_sub().
|
static |
int argc |
Definition at line 183 of file ruby.c.
Referenced by addrinfo_s_udp(), apply2files(), argf_block_call_i(), argf_block_call_line_i(), argf_forward_call(), argf_getpartial(), ary_ensure_room_for_unshift(), ary_memcpy0(), BigDecimal_s_allocate(), build_postexe_iseq(), call_cfunc_m1(), collect_all(), collect_i(), compat_init_setproctitle(), core_hash_merge(), count_iter_i(), cycle_i(), date_s_valid_commercial_p(), dir_globs(), drop_i(), drop_while_i(), each_val_i(), each_with_index_i(), enum_zip(), enumerator_initialize(), env_values_at(), exit_initialize(), extract_raise_opts(), fdbm_values_at(), fgdbm_values_at(), find_all_i(), find_i(), find_index_iter_i(), flat_map_i(), flock_winnt(), fsdbm_values_at(), function_call(), grep_iter_i(), group_by_i(), gzfile_wrap(), Init_openssl(), initialize(), invoke_iseq_block_from_c(), io_getch(), io_wait_readwrite(), iseq_build_from_ary_body(), iseq_compile_each(), iseq_optimize(), lazy_add_method(), lazy_to_enum(), lazy_uniq_func(), lazy_uniq_iter(), lazy_zip(), main(), match_values_at(), max_by_i(), member_i(), method_missing(), min_by_i(), minmax_by_i(), mInteger_to_json(), moreswitches(), new_insn_body(), new_insn_core(), nucomp_s_alloc(), num_step_size(), nurat_s_alloc(), obj_to_enum(), old_to_new(), open_key_args(), ossl_cipher_is_authenticated(), parser_compile_error(), partition_i(), pipe_open_s(), proc_options(), process_sflag(), rand_range(), rb_add_method_cfunc(), rb_apply(), rb_ary_concat_multi(), rb_ary_zip(), rb_block_call(), rb_block_lambda(), rb_call(), rb_check_argv(), rb_check_arity(), rb_check_block_call(), rb_check_funcall_with_hook(), rb_enumeratorize(), rb_exec_fillarg(), rb_execarg_commandline(), rb_f_kill(), rb_f_p(), rb_f_p_internal(), rb_f_send(), rb_file_chmod(), rb_get_values_at(), rb_hash_fetch_values(), rb_hash_s_create(), rb_hash_values_at(), rb_io_print(), rb_io_puts(), rb_io_s_foreach(), rb_io_s_popen(), rb_iseq_disasm(), rb_lambda_call(), rb_longjmp(), rb_mod_attr_accessor(), rb_mod_attr_reader(), rb_mod_attr_writer(), rb_mod_include(), rb_mod_modfunc(), rb_mod_prepend(), rb_mod_remove_method(), rb_mod_undef_method(), rb_obj_dig(), rb_obj_extend(), rb_obj_info_dump(), rb_reg_s_union(), rb_scan_args(), rb_str_concat_multi(), rb_str_count(), rb_str_delete_bang(), rb_str_encode(), rb_str_end_with(), rb_str_format(), rb_str_prepend_multi(), rb_str_slice_bang(), rb_str_squeeze_bang(), rb_str_start_with(), rb_struct_initialize_m(), rb_struct_s_def(), rb_vmdebug_stack_dump_th(), rb_w32_asynchronize(), reject_i(), ruby_set_argv(), ruby_sysinit(), set_const_visibility(), set_method_visibility(), setup_args(), setup_method_cfunc_struct(), setup_narg(), sock_initialize(), sort_by_i(), take_i(), take_while_i(), tracepoint_new_s(), uniq_iter(), valid_civil_sub(), valid_commercial_sub(), valid_jd_sub(), valid_ordinal_sub(), vm_bind_update_env(), vm_call0(), vm_call0_cfunc_with_frame(), vm_call_bmethod(), vm_call_cfunc_with_frame(), vm_call_method_missing(), vm_call_opt_call(), vm_invoke_ifunc_block(), vm_invoke_symbol_block(), vm_yield_setup_args(), weeknumber_v(), with_gvl_callback(), zip_ary(), and zip_i().
char** argv |
Definition at line 184 of file ruby.c.
Referenced by addrinfo_s_udp(), asn1time_to_time(), BigDecimal_s_allocate(), call_cfunc_m1(), call_trace_func(), collect_all(), collect_i(), count_iter_i(), cycle_i(), date_s_valid_commercial_p(), drop_i(), each_pair_i_fast(), each_with_index_i(), exit_initialize(), ffi_prep_args(), find_index_iter_i(), flat_map_i(), gzfile_wrap(), Init_openssl(), io_getch(), iseq_build_from_ary_body(), lazy_zip_func(), lazyenum_yield_values(), member_i(), mInteger_to_json(), moreswitches(), new_insn_body(), new_insn_core(), nucomp_s_alloc(), num_step_size(), nurat_s_alloc(), old_to_new(), ossl_cipher_is_authenticated(), parser_compile_error(), proc_exec_cmd(), proc_options(), process_sflag(), rand_range(), rb_apply(), rb_ary_dig(), rb_block_call(), rb_block_lambda(), rb_call(), rb_check_block_call(), rb_check_deadlock(), rb_check_funcall_with_hook(), rb_enumeratorize(), rb_execarg_commandline(), rb_execarg_init(), rb_f_send(), rb_fiber_start(), rb_fiddle_new_function(), rb_file_chmod(), rb_funcall(), rb_hash_dig(), rb_lambda_call(), rb_longjmp(), rb_name_error(), rb_name_error_str(), rb_obj_dig(), rb_obj_info_dump(), rb_spawn_process(), rb_str_encode(), rb_str_format(), rb_struct_dig(), rb_struct_s_def(), rb_threadptr_signal_exit(), rb_threadptr_signal_raise(), rb_w32_asynchronize(), rb_yield_values(), ruby_sysinit(), save_env_i(), security(), send_internal(), set_argv(), sock_initialize(), take_i(), take_while_i(), uniq_iter(), valid_civil_sub(), valid_commercial_sub(), valid_jd_sub(), valid_ordinal_sub(), vm_bind_update_env(), vm_call0(), vm_call_bmethod(), vm_call_cfunc_with_frame(), vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), vm_call_method_missing(), vm_call_method_nome(), vm_call_opt_call(), w32_aspawn_flags(), weeknumber_v(), zip_ary(), and zip_i().
struct { ... } origarg |
Referenced by process_options(), ruby_init_loadpath(), ruby_set_argv(), ruby_sysinit(), and set_arg0().