Ruby
2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
|
#include "ruby/encoding.h"
#include "ruby/thread.h"
#include "ruby/version.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"
#include "mjit.h"
Go to the source code of this file.
Data Structures | |
struct | ruby_features_t |
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 | FEATURE_SET_TO(feat, bit_mask, bit_set) rb_feature_set_to(&(feat), bit_mask, bit_set) |
#define | FEATURE_SET(feat, bits) FEATURE_SET_TO(feat, bits, bits) |
#define | FEATURE_SET_RESTORE(feat, save) FEATURE_SET_TO(feat, (save).mask, (save).set & (save).mask) |
#define | FEATURE_SET_P(feat, bits) ((feat).set & (bits)) |
#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 | str_conv_enc(str, from, to) (str) |
#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 | FEATURE_FOUND goto found |
#define | SET_FEATURE(bit) if (NAME_MATCH_P(#bit, str, len)) {set |= mask = FEATURE_BIT(bit); FEATURE_FOUND;} |
#define | SET_WHEN_DEBUG(bit) |
#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 | |
void | Init_ruby_description (void) |
char * | getenv () |
void | rb_warning_category_update (unsigned int mask, unsigned int bits) |
void | ruby_push_include (const char *path, VALUE(*filter)(VALUE)) |
void | ruby_incpush (const char *path) |
void | ruby_incpush_expand (const char *path) |
void | ruby_init_loadpath (void) |
int | ruby_env_debug_option (const char *str, int len, void *arg) |
void | Init_builtin_features (void) |
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) |
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... | |
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) |
void | ruby_sysinit (int *argc, char ***argv) |
Initializes the process for libruby. More... | |
Variables | |
VALUE | ruby_archlibdir_path |
VALUE | ruby_prefix_path |
const RUBY_EXTERN int | ruby_patchlevel |
VALUE | rb_argv0 |
VALUE | rb_e_script |
#define AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */ |
#define EACH_DEBUG_FEATURES | ( | X, | |
SEP | |||
) |
#define EACH_DUMPS | ( | X, | |
SEP | |||
) |
#define EACH_FEATURES | ( | X, | |
SEP | |||
) |
#define FEATURE_FOUND goto found |
#define FEATURE_SET | ( | feat, | |
bits | |||
) | FEATURE_SET_TO(feat, bits, bits) |
#define FEATURE_SET_RESTORE | ( | feat, | |
save | |||
) | FEATURE_SET_TO(feat, (save).mask, (save).set & (save).mask) |
#define FEATURE_SET_TO | ( | feat, | |
bit_mask, | |||
bit_set | |||
) | rb_feature_set_to(&(feat), bit_mask, bit_set) |
#define INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index") |
#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) |
#define is_option_with_optarg | ( | name, | |
allow_hyphen, | |||
allow_envopt, | |||
needs_arg, | |||
next_arg | |||
) |
#define M | ( | shortopt, | |
longopt, | |||
desc | |||
) |
#define MODE_TO_LOAD (O_RDONLY) |
#define need_argument | ( | name, | |
s, | |||
needs_arg, | |||
next_arg | |||
) |
#define PREFIX_PATH | ( | ) | RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) |
#define rb_define_readonly_boolean | ( | name, | |
val | |||
) | rb_define_virtual_variable((name), (val) ? true_value : false_value, 0) |
#define RUBY_RELATIVE | ( | path, | |
len | |||
) | rubylib_path_new((path), (len)) |
#define rubylib_path_new rb_str_new |
#define set_encoding_part | ( | type | ) |
#define set_external_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("default_external", &(opt)->ext.enc.name, (e), (elen)) |
#define SET_FEATURE | ( | bit | ) | if (NAME_MATCH_P(#bit, str, len)) {set |= mask = FEATURE_BIT(bit); FEATURE_FOUND;} |
#define set_internal_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("default_internal", &(opt)->intern.enc.name, (e), (elen)) |
#define set_source_encoding_once | ( | opt, | |
e, | |||
elen | |||
) | set_option_encoding_once("source", &(opt)->src.enc.name, (e), (elen)) |
#define SET_WHEN_DEBUG | ( | bit | ) |
#define SHOW | ( | m | ) | show_usage_line((m).str, (m).namelen, (m).secondlen, help) |
typedef struct ruby_cmdline_options ruby_cmdline_options_t |
anonymous enum |
enum dump_flag_bits |
enum feature_flag_bits |
char* getenv | ( | ) |
Referenced by ruby_init_loadpath().
Definition at line 66 of file builtin.c.
References NULL, and rb_load_with_builtin_functions().
Definition at line 100 of file version.c.
References MJIT_OPTS_ON, MKSTR, and rb_define_global_const().
Definition at line 2180 of file ruby.c.
References load_file_arg::fname, rb_load_file_str(), and rb_str_new_cstr.
Definition at line 2187 of file ruby.c.
References rb_parser_load_file(), and rb_parser_new().
Referenced by rb_load_file().
Definition at line 2193 of file ruby.c.
References f, and load_file_arg::opt.
Referenced by rb_load_file_str().
Definition at line 153 of file debug.c.
References fprintf(), len, n, NAME_MATCH_VALUE, numberof, Qtrue, ruby_enable_coredump, ruby_initial_gc_stress_ptr, ruby_on_ci, ruby_rgengc_debug, SET_UINT_LIST, SET_WHEN, and stderr.
Definition at line 443 of file ruby.c.
References path, and ruby_push_include().
Definition at line 406 of file ruby.c.
References path.
Referenced by ruby_incpush(), ruby_incpush_expand(), and ruby_init_loadpath().
int argc |
Definition at line 222 of file ruby.c.
Referenced by compat_init_setproctitle(), goruby_options(), main(), rb_add_method_cfunc(), rb_adjust_argv_kw_splat(), rb_apply(), rb_ary_aref(), rb_ary_last(), rb_block_call(), rb_block_call_kw(), rb_check_block_call(), rb_check_funcall_with_hook(), rb_define_global_function(), rb_define_method(), rb_define_method_id(), rb_define_module_function(), rb_define_private_method(), rb_define_protected_method(), rb_enum_values_pack(), rb_enumeratorize(), rb_execarg_commandline(), rb_f_abort(), rb_f_eval(), rb_f_exec(), rb_f_exit(), rb_f_kill(), rb_f_raise(), rb_f_sprintf(), rb_f_trace_var(), rb_f_untrace_var(), rb_fiber_resume(), rb_fiber_start(), rb_file_s_absolute_path(), rb_file_s_expand_path(), rb_funcall_passing_block_kw(), rb_funcallv_kw(), rb_funcallv_public_kw(), rb_int_powm(), rb_io_print(), rb_io_printf(), rb_io_puts(), rb_lambda_call(), rb_make_no_method_exception(), rb_math_log(), rb_method_call(), rb_method_call_kw(), rb_method_call_with_block(), rb_mod_class_variables(), rb_mod_constants(), rb_obj_call_init(), rb_obj_call_init_kw(), rb_obj_methods(), rb_obj_singleton_methods(), rb_proc_call_kw(), rb_proc_call_with_block(), rb_proc_call_with_block_kw(), rb_str_encode(), rb_sym_proc_call(), rb_vm_call0(), rb_vm_call_kw(), rb_w32_asynchronize(), rb_yield_block(), rsock_bsock_send(), rsock_s_recvfrom(), ruby_options(), ruby_process_options(), and ruby_sysinit().
Definition at line 223 of file ruby.c.
Referenced by asn1time_to_time(), compat_init_setproctitle(), ffi_prep_args(), goruby_options(), main(), rb_apply(), rb_block_call(), rb_block_call_kw(), rb_check_block_call(), rb_check_funcall_with_hook(), rb_enum_values_pack(), rb_enumeratorize(), rb_execarg_commandline(), rb_f_abort(), rb_f_eval(), rb_f_exec(), rb_f_kill(), rb_f_sprintf(), rb_f_trace_var(), rb_f_untrace_var(), rb_fiber_resume(), rb_fiber_start(), rb_fiddle_new_function(), rb_file_s_absolute_path(), rb_file_s_expand_path(), rb_funcall(), rb_funcall_passing_block_kw(), rb_funcallv_kw(), rb_funcallv_public_kw(), rb_int_powm(), rb_io_print(), rb_io_printf(), rb_io_puts(), rb_lambda_call(), rb_make_no_method_exception(), rb_math_log(), rb_method_call(), rb_method_call_kw(), rb_method_call_with_block(), rb_mod_class_variables(), rb_mod_constants(), rb_name_error(), rb_name_error_str(), rb_obj_call_init(), rb_obj_call_init_kw(), rb_obj_methods(), rb_obj_singleton_methods(), rb_proc_call_kw(), rb_proc_call_with_block(), rb_proc_call_with_block_kw(), rb_str_encode(), rb_sym_proc_call(), rb_threadptr_signal_exit(), rb_threadptr_signal_raise(), rb_vm_call_kw(), rb_w32_aspawn(), rb_w32_asynchronize(), rb_w32_uaspawn(), rb_yield_block(), rsock_bsock_send(), rsock_s_recvfrom(), ruby_options(), ruby_process_options(), and ruby_sysinit().
VALUE ruby_archlibdir_path |
Definition at line 579 of file ruby.c.
Referenced by ruby_init_loadpath().
const RUBY_EXTERN int ruby_patchlevel |
VALUE ruby_prefix_path |
Definition at line 579 of file ruby.c.
Referenced by ruby_init_loadpath().