Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Functions | Variables
object.c File Reference
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby/encoding.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include "constant.h"
#include "internal.h"
#include "id.h"
#include "probes.h"

Go to the source code of this file.

Data Structures

struct  conv_method_tbl
 

Macros

#define id_eq   idEq
 
#define id_eql   idEqlP
 
#define id_match   idEqTilde
 
#define id_inspect   idInspect
 
#define id_init_copy   idInitialize_copy
 
#define id_init_clone   idInitialize_clone
 
#define id_init_dup   idInitialize_dup
 
#define id_const_missing   idConst_missing
 
#define CLASS_OR_MODULE_P(obj)
 
#define id_for_setter(name, type, message)   check_setter_id(name, rb_is_##type##_id, rb_is_##type##_name, message)
 
#define IMPLICIT_CONVERSIONS   7
 
#define OutOfRange()
 
#define rb_intern(str)   rb_intern_const(str)
 

Functions

VALUE rb_obj_hide (VALUE obj)
 
VALUE rb_obj_reveal (VALUE obj, VALUE klass)
 
VALUE rb_obj_setup (VALUE obj, VALUE klass, VALUE type)
 
VALUE rb_equal (VALUE obj1, VALUE obj2)
 
int rb_eql (VALUE obj1, VALUE obj2)
 
VALUE rb_obj_equal (VALUE obj1, VALUE obj2)
 
VALUE rb_obj_hash (VALUE obj)
 
VALUE rb_obj_not (VALUE obj)
 
VALUE rb_obj_not_equal (VALUE obj1, VALUE obj2)
 
VALUE rb_class_real (VALUE cl)
 
VALUE rb_obj_class (VALUE obj)
 
static VALUE rb_obj_singleton_class (VALUE obj)
 
void rb_obj_copy_ivar (VALUE dest, VALUE obj)
 
static void init_copy (VALUE dest, VALUE obj)
 
VALUE rb_obj_clone (VALUE obj)
 
VALUE rb_obj_dup (VALUE obj)
 
VALUE rb_obj_init_copy (VALUE obj, VALUE orig)
 
VALUE rb_obj_init_dup_clone (VALUE obj, VALUE orig)
 
VALUE rb_any_to_s (VALUE obj)
 
VALUE rb_inspect (VALUE obj)
 
static int inspect_i (st_data_t k, st_data_t v, st_data_t a)
 
static VALUE inspect_obj (VALUE obj, VALUE str, int recur)
 
static VALUE rb_obj_inspect (VALUE obj)
 
static VALUE class_or_module_required (VALUE c)
 
static VALUE class_search_ancestor (VALUE cl, VALUE c)
 
VALUE rb_obj_is_instance_of (VALUE obj, VALUE c)
 
VALUE rb_obj_is_kind_of (VALUE obj, VALUE c)
 
VALUE rb_class_search_ancestor (VALUE cl, VALUE c)
 
VALUE rb_obj_tap (VALUE obj)
 
static VALUE rb_obj_dummy (void)
 
VALUE rb_obj_tainted (VALUE obj)
 
VALUE rb_obj_taint (VALUE obj)
 
VALUE rb_obj_untaint (VALUE obj)
 
VALUE rb_obj_untrusted (VALUE obj)
 
VALUE rb_obj_untrust (VALUE obj)
 
VALUE rb_obj_trust (VALUE obj)
 
void rb_obj_infect (VALUE obj1, VALUE obj2)
 
VALUE rb_obj_freeze (VALUE obj)
 
VALUE rb_obj_frozen_p (VALUE obj)
 
static VALUE nil_to_i (VALUE obj)
 
static VALUE nil_to_f (VALUE obj)
 
static VALUE nil_to_s (VALUE obj)
 
static VALUE nil_to_a (VALUE obj)
 
static VALUE nil_to_h (VALUE obj)
 
static VALUE nil_inspect (VALUE obj)
 
static VALUE true_to_s (VALUE obj)
 
static VALUE true_and (VALUE obj, VALUE obj2)
 
static VALUE true_or (VALUE obj, VALUE obj2)
 
static VALUE true_xor (VALUE obj, VALUE obj2)
 
static VALUE false_to_s (VALUE obj)
 
static VALUE false_and (VALUE obj, VALUE obj2)
 
static VALUE false_or (VALUE obj, VALUE obj2)
 
static VALUE false_xor (VALUE obj, VALUE obj2)
 
static VALUE rb_true (VALUE obj)
 
static VALUE rb_false (VALUE obj)
 
static VALUE rb_obj_match (VALUE obj1, VALUE obj2)
 
static VALUE rb_obj_not_match (VALUE obj1, VALUE obj2)
 
static VALUE rb_obj_cmp (VALUE obj1, VALUE obj2)
 
static VALUE rb_mod_to_s (VALUE klass)
 
static VALUE rb_mod_freeze (VALUE mod)
 
static VALUE rb_mod_eqq (VALUE mod, VALUE arg)
 
VALUE rb_class_inherited_p (VALUE mod, VALUE arg)
 
static VALUE rb_mod_lt (VALUE mod, VALUE arg)
 
static VALUE rb_mod_ge (VALUE mod, VALUE arg)
 
static VALUE rb_mod_gt (VALUE mod, VALUE arg)
 
static VALUE rb_mod_cmp (VALUE mod, VALUE arg)
 
static VALUE rb_module_s_alloc (VALUE klass)
 
static VALUE rb_class_s_alloc (VALUE klass)
 
static VALUE rb_mod_initialize (VALUE module)
 
static VALUE rb_class_initialize (int argc, VALUE *argv, VALUE klass)
 
void rb_undefined_alloc (VALUE klass)
 
VALUE rb_obj_alloc (VALUE klass)
 
static VALUE rb_class_allocate_instance (VALUE klass)
 
VALUE rb_class_new_instance (int argc, VALUE *argv, VALUE klass)
 
VALUE rb_class_superclass (VALUE klass)
 
VALUE rb_class_get_superclass (VALUE klass)
 
static ID check_setter_id (VALUE name, int(*valid_id_p)(ID), int(*valid_name_p)(VALUE), const char *message)
 
static int rb_is_attr_id (ID id)
 
static int rb_is_attr_name (VALUE name)
 
static ID id_for_attr (VALUE name)
 
ID rb_check_attr_id (ID id)
 
static VALUE rb_mod_attr_reader (int argc, VALUE *argv, VALUE klass)
 
VALUE rb_mod_attr (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_mod_attr_writer (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_mod_attr_accessor (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_mod_const_get (int argc, VALUE *argv, VALUE mod)
 
static VALUE rb_mod_const_set (VALUE mod, VALUE name, VALUE value)
 
static VALUE rb_mod_const_defined (int argc, VALUE *argv, VALUE mod)
 
static VALUE rb_obj_ivar_get (VALUE obj, VALUE iv)
 
static VALUE rb_obj_ivar_set (VALUE obj, VALUE iv, VALUE val)
 
static VALUE rb_obj_ivar_defined (VALUE obj, VALUE iv)
 
static VALUE rb_mod_cvar_get (VALUE obj, VALUE iv)
 
static VALUE rb_mod_cvar_set (VALUE obj, VALUE iv, VALUE val)
 
static VALUE rb_mod_cvar_defined (VALUE obj, VALUE iv)
 
static VALUE rb_mod_singleton_p (VALUE klass)
 
static VALUE convert_type (VALUE val, const char *tname, const char *method, int raise)
 
VALUE rb_convert_type (VALUE val, int type, const char *tname, const char *method)
 
VALUE rb_check_convert_type (VALUE val, int type, const char *tname, const char *method)
 
static VALUE rb_to_integer (VALUE val, const char *method)
 
VALUE rb_check_to_integer (VALUE val, const char *method)
 
VALUE rb_to_int (VALUE val)
 
VALUE rb_check_to_int (VALUE val)
 
static VALUE rb_convert_to_integer (VALUE val, int base)
 
VALUE rb_Integer (VALUE val)
 
static VALUE rb_f_integer (int argc, VALUE *argv, VALUE obj)
 
double rb_cstr_to_dbl (const char *p, int badcheck)
 
double rb_str_to_dbl (VALUE str, int badcheck)
 
VALUE rb_Float (VALUE val)
 
static VALUE rb_f_float (VALUE obj, VALUE arg)
 
VALUE rb_to_float (VALUE val)
 
VALUE rb_check_to_float (VALUE val)
 
double rb_num2dbl (VALUE val)
 
VALUE rb_String (VALUE val)
 
static VALUE rb_f_string (VALUE obj, VALUE arg)
 
VALUE rb_Array (VALUE val)
 
static VALUE rb_f_array (VALUE obj, VALUE arg)
 
VALUE rb_Hash (VALUE val)
 
static VALUE rb_f_hash (VALUE obj, VALUE arg)
 
void Init_Object (void)
 Initializes the world of objects and classes. More...
 

Variables

VALUE rb_cBasicObject
 
VALUE rb_mKernel
 
VALUE rb_cObject
 
VALUE rb_cModule
 
VALUE rb_cClass
 
VALUE rb_cData
 
VALUE rb_cNilClass
 
VALUE rb_cTrueClass
 
VALUE rb_cFalseClass
 
static st_tableimmediate_frozen_tbl = 0
 
static const char invalid_attribute_name [] = "invalid attribute name `%"PRIsVALUE"'"
 
static struct conv_method_tbl conv_method_names []
 

Macro Definition Documentation

#define CLASS_OR_MODULE_P (   obj)
Value:
static VALUE VALUE obj
Definition: tcltklib.c:3150
#define T_CLASS
#define T_MODULE
#define BUILTIN_TYPE(x)
#define SPECIAL_CONST_P(x)

Definition at line 48 of file object.c.

Referenced by rb_class_inherited_p(), rb_mod_cmp(), rb_mod_ge(), and rb_mod_to_s().

#define id_const_missing   idConst_missing

Definition at line 46 of file object.c.

Referenced by rb_mod_const_get().

#define id_eq   idEq

Definition at line 39 of file object.c.

Referenced by rb_equal(), and rb_obj_not_equal().

#define id_eql   idEqlP

Definition at line 40 of file object.c.

Referenced by rb_eql().

#define id_for_setter (   name,
  type,
  message 
)    check_setter_id(name, rb_is_##type##_id, rb_is_##type##_name, message)

Definition at line 1910 of file object.c.

Referenced by id_for_attr(), rb_mod_const_set(), rb_mod_cvar_set(), and rb_obj_ivar_set().

#define id_init_clone   idInitialize_clone

Definition at line 44 of file object.c.

Referenced by rb_obj_clone().

#define id_init_copy   idInitialize_copy

Definition at line 43 of file object.c.

Referenced by rb_obj_init_dup_clone().

#define id_init_dup   idInitialize_dup

Definition at line 45 of file object.c.

Referenced by rb_obj_dup().

#define id_inspect   idInspect

Definition at line 42 of file object.c.

Referenced by rb_inspect().

#define id_match   idEqTilde

Definition at line 41 of file object.c.

Referenced by rb_obj_not_match().

#define IMPLICIT_CONVERSIONS   7

Definition at line 2602 of file object.c.

Referenced by convert_type().

#define OutOfRange ( )
Value:
((end - p > max_width) ? \
(w = max_width, ellipsis = "...") : \
(w = (int)(end - p), ellipsis = ""))
VP_EXPORT int
Definition: bigdecimal.c:5172
gz end
Definition: zlib.c:2272
register C_block * p
Definition: crypt.c:309

Referenced by rb_cstr_to_dbl().

#define rb_intern (   str)    rb_intern_const(str)

Function Documentation

static ID check_setter_id ( VALUE  name,
int(*)(ID valid_id_p,
int(*)(VALUE valid_name_p,
const char *  message 
)
static
static VALUE class_or_module_required ( VALUE  c)
static
static VALUE class_search_ancestor ( VALUE  cl,
VALUE  c 
)
static

Definition at line 655 of file object.c.

References RCLASS_M_TBL_WRAPPER, and RCLASS_SUPER.

Referenced by rb_class_inherited_p(), rb_class_search_ancestor(), and rb_obj_is_kind_of().

static VALUE convert_type ( VALUE  val,
const char *  tname,
const char *  method,
int  raise 
)
static
static VALUE false_and ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1315 of file object.c.

References Qfalse.

Referenced by Init_Object().

static VALUE false_or ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1331 of file object.c.

References Qfalse, Qtrue, and RTEST.

Referenced by Init_Object().

static VALUE false_to_s ( VALUE  obj)
static

Definition at line 1299 of file object.c.

References rb_usascii_str_new2.

Referenced by Init_Object().

static VALUE false_xor ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1350 of file object.c.

References Qfalse, Qtrue, and RTEST.

Referenced by Init_Object().

static ID id_for_attr ( VALUE  name)
static

Definition at line 1952 of file object.c.

References id_for_setter.

Referenced by rb_mod_attr(), rb_mod_attr_accessor(), rb_mod_attr_reader(), and rb_mod_attr_writer().

static void init_copy ( VALUE  dest,
VALUE  obj 
)
static
static int inspect_i ( st_data_t  k,
st_data_t  v,
st_data_t  a 
)
static
static VALUE inspect_obj ( VALUE  obj,
VALUE  str,
int  recur 
)
static

Definition at line 514 of file object.c.

References inspect_i(), OBJ_INFECT, rb_ivar_foreach(), rb_str_cat2(), RSTRING_PTR, and str.

Referenced by rb_obj_inspect().

static VALUE nil_inspect ( VALUE  obj)
static

Definition at line 1199 of file object.c.

References rb_usascii_str_new2.

Referenced by Init_Object().

static VALUE nil_to_a ( VALUE  obj)
static

Definition at line 1169 of file object.c.

References rb_ary_new2.

Referenced by Init_Object().

static VALUE nil_to_f ( VALUE  obj)
static

Definition at line 1139 of file object.c.

References DBL2NUM.

Referenced by Init_Object().

static VALUE nil_to_h ( VALUE  obj)
static

Definition at line 1186 of file object.c.

References rb_hash_new().

Referenced by Init_Object().

static VALUE nil_to_i ( VALUE  obj)
static

Definition at line 1124 of file object.c.

References INT2FIX.

Referenced by Init_Object().

static VALUE nil_to_s ( VALUE  obj)
static

Definition at line 1152 of file object.c.

References rb_usascii_str_new().

Referenced by Init_Object().

VALUE rb_any_to_s ( VALUE  obj)
VALUE rb_Array ( VALUE  val)
ID rb_check_attr_id ( ID  id)

Definition at line 1958 of file object.c.

References id, QUOTE_ID, rb_is_attr_id(), and rb_name_error_str().

Referenced by rb_attr().

VALUE rb_check_convert_type ( VALUE  val,
int  type,
const char *  tname,
const char *  method 
)
VALUE rb_check_to_float ( VALUE  val)

Definition at line 2977 of file object.c.

References Qnil, rb_check_convert_type(), rb_cNumeric, rb_obj_is_kind_of(), RB_TYPE_P, T_FLOAT, and val.

Referenced by rand_random(), and rand_range().

VALUE rb_check_to_int ( VALUE  val)

Definition at line 2706 of file object.c.

References rb_check_to_integer().

Referenced by exit_initialize().

VALUE rb_check_to_integer ( VALUE  val,
const char *  method 
)
static VALUE rb_class_allocate_instance ( VALUE  klass)
static

Definition at line 1838 of file object.c.

References FL_WB_PROTECTED, NEWOBJ_OF, obj, RGENGC_WB_PROTECTED_OBJECT, and T_OBJECT.

Referenced by Init_Object().

VALUE rb_class_get_superclass ( VALUE  klass)

Definition at line 1905 of file object.c.

References RCLASS.

VALUE rb_class_inherited_p ( VALUE  mod,
VALUE  arg 
)
static VALUE rb_class_initialize ( int  argc,
VALUE argv,
VALUE  klass 
)
static
VALUE rb_class_new_instance ( int  argc,
VALUE argv,
VALUE  klass 
)
VALUE rb_class_real ( VALUE  cl)
static VALUE rb_class_s_alloc ( VALUE  klass)
static

Definition at line 1678 of file object.c.

References rb_class_boot().

Referenced by Init_Object().

VALUE rb_class_search_ancestor ( VALUE  cl,
VALUE  c 
)

Definition at line 666 of file object.c.

References class_or_module_required(), class_search_ancestor(), and RCLASS_ORIGIN.

Referenced by umethod_bind().

VALUE rb_class_superclass ( VALUE  klass)
static VALUE rb_convert_to_integer ( VALUE  val,
int  base 
)
static
VALUE rb_convert_type ( VALUE  val,
int  type,
const char *  tname,
const char *  method 
)
double rb_cstr_to_dbl ( const char *  p,
int  badcheck 
)
int rb_eql ( VALUE  obj1,
VALUE  obj2 
)

Definition at line 100 of file object.c.

References id_eql, rb_funcall(), and RTEST.

Referenced by cdhash_cmp(), eql_i(), hash_equal(), rb_any_cmp(), and recursive_eql().

VALUE rb_equal ( VALUE  obj1,
VALUE  obj2 
)
static VALUE rb_f_array ( VALUE  obj,
VALUE  arg 
)
static

Definition at line 3063 of file object.c.

References rb_Array().

Referenced by Init_Object().

static VALUE rb_f_float ( VALUE  obj,
VALUE  arg 
)
static

Definition at line 2957 of file object.c.

References rb_Float().

Referenced by Init_Object().

static VALUE rb_f_hash ( VALUE  obj,
VALUE  arg 
)
static

Definition at line 3098 of file object.c.

References rb_Hash().

Referenced by Init_Object().

static VALUE rb_f_integer ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 2787 of file object.c.

References arg, NULL, NUM2INT, Qnil, rb_convert_to_integer(), and rb_scan_args().

Referenced by Init_Object().

static VALUE rb_f_string ( VALUE  obj,
VALUE  arg 
)
static

Definition at line 3032 of file object.c.

References rb_String().

Referenced by Init_Object().

static VALUE rb_false ( VALUE  obj)
static

Definition at line 1380 of file object.c.

References Qfalse.

Referenced by Init_Object().

VALUE rb_Float ( VALUE  val)
VALUE rb_Hash ( VALUE  val)
VALUE rb_inspect ( VALUE  obj)
VALUE rb_Integer ( VALUE  val)
static int rb_is_attr_id ( ID  id)
static

Definition at line 1938 of file object.c.

References rb_is_const_id(), and rb_is_local_id().

Referenced by rb_check_attr_id().

static int rb_is_attr_name ( VALUE  name)
static

Definition at line 1944 of file object.c.

References rb_is_const_name(), and rb_is_local_name().

VALUE rb_mod_attr ( int  argc,
VALUE argv,
VALUE  klass 
)

Definition at line 1991 of file object.c.

References id_for_attr(), Qfalse, Qnil, Qtrue, rb_attr(), rb_mod_attr_reader(), rb_warning(), RTEST, and TRUE.

Referenced by Init_Object().

static VALUE rb_mod_attr_accessor ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 2040 of file object.c.

References argc, i, id_for_attr(), Qnil, rb_attr(), and TRUE.

Referenced by Init_Object().

static VALUE rb_mod_attr_reader ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 1980 of file object.c.

References argc, FALSE, i, id_for_attr(), Qnil, rb_attr(), and TRUE.

Referenced by Init_Object(), and rb_mod_attr().

static VALUE rb_mod_attr_writer ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 2012 of file object.c.

References argc, FALSE, i, id_for_attr(), Qnil, rb_attr(), and TRUE.

Referenced by Init_Object().

static VALUE rb_mod_cmp ( VALUE  mod,
VALUE  arg 
)
static

Definition at line 1651 of file object.c.

References CLASS_OR_MODULE_P, cmp, INT2FIX, NIL_P(), Qnil, and rb_class_inherited_p().

Referenced by Init_Object().

static VALUE rb_mod_const_defined ( int  argc,
VALUE argv,
VALUE  mod 
)
static
static VALUE rb_mod_const_get ( int  argc,
VALUE argv,
VALUE  mod 
)
static
static VALUE rb_mod_const_set ( VALUE  mod,
VALUE  name,
VALUE  value 
)
static

Definition at line 2203 of file object.c.

References id_for_setter, PRIsVALUE, rb_const_set(), and value.

Referenced by Init_Object().

static VALUE rb_mod_cvar_defined ( VALUE  obj,
VALUE  iv 
)
static
static VALUE rb_mod_cvar_get ( VALUE  obj,
VALUE  iv 
)
static
static VALUE rb_mod_cvar_set ( VALUE  obj,
VALUE  iv,
VALUE  val 
)
static

Definition at line 2522 of file object.c.

References id_for_setter, PRIsVALUE, rb_cvar_set(), and val.

Referenced by Init_Object().

static VALUE rb_mod_eqq ( VALUE  mod,
VALUE  arg 
)
static

Definition at line 1542 of file object.c.

References rb_obj_is_kind_of().

Referenced by Init_Object().

static VALUE rb_mod_freeze ( VALUE  mod)
static

Definition at line 1525 of file object.c.

References rb_class_name(), and rb_obj_freeze().

Referenced by Init_Object().

static VALUE rb_mod_ge ( VALUE  mod,
VALUE  arg 
)
static

Definition at line 1611 of file object.c.

References CLASS_OR_MODULE_P, rb_class_inherited_p(), rb_eTypeError, and rb_raise().

Referenced by Init_Object(), and rb_mod_gt().

static VALUE rb_mod_gt ( VALUE  mod,
VALUE  arg 
)
static

Definition at line 1632 of file object.c.

References Qfalse, and rb_mod_ge().

Referenced by Init_Object().

static VALUE rb_mod_initialize ( VALUE  module)
static

Definition at line 1710 of file object.c.

References Qnil, rb_block_given_p(), and rb_mod_module_exec().

Referenced by Init_Object(), and rb_class_initialize().

static VALUE rb_mod_lt ( VALUE  mod,
VALUE  arg 
)
static

Definition at line 1591 of file object.c.

References Qfalse, and rb_class_inherited_p().

Referenced by Init_Object().

static VALUE rb_mod_singleton_p ( VALUE  klass)
static

Definition at line 2580 of file object.c.

References FL_SINGLETON, FL_TEST, Qfalse, Qtrue, RB_TYPE_P, and T_CLASS.

Referenced by Init_Object().

static VALUE rb_mod_to_s ( VALUE  klass)
static
static VALUE rb_module_s_alloc ( VALUE  klass)
static

Definition at line 1669 of file object.c.

References mod, rb_module_new(), and RBASIC_SET_CLASS.

Referenced by Init_Object().

double rb_num2dbl ( VALUE  val)

Definition at line 2987 of file object.c.

References rb_eTypeError, rb_Float(), rb_raise(), RFLOAT_VALUE, T_FLOAT, T_NIL, T_STRING, and TYPE.

Referenced by thread_join_m().

VALUE rb_obj_alloc ( VALUE  klass)
VALUE rb_obj_class ( VALUE  obj)

Definition at line 226 of file object.c.

References CLASS_OF, and rb_class_real().

Referenced by ary_make_shared_copy(), BigDecimal_new(), cannot_be_coerced_into_BigDecimal(), coerce_failed(), copy_path_class(), d_lite_plus(), dup_obj(), dup_obj_as_complex(), enc_inspect(), encoded_dup(), exc_equal(), extract_user_token(), get_new_timeval(), get_timeval(), if(), Init_Object(), inspect_enumerator(), inspect_struct(), io_reopen(), mString_to_json_raw_object(), mSyslog_log(), name_err_mesg_equal(), not_encoding(), ossl_asn1_default_tag(), ossl_cipher_init(), ossl_x509_inspect(), path_basename(), path_dirname(), path_each_entry(), path_entries(), path_expand_path(), path_readlink(), path_realdirpath(), path_realpath(), path_split(), path_sub(), path_sub_ext(), random_equal(), rb_ary_slice_bang(), rb_ary_subseq(), rb_ary_times(), rb_ary_to_a(), rb_ary_uniq(), rb_digest_base_block_length(), rb_digest_base_copy(), rb_digest_base_digest_length(), rb_digest_base_finish(), rb_digest_base_reset(), rb_digest_base_update(), rb_dlptr_inspect(), rb_fiddle_ptr_inspect(), rb_hash_aset(), rb_hash_dup_empty(), rb_hash_to_h(), rb_ivar_set(), rb_obj_alloc(), rb_obj_clone(), rb_obj_dup(), rb_obj_init_copy(), rb_obj_is_instance_of(), rb_profile_frame_classpath(), rb_stat_cmp(), rb_str_dup(), rb_str_new_frozen(), rb_str_new_shared(), rb_str_new_with_class(), rb_str_substr(), rb_str_to_s(), rb_struct_eql(), rb_struct_equal(), rb_struct_hash(), rb_struct_initialize_m(), rb_struct_members(), rb_struct_members_m(), rb_tmp_class_path(), str_byte_substr(), str_gsub(), strscan_inspect(), syserr_initialize(), tcl_protect_core(), time_dup(), undumpable(), and vm_search_super_method().

VALUE rb_obj_clone ( VALUE  obj)
static VALUE rb_obj_cmp ( VALUE  obj1,
VALUE  obj2 
)
static

Definition at line 1436 of file object.c.

References INT2FIX, Qnil, and rb_equal().

Referenced by Init_Object().

void rb_obj_copy_ivar ( VALUE  dest,
VALUE  obj 
)

Definition at line 255 of file object.c.

References ALLOC_N, flags, len, MEMCPY, ptr, RBASIC, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IVPTR, and xfree.

Referenced by init_copy().

static VALUE rb_obj_dummy ( void  )
static

Definition at line 924 of file object.c.

References Qnil.

Referenced by Init_Object().

VALUE rb_obj_dup ( VALUE  obj)
VALUE rb_obj_equal ( VALUE  obj1,
VALUE  obj2 
)

Definition at line 142 of file object.c.

References Qfalse, and Qtrue.

Referenced by Init_Object(), and opt_eq_func().

VALUE rb_obj_freeze ( VALUE  obj)
VALUE rb_obj_frozen_p ( VALUE  obj)

Definition at line 1096 of file object.c.

References OBJ_FROZEN, Qfalse, Qtrue, SPECIAL_CONST_P, and st_lookup().

Referenced by dump_object(), generic_ivar_set(), and Init_Object().

VALUE rb_obj_hash ( VALUE  obj)

Definition at line 162 of file object.c.

References index, LONG2FIX, NUM2LONG, rb_obj_id(), and rb_objid_hash().

Referenced by Init_Object().

VALUE rb_obj_hide ( VALUE  obj)
void rb_obj_infect ( VALUE  obj1,
VALUE  obj2 
)

Definition at line 1041 of file object.c.

References OBJ_INFECT.

VALUE rb_obj_init_copy ( VALUE  obj,
VALUE  orig 
)

Definition at line 422 of file object.c.

References obj, rb_check_frozen, rb_check_trusted, rb_eTypeError, rb_obj_class(), rb_raise(), and TYPE.

Referenced by Init_Object().

VALUE rb_obj_init_dup_clone ( VALUE  obj,
VALUE  orig 
)

Definition at line 435 of file object.c.

References id_init_copy, obj, and rb_funcall().

Referenced by Init_Object().

static VALUE rb_obj_inspect ( VALUE  obj)
static
VALUE rb_obj_is_instance_of ( VALUE  obj,
VALUE  c 
)
VALUE rb_obj_is_kind_of ( VALUE  obj,
VALUE  c 
)
static VALUE rb_obj_ivar_defined ( VALUE  obj,
VALUE  iv 
)
static
static VALUE rb_obj_ivar_get ( VALUE  obj,
VALUE  iv 
)
static
static VALUE rb_obj_ivar_set ( VALUE  obj,
VALUE  iv,
VALUE  val 
)
static

Definition at line 2416 of file object.c.

References id_for_setter, PRIsVALUE, and rb_ivar_set().

Referenced by Init_Object().

static VALUE rb_obj_match ( VALUE  obj1,
VALUE  obj2 
)
static

Definition at line 1396 of file object.c.

References Qnil.

Referenced by Init_Object().

VALUE rb_obj_not ( VALUE  obj)

Definition at line 184 of file object.c.

References Qfalse, Qtrue, and RTEST.

Referenced by Init_Object().

VALUE rb_obj_not_equal ( VALUE  obj1,
VALUE  obj2 
)

Definition at line 197 of file object.c.

References id_eq, Qfalse, Qtrue, rb_funcall(), result, and RTEST.

Referenced by Init_Object().

static VALUE rb_obj_not_match ( VALUE  obj1,
VALUE  obj2 
)
static

Definition at line 1410 of file object.c.

References id_match, Qfalse, Qtrue, rb_funcall(), result, and RTEST.

Referenced by Init_Object().

VALUE rb_obj_reveal ( VALUE  obj,
VALUE  klass 
)
VALUE rb_obj_setup ( VALUE  obj,
VALUE  klass,
VALUE  type 
)

Definition at line 71 of file object.c.

References FL_SET, FL_TAINT, obj, rb_safe_level, RBASIC, RBASIC_SET_CLASS, and type.

static VALUE rb_obj_singleton_class ( VALUE  obj)
static

Definition at line 249 of file object.c.

References rb_singleton_class().

Referenced by Init_Object().

VALUE rb_obj_taint ( VALUE  obj)
VALUE rb_obj_tainted ( VALUE  obj)

Definition at line 939 of file object.c.

References OBJ_TAINTED, Qfalse, and Qtrue.

Referenced by Init_Object(), and rb_obj_untrusted().

VALUE rb_obj_tap ( VALUE  obj)

Definition at line 689 of file object.c.

References obj, and rb_yield().

Referenced by Init_Object().

VALUE rb_obj_trust ( VALUE  obj)

Definition at line 1034 of file object.c.

References rb_obj_untaint(), and rb_warning().

Referenced by Init_Object().

VALUE rb_obj_untaint ( VALUE  obj)

Definition at line 987 of file object.c.

References FL_TAINT, FL_UNSET, obj, OBJ_TAINTED, rb_check_frozen, and rb_secure().

Referenced by Init_Object(), path_untaint(), rb_obj_trust(), and time_zone().

VALUE rb_obj_untrust ( VALUE  obj)

Definition at line 1019 of file object.c.

References rb_obj_taint(), and rb_warning().

Referenced by Init_Object().

VALUE rb_obj_untrusted ( VALUE  obj)

Definition at line 1005 of file object.c.

References rb_obj_tainted(), and rb_warning().

Referenced by Init_Object().

double rb_str_to_dbl ( VALUE  str,
int  badcheck 
)

Definition at line 2890 of file object.c.

References ALLOCV, ALLOCV_END, len, MEMCPY, p, rb_cstr_to_dbl(), rb_eArgError, rb_raise(), ret, RSTRING_LEN, RSTRING_PTR, s, StringValue, and v.

Referenced by f_to_f(), rb_Float(), and rb_str_to_f().

VALUE rb_String ( VALUE  val)
VALUE rb_to_float ( VALUE  val)
VALUE rb_to_int ( VALUE  val)
static VALUE rb_to_integer ( VALUE  val,
const char *  method 
)
static
static VALUE rb_true ( VALUE  obj)
static

Definition at line 1363 of file object.c.

References Qtrue.

Referenced by Init_Object().

void rb_undefined_alloc ( VALUE  klass)

Definition at line 1775 of file object.c.

References PRIsVALUE, rb_eTypeError, and rb_raise().

Referenced by enc_s_alloc(), and rb_obj_alloc().

static VALUE true_and ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1237 of file object.c.

References Qfalse, Qtrue, and RTEST.

Referenced by Init_Object().

static VALUE true_or ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1259 of file object.c.

References Qtrue.

Referenced by Init_Object().

static VALUE true_to_s ( VALUE  obj)
static

Definition at line 1222 of file object.c.

References rb_usascii_str_new2.

Referenced by Init_Object().

static VALUE true_xor ( VALUE  obj,
VALUE  obj2 
)
static

Definition at line 1275 of file object.c.

References Qfalse, Qtrue, and RTEST.

Referenced by Init_Object().

Variable Documentation

struct conv_method_tbl conv_method_names[]
static
Initial value:
= {
{"to_int", 0},
{"to_ary", 0},
{"to_str", 0},
{"to_sym", 0},
{"to_hash", 0},
{"to_proc", 0},
{"to_io", 0},
{"to_a", 0},
{"to_s", 0},
{NULL, 0}
}
#define NULL
Definition: _sdbm.c:102

Referenced by convert_type(), and Init_Object().

st_table* immediate_frozen_tbl = 0
static

Definition at line 1046 of file object.c.

const char invalid_attribute_name[] = "invalid attribute name `%"PRIsVALUE"'"
static

Definition at line 1949 of file object.c.

VALUE rb_cBasicObject

Definition at line 28 of file object.c.

VALUE rb_cClass

Definition at line 32 of file object.c.

VALUE rb_cData

Definition at line 33 of file object.c.

VALUE rb_cFalseClass

Definition at line 37 of file object.c.

VALUE rb_cModule

Definition at line 31 of file object.c.

VALUE rb_cNilClass

Definition at line 35 of file object.c.

VALUE rb_cObject

Definition at line 30 of file object.c.

VALUE rb_cTrueClass

Definition at line 36 of file object.c.

VALUE rb_mKernel

Definition at line 29 of file object.c.