Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
|
#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 |
RUBY_EXTERN const int | ruby_patchlevel |
VALUE | rb_argv0 |
VALUE | rb_e_script |
#define AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */ |
#define check_envopt | ( | name, | |
allow_envopt | |||
) |
#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 2205 of file ruby.c.
References load_file_arg::fname, rb_load_file_str(), and rb_str_new_cstr.
Definition at line 2212 of file ruby.c.
References rb_parser_load_file(), and rb_parser_new().
Referenced by rb_load_file().
Definition at line 2218 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 ruby_process_options(), and ruby_sysinit().
char** argv |
Definition at line 223 of file ruby.c.
Referenced by ruby_process_options(), and ruby_sysinit().
VALUE ruby_archlibdir_path |
Definition at line 579 of file ruby.c.
Referenced by ruby_init_loadpath().
RUBY_EXTERN const int ruby_patchlevel |
VALUE ruby_prefix_path |
Definition at line 579 of file ruby.c.
Referenced by ruby_init_loadpath().