Ruby
2.1.10p492(2016-04-01revision54464)
|
Go to the source code of this file.
Macros | |
#define | N_REF_FUNC numberof(ref_func) |
Variables | |
VALUE | rb_cStruct |
static ID | id_members |
static VALUE(*const | ref_func [])(VALUE) |
Definition at line 132 of file struct.c.
Referenced by rb_struct_new(), and setup_struct().
Definition at line 177 of file struct.c.
References rb_class_inherited(), rb_class_new(), rb_make_metaclass(), and RBASIC.
Referenced by rb_struct_define(), rb_struct_s_def(), and struct_define_without_accessor().
Definition at line 1068 of file struct.c.
References id_members, rb_cObject, rb_cStruct, rb_define_alias(), rb_define_class(), rb_define_method(), rb_define_singleton_method(), rb_include_module(), rb_intern, rb_mEnumerable, rb_struct_aref(), rb_struct_aset(), rb_struct_each(), rb_struct_each_pair(), rb_struct_eql(), rb_struct_equal(), rb_struct_hash(), rb_struct_init_copy(), rb_struct_initialize_m(), rb_struct_inspect(), rb_struct_members_m(), rb_struct_s_def(), rb_struct_select(), rb_struct_size(), rb_struct_to_a(), rb_struct_to_h(), rb_struct_values_at(), and rb_undef_alloc_func().
Definition at line 605 of file struct.c.
References i, id, len, OBJ_INFECT, RARRAY_AREF, rb_class_name(), rb_id2str(), rb_inspect(), rb_is_const_id(), rb_is_local_id(), rb_obj_class(), rb_str_append(), rb_str_cat2(), rb_str_new2, rb_struct_members(), RSTRING_PTR, RSTRUCT_GET, RSTRUCT_LEN, str, and SYM2ID.
Referenced by rb_struct_inspect().
Definition at line 188 of file struct.c.
References id, ID2SYM, PRIsVALUE, QUOTE, rb_const_defined_at(), rb_define_class_id_under(), rb_is_const_name(), rb_mod_remove_const(), rb_name_error_str(), rb_str_to_str(), rb_to_id(), and rb_warn().
Referenced by rb_struct_define(), and rb_struct_s_def().
NORETURN | ( | static void | not_a_memberID id | ) |
Definition at line 91 of file struct.c.
References PRIsVALUE, QUOTE_ID, and rb_name_error().
Referenced by rb_struct_getmember(), and rb_struct_set().
|
static |
Definition at line 432 of file struct.c.
References id_members, RARRAY_LEN, rb_eTypeError, rb_raise(), RB_TYPE_P, struct_ivar_get(), and T_ARRAY.
Referenced by rb_struct_initialize_m(), rb_struct_new(), and struct_alloc().
Definition at line 494 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR(), and rb_class_new_instance().
Definition at line 235 of file struct.c.
References struct_alloc().
Referenced by Init_thread(), and range_alloc().
Definition at line 757 of file struct.c.
References i, NUM2LONG, PRIsVALUE, QUOTE, rb_check_id(), rb_eIndexError, rb_name_error_str(), rb_raise(), rb_struct_aref_id(), RB_TYPE_P, RSTRUCT_GET, RSTRUCT_LEN, SYM2ID, T_STRING, and T_SYMBOL.
Referenced by Init_Struct(), and struct_entry().
Definition at line 724 of file struct.c.
References i, len, RARRAY_AREF, RARRAY_LEN, rb_id2name(), rb_name_error(), rb_struct_members(), RSTRUCT_GET, SYM2ID, and UNREACHABLE.
Referenced by rb_struct_aref().
Definition at line 827 of file struct.c.
References i, NUM2LONG, PRIsVALUE, QUOTE, rb_check_id(), rb_eIndexError, rb_name_error_str(), rb_raise(), rb_struct_aset_id(), rb_struct_modify(), RB_TYPE_P, RSTRUCT_LEN, RSTRUCT_SET, SYM2ID, T_STRING, T_SYMBOL, and val.
Referenced by Init_Struct().
Definition at line 785 of file struct.c.
References i, len, RARRAY_AREF, RARRAY_LEN, rb_eTypeError, rb_id2name(), rb_name_error(), rb_raise(), rb_struct_members(), rb_struct_modify(), RSTRUCT_LEN, RSTRUCT_SET, SYM2ID, UNREACHABLE, and val.
Referenced by rb_struct_aset().
Definition at line 306 of file struct.c.
References anonymous_struct(), ary, ID2SYM, new_struct(), rb_ary_push(), rb_ary_tmp_new(), rb_cStruct, rb_intern, rb_str_new2, setup_struct(), st, and va_end().
Definition at line 327 of file struct.c.
References ary, ID2SYM, rb_ary_push(), rb_ary_tmp_new(), rb_cStruct, rb_define_class_under(), rb_intern, setup_struct(), and va_end().
Referenced by Init_etc(), and Init_process().
VALUE rb_struct_define_without_accessor | ( | const char * | class_name, |
VALUE | super, | ||
rb_alloc_func_t | alloc, | ||
... | |||
) |
Definition at line 288 of file struct.c.
References ID2SYM, name, NULL, OBJ_FREEZE, rb_ary_push(), rb_ary_tmp_new(), rb_intern, struct_define_without_accessor(), and va_end().
Referenced by Init_Range().
VALUE rb_struct_define_without_accessor_under | ( | VALUE | outer, |
const char * | class_name, | ||
VALUE | super, | ||
rb_alloc_func_t | alloc, | ||
... | |||
) |
Definition at line 270 of file struct.c.
References ID2SYM, name, NULL, OBJ_FREEZE, rb_ary_push(), rb_ary_tmp_new(), rb_intern, struct_define_without_accessor(), and va_end().
Referenced by Init_thread().
Definition at line 549 of file struct.c.
References i, rb_yield(), RETURN_SIZED_ENUMERATOR, RSTRUCT_GET, RSTRUCT_LEN, s, and struct_enum_size().
Referenced by Init_Struct().
Definition at line 580 of file struct.c.
References i, key, rb_ary_entry(), rb_assoc_new(), rb_block_arity(), rb_struct_members(), rb_yield(), rb_yield_values(), RETURN_SIZED_ENUMERATOR, RSTRUCT_GET, RSTRUCT_LEN, s, struct_enum_size(), and value.
Referenced by Init_Struct().
Definition at line 1012 of file struct.c.
References Qfalse, Qtrue, rb_bug(), rb_exec_recursive_paired(), rb_obj_class(), RB_TYPE_P, recursive_eql(), RSTRUCT_LEN, and T_STRUCT.
Referenced by Init_Struct().
Definition at line 948 of file struct.c.
References Qfalse, Qtrue, rb_bug(), rb_exec_recursive_paired(), rb_obj_class(), RB_TYPE_P, recursive_equal(), RSTRUCT_LEN, and T_STRUCT.
Referenced by Init_Struct().
Definition at line 97 of file struct.c.
References i, ID2SYM, len, not_a_member(), RARRAY_AREF, RARRAY_LEN, rb_struct_members(), RSTRUCT_GET, and UNREACHABLE.
Referenced by rb_struct_ref().
Definition at line 968 of file struct.c.
References i, INT2FIX, len, n, NUM2LONG, ptr, rb_hash(), rb_hash_end, rb_hash_start(), rb_hash_uint, rb_obj_class(), RSTRUCT_CONST_PTR, and RSTRUCT_LEN.
Referenced by Init_Struct().
Definition at line 707 of file struct.c.
References i, len, OBJ_INIT_COPY, rb_eTypeError, rb_raise(), RSTRUCT_GET, RSTRUCT_LEN, and RSTRUCT_SET.
Referenced by Init_Struct(), and range_initialize_copy().
Definition at line 466 of file struct.c.
References RARRAY_CONST_PTR, RARRAY_LENINT, and rb_struct_initialize_m().
Referenced by r_object0().
Definition at line 446 of file struct.c.
References argc, i, klass, n, num_members(), Qnil, rb_eArgError, rb_mem_clear(), rb_obj_class(), rb_raise(), rb_struct_modify(), RSTRUCT_CONST_PTR, and RSTRUCT_SET.
Referenced by Init_Struct(), and rb_struct_initialize().
Definition at line 658 of file struct.c.
References inspect_struct(), and rb_exec_recursive().
Referenced by Init_Struct().
Definition at line 33 of file struct.c.
References rb_intern, and struct_ivar_get().
Definition at line 53 of file struct.c.
References RARRAY_LEN, rb_eTypeError, rb_obj_class(), rb_raise(), rb_struct_s_members(), and RSTRUCT_LEN.
Referenced by inspect_struct(), rb_struct_aref_id(), rb_struct_aset_id(), rb_struct_each_pair(), rb_struct_getmember(), rb_struct_set(), rb_struct_to_h(), and w_object().
Definition at line 84 of file struct.c.
References rb_obj_class(), and rb_struct_s_members_m().
Referenced by Init_Struct().
Definition at line 148 of file struct.c.
References rb_check_frozen, and rb_check_trusted.
Referenced by rb_struct_aset(), rb_struct_aset_id(), rb_struct_initialize_m(), and rb_struct_set().
Definition at line 500 of file struct.c.
References args, i, N_REF_FUNC, num_members(), numberof, RARRAY_PTR(), rb_ary_tmp_new(), rb_class_new_instance(), rb_long2int, size, and va_end().
Definition at line 116 of file struct.c.
References rb_frame_this_func(), and rb_struct_getmember().
Referenced by setup_struct().
Definition at line 121 of file struct.c.
References RSTRUCT_GET.
Definition at line 122 of file struct.c.
References RSTRUCT_GET.
Definition at line 123 of file struct.c.
References RSTRUCT_GET.
Definition at line 124 of file struct.c.
References RSTRUCT_GET.
Definition at line 125 of file struct.c.
References RSTRUCT_GET.
Definition at line 126 of file struct.c.
References RSTRUCT_GET.
Definition at line 127 of file struct.c.
References RSTRUCT_GET.
Definition at line 128 of file struct.c.
References RSTRUCT_GET.
Definition at line 129 of file struct.c.
References RSTRUCT_GET.
Definition at line 130 of file struct.c.
References RSTRUCT_GET.
Definition at line 395 of file struct.c.
References anonymous_struct(), argc, argv, i, id, ID2SYM, name, new_struct(), NIL_P(), Qnil, RARRAY_ASET, rb_ary_set_len(), rb_ary_tmp_new(), rb_block_given_p(), rb_check_arity, rb_mod_module_eval(), rb_to_id(), setup_struct(), st, SYMBOL_P, and UNLIMITED_ARGUMENTS.
Referenced by Init_Struct().
Definition at line 39 of file struct.c.
References id_members, NIL_P(), rb_eTypeError, rb_raise(), RB_TYPE_P, struct_ivar_get(), and T_ARRAY.
Referenced by r_object0(), rb_struct_members(), and rb_struct_s_members_m().
Definition at line 65 of file struct.c.
References rb_ary_dup(), and rb_struct_s_members().
Referenced by rb_struct_members_m(), and setup_struct().
Definition at line 899 of file struct.c.
References i, rb_ary_new(), rb_ary_push(), rb_check_arity, rb_yield(), result, RETURN_SIZED_ENUMERATOR, RSTRUCT_GET, RSTRUCT_LEN, RTEST, and struct_enum_size().
Referenced by Init_Struct().
Definition at line 155 of file struct.c.
References i, len, not_a_member(), RARRAY_AREF, RARRAY_LEN, rb_frame_this_func(), rb_id_attrset(), rb_struct_members(), rb_struct_modify(), RSTRUCT_SET, SYM2ID, UNREACHABLE, and val.
Referenced by setup_struct().
Definition at line 1037 of file struct.c.
References LONG2FIX, and RSTRUCT_LEN.
Referenced by Init_Struct(), and struct_enum_size().
Definition at line 676 of file struct.c.
References rb_ary_new4, RSTRUCT_CONST_PTR, and RSTRUCT_LEN.
Referenced by Init_Struct().
Definition at line 693 of file struct.c.
References i, rb_ary_entry(), rb_hash_aset(), rb_hash_new(), rb_struct_members(), RSTRUCT_GET, and RSTRUCT_LEN.
Referenced by Init_Struct().
Definition at line 879 of file struct.c.
References rb_get_values_at(), RSTRUCT_LEN, and struct_entry().
Referenced by Init_Struct().
Definition at line 987 of file struct.c.
References i, len, ptr, Qfalse, Qtrue, rb_eql(), RSTRUCT_CONST_PTR, and RSTRUCT_LEN.
Referenced by rb_struct_eql().
Definition at line 917 of file struct.c.
References i, len, ptr, Qfalse, Qtrue, rb_equal(), RSTRUCT_CONST_PTR, and RSTRUCT_LEN.
Referenced by rb_struct_equal().
Definition at line 206 of file struct.c.
References i, id_members, len, N_REF_FUNC, OBJ_FREEZE, RARRAY_CONST_PTR, RARRAY_LEN, rb_class_new_instance(), rb_define_alloc_func(), rb_define_method_id(), rb_define_singleton_method(), rb_id_attrset(), rb_ivar_set(), rb_struct_ref(), rb_struct_s_members_m(), rb_struct_set(), ref_func, struct_alloc(), and SYM2ID.
Referenced by rb_struct_define(), rb_struct_define_under(), and rb_struct_s_def().
Definition at line 472 of file struct.c.
References ALLOC_N, FL_WB_PROTECTED, n, NEWOBJ_OF, num_members(), rb_mem_clear(), RBASIC, RGENGC_WB_PROTECTED_STRUCT, RSTRUCT_EMBED_LEN_MASK, RSTRUCT_EMBED_LEN_MAX, RSTRUCT_EMBED_LEN_SHIFT, st, and T_STRUCT.
Referenced by rb_struct_alloc_noinit(), setup_struct(), and struct_define_without_accessor().
|
static |
Definition at line 241 of file struct.c.
References anonymous_struct(), id_members, klass, rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_ivar_set(), and struct_alloc().
Referenced by rb_struct_define_without_accessor(), and rb_struct_define_without_accessor_under().
Definition at line 859 of file struct.c.
References LONG2NUM, and rb_struct_aref().
Referenced by rb_struct_values_at().
Definition at line 524 of file struct.c.
References rb_struct_size().
Referenced by rb_struct_each(), rb_struct_each_pair(), and rb_struct_select().
Definition at line 21 of file struct.c.
References Qnil, rb_cStruct, rb_ivar_defined(), rb_ivar_get(), and RCLASS_SUPER.
Referenced by num_members(), rb_struct_iv_get(), and rb_struct_s_members().
|
static |
Definition at line 16 of file struct.c.
Referenced by Init_Struct(), num_members(), rb_struct_s_members(), setup_struct(), and struct_define_without_accessor().