#include "ruby/ruby.h"#include "ruby/encoding.h"#include "internal.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 | cmdline_options |
| struct | load_file_arg |
Defines | |
| #define | DISABLE_RUBYGEMS 0 |
| #define | DEFAULT_RUBYGEMS_ENABLED "enabled" |
| #define | DISABLE_BIT(bit) (1U << disable_##bit) |
| #define | DUMP_BIT(bit) (1U << dump_##bit) |
| #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) |
| #define | rubylib_mangled_path rb_str_new |
| #define | RUBY_RELATIVE(path, len) rubylib_mangled_path((path), (len)) |
| #define | PREFIX_PATH() RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) |
| #define | NAME_MATCH_P(name, str, len) ((len) < (int)sizeof(name) && strncmp((str), (name), (len)) == 0) |
| #define | UNSET_WHEN(name, bit, str, len) |
| #define | SET_WHEN(name, bit, str, len) |
| #define | UNSET_WHEN_DISABLE(bit) UNSET_WHEN(#bit, DISABLE_BIT(bit), str, len) |
| #define | SET_WHEN_DISABLE(bit) SET_WHEN(#bit, DISABLE_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) |
| #define | is_option_with_arg(name, allow_hyphen, allow_envopt) is_option_with_optarg(name, allow_hyphen, allow_envopt, Qtrue) |
| #define | is_option_with_optarg(name, allow_hyphen, allow_envopt, needs_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 | PREPARE_PARSE_MAIN(expr) |
Enumerations | |
| enum | disable_flag_bits { disable_gems, disable_rubyopt, disable_flag_count } |
| enum | dump_flag_bits { dump_version, dump_version_v, dump_copyright, dump_usage, dump_help, dump_yydebug, dump_syntax, dump_parsetree, dump_parsetree_with_comment, dump_insns, dump_flag_count } |
Functions | |
| char * | getenv () |
| static void | init_ids (struct cmdline_options *) |
| static struct cmdline_options * | cmdline_options_init (struct cmdline_options *opt) |
| static NODE * | load_file (VALUE, VALUE, int, struct cmdline_options *) |
| static void | forbid_setid (const char *, struct cmdline_options *) |
| 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 rb_env_t * | toplevel_context (VALUE toplevel_binding) |
| static void | process_sflag (int *sflag) |
| static long | proc_options (long argc, char **argv, struct cmdline_options *opt, int envopt) |
| static void | moreswitches (const char *s, struct cmdline_options *opt, int envopt) |
| static void | enable_option (const char *str, int len, void *arg) |
| static void | disable_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) |
| void | Init_enc (void) |
| static VALUE | process_options (int argc, char **argv, struct cmdline_options *opt) |
| static VALUE | load_file_internal (VALUE arg) |
| static VALUE | restore_lineno (VALUE lineno) |
| void * | rb_load_file (const char *fname) |
| void * | rb_load_file_str (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) |
| void | ruby_script (const char *name) |
| Sets the current script name to this value. | |
| void | ruby_set_script_name (VALUE name) |
| Sets the current script name to this value. | |
| 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. | |
| 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). | |
Variables | |
| struct { | |
| int argc | |
| char ** argv | |
| } | origarg |
| VALUE | rb_argv0 |
| #define check_envopt | ( | name, | |||
| allow_envopt | ) |
(((allow_envopt) || !envopt) ? (void)0 : \
rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --" name))
| #define DEFAULT_RUBYGEMS_ENABLED "enabled" |
| #define DISABLE_BIT | ( | bit | ) | (1U << disable_##bit) |
Definition at line 64 of file ruby.c.
Referenced by cmdline_options_init(), and process_options().
| #define DUMP_BIT | ( | bit | ) | (1U << dump_##bit) |
Definition at line 71 of file ruby.c.
Referenced by proc_options(), and process_options().
| #define forbid_setid | ( | s | ) | forbid_setid((s), opt) |
Definition at line 128 of file ruby.c.
Referenced by load_file_internal(), proc_options(), and process_options().
| #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) |
Referenced by proc_options().
| #define is_option_with_optarg | ( | name, | |||
| allow_hyphen, | |||||
| allow_envopt, | |||||
| needs_arg | ) |
(strncmp((name), s, n = sizeof(name) - 1) == 0 && is_option_end(s[n], (allow_hyphen)) ? \ (check_envopt(name, (allow_envopt)), s += n, \ need_argument(name, s, needs_arg), 1) : 0)
| #define M | ( | shortopt, | |||
| longopt, | |||||
| desc | ) |
{ \
shortopt " " longopt " " desc, \
(unsigned short)sizeof(shortopt), \
(unsigned short)sizeof(longopt), \
}
| #define NAME_MATCH_P | ( | name, | |||
| str, | |||||
| len | ) | ((len) < (int)sizeof(name) && strncmp((str), (name), (len)) == 0) |
Definition at line 701 of file ruby.c.
Referenced by disable_option(), and enable_option().
| #define need_argument | ( | name, | |||
| s, | |||||
| needs_arg | ) |
((*(s)++ ? !*(s) : (!--argc || !((s) = *++argv))) && (needs_arg) ? \ rb_raise(rb_eRuntimeError, "missing argument for --" name) \ : (void)0)
| #define PREFIX_PATH | ( | ) | RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) |
Referenced by ruby_init_loadpath_safe().
| #define PREPARE_PARSE_MAIN | ( | expr | ) |
do { \ rb_env_t *env = toplevel_context(toplevel_binding); \ th->parse_in_eval--; \ th->base_block = &env->block; \ expr; \ th->parse_in_eval++; \ th->base_block = 0; \ } while (0)
Referenced by process_options().
| #define rb_orig_progname (GET_VM()->orig_progname) |
Definition at line 1211 of file ruby.c.
Referenced by proc_argv0(), ruby_script(), and ruby_set_script_name().
| #define rb_progname (GET_VM()->progname) |
Definition at line 1210 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_mangled_path((path), (len)) |
Referenced by ruby_init_loadpath_safe().
| #define rubylib_mangled_path rb_str_new |
Definition at line 251 of file ruby.c.
Referenced by push_include(), and ruby_init_loadpath_safe().
| #define set_encoding_part | ( | type | ) |
if (!(p = strchr(s, ':'))) { \ set_##type##_encoding_once(opt, s, 0); \ break; \ } \ else if (p > s) { \ set_##type##_encoding_once(opt, s, p-s); \ }
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 777 of file ruby.c.
Referenced by proc_options().
| #define set_internal_encoding_once | ( | opt, | |||
| e, | |||||
| elen | ) | set_option_encoding_once("default_internal", &(opt)->intern.enc.name, (e), (elen)) |
Definition at line 775 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 779 of file ruby.c.
Referenced by proc_options().
| #define SET_WHEN | ( | name, | |||
| bit, | |||||
| str, | |||||
| len | ) |
if (NAME_MATCH_P((name), (str), (len))) { \ *(unsigned int *)arg |= (bit); \ return; \ }
| #define SET_WHEN_DISABLE | ( | bit | ) | SET_WHEN(#bit, DISABLE_BIT(bit), str, len) |
Referenced by disable_option().
| #define SET_WHEN_DUMP | ( | bit | ) | SET_WHEN(#bit, DUMP_BIT(bit), str, len) |
Referenced by dump_option().
| #define SHOW | ( | m | ) |
do { \ int wrap = help && (m).namelen + (m).secondlen - 2 > w; \ printf(" %.*s%-*.*s%-*s%s\n", (m).namelen-1, (m).str, \ (wrap ? 0 : w - (m).namelen + 1), \ (help ? (m).secondlen-1 : 0), (m).str + (m).namelen, \ (wrap ? w + 3 : 0), (wrap ? "\n" : ""), \ (m).str + (m).namelen + (m).secondlen); \ } while (0)
Referenced by usage().
| #define src_encoding_index GET_VM()->src_encoding_index |
Definition at line 110 of file ruby.c.
Referenced by cmdline_options_init(), load_file_internal(), and process_options().
| #define UNSET_WHEN | ( | name, | |||
| bit, | |||||
| str, | |||||
| len | ) |
if (NAME_MATCH_P((name), (str), (len))) { \ *(unsigned int *)arg &= ~(bit); \ return; \ }
| #define UNSET_WHEN_DISABLE | ( | bit | ) | UNSET_WHEN(#bit, DISABLE_BIT(bit), str, len) |
Referenced by enable_option().
| enum disable_flag_bits |
| enum dump_flag_bits |
| static void add_modules | ( | VALUE * | req_list, | |
| const char * | mod | |||
| ) | [static] |
Definition at line 539 of file ruby.c.
References list, rb_ary_new(), rb_ary_push(), rb_str_new2, and RBASIC_CLEAR_CLASS.
Referenced by proc_options().
| static struct cmdline_options* cmdline_options_init | ( | struct cmdline_options * | opt | ) | [static, read] |
Definition at line 113 of file ruby.c.
References cmdline_options::disable, DISABLE_BIT, cmdline_options::enc, cmdline_options::ext, init_ids(), cmdline_options::intern, MEMZERO, cmdline_options::src, and src_encoding_index.
Referenced by rb_load_file_str(), and ruby_process_options().
| static void disable_option | ( | const char * | str, | |
| int | len, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 730 of file ruby.c.
References NAME_MATCH_P, rb_warn(), and SET_WHEN_DISABLE.
Referenced by proc_options().
| static void dump_option | ( | const char * | str, | |
| int | len, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 743 of file ruby.c.
References rb_warn(), SET_WHEN_DUMP, usage(), version(), and yydebug.
Referenced by proc_options().
| static void enable_option | ( | const char * | str, | |
| int | len, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 717 of file ruby.c.
References NAME_MATCH_P, rb_warn(), and UNSET_WHEN_DISABLE.
Referenced by proc_options().
| static VALUE expand_include_path | ( | VALUE | path | ) | [static] |
Definition at line 343 of file ruby.c.
References Qnil, rb_file_expand_path(), and RSTRING_PTR.
Referenced by ruby_incpush_expand(), and ruby_init_loadpath_safe().
| static VALUE false_value | ( | void | ) | [static] |
| static void fill_standard_fds | ( | void | ) | [static] |
| static void forbid_setid | ( | const char * | s, | |
| struct cmdline_options * | opt | |||
| ) | [static] |
Definition at line 1878 of file ruby.c.
References rb_eSecurityError, rb_raise(), cmdline_options::safe_level, and cmdline_options::setids.
| char* getenv | ( | ) |
| static VALUE identical_path | ( | VALUE | path | ) | [static] |
Definition at line 325 of file ruby.c.
Referenced by ruby_init_loadpath_safe().
| void Init_enc | ( | void | ) |
Definition at line 7 of file dmyext.c.
Referenced by init_libraries_internal(), and process_options().
| static void init_ids | ( | struct cmdline_options * | opt | ) | [static] |
Definition at line 1862 of file ruby.c.
References getegid(), geteuid(), getgid(), getuid(), cmdline_options::safe_level, and cmdline_options::setids.
Referenced by cmdline_options_init().
| static NODE * load_file | ( | VALUE | parser, | |
| VALUE | fname, | |||
| int | script, | |||
| struct cmdline_options * | opt | |||
| ) | [static] |
Definition at line 1758 of file ruby.c.
References load_file_arg::fname, load_file_internal(), load_file_arg::opt, load_file_arg::parser, rb_ensure(), rb_gv_get(), restore_lineno(), and load_file_arg::script.
Referenced by process_options(), and rb_load_file_str().
| static VALUE load_file_internal | ( | VALUE | arg | ) | [static] |
Definition at line 1584 of file ruby.c.
References CONST_ID, cmdline_options::enc, errno, cmdline_options::ext, f, FALSE, load_file_arg::fname, forbid_setid, fstat, INT2FIX, cmdline_options::intern, moreswitches(), NIL_P, O_BINARY, load_file_arg::opt, opt_enc_index(), load_file_arg::parser, Qnil, rb_ascii8bit_encoding(), rb_cloexec_open(), rb_define_global_const(), rb_enc_associate(), rb_enc_from_encoding(), rb_enc_from_index(), rb_funcall(), rb_io_close(), rb_io_fdopen(), rb_io_getbyte(), rb_io_gets(), rb_io_ungetbyte(), rb_load_fail(), 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_encode_ospath(), rb_str_new(), rb_str_new2, rb_str_new_cstr(), rb_update_max_fd(), rb_utf8_encoding(), cmdline_options::req_list, require_libraries(), RSTRING_LEN, RSTRING_PTR, ruby_set_script_name(), S_ISDIR, load_file_arg::script, cmdline_options::script_name, cmdline_options::src, src_encoding_index, stat, STRCASECMP, strerror(), StringValueCStr, strrchr(), strstr(), and cmdline_options::xflag.
Referenced by load_file().
| static VALUE locale_path | ( | VALUE | path | ) | [static] |
Definition at line 330 of file ruby.c.
References rb_enc_associate(), and rb_locale_encoding().
Referenced by ruby_incpush().
| static void moreswitches | ( | const char * | s, | |
| struct cmdline_options * | opt, | |||
| int | envopt | |||
| ) | [static] |
Definition at line 655 of file ruby.c.
References argc, argv, ISSPACE, 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().
| static int opt_enc_index | ( | VALUE | enc_name | ) | [static] |
Definition at line 1196 of file ruby.c.
References rb_enc_find_index(), rb_enc_from_index(), rb_eRuntimeError, rb_raise(), and RSTRING_PTR.
Referenced by load_file_internal(), and process_options().
| static VALUE opt_W_getter | ( | ID | id, | |
| void * | data | |||
| ) | [static] |
| static VALUE proc_argv0 | ( | VALUE | process | ) | [static] |
Definition at line 1795 of file ruby.c.
References rb_orig_progname.
Referenced by ruby_prog_init().
| static long proc_options | ( | long | argc, | |
| char ** | argv, | |||
| struct cmdline_options * | opt, | |||
| int | envopt | |||
| ) | [static] |
Definition at line 783 of file ruby.c.
References add_modules(), cmdline_options::disable, disable_option(), cmdline_options::do_line, cmdline_options::do_loop, cmdline_options::do_print, cmdline_options::do_search, cmdline_options::do_split, cmdline_options::dump, DUMP_BIT, dump_option(), cmdline_options::e_script, enable_option(), cmdline_options::enc, enc_name(), cmdline_options::ext, forbid_setid, is_option_with_arg, 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, cmdline_options::req_list, ruby_debug, ruby_each_words(), ruby_incpush_expand(), ruby_set_inplace_mode(), ruby_verbose, cmdline_options::safe_level, scan_oct, cmdline_options::script, set_encoding_part, set_external_encoding_once, set_internal_encoding_once, set_source_encoding_once, cmdline_options::sflag, cmdline_options::src, strlen(), TRUE, usage(), cmdline_options::verbose, version(), cmdline_options::xflag, and yydebug.
Referenced by moreswitches(), and process_options().
| static VALUE proc_setproctitle | ( | VALUE | process, | |
| VALUE | title | |||
| ) | [static] |
Definition at line 1818 of file ruby.c.
References RSTRING_LENINT, RSTRING_PTR, setproctitle(), and StringValue.
Referenced by ruby_prog_init(), and set_arg0().
| static VALUE process_options | ( | int | argc, | |
| char ** | argv, | |||
| struct cmdline_options * | opt | |||
| ) | [static] |
Definition at line 1321 of file ruby.c.
References cmdline_options::disable, DISABLE_BIT, dln_find_file_r, cmdline_options::do_line, cmdline_options::do_loop, cmdline_options::do_print, cmdline_options::do_search, cmdline_options::do_split, cmdline_options::dump, DUMP_BIT, cmdline_options::e_script, cmdline_options::enc, cmdline_options::ext, FL_TAINT, FL_UNSET, forbid_setid, GET_THREAD(), GET_VM, getenv, Init_enc(), Init_ext(), cmdline_options::intern, load_file(), MAXPATHLEN, moreswitches(), OBJ_TAINT, opt_enc_index(), origarg, PATH_ENV, PREPARE_PARSE_MAIN, proc_options(), process_sflag(), Qfalse, Qnil, Qtrue, Qundef, RARRAY_AREF, RARRAY_ASET, RARRAY_LEN, rb_argv, rb_cObject, rb_const_get(), rb_default_internal_encoding(), rb_define_global_function(), rb_define_module(), rb_enc_associate(), rb_enc_find_index(), 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_intern, rb_io_flush(), rb_io_write(), rb_iseq_new_main(), rb_locale_encoding(), rb_obj_freeze(), rb_parser_append_print(), rb_parser_compile_string(), rb_parser_dump_tree(), rb_parser_new(), rb_parser_set_yydebug(), rb_parser_while_loop(), rb_progname, rb_realpath_internal(), rb_stdio_set_default_encoding(), rb_stdout, rb_str_dup(), rb_str_new_cstr(), rb_warning(), 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(), cmdline_options::safe_level, cmdline_options::script, cmdline_options::script_name, cmdline_options::sflag, cmdline_options::src, src_encoding_index, usage(), cmdline_options::verbose, version(), cmdline_options::xflag, and yydebug.
Referenced by ruby_process_options().
| static void process_sflag | ( | int * | sflag | ) | [static] |
Definition at line 589 of file ruby.c.
References args, argv, FALSE, ISALNUM, 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().
| static void push_include | ( | const char * | path, | |
| VALUE(*)(VALUE) | filter | |||
| ) | [static] |
Definition at line 255 of file ruby.c.
References CharNext, GET_VM, PATH_SEP_CHAR, rb_ary_push(), and rubylib_mangled_path.
Referenced by ruby_push_include().
| static VALUE rb_f_chomp | ( | int | argc, | |
| VALUE * | argv | |||
| ) | [static] |
Definition at line 1310 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
| static VALUE rb_f_chop | ( | void | ) | [static] |
Definition at line 1290 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
| static VALUE rb_f_gsub | ( | int | argc, | |
| VALUE * | argv | |||
| ) | [static] |
Definition at line 1272 of file ruby.c.
References rb_funcall_passing_block(), rb_intern, rb_lastline_set(), and uscore_get().
Referenced by process_options().
| static VALUE rb_f_sub | ( | int | argc, | |
| VALUE * | argv | |||
| ) | [static] |
Definition at line 1253 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 1769 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 1776 of file ruby.c.
References cmdline_options_init(), load_file(), and rb_parser_new().
Referenced by rb_load_file(), and rb_load_internal0().
| static void require_libraries | ( | VALUE * | req_list | ) | [static] |
Definition at line 554 of file ruby.c.
References CONST_ID, GET_THREAD(), list, OBJ_FREEZE, rb_thread_struct::parse_in_eval, RARRAY_LEN, rb_ary_shift(), rb_cString, rb_default_external_encoding(), rb_enc_associate(), rb_funcall2, rb_vm_top_self(), and RBASIC_SET_CLASS_RAW.
Referenced by load_file_internal(), and process_options().
| static VALUE restore_lineno | ( | VALUE | lineno | ) | [static] |
| void ruby_incpush | ( | const char * | path | ) |
Definition at line 337 of file ruby.c.
References locale_path(), and ruby_push_include().
Referenced by init_loadpath().
| void ruby_incpush_expand | ( | const char * | path | ) |
Definition at line 354 of file ruby.c.
References expand_include_path(), and ruby_push_include().
Referenced by proc_options().
| void ruby_init_loadpath | ( | void | ) |
Definition at line 380 of file ruby.c.
References ruby_init_loadpath_safe().
| void ruby_init_loadpath_safe | ( | int | safe_level | ) |
Definition at line 386 of file ruby.c.
References dln_find_file_r, expand_include_path(), f, GET_VM, getenv, identical_path(), MAXPATHLEN, NULL, PATH_ENV, PREFIX_PATH, Qnil, rb_ary_push(), rb_ascii8bit_encoding(), rb_cObject, rb_const_set(), rb_enc_path_last_separator(), rb_intern_const, rb_ivar_set(), rb_obj_freeze(), rb_realpath_internal(), rb_str_freeze(), rb_str_new(), rb_str_new_cstr(), rb_str_resize(), RSTRING_PTR, ruby_exec_prefix, ruby_initial_load_paths, ruby_push_include(), RUBY_RELATIVE, rubylib_mangled_path, strlcpy(), strlen(), STRNCASECMP, and strrchr().
Referenced by process_options(), and ruby_init_loadpath().
| static void ruby_init_prelude | ( | void | ) | [static] |
Definition at line 1189 of file ruby.c.
References rb_cObject, rb_const_remove(), and rb_intern_const.
Referenced by process_options().
| void* ruby_process_options | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 1960 of file ruby.c.
References cmdline_options_init(), process_options(), rb_gc_register_mark_object(), rb_progname, rb_str_new4, ruby_script(), and cmdline_options::script_name.
Referenced by ruby_options().
| void ruby_prog_init | ( | void | ) |
Defines built-in variables.
Definition at line 1913 of file ruby.c.
References opt_W_getter(), proc_argv0(), proc_setproctitle(), rb_argv, rb_define_global_const(), rb_define_hooked_variable(), rb_define_module_function(), rb_define_variable(), rb_mProcess, rb_progname, ruby_debug, ruby_verbose, set_arg0(), and verbose_setter().
Referenced by ruby_setup().
| void ruby_push_include | ( | const char * | path, | |
| VALUE(*)(VALUE) | filter | |||
| ) |
Definition at line 317 of file ruby.c.
References push_include().
Referenced by ruby_incpush(), ruby_incpush_expand(), and ruby_init_loadpath_safe().
| void ruby_script | ( | const char * | name | ) |
Sets the current script name to this value.
This is similar to $0 = name in Ruby level but also affects Method::location and others.
Definition at line 1842 of file ruby.c.
References rb_external_str_new(), rb_orig_progname, rb_progname, rb_vm_set_progname(), and strlen().
Referenced by ruby_process_options().
| void ruby_set_argv | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 1939 of file ruby.c.
References OBJ_FREEZE, origarg, rb_argv, rb_ary_clear(), rb_ary_push(), and rb_external_str_new_cstr().
Referenced by process_options().
| void ruby_set_script_name | ( | VALUE | name | ) |
Sets the current script name to this value.
Same as ruby_script() but accepts a VALUE.
Definition at line 1855 of file ruby.c.
References rb_orig_progname, rb_progname, rb_str_dup(), and rb_vm_set_progname().
Referenced by load_file_internal(), and process_options().
| void ruby_sysinit | ( | int * | argc, | |
| char *** | argv | |||
| ) |
Initializes the process for ruby(1).
This function assumes this process is ruby(1) and it has just started. Usually programs that embeds CRuby interpreter should not call this function, and should do their own initialization.
Definition at line 2018 of file ruby.c.
References fill_standard_fds(), origarg, and rb_w32_sysinit().
| static void set_arg0 | ( | VALUE | val, | |
| ID | id | |||
| ) | [static] |
Definition at line 1828 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 void set_option_encoding_once | ( | const char * | type, | |
| VALUE * | name, | |||
| const char * | e, | |||
| long | elen | |||
| ) | [static] |
Definition at line 760 of file ruby.c.
References INT2FIX, PRIsVALUE, rb_eRuntimeError, rb_funcall(), rb_intern, rb_raise(), rb_str_new(), and strlen().
| static rb_env_t* toplevel_context | ( | VALUE | toplevel_binding | ) | [static] |
Definition at line 578 of file ruby.c.
References rb_binding_t::env, env, GetBindingPtr, and GetEnvPtr.
| static void usage | ( | const char * | name, | |
| int | help | |||
| ) | [static] |
Definition at line 136 of file ruby.c.
References DEFAULT_RUBYGEMS_ENABLED, M, numberof, and SHOW.
Referenced by dump_option(), proc_options(), and process_options().
| static VALUE uscore_get | ( | void | ) | [static] |
Definition at line 1230 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 void verbose_setter | ( | VALUE | val, | |
| ID | id, | |||
| void * | data | |||
| ) | [static] |
Definition at line 1889 of file ruby.c.
Referenced by ruby_prog_init().
| int argc |
Definition at line 131 of file ruby.c.
Referenced by append_method(), argf_block_call_i(), callback(), collect_all(), collect_i(), count_iter_i(), drop_i(), each_with_index_i(), enumerator_block_call(), enumerator_size(), enumerator_with_index_i(), enumerator_with_object_i(), find_index_iter_i(), flat_map_i(), initialize(), lazy_drop_func(), lazy_drop_while_func(), lazy_flat_map_func(), lazy_flat_map_i(), lazy_grep_func(), lazy_grep_iter(), lazy_init_block_i(), lazy_init_iterator(), lazy_map_func(), lazy_reject_func(), lazy_select_func(), lazy_take_func(), lazy_take_while_func(), lazy_zip_func(), member_i(), moreswitches(), next_ii(), num_step_size(), pipe_open(), pipe_open_s(), rb_apply(), rb_f_p_internal(), rb_fiber_start(), rb_iseq_disasm(), rb_marshal_dump(), rb_reg_s_union(), rb_spawn_process(), rb_str_encode(), take_i(), take_while_i(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), vm_callee_setup_arg_complex(), yielder_yield_i(), zip_ary(), and zip_i().
| char** argv |
Definition at line 132 of file ruby.c.
Referenced by append_method(), argf_block_call_i(), asn1time_to_time(), call_original_exit(), call_trace_func(), collect_all(), collect_i(), count_iter_i(), do_spawn(), drop_i(), each_with_index_i(), enumerator_block_call(), enumerator_size(), enumerator_with_index_i(), enumerator_with_object_i(), find_index_iter_i(), flat_map_i(), fromDefaultEnc_toUTF8(), iseq_build_from_ary_body(), lazy_drop_func(), lazy_drop_while_func(), lazy_flat_map_func(), lazy_flat_map_i(), lazy_grep_func(), lazy_grep_iter(), lazy_init_block_i(), lazy_init_iterator(), lazy_map_func(), lazy_reject_func(), lazy_select_func(), lazy_take_func(), lazy_take_while_func(), lazy_zip_arrays_func(), lazy_zip_func(), member_i(), moreswitches(), new_insn_body(), next_ii(), num_step_size(), pipe_open(), pipe_open_s(), process_sflag(), rb_check_deadlock(), rb_f_p_internal(), rb_fiber_start(), rb_fiddle_new_function(), rb_marshal_dump(), rb_name_error(), rb_name_error_str(), rb_str_encode(), rb_threadptr_signal_exit(), rb_threadptr_signal_raise(), set_argv(), take_i(), take_while_i(), vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), vm_callee_setup_arg_complex(), yielder_yield_i(), zip_ary(), and zip_i().
struct { ... } origarg [static] |
Referenced by process_options(), ruby_set_argv(), ruby_sysinit(), and set_arg0().
| VALUE rb_argv0 |
Definition at line 1212 of file ruby.c.
Referenced by Init_tcltklib(), ruby_open_tk_dll(), ruby_tcl_create_ip_and_stubs_init(), and ruby_tcltk_stubs().
1.6.1