Ruby
2.5.0dev(2017-10-22revision60238)
|
#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 | 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 | 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 () |
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_safe (int safe_level) |
void | ruby_init_loadpath (void) |
int | ruby_env_debug_option (const char *str, int len, void *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) |
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 | |
RUBY_EXTERN const int | ruby_patchlevel |
VALUE | rb_argv0 |
#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 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 MAXPATHLEN 1024 |
Definition at line 45 of file ruby.c.
Referenced by ruby_init_loadpath_safe().
#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 rb_orig_progname (GET_VM()->orig_progname) |
Definition at line 1355 of file ruby.c.
Referenced by ruby_script(), and ruby_set_script_name().
#define rb_progname (GET_VM()->progname) |
Definition at line 1354 of file ruby.c.
Referenced by ruby_script(), and ruby_set_script_name().
#define RUBY_RELATIVE | ( | path, | |
len | |||
) | rubylib_path_new((path), (len)) |
#define rubylib_path_new rb_str_new |
#define SET_COMPILE_OPTION | ( | h, | |
o, | |||
name | |||
) |
#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)) {mask = FEATURE_BIT(bit); goto 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 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 | ( | ) |
void* rb_load_file | ( | const char * | fname | ) |
Definition at line 2023 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 2030 of file ruby.c.
References rb_parser_load_file(), and rb_parser_new().
Referenced by rb_load_file().
Definition at line 2036 of file ruby.c.
References load_file_arg::opt.
Referenced by rb_load_file_str().
int ruby_env_debug_option | ( | const char * | str, |
int | len, | ||
void * | arg | ||
) |
Definition at line 143 of file debug.c.
References NAME_MATCH_VALUE, numberof, Qtrue, ruby_enable_coredump, ruby_initial_gc_stress_ptr, ruby_rgengc_debug, SET_UINT_LIST, and SET_WHEN.
void ruby_incpush_expand | ( | const char * | path | ) |
Definition at line 386 of file ruby.c.
References ruby_push_include().
void ruby_init_loadpath_safe | ( | int | safe_level | ) |
Definition at line 481 of file ruby.c.
References len, MAXPATHLEN, NULL, rb_fatal(), rb_str_modify_expand(), rb_str_new(), rb_str_resize(), rb_str_set_len(), rb_utf8_str_new(), RSTRING_EMBED_LEN_MAX, RSTRING_PTR, and ruby_initial_load_paths.
Referenced by ruby_init_loadpath().
Definition at line 349 of file ruby.c.
Referenced by ruby_incpush(), and ruby_incpush_expand().
int argc |
Definition at line 187 of file ruby.c.
Referenced by compat_init_setproctitle(), rb_add_method_cfunc(), rb_apply(), rb_block_call(), rb_check_block_call(), rb_execarg_commandline(), rb_fiber_start(), rb_get_values_at(), rb_hash_fetch_values(), rb_hash_values_at(), rb_io_print(), rb_io_puts(), rb_lambda_call(), rb_obj_dig(), and rb_w32_asynchronize().
char** argv |
Definition at line 188 of file ruby.c.
Referenced by asn1time_to_time(), rb_apply(), rb_ary_dig(), rb_block_call(), rb_check_block_call(), rb_execarg_init(), rb_fiber_start(), rb_fiddle_new_function(), rb_funcall(), rb_hash_dig(), rb_lambda_call(), rb_obj_dig(), and rb_w32_asynchronize().
RUBY_EXTERN const int ruby_patchlevel |