Ruby
1.9.3p551(2014-11-13revision48407)
|
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby/encoding.h"
#include "node.h"
#include "constant.h"
#include "internal.h"
Go to the source code of this file.
Data Structures | |
struct | fc_result |
struct | trace_var |
struct | global_variable |
struct | trace_data |
struct | obj_ivar_tag |
Macros | |
#define | global_variable rb_global_variable |
#define | global_entry rb_global_entry |
#define | gvar_getter_t rb_gvar_getter_t |
#define | gvar_setter_t rb_gvar_setter_t |
#define | gvar_marker_t rb_gvar_marker_t |
#define | undef_getter rb_gvar_undef_getter |
#define | undef_setter rb_gvar_undef_setter |
#define | undef_marker rb_gvar_undef_marker |
#define | val_getter rb_gvar_val_getter |
#define | val_setter rb_gvar_val_setter |
#define | val_marker rb_gvar_val_marker |
#define | var_getter rb_gvar_var_getter |
#define | var_setter rb_gvar_var_setter |
#define | var_marker rb_gvar_var_marker |
#define | readonly_setter rb_gvar_readonly_setter |
#define | check_autoload_table(av) (struct st_table *)rb_check_typeddata((av), &autoload_data_type) |
#define | CVAR_LOOKUP(v, r) |
Variables | |
st_table * | rb_global_tbl |
st_table * | rb_class_tbl |
static ID | autoload |
static ID | classpath |
static ID | tmp_classpath |
static ID | classid |
static int | special_generic_ivar = 0 |
static st_table * | generic_iv_tbl |
static const rb_data_type_t | autoload_data_type |
#define check_autoload_table | ( | av | ) | (struct st_table *)rb_check_typeddata((av), &autoload_data_type) |
Definition at line 1434 of file variable.c.
Referenced by autoload_delete(), autoload_node(), and rb_autoload().
Definition at line 2010 of file variable.c.
Referenced by rb_cvar_defined(), rb_cvar_get(), and rb_cvar_set().
#define global_entry rb_global_entry |
Definition at line 324 of file variable.c.
Referenced by rb_alias_variable(), rb_f_trace_var(), rb_f_untrace_var(), rb_global_entry(), rb_gv_get(), and rb_gv_set().
#define global_variable rb_global_variable |
Definition at line 323 of file variable.c.
#define gvar_getter_t rb_gvar_getter_t |
Definition at line 326 of file variable.c.
Referenced by rb_define_hooked_variable().
#define gvar_marker_t rb_gvar_marker_t |
Definition at line 328 of file variable.c.
#define gvar_setter_t rb_gvar_setter_t |
Definition at line 327 of file variable.c.
Referenced by rb_define_hooked_variable().
#define readonly_setter rb_gvar_readonly_setter |
Definition at line 359 of file variable.c.
Referenced by rb_define_readonly_variable(), and rb_define_virtual_variable().
#define undef_getter rb_gvar_undef_getter |
Definition at line 347 of file variable.c.
Referenced by rb_global_entry(), and rb_gvar_defined().
#define undef_marker rb_gvar_undef_marker |
Definition at line 349 of file variable.c.
Referenced by rb_global_entry().
#define undef_setter rb_gvar_undef_setter |
Definition at line 348 of file variable.c.
Referenced by rb_global_entry().
#define val_getter rb_gvar_val_getter |
Definition at line 351 of file variable.c.
Referenced by rb_define_virtual_variable(), and undef_setter().
#define val_marker rb_gvar_val_marker |
Definition at line 353 of file variable.c.
Referenced by undef_setter().
#define val_setter rb_gvar_val_setter |
Definition at line 352 of file variable.c.
Referenced by undef_setter().
#define var_getter rb_gvar_var_getter |
Definition at line 355 of file variable.c.
Referenced by rb_define_hooked_variable().
#define var_marker rb_gvar_var_marker |
Definition at line 357 of file variable.c.
Referenced by rb_define_hooked_variable().
#define var_setter rb_gvar_var_setter |
Definition at line 356 of file variable.c.
Referenced by rb_define_hooked_variable().
Definition at line 1472 of file variable.c.
References autoload, check_autoload_table, id, n, st_table::num_entries, RCLASS_CONST_TBL, RCLASS_IV_TBL, st_delete, st_lookup, tbl, val, and xfree.
Referenced by rb_const_remove(), and rb_const_set().
Definition at line 1417 of file variable.c.
References st_free_table.
Definition at line 1411 of file variable.c.
References rb_mark_tbl().
Definition at line 1423 of file variable.c.
References ptr, st_memsize(), and tbl.
Definition at line 1509 of file variable.c.
References autoload, autoload_provided(), check_autoload_table, Check_Type, rb_eArgError, rb_ensure(), rb_raise(), rb_safe_level, rb_set_safe_level_force(), RCLASS_IV_TBL, reset_safe(), RSTRING_PTR, safe, st_lookup, T_STRING, tbl, and val.
Referenced by rb_autoload_load(), rb_autoload_p(), and rb_const_defined_0().
Definition at line 1542 of file variable.c.
References Qundef, RCLASS_CONST_TBL, st_lookup, tbl, val, and value.
Referenced by rb_autoload_load(), and rb_autoload_p().
Definition at line 1495 of file variable.c.
References p, and rb_feature_provided().
Referenced by autoload_node().
Definition at line 1877 of file variable.c.
References OBJ_UNTRUSTED, rb_check_frozen, rb_eSecurityError, rb_raise(), and rb_safe_level.
Referenced by rb_const_set(), and rb_cvar_set().
Definition at line 144 of file variable.c.
References classid, classpath, find_class_path(), n, OBJ_FREEZE, path, Qnil, rb_bug(), rb_cObject, rb_id2str(), rb_str_dup(), RCLASS_IV_TBL, st_delete, st_insert, st_lookup, SYM2ID, T_STRING, and TYPE.
Referenced by rb_class_path(), rb_cmperr(), and rb_mod_name().
Definition at line 1360 of file variable.c.
References ID2SYM, rb_funcall(), and rb_intern.
Referenced by rb_const_get_0().
Definition at line 2137 of file variable.c.
References ID2SYM, rb_ary_includes(), rb_ary_push(), rb_is_class_id(), and ST_CONTINUE.
Referenced by rb_mod_class_variables().
|
static |
Definition at line 73 of file variable.c.
References fc_path(), key, fc_result::klass, list, fc_result::name, fc_result::path, fc_result::prev, rb_is_const_id(), RCLASS_CONST_TBL, res, ST_CONTINUE, st_foreach, ST_STOP, T_CLASS, T_MODULE, fc_result::track, TYPE, rb_const_entry_struct::value, and value.
Referenced by find_class_path().
Definition at line 46 of file variable.c.
References classpath, n, fc_result::name, OBJ_FREEZE, path, fc_result::prev, rb_cObject, rb_id2str(), rb_str_append(), rb_str_cat2(), rb_str_dup(), RCLASS_IV_TBL, st_lookup, and fc_result::track.
Referenced by fc_i().
Definition at line 116 of file variable.c.
References classpath, fc_i(), fc_result::klass, klass, fc_result::name, fc_result::path, fc_result::prev, Qnil, rb_cObject, RCLASS_CONST_TBL, RCLASS_IV_TBL, st_delete, st_foreach_safe(), st_init_numtable, st_insert, tmp_classpath, and fc_result::track.
Referenced by classname().
Definition at line 871 of file variable.c.
References data, Qfalse, Qtrue, st_lookup, and tbl.
Referenced by rb_ivar_defined().
Definition at line 830 of file variable.c.
References Qnil, rb_id2name(), rb_warning(), st_lookup, tbl, and val.
Referenced by ivar_get().
Definition at line 886 of file variable.c.
References data, key, st_table::num_entries, st_delete, st_free_table, st_lookup, status, and tbl.
Referenced by rb_obj_remove_instance_variable().
Definition at line 848 of file variable.c.
References data, FL_EXIVAR, FL_SET, rb_error_frozen(), rb_obj_frozen_p(), rb_special_const_p(), st_add_direct, st_init_numtable, st_insert, st_lookup, and tbl.
Referenced by rb_ivar_set().
Definition at line 923 of file variable.c.
References givar_mark_i(), rb_special_const_p(), ST_CONTINUE, and st_foreach_safe().
Referenced by rb_mark_generic_ivar_tbl().
Definition at line 916 of file variable.c.
References rb_gc_mark(), and ST_CONTINUE.
Referenced by givar_i().
Definition at line 480 of file variable.c.
References ALLOCA_N, buf, id, len, memcpy(), rb_intern, rb_intern2(), and strlen().
Referenced by rb_define_hooked_variable(), rb_gv_get(), and rb_gv_set().
|
static |
Definition at line 746 of file variable.c.
References ID2SYM, rb_ary_push(), and ST_CONTINUE.
Referenced by rb_f_global_variables().
Definition at line 27 of file variable.c.
References autoload, classid, classpath, CONST_ID, st_init_numtable, and tmp_classpath.
Definition at line 990 of file variable.c.
References FL_EXIVAR, FL_TEST, generic_ivar_get(), index, len, ptr, Qnil, Qundef, rb_id2name(), rb_special_const_p(), rb_warning(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup, T_CLASS, T_MODULE, T_OBJECT, TYPE, and val.
Referenced by rb_attr_get(), and rb_ivar_get().
Definition at line 1241 of file variable.c.
References ID2SYM, rb_ary_push(), rb_is_instance_id(), and ST_CONTINUE.
Referenced by rb_obj_instance_variables().
Definition at line 1752 of file variable.c.
References CONST_PRIVATE, rb_const_entry_struct::flag, ID2SYM, rb_ary_push(), ST_CONTINUE, and sym.
Referenced by rb_const_list().
|
static |
Definition at line 458 of file variable.c.
References trace_var::data, global_variable::data, global_variable::marker, trace_var::next, rb_gc_mark_maybe(), ST_CONTINUE, global_variable::trace, and var.
Referenced by rb_gc_mark_global_tbl().
NORETURN | ( | static void | uninitialized_constantVALUE, ID | ) |
Definition at line 1160 of file variable.c.
References obj_ivar_tag::arg, arg, func, obj_ivar_tag::func, int, key, obj_ivar_tag::obj, obj, obj_ivar_i(), ROBJECT_IV_INDEX_TBL, st_foreach_safe(), tbl, and val.
Referenced by rb_ivar_foreach().
Definition at line 1147 of file variable.c.
References obj_ivar_tag::arg, data, obj_ivar_tag::func, long, obj_ivar_tag::obj, Qundef, ROBJECT_IVPTR, ROBJECT_NUMIV, ST_CONTINUE, and val.
Referenced by obj_ivar_each().
Definition at line 2003 of file variable.c.
References c, RBASIC, T_ICLASS, and TYPE.
Referenced by rb_cvar_get(), and rb_cvar_set().
Definition at line 778 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, global_entry, name1, trace_var::next, rb_eRuntimeError, rb_eSecurityError, rb_global_entry(), rb_raise(), rb_safe_level, st_add_direct, st_lookup, global_variable::trace, and xfree.
Referenced by Init_load(), and m_core_set_variable_alias().
Definition at line 1032 of file variable.c.
References FALSE, and ivar_get().
Referenced by ecerr_destination_encoding(), ecerr_destination_encoding_name(), ecerr_error_bytes(), ecerr_error_char(), ecerr_incomplete_input(), ecerr_readagain_bytes(), ecerr_source_encoding(), ecerr_source_encoding_name(), eval_string_with_cref(), exc_backtrace(), exc_equal(), exc_to_s(), exit_status(), exit_success_p(), gzfile_error_inspect(), iconv_failure_failed(), iconv_failure_inspect(), iconv_failure_success(), name_err_name(), name_err_to_s(), nometh_err_args(), ossl_asn1_get_asn1type(), private_iv_get(), pst_pid(), readline_attempted_completion_function(), readline_s_get_completion_case_fold(), readline_s_get_completion_proc(), reg_compile_gen(), slicebefore_i(), sockopt_data(), sockopt_family_m(), sockopt_level(), sockopt_optname(), stop_result(), syck_parser_load(), syck_parser_load_documents(), syck_resolver_add_type(), syck_resolver_transfer(), syserr_eqq(), syserr_errno(), vm_call0(), and vm_call_method().
Definition at line 1438 of file variable.c.
References autoload, av, check_autoload_table, DATA_PTR(), FL_TAINT, FL_UNSET, NODE_MEMO, OBJ_FREEZE, Qundef, rb_const_set(), rb_eArgError, rb_eNameError, rb_id2name(), rb_is_const_id(), rb_node_newnode, rb_raise(), rb_safe_level, rb_str_new2(), RCLASS_CONST_TBL, RCLASS_IV_TBL, st_add_direct, st_init_numtable, st_insert, st_lookup, tbl, TypedData_Wrap_Struct, and value.
Referenced by rb_dl_init_callbacks(), and rb_mod_autoload().
Definition at line 1554 of file variable.c.
References autoload_node(), autoload_node_id(), Qfalse, rb_require_safe(), rb_sourcefile, and src.
Referenced by rb_const_get_0(), and vm_get_ev_const().
Definition at line 1570 of file variable.c.
References autoload_node(), autoload_node_id(), Qnil, and RCLASS_SUPER.
Referenced by rb_mod_autoload_p().
Definition at line 311 of file variable.c.
References name, rb_class_name(), and RSTRING_PTR.
Referenced by check_iconv(), extract_user_token(), iconv_failure_inspect(), method_inspect(), method_missing(), mnew(), mSyslog_inspect(), pst_inspect(), r_object0(), rb_class_path(), rb_const_get_0(), rb_const_remove(), rb_cvar_get(), rb_cvar_set(), rb_define_class_id_under(), rb_define_module_id_under(), rb_io_s_new(), rb_method_entry_make(), rb_mod_define_method(), rb_mod_remove_cvar(), rb_obj_classname(), rb_print_undef(), rb_thread_current_status(), rb_undef(), remove_method(), set_const_visibility(), thread_s_new(), umethod_bind(), and uninitialized_constant().
Definition at line 305 of file variable.c.
References rb_class_path(), and rb_class_real().
Referenced by cannot_be_coerced_into_BigDecimal(), dir_inspect(), error_print(), exc_inspect(), exc_to_s(), inspect_struct(), mString_to_json_raw_object(), name_err_to_s(), rb_class2name(), rb_io_inspect(), rb_mod_freeze(), rb_mod_to_s(), and w_extended().
Definition at line 189 of file variable.c.
References classname(), n, NIL_P, OBJ_FREEZE, path, rb_class2name(), rb_cModule, rb_ivar_set(), rb_obj_class(), rb_sprintf(), RBASIC, RCLASS_IV_TBL, s, st_lookup, T_MODULE, tmp_classpath, and TYPE.
Referenced by class2path(), ossl_cipher_init(), rb_class_name(), rb_set_class_path(), and rb_set_class_path_string().
Definition at line 1847 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Referenced by console_dev(), Init_cparse(), Init_strscan(), rb_define_class(), rb_define_module(), rb_mod_const_defined(), rb_path_to_class(), syck_const_find(), and vm_get_ev_const().
|
static |
Definition at line 1811 of file variable.c.
References autoload_node(), BUILTIN_TYPE, CONST_PRIVATE, rb_const_entry_struct::flag, klass, Qfalse, Qtrue, Qundef, rb_cObject, RCLASS_CONST_TBL, RCLASS_SUPER, st_lookup, T_MODULE, rb_const_entry_struct::value, and value.
Referenced by rb_const_defined(), rb_const_defined_at(), rb_const_defined_from(), rb_public_const_defined(), rb_public_const_defined_at(), and rb_public_const_defined_from().
Definition at line 1853 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Referenced by debug_lines(), make_struct(), rb_const_remove(), rb_define_class_id_under(), rb_define_module_id_under(), rb_mod_const_defined(), and vm_search_const_defined_class().
Definition at line 1841 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 1635 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Referenced by callback(), console_dev(), cState_from_state_s(), float_arg(), function_call(), generic_to_value(), Init_cparse(), Init_generator(), Init_objspace(), Init_parser(), Init_syck(), Init_tcltklib(), Init_tkutil(), mktime_r(), numeric_arg(), process_options(), raise_method_missing(), rb_define_class(), rb_define_module(), rb_mod_const_get(), save_env(), set_argv(), syck_const_find(), syserr_eqq(), syserr_initialize(), vm_get_ev_const(), vm_set_main_stack(), and yaml_org_handler().
Definition at line 1586 of file variable.c.
References BUILTIN_TYPE, const_missing(), CONST_PRIVATE, data, rb_const_entry_struct::flag, klass, Qundef, rb_autoload_load(), rb_class2name(), rb_cObject, rb_id2name(), rb_name_error(), rb_vm_inc_const_missing_count(), rb_warn(), RCLASS_CONST_TBL, RCLASS_SUPER, RTEST, st_lookup, T_MODULE, rb_const_entry_struct::value, and value.
Referenced by rb_const_get(), rb_const_get_at(), rb_const_get_from(), rb_public_const_get(), rb_public_const_get_at(), and rb_public_const_get_from().
Definition at line 1641 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Referenced by debug_lines(), Init_cparse(), mark(), path_unlink(), rb_define_class_id_under(), rb_define_module_id_under(), rb_mod_const_get(), and rb_path_to_class().
Definition at line 1629 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1761 of file variable.c.
References ary, data, list_i(), st_table::num_entries, rb_ary_new2(), st_foreach_safe(), st_free_table, and tbl.
Referenced by rb_mod_constants(), and rb_mod_s_constants().
Definition at line 1686 of file variable.c.
References autoload_delete(), id, n, OBJ_UNTRUSTED, Qnil, Qundef, rb_check_frozen, rb_class2name(), rb_const_defined_at(), rb_eSecurityError, rb_id2name(), rb_name_error(), rb_raise(), rb_safe_level, rb_vm_change_state(), RCLASS_CONST_TBL, st_delete, v, val, and xfree.
Referenced by rb_mod_remove_const(), and ruby_init_prelude().
Definition at line 1885 of file variable.c.
References ALLOC, autoload_delete(), check_before_mod_set(), CONST_PUBLIC, rb_const_entry_struct::flag, NIL_P, Qundef, rb_eTypeError, rb_id2name(), rb_raise(), rb_vm_change_state(), rb_warn(), RCLASS_CONST_TBL, st_init_numtable, st_insert, st_lookup, val, rb_const_entry_struct::value, and value.
Definition at line 959 of file variable.c.
References data, FL_EXIVAR, FL_SET, FL_TEST, FL_UNSET, st_table::num_entries, rb_free_generic_ivar(), st_add_direct, st_copy, st_free_table, st_insert, st_lookup, and tbl.
Referenced by d_lite_marshal_dump(), d_lite_marshal_load(), init_copy(), nucomp_marshal_dump(), nucomp_marshal_load(), nurat_marshal_dump(), nurat_marshal_load(), time_mdump(), and time_mload().
Definition at line 2116 of file variable.c.
References rb_cvar_get(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2106 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2098 of file variable.c.
References CVAR_LOOKUP, Qfalse, and Qtrue.
Referenced by rb_mod_cvar_defined(), and rb_mod_remove_cvar().
Definition at line 2071 of file variable.c.
References BUILTIN_TYPE, CVAR_LOOKUP, id, klass, original_module(), rb_class2name(), rb_id2name(), rb_name_error(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_delete, T_CLASS, target, and value.
Referenced by rb_cv_get(), and rb_mod_cvar_get().
Definition at line 2038 of file variable.c.
References BUILTIN_TYPE, check_before_mod_set(), CVAR_LOOKUP, id, klass, original_module(), rb_class2name(), rb_id2name(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_delete, st_init_numtable, st_insert, T_CLASS, and target.
Referenced by rb_cv_set(), rb_define_class_variable(), and rb_mod_cvar_set().
Definition at line 2126 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 1923 of file variable.c.
References rb_cObject, rb_const_set(), rb_intern, rb_is_const_id(), rb_secure(), and rb_warn().
Referenced by Init_bigdecimal(), Init_Complex(), Init_cparse(), Init_curses(), Init_date_core(), Init_dbm(), Init_dl(), Init_dlhandle(), Init_dlptr(), Init_etc(), Init_fcntl(), Init_fiddle(), Init_fiddle_function(), Init_File(), Init_gdbm(), Init_IO(), Init_marshal(), Init_Math(), Init_nkf(), Init_Numeric(), Init_openssl(), Init_ossl_asn1(), Init_ossl_config(), Init_ossl_pkcs7(), Init_ossl_ssl(), Init_ossl_x509name(), Init_process(), Init_psych_parser(), Init_Random(), Init_readline(), Init_Regexp(), Init_syck(), Init_tcltklib(), Init_Thread(), Init_tkutil(), Init_transcode(), Init_VM(), Init_wait_for_single_fd(), Init_win32ole(), Init_zlib(), ole_const_load(), rb_define_global_const(), rb_file_const(), ripper_init_eventids1(), ripper_init_eventids2_table(), set_encoding_const(), and set_syserr().
Definition at line 1937 of file variable.c.
References rb_cObject, and rb_define_const().
Referenced by Init_Hash(), Init_IO(), Init_Object(), Init_version(), Init_VM(), load_file_internal(), and ruby_prog_init().
void rb_define_hooked_variable | ( | const char * | name, |
VALUE * | var, | ||
VALUE(*)(ANYARGS) | getter, | ||
void(*)(ANYARGS) | setter | ||
) |
Definition at line 496 of file variable.c.
References global_variable::data, global_variable::getter, global_id(), gvar_getter_t, gvar_setter_t, global_variable::marker, Qnil, RB_GC_GUARD, rb_global_entry(), global_variable::setter, rb_global_entry::var, var_getter, var_marker, and var_setter.
Referenced by Init_IO(), Init_load(), rb_define_readonly_variable(), rb_define_variable(), rb_define_virtual_variable(), and ruby_prog_init().
Definition at line 521 of file variable.c.
References rb_define_hooked_variable(), and readonly_setter.
Referenced by Init_IO().
Definition at line 515 of file variable.c.
References rb_define_hooked_variable().
Referenced by Init_IO(), Init_String(), and ruby_prog_init().
void rb_define_virtual_variable | ( | const char * | name, |
VALUE(*)(ANYARGS) | getter, | ||
void(*)(ANYARGS) | setter | ||
) |
Definition at line 527 of file variable.c.
References global_variable::getter, rb_define_hooked_variable(), readonly_setter, global_variable::setter, and val_getter.
Referenced by Init_eval(), Init_IO(), Init_load(), Init_process(), Init_Regexp(), Init_safe(), and Init_Time().
Definition at line 762 of file variable.c.
References ary, buf, gvar_i(), i, ID2SYM, rb_ary_new(), rb_ary_push(), rb_intern2(), and st_foreach_safe().
Referenced by Init_eval().
Definition at line 567 of file variable.c.
References ALLOC, cmd, trace_var::data, trace_var::func, global_entry, trace_var::next, NIL_P, OBJ_TAINTED, Qnil, rb_block_proc(), rb_eSecurityError, rb_f_untrace_var(), rb_global_entry(), rb_raise(), rb_scan_args(), rb_secure(), rb_to_id(), rb_trace_eval(), trace_var::removed, and var.
Referenced by Init_eval().
Definition at line 627 of file variable.c.
References ary, cmd, data, trace_var::data, global_entry, id, trace_var::next, NIL_P, Qnil, rb_ary_new(), rb_ary_new3(), rb_ary_push(), rb_id2name(), rb_name_error(), rb_scan_args(), rb_secure(), rb_to_id(), remove_trace(), trace_var::removed, st_lookup, and var.
Referenced by Init_eval(), and rb_f_trace_var().
Definition at line 940 of file variable.c.
References key, st_delete, st_free_table, and tbl.
Referenced by obj_free(), and rb_copy_generic_ivar().
Definition at line 473 of file variable.c.
References mark_global_entry(), and st_foreach_safe().
Referenced by gc_marks().
RUBY_FUNC_EXPORTED size_t rb_generic_ivar_memsize | ( | VALUE | obj | ) |
Definition at line 950 of file variable.c.
References st_lookup, st_memsize(), and tbl.
Referenced by memsize_of().
struct global_entry* rb_global_entry | ( | ID | id | ) |
Definition at line 362 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, data, global_variable::data, global_variable::getter, global_entry, id, global_variable::marker, global_variable::setter, st_add_direct, st_lookup, global_variable::trace, undef_getter, undef_marker, undef_setter, and var.
Referenced by iseq_build_from_ary_body(), rb_alias_variable(), rb_define_hooked_variable(), rb_f_trace_var(), rb_gv_get(), and rb_gv_set().
Definition at line 730 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_get().
Referenced by load_file(), and mSyslog_open().
Definition at line 721 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_set().
Referenced by process_sflag(), and restore_lineno().
VALUE rb_gvar_defined | ( | struct global_entry * | entry | ) |
Definition at line 739 of file variable.c.
References Qfalse, Qtrue, and undef_getter.
VALUE rb_gvar_get | ( | struct global_entry * | entry | ) |
Definition at line 670 of file variable.c.
References global_variable::data, global_variable::getter, and var.
VALUE rb_gvar_set | ( | struct global_entry * | entry, |
VALUE | val | ||
) |
Definition at line 702 of file variable.c.
References global_variable::block_trace, global_variable::data, rb_ensure(), rb_eSecurityError, rb_raise(), rb_safe_level, global_variable::setter, global_variable::trace, trace_data::trace, trace_en(), trace_ev(), trace_data::val, and val.
Definition at line 2220 of file variable.c.
References rb_intern, and rb_ivar_get().
Referenced by call_trace_proc(), callback(), esignal_signo(), function_call(), localjump_reason(), localjump_xvalue(), method_inspect(), ossl_call_session_get_cb(), ossl_call_session_new_cb(), ossl_call_session_remove_cb(), ossl_ssl_setup(), ossl_sslctx_setup(), ossl_x509extfactory_create_ext(), ossl_x509stctx_initialize(), ossl_x509stctx_verify(), ossl_x509store_verify(), parse(), pst_to_i(), rb_mod_to_s(), ruby_cleanup(), and sysexit_status().
Definition at line 2228 of file variable.c.
References rb_intern, and rb_ivar_set().
Referenced by build_exception(), esignal_init(), exc_initialize(), exc_set_backtrace(), exit_initialize(), initialize(), initialize_params(), make_localjump_error(), name_err_initialize(), nometh_err_initialize(), ossl_ssl_initialize(), ossl_sslctx_initialize(), ossl_x509extfactory_alloc(), ossl_x509extfactory_set_crl(), ossl_x509extfactory_set_issuer_cert(), ossl_x509extfactory_set_subject_cert(), ossl_x509extfactory_set_subject_req(), ossl_x509stctx_initialize(), ossl_x509store_initialize(), ossl_x509store_set_flags(), ossl_x509store_set_purpose(), ossl_x509store_set_time(), ossl_x509store_set_trust(), ossl_x509store_set_vfy_cb(), ossl_x509store_verify(), raise_from_check(), rb_last_status_set(), setup_exception(), switch(), syck_badalias_initialize(), syck_domaintype_initialize(), syck_genericresolver_node_import(), syck_map_initialize(), syck_map_style_set(), syck_map_value_set(), syck_node_type_id_set(), syck_privatetype_initialize(), syck_scalar_initialize(), syck_scalar_style_set(), syck_scalar_value_set(), syck_seq_initialize(), syck_seq_style_set(), syck_seq_value_set(), syck_set_ivars(), syck_yobject_initialize(), and syserr_initialize().
st_index_t rb_ivar_count | ( | VALUE | obj | ) |
Definition at line 1203 of file variable.c.
References count, data, FL_EXIVAR, FL_TEST, i, st_table::num_entries, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, st_lookup, T_CLASS, T_MODULE, T_OBJECT, tbl, and TYPE.
Definition at line 1112 of file variable.c.
References FL_EXIVAR, FL_TEST, generic_ivar_defined(), index, Qfalse, Qtrue, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup, T_CLASS, T_MODULE, T_OBJECT, TYPE, and val.
Referenced by get_digest_base_metadata(), rb_obj_ivar_defined(), and struct_ivar_get().
Definition at line 1177 of file variable.c.
References FL_EXIVAR, FL_TEST, func, obj_ivar_each(), rb_special_const_p(), RCLASS_IV_TBL, st_foreach_safe(), st_lookup, T_CLASS, T_MODULE, T_OBJECT, tbl, and TYPE.
Referenced by inspect_obj(), rb_obj_instance_variables(), and w_objivar().
Definition at line 1026 of file variable.c.
References ivar_get(), and TRUE.
Referenced by add_event_call_back(), chunk_i(), echild_status(), EVENTSINK_Invoke(), fev_get_handler(), fev_off_event(), fole_s_show_help(), folemethod_event(), folemethod_name(), foleparam_name(), foletype_name(), folevariable_name(), get_digest_base_metadata(), get_strpath(), initialize_params(), NIL_P(), ossl_start_ssl(), range_loader(), rb_enc_get_index(), rb_iv_get(), rb_method_entry_make(), rb_obj_ivar_get(), rb_undef(), reduce(), singleton_class_of(), slicebefore_i(), struct_ivar_get(), syck_badalias_cmp(), syck_emitter_emit(), syck_map_add_m(), syck_out_map(), syck_out_scalar(), syck_out_seq(), syck_seq_add_m(), syck_set_model(), tcl_protect_core(), and vm_getivar().
Definition at line 1038 of file variable.c.
References ALLOC_N, generic_ivar_set(), i, index, klass, len, MEMCPY, st_table::num_entries, OBJ_UNTRUSTED, ptr, Qundef, rb_check_frozen, rb_eSecurityError, rb_obj_class(), rb_raise(), rb_safe_level, RBASIC, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, REALLOC_N, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_add_direct, st_init_numtable, st_insert, st_lookup, T_CLASS, T_MODULE, T_OBJECT, TYPE, and val.
Definition at line 905 of file variable.c.
References rb_mark_tbl(), st_lookup, and tbl.
Referenced by gc_mark_children().
Definition at line 932 of file variable.c.
References givar_i(), and st_foreach_safe().
Referenced by gc_marks().
Definition at line 2165 of file variable.c.
References ary, cv_i(), rb_ary_new(), RCLASS_IV_TBL, and st_foreach_safe().
Referenced by Init_Object().
Definition at line 1726 of file variable.c.
References data, RCLASS_CONST_TBL, st_foreach_safe(), st_init_numtable, sv_i(), and tbl.
Referenced by rb_mod_const_of(), rb_mod_constants(), and rb_mod_s_constants().
Definition at line 1403 of file variable.c.
References Qnil, rb_frame_pop(), rb_to_id(), and uninitialized_constant().
Referenced by Init_Object().
Definition at line 1739 of file variable.c.
References data, mod, rb_cObject, rb_mod_const_at(), and RCLASS_SUPER.
Referenced by rb_mod_constants(), and rb_mod_s_constants().
Definition at line 1790 of file variable.c.
References Qtrue, rb_const_list(), rb_mod_const_at(), rb_mod_const_of(), rb_scan_args(), RTEST, and tbl.
Referenced by Init_Object(), and rb_mod_s_constants().
Definition at line 180 of file variable.c.
References classname(), NIL_P, path, and rb_str_dup().
Referenced by Init_Object().
Definition at line 1982 of file variable.c.
References CONST_PRIVATE, obj, and set_const_visibility().
Referenced by Init_Object().
Definition at line 1996 of file variable.c.
References CONST_PUBLIC, obj, and set_const_visibility().
Referenced by Init_Object().
Definition at line 1675 of file variable.c.
References rb_const_remove(), rb_id2name(), rb_is_const_id(), rb_name_error(), and rb_to_id().
Referenced by console_dev(), Init_Object(), and make_struct().
Definition at line 2196 of file variable.c.
References id, n, OBJ_UNTRUSTED, Qnil, rb_check_frozen, rb_class2name(), rb_cvar_defined(), rb_eSecurityError, rb_id2name(), rb_is_class_id(), rb_name_error(), rb_raise(), rb_safe_level, rb_to_id(), RCLASS_IV_TBL, st_delete, and val.
Referenced by Init_Object().
Definition at line 299 of file variable.c.
References classid, ID2SYM, and rb_ivar_set().
Referenced by boot_defclass(), rb_define_class(), and rb_define_module_id().
Definition at line 318 of file variable.c.
References CLASS_OF, and rb_class2name().
Referenced by addrinfo_inspect(), BigDecimal_power(), caller_setup_args(), check_strscan(), coerce_rescue(), convert_type(), d_lite_inspect(), define_final(), divmodv(), econv_inspect(), enc_inspect(), eval_string_with_cref(), folevariant_initialize(), generator_initialize(), GetVpValueWithPrec(), init_copy(), inspect_enumerator(), iseq_inspect(), match_inspect(), method_inspect(), must_encoding(), must_respond_to(), name_err_mesg_to_str(), nucomp_coerce(), num2i32(), num_exact(), num_init_copy(), num_sadded(), nurat_coerce(), path_inspect(), proc_to_s(), rand_init(), range_each(), range_step(), rb_any_to_s(), rb_big_coerce(), rb_check_convert_type(), rb_check_inheritable(), rb_check_safe_str(), rb_check_type(), rb_check_typeddata(), rb_cmperr(), rb_convert_type(), rb_define_module(), rb_define_module_id_under(), rb_digest_instance_inspect(), rb_digest_instance_method_unimpl(), rb_f_kill(), rb_hash_set_default_proc(), rb_mod_define_method(), rb_obj_clone(), rb_obj_dup(), rb_obj_inspect(), rb_stat_inspect(), rb_str_index_m(), rb_str_partition(), rb_str_rindex_m(), rb_str_rpartition(), rb_thread_inspect(), rb_to_float(), rb_to_integer(), reg_operand(), rescue_callback(), setup_exception(), sockopt_inspect(), time_timespec(), uscore_get(), vm_define_method(), w_object(), and wdivmod().
Definition at line 1267 of file variable.c.
References ary, ivar_i(), rb_ary_new(), and rb_ivar_foreach().
Referenced by Init_Object().
Definition at line 1299 of file variable.c.
References FL_EXIVAR, FL_TEST, generic_ivar_remove(), id, index, n, OBJ_UNTRUSTED, Qnil, Qundef, rb_check_frozen, rb_eSecurityError, rb_id2name(), rb_is_instance_id(), rb_name_error(), rb_raise(), rb_safe_level, rb_special_const_p(), rb_to_id(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_delete, st_lookup, T_CLASS, T_MODULE, T_OBJECT, TYPE, v, and val.
Referenced by Init_Object().
Definition at line 293 of file variable.c.
References rb_path_to_class(), and rb_str_new_cstr().
Referenced by convert_UTF8_to_JSON_ASCII(), Init_bubblebabble(), Init_funcall(), Init_generator(), Init_md5(), Init_ossl_digest(), Init_parser(), Init_rmd160(), Init_sha1(), Init_sha2(), Init_tcltklib(), and path2class().
Definition at line 253 of file variable.c.
References c, enc, id, p, path, rb_cObject, rb_const_defined(), rb_const_get_at(), rb_eArgError, rb_enc_asciicompat, rb_enc_get(), rb_eTypeError, rb_intern3(), rb_raise(), RSTRING_PTR, T_CLASS, T_MODULE, and TYPE.
Referenced by class2path(), path2class(), path2module(), r_object0(), and rb_path2class().
Definition at line 1865 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 1871 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 1859 of file variable.c.
References rb_const_defined_0(), and TRUE.
Referenced by vm_get_ev_const().
Definition at line 1653 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1659 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1647 of file variable.c.
References rb_const_get_0(), and TRUE.
Referenced by vm_get_ev_const().
Definition at line 236 of file variable.c.
References classpath, OBJ_FREEZE, rb_class_path(), rb_cObject, rb_ivar_set(), rb_str_cat2(), rb_str_dup(), rb_str_new2(), and str.
Referenced by Init_IO().
Definition at line 219 of file variable.c.
References classpath, OBJ_FREEZE, rb_class_path(), rb_cObject, rb_ivar_set(), rb_str_append(), rb_str_cat2(), rb_str_dup(), rb_str_new_frozen(), and str.
Referenced by rb_define_class_id_under(), and rb_define_module_id_under().
Definition at line 538 of file variable.c.
References rb_ary_new3(), and rb_eval_cmd().
Referenced by rb_f_trace_var().
void readonly_setter | ( | VALUE | val, |
ID | id, | ||
void * | data, | ||
struct global_variable * | gvar | ||
) |
Definition at line 452 of file variable.c.
References rb_id2name(), and rb_name_error().
|
static |
Definition at line 595 of file variable.c.
References trace_var::next, trace_var::removed, t, global_variable::trace, and xfree.
Referenced by rb_f_untrace_var(), and trace_en().
Definition at line 1502 of file variable.c.
References rb_set_safe_level_force(), and safe.
Referenced by autoload_node().
|
static |
Definition at line 1943 of file variable.c.
References argc, flag, i, id, OBJ_UNTRUSTED, rb_class2name(), rb_clear_cache_by_class(), rb_eSecurityError, rb_frame_callee(), rb_id2name(), rb_name_error(), rb_raise(), rb_safe_level, rb_to_id(), rb_warning(), RCLASS_CONST_TBL, st_lookup, v, and val.
Referenced by rb_mod_private_constant(), and rb_mod_public_constant().
|
static |
Definition at line 1715 of file variable.c.
References rb_is_const_id(), ST_CONTINUE, st_insert, and st_lookup.
Referenced by rb_mod_const_at().
|
static |
Definition at line 694 of file variable.c.
References global_variable::block_trace, Qnil, and remove_trace().
Referenced by rb_gvar_set().
|
static |
Definition at line 682 of file variable.c.
References trace_var::data, trace_var::func, trace_var::next, Qnil, trace_data::trace, and trace_data::val.
Referenced by rb_gvar_set().
VALUE undef_getter | ( | ID | id, |
void * | data, | ||
struct global_variable * | var | ||
) |
Definition at line 390 of file variable.c.
References Qnil, rb_id2name(), and rb_warning().
Definition at line 408 of file variable.c.
void undef_setter | ( | VALUE | val, |
ID | id, | ||
void * | data, | ||
struct global_variable * | var | ||
) |
Definition at line 398 of file variable.c.
References global_variable::data, global_variable::getter, global_variable::marker, global_variable::setter, val_getter, val_marker, and val_setter.
Definition at line 1348 of file variable.c.
References rb_class2name(), rb_class_real(), rb_cObject, rb_id2name(), and rb_name_error().
Referenced by rb_mod_const_missing().
VALUE val_getter | ( | ID | id, |
void * | data, | ||
struct global_variable * | var | ||
) |
Definition at line 413 of file variable.c.
References data.
Definition at line 425 of file variable.c.
References data, and rb_gc_mark_maybe().
void val_setter | ( | VALUE | val, |
ID | id, | ||
void * | data, | ||
struct global_variable * | var | ||
) |
Definition at line 419 of file variable.c.
References global_variable::data.
VALUE var_getter | ( | ID | id, |
void * | data, | ||
struct global_variable * | gvar | ||
) |
Definition at line 432 of file variable.c.
Definition at line 446 of file variable.c.
References rb_gc_mark_maybe().
void var_setter | ( | VALUE | val, |
ID | id, | ||
void * | data, | ||
struct global_variable * | gvar | ||
) |
Definition at line 440 of file variable.c.
|
static |
Definition at line 24 of file variable.c.
Referenced by autoload_delete(), autoload_node(), Init_var_tables(), and rb_autoload().
|
static |
Definition at line 1429 of file variable.c.
|
static |
Definition at line 24 of file variable.c.
Referenced by classname(), Init_var_tables(), and rb_name_class().
|
static |
Definition at line 24 of file variable.c.
Referenced by classname(), fc_path(), find_class_path(), Init_var_tables(), rb_set_class_path(), and rb_set_class_path_string().
|
static |
Definition at line 816 of file variable.c.
st_table* rb_global_tbl |
Definition at line 22 of file variable.c.
|
static |
Definition at line 815 of file variable.c.
|
static |
Definition at line 24 of file variable.c.
Referenced by find_class_path(), Init_var_tables(), and rb_class_path().