Ruby
1.9.3p547(2014-05-14revision45962)
|
Go to the source code of this file.
Macros | |
#define | numberof(array) (int)(sizeof(array) / sizeof((array)[0])) |
#define | N_REF_FUNC numberof(ref_func) |
Variables | |
VALUE | rb_cStruct |
static ID | id_members |
static VALUE(*const | ref_func [])(VALUE) |
Definition at line 137 of file struct.c.
Referenced by make_struct(), and rb_struct_new().
Definition at line 136 of file struct.c.
Referenced by rb_struct_new().
void Init_Struct | ( | void | ) |
Definition at line 944 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_values_at(), and rb_undef_alloc_func().
Definition at line 510 of file struct.c.
References i, id, len, OBJ_INFECT, RARRAY_PTR, 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_LEN, RSTRUCT_PTR, and SYM2ID.
Referenced by rb_struct_inspect().
Definition at line 183 of file struct.c.
References i, id, ID2SYM, id_members, len, N_REF_FUNC, NIL_P, OBJ_FREEZE, RARRAY_LEN, RARRAY_PTR, rb_class_inherited(), rb_class_new(), rb_class_new_instance(), rb_const_defined_at(), rb_define_alloc_func(), rb_define_class_id_under(), rb_define_method_id(), rb_define_singleton_method(), rb_id_attrset(), rb_is_const_id(), rb_is_local_id(), rb_ivar_set(), rb_make_metaclass(), rb_mod_remove_const(), rb_name_error(), rb_str_to_str(), rb_struct_ref(), rb_struct_s_members_m(), rb_struct_set(), rb_to_id(), rb_warn(), RBASIC, ref_func, StringValuePtr, struct_alloc(), and SYM2ID.
Referenced by rb_struct_define(), and rb_struct_s_def().
Definition at line 354 of file struct.c.
References id_members, RARRAY_LEN, rb_eTypeError, rb_raise(), struct_ivar_get(), T_ARRAY, and TYPE.
Referenced by rb_struct_initialize_m(), rb_struct_new(), and struct_alloc().
Definition at line 415 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR, and rb_class_new_instance().
Definition at line 644 of file struct.c.
References i, NUM2LONG(), rb_eIndexError, rb_raise(), rb_struct_aref_id(), rb_to_id(), RSTRUCT_LEN, RSTRUCT_PTR, T_STRING, T_SYMBOL, and TYPE.
Referenced by Init_Struct(), and struct_entry().
Definition at line 606 of file struct.c.
References i, len, Qnil, RARRAY_LEN, RARRAY_PTR, rb_id2name(), rb_name_error(), rb_struct_members(), RSTRUCT_PTR, and SYM2ID.
Referenced by rb_struct_aref().
Definition at line 709 of file struct.c.
References i, NUM2LONG(), rb_eIndexError, rb_raise(), rb_struct_aset_id(), rb_struct_modify(), rb_to_id(), RSTRUCT_LEN, RSTRUCT_PTR, T_STRING, T_SYMBOL, and TYPE.
Referenced by Init_Struct().
Definition at line 664 of file struct.c.
References i, len, RARRAY_LEN, RARRAY_PTR, rb_eTypeError, rb_id2name(), rb_name_error(), rb_raise(), rb_struct_members(), rb_struct_modify(), RSTRUCT_LEN, RSTRUCT_PTR, and SYM2ID.
Referenced by rb_struct_aset().
Definition at line 274 of file struct.c.
References ID2SYM, make_struct(), Qnil, rb_ary_new(), rb_ary_push(), rb_cStruct, rb_intern, and rb_str_new2().
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 239 of file struct.c.
References ID2SYM, id_members, name, NULL, OBJ_FREEZE, rb_ary_new2(), rb_ary_push(), rb_class_inherited(), rb_class_new(), rb_define_alloc_func(), rb_define_class(), rb_intern, rb_ivar_set(), rb_make_metaclass(), RBASIC, and struct_alloc().
Referenced by Init_Range().
Definition at line 463 of file struct.c.
References i, rb_yield(), RETURN_ENUMERATOR, RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by Init_Struct().
Definition at line 496 of file struct.c.
References i, rb_ary_entry(), rb_struct_members(), rb_yield_values(), RETURN_ENUMERATOR, RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by Init_Struct().
Definition at line 898 of file struct.c.
References Qfalse, Qtrue, rb_bug(), rb_exec_recursive_paired(), rb_obj_class(), recursive_eql(), RSTRUCT_LEN, T_STRUCT, and TYPE.
Referenced by Init_Struct().
Definition at line 828 of file struct.c.
References Qfalse, Qtrue, rb_bug(), rb_exec_recursive_paired(), rb_obj_class(), recursive_equal(), RSTRUCT_LEN, T_STRUCT, and TYPE.
Referenced by Init_Struct().
Definition at line 100 of file struct.c.
References i, ID2SYM, len, Qnil, RARRAY_LEN, RARRAY_PTR, rb_id2name(), rb_name_error(), rb_struct_members(), and RSTRUCT_PTR.
Referenced by rb_struct_ref().
Definition at line 868 of file struct.c.
References rb_exec_recursive_outer(), and recursive_hash().
Referenced by Init_Struct().
Definition at line 590 of file struct.c.
References MEMCPY, rb_check_frozen, rb_eTypeError, rb_obj_class(), rb_obj_is_instance_of(), rb_raise(), RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by Init_Struct().
Definition at line 386 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR, and rb_struct_initialize_m().
Referenced by r_object0().
Definition at line 368 of file struct.c.
References MEMCPY, num_members(), Qnil, rb_eArgError, rb_mem_clear(), rb_obj_class(), rb_raise(), rb_struct_modify(), and RSTRUCT_PTR.
Referenced by Init_Struct(), and rb_struct_initialize().
Definition at line 565 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(), and w_object().
Definition at line 94 of file struct.c.
References rb_obj_class(), and rb_struct_s_members_m().
Referenced by Init_Struct().
|
static |
Definition at line 153 of file struct.c.
References OBJ_UNTRUSTED, rb_check_frozen, rb_eSecurityError, rb_raise(), and rb_safe_level.
Referenced by rb_struct_aset(), rb_struct_aset_id(), rb_struct_initialize_m(), and rb_struct_set().
Definition at line 421 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, and size.
Definition at line 120 of file struct.c.
References rb_frame_this_func(), and rb_struct_getmember().
Referenced by make_struct().
Definition at line 125 of file struct.c.
References RSTRUCT_PTR.
Definition at line 126 of file struct.c.
References RSTRUCT_PTR.
Definition at line 127 of file struct.c.
References RSTRUCT_PTR.
Definition at line 128 of file struct.c.
References RSTRUCT_PTR.
Definition at line 129 of file struct.c.
References RSTRUCT_PTR.
Definition at line 130 of file struct.c.
References RSTRUCT_PTR.
Definition at line 131 of file struct.c.
References RSTRUCT_PTR.
Definition at line 132 of file struct.c.
References RSTRUCT_PTR.
Definition at line 133 of file struct.c.
References RSTRUCT_PTR.
Definition at line 134 of file struct.c.
References RSTRUCT_PTR.
Definition at line 329 of file struct.c.
References i, id, ID2SYM, make_struct(), name, NIL_P, Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_unshift(), rb_block_given_p(), rb_mod_module_eval(), rb_scan_args(), rb_to_id(), and SYMBOL_P.
Referenced by Init_Struct().
Definition at line 39 of file struct.c.
References id_members, NIL_P, rb_eTypeError, rb_raise(), struct_ivar_get(), T_ARRAY, and TYPE.
Referenced by r_object0(), rb_struct_members(), and rb_struct_s_members_m().
Definition at line 65 of file struct.c.
References p, RARRAY_LEN, RARRAY_PTR, rb_ary_new2(), rb_ary_push(), and rb_struct_s_members().
Referenced by make_struct(), and rb_struct_members_m().
Definition at line 775 of file struct.c.
References i, rb_ary_new(), rb_ary_push(), rb_eArgError, rb_raise(), rb_yield(), result, RETURN_ENUMERATOR, RSTRUCT_LEN, RSTRUCT_PTR, and RTEST.
Referenced by Init_Struct().
Definition at line 161 of file struct.c.
References i, len, Qnil, RARRAY_LEN, RARRAY_PTR, rb_frame_this_func(), rb_id2name(), rb_id_attrset(), rb_name_error(), rb_struct_members(), rb_struct_modify(), RSTRUCT_PTR, and SYM2ID.
Referenced by make_struct().
Definition at line 923 of file struct.c.
References LONG2FIX, and RSTRUCT_LEN.
Referenced by Init_Struct().
Definition at line 583 of file struct.c.
References rb_ary_new4(), RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by Init_Struct().
Definition at line 754 of file struct.c.
References rb_get_values_at(), RSTRUCT_LEN, and struct_entry().
Referenced by Init_Struct().
Definition at line 874 of file struct.c.
References i, len, Qfalse, Qtrue, rb_eql(), RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by rb_struct_eql().
Definition at line 795 of file struct.c.
References i, len, Qfalse, Qtrue, rb_equal(), RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by rb_struct_equal().
Definition at line 841 of file struct.c.
References i, INT2FIX, len, NUM2LONG(), rb_hash(), rb_hash_end(), rb_hash_start(), rb_hash_uint(), rb_obj_class(), RSTRUCT_LEN, and RSTRUCT_PTR.
Referenced by rb_struct_hash().
Definition at line 392 of file struct.c.
References ALLOC_N, NEWOBJ, num_members(), OBJSETUP, rb_mem_clear(), RBASIC, RSTRUCT_EMBED_LEN_MASK, RSTRUCT_EMBED_LEN_MAX, RSTRUCT_EMBED_LEN_SHIFT, and T_STRUCT.
Referenced by make_struct(), rb_struct_alloc_noinit(), and rb_struct_define_without_accessor().
Definition at line 732 of file struct.c.
References LONG2NUM, and rb_struct_aref().
Referenced by rb_struct_values_at().
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(), make_struct(), num_members(), rb_struct_define_without_accessor(), and rb_struct_s_members().
VALUE rb_cStruct |
Definition at line 15 of file struct.c.
Referenced by Init_Struct(), rb_struct_define(), and struct_ivar_get().