Ruby
2.0.0p598(2014-11-13revision48408)
|
#include "ruby/ruby.h"
#include "ruby/util.h"
#include "internal.h"
#include "dln.h"
#include "eval_intern.h"
#include "probes.h"
#include "node.h"
Go to the source code of this file.
Data Structures | |
struct | loaded_feature_searching |
Macros | |
#define | numberof(array) (int)(sizeof(array) / sizeof((array)[0])) |
#define | IS_RBEXT(e) (strcmp((e), ".rb") == 0) |
#define | IS_SOEXT(e) (strcmp((e), ".so") == 0 || strcmp((e), ".o") == 0) |
#define | IS_DLEXT(e) (strcmp((e), DLEXT) == 0) |
#define | rb_intern(str) rb_intern2((str), strlen(str)) |
Enumerations | |
enum | expand_type { EXPAND_ALL, EXPAND_RELATIVE, EXPAND_HOME, EXPAND_NON_CACHE } |
Variables | |
VALUE | ruby_dln_librefs |
static const char *const | loadable_ext [] |
Definition at line 22 of file load.c.
Referenced by loaded_feature_path(), rb_feature_p(), rb_feature_provided(), and search_required().
Definition at line 17 of file load.c.
Referenced by loaded_feature_path(), rb_feature_p(), rb_feature_provided(), and search_required().
Definition at line 18 of file load.c.
Referenced by rb_feature_p(), rb_feature_provided(), and search_required().
Definition at line 15 of file load.c.
Referenced by features_index_add_single(), and rb_feature_p().
#define rb_intern | ( | str | ) | rb_intern2((str), strlen(str)) |
enum expand_type |
Definition at line 227 of file load.c.
References features_index_add_single(), NULL, p, rb_str_subseq(), RSTRING_LEN, and StringValuePtr.
Referenced by get_loaded_features_index(), and rb_provide_feature().
Definition at line 188 of file load.c.
References Check_Type, get_loaded_features_index_raw(), NIL_P(), numberof, Qnil, rb_ary_cat(), rb_ary_push(), rb_ary_tmp_new(), RB_TYPE_P, ruby_strdup(), st_insert(), st_lookup(), StringValueCStr, T_ARRAY, T_FIXNUM, and T_STRING.
Referenced by features_index_add().
Definition at line 163 of file load.c.
References GET_VM.
Referenced by Init_load(), rb_feature_p(), and rb_provide_feature().
Definition at line 273 of file load.c.
References features_index_add(), GET_VM, i, INT2FIX, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_index, loaded_features_index_clear_i(), rb_vm_struct::loaded_features_snapshot, RARRAY_LEN, rb_ary_entry(), rb_ary_shared_with_p(), rb_ary_store(), rb_str_freeze(), reset_loaded_features_snapshot(), st_foreach(), and StringValue.
Referenced by rb_feature_p().
Definition at line 176 of file load.c.
References GET_VM.
Referenced by features_index_add_single().
Definition at line 182 of file load.c.
References GET_VM.
Referenced by load_lock(), load_unlock(), rb_feature_p(), and ruby_init_ext().
void Init_load | ( | ) |
Definition at line 1148 of file load.c.
References rb_vm_struct::expanded_load_path, get_loaded_features(), GET_VM, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, load_path_getter(), rb_vm_struct::load_path_snapshot, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_index, rb_vm_struct::loaded_features_snapshot, rb_alias_variable(), rb_ary_new(), rb_ary_tmp_new(), rb_cModule, rb_define_global_function(), rb_define_hooked_variable(), rb_define_method(), rb_define_virtual_variable(), rb_f_autoload(), rb_f_autoload_p(), rb_f_load(), rb_f_require(), rb_f_require_relative(), rb_gc_register_mark_object(), rb_gvar_readonly_setter(), rb_intern, rb_intern2(), rb_mod_autoload(), rb_mod_autoload_p(), ruby_dln_librefs, and st_init_strtable().
Definition at line 927 of file load.c.
References dln_load(), NOEX_PUBLIC, RSTRING_PTR, and SCOPE_SET.
Referenced by rb_require_safe().
Definition at line 921 of file load.c.
References rb_load_fail().
Referenced by rb_f_load(), rb_load(), and rb_require_safe().
|
static |
Definition at line 704 of file load.c.
References data, get_loading_table(), GET_VM, nd_type, NODE_MEMO, Qfalse, Qnil, rb_backtrace(), rb_thread_shield_new(), rb_thread_shield_wait(), RB_TYPE_P, rb_warning(), RNODE, RTEST, ruby_strdup(), ruby_verbose, st_init_strtable(), st_insert(), st_lookup(), T_NODE, and void.
Referenced by rb_require_safe().
Definition at line 102 of file load.c.
References my_getcwd, rb_filesystem_str_new_cstr(), and xfree.
Referenced by rb_get_expanded_load_path().
Definition at line 157 of file load.c.
References rb_vm_struct::load_path.
Referenced by Init_load().
Definition at line 758 of file load.c.
References get_loading_table(), key, release_thread_shield(), and st_update().
Referenced by rb_require_safe().
|
static |
Definition at line 310 of file load.c.
References e, i, IS_DLEXT, IS_RBEXT, len, n, p, RARRAY_LEN, RARRAY_PTR(), RSTRING_LEN, s, and StringValuePtr.
Referenced by loaded_feature_path_i(), and rb_feature_p().
Definition at line 362 of file load.c.
References loaded_feature_searching::len, loaded_feature_searching::load_path, loaded_feature_path(), loaded_feature_searching::name, p, loaded_feature_searching::result, s, ST_CONTINUE, ST_STOP, strlen(), and loaded_feature_searching::type.
Referenced by rb_feature_p().
Definition at line 266 of file load.c.
References ST_DELETE, and xfree.
Referenced by get_loaded_features_index().
NORETURN | ( | static void | load_failedVALUE | ) |
|
static |
Definition at line 53 of file load.c.
References ary, EXPAND_HOME, EXPAND_NON_CACHE, EXPAND_RELATIVE, rb_vm_struct::expanded_load_path, GET_VM, i, level, rb_vm_struct::load_path, rb_vm_struct::load_path_snapshot, path, Qnil, RARRAY_LEN, RARRAY_PTR(), rb_ary_push(), rb_ary_replace(), rb_ary_tmp_new(), rb_file_expand_path_fast(), rb_get_path_check_convert(), rb_get_path_check_to_string(), rb_is_absolute_path(), rb_obj_freeze(), rb_safe_level, rb_str_freeze(), RB_TYPE_P, RSTRING_PTR, and T_STRING.
Referenced by rb_get_expanded_load_path().
Definition at line 1116 of file load.c.
References klass, NIL_P(), rb_class_real(), rb_eTypeError, rb_mod_autoload(), rb_raise(), and rb_vm_cbase().
Referenced by Init_load().
Definition at line 1137 of file load.c.
References klass, NIL_P(), Qnil, rb_mod_autoload_p(), and rb_vm_cbase().
Referenced by Init_load().
Definition at line 674 of file load.c.
References FilePathValue, load_failed(), path, Qtrue, rb_file_load_ok(), rb_find_file(), rb_load_internal(), rb_scan_args(), rb_sourcefile, rb_sourceline(), RSTRING_PTR, RTEST, RUBY_DTRACE_LOAD_ENTRY, RUBY_DTRACE_LOAD_ENTRY_ENABLED, RUBY_DTRACE_LOAD_RETURN, RUBY_DTRACE_LOAD_RETURN_ENABLED, and StringValuePtr.
Referenced by Init_load().
Definition at line 806 of file load.c.
References rb_require_safe(), and rb_safe_level.
Referenced by Init_load().
Definition at line 820 of file load.c.
References NIL_P(), rb_current_realfilepath(), rb_file_absolute_path(), rb_file_dirname(), rb_loaderror(), rb_require_safe(), and rb_safe_level.
Referenced by Init_load().
|
static |
Definition at line 374 of file load.c.
References buf, data, DLEXT_MAXLEN, e, f, FIX2LONG, get_loaded_features(), get_loaded_features_index(), get_loading_table(), i, index, IS_DLEXT, IS_RBEXT, IS_SOEXT, loaded_feature_searching::len, len, loaded_feature_searching::load_path, loadable_ext, loaded_feature_path(), loaded_feature_path_i(), MEMCPY, n, loaded_feature_searching::name, NIL_P(), numberof, p, Qnil, RARRAY_LEN, RARRAY_PTR(), rb_get_expanded_load_path(), rb_str_resize(), rb_str_tmp_new(), RB_TYPE_P, loaded_feature_searching::result, RSTRING_LEN, RSTRING_PTR, st_foreach(), st_get_key(), st_lookup(), StringValuePtr, strlcpy(), strlen(), T_ARRAY, type, loaded_feature_searching::type, and v.
Referenced by rb_feature_provided(), and search_required().
Definition at line 523 of file load.c.
References FALSE, IS_DLEXT, IS_RBEXT, IS_SOEXT, Qnil, rb_feature_p(), rb_file_expand_path_fast(), rb_get_path(), rb_str_new2, RSTRING_PTR, strchr(), strrchr(), and TRUE.
Referenced by autoload_provided(), and rb_provided().
Definition at line 111 of file load.c.
References EXPAND_ALL, EXPAND_HOME, EXPAND_NON_CACHE, EXPAND_RELATIVE, rb_vm_struct::expanded_load_path, GET_VM, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, load_path_getcwd(), rb_vm_struct::load_path_snapshot, Qtrue, rb_ary_shared_with_p(), rb_construct_expanded_load_path(), and rb_str_equal().
Referenced by rb_feature_p(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 638 of file load.c.
References FilePathValue, load_failed(), rb_find_file(), rb_load_internal(), and tmp.
Referenced by rb_load_protect().
Definition at line 574 of file load.c.
References rb_thread_struct::errinfo, EXEC_TAG, FALSE, FIXNUM_P, GET_THREAD(), rb_thread_struct::mild_compile_error, NIL_P(), POP_TAG, PUSH_TAG, Qfalse, Qnil, rb_exc_raise(), rb_extend_object(), RB_GC_GUARD, rb_iseq_eval(), rb_iseq_new_top(), rb_load_file(), rb_module_new(), rb_obj_clone(), rb_realpath_internal(), rb_secure(), rb_str_new2, rb_vm_jump_tag_but_local_jump(), rb_vm_top_self(), RSTRING_PTR, state, th, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, and TRUE.
Referenced by rb_f_load(), rb_load(), and rb_require_safe().
Definition at line 1072 of file load.c.
References FilePathValue, Qnil, rb_autoload(), rb_to_id(), and RSTRING_PTR.
Referenced by Init_load(), and rb_f_autoload().
Definition at line 1095 of file load.c.
References Qnil, rb_autoload_p(), and rb_check_id().
Referenced by Init_load(), and rb_f_autoload_p().
Definition at line 566 of file load.c.
References rb_provide_feature(), and rb_usascii_str_new2.
Referenced by InitVM_Enumerator().
Definition at line 549 of file load.c.
References features_index_add(), get_loaded_features(), INT2FIX, OBJ_FROZEN, RARRAY_LEN, rb_ary_push(), rb_eRuntimeError, rb_raise(), rb_str_freeze(), and reset_loaded_features_snapshot().
Referenced by rb_provide(), and rb_require_safe().
Definition at line 517 of file load.c.
References rb_feature_provided().
Definition at line 1024 of file load.c.
References OBJ_FREEZE, rb_require_safe(), rb_safe_level, and rb_str_new2.
Referenced by Init_bubblebabble(), Init_generator(), Init_md5(), Init_ossl_digest(), Init_parser(), Init_psych_parser(), Init_rmd160(), Init_sha1(), Init_sha2(), Init_tkutil(), and process_options().
Definition at line 934 of file load.c.
References rb_thread_struct::errinfo, EXEC_TAG, FilePathValue, GET_THREAD(), JUMP_TAG, load_ext(), load_failed(), load_lock(), load_unlock(), LONG2NUM, NIL_P(), path, POP_TAG, PUSH_TAG, Qfalse, Qnil, Qtrue, rb_ary_push(), rb_load_internal(), rb_provide_feature(), rb_safe_level, rb_set_safe_level_force(), rb_sourcefile, rb_sourceline(), rb_vm_call_cfunc(), rb_vm_top_self(), result, RSTRING_PTR, ruby_dln_librefs, RUBY_DTRACE_FIND_REQUIRE_ENTRY, RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_FIND_REQUIRE_RETURN, RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED, RUBY_DTRACE_REQUIRE_ENTRY, RUBY_DTRACE_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_REQUIRE_RETURN, RUBY_DTRACE_REQUIRE_RETURN_ENABLED, safe, search_required(), state, StringValuePtr, and th.
Referenced by autoload_require(), load_transcoder_entry(), rb_f_require(), rb_f_require_relative(), rb_require(), and require_enc().
|
static |
Definition at line 1032 of file load.c.
References name, NEW_MEMO, rb_warn(), ruby_strdup(), and ST_CONTINUE.
Referenced by ruby_init_ext().
|
static |
Definition at line 745 of file load.c.
References rb_thread_shield_destroy(), rb_thread_shield_release(), ST_CONTINUE, ST_DELETE, ST_STOP, and xfree.
Referenced by load_unlock().
Definition at line 169 of file load.c.
References GET_VM, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_snapshot, and rb_ary_replace().
Referenced by get_loaded_features_index(), and rb_provide_feature().
RUBY_FUNC_EXPORTED void ruby_init_ext | ( | const char * | name, |
void(*)(void) | init | ||
) |
Definition at line 1047 of file load.c.
References get_loading_table(), GET_VM, register_init_ext(), st_init_strtable(), and st_update().
Referenced by init_golf().
Definition at line 831 of file load.c.
References FALSE, IS_DLEXT, IS_RBEXT, IS_SOEXT, loadable_ext, OBJ_FREEZE, rb_feature_p(), rb_filesystem_str_new_cstr(), rb_find_file_ext_safe(), rb_find_file_safe(), rb_str_cat2(), rb_str_subseq(), RSTRING_PTR, strchr(), strrchr(), tmp, TRUE, and type.
Referenced by rb_require_safe().
Definition at line 25 of file load.c.
Referenced by rb_feature_p(), and search_required().
VALUE ruby_dln_librefs |
Definition at line 13 of file load.c.
Referenced by Init_load(), and rb_require_safe().