Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

object.c File Reference

#include "ruby.h"
#include "st.h"
#include "util.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>

Go to the source code of this file.

Functions

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_id (VALUE obj)
VALUE rb_obj_id_obsolete (VALUE obj)
VALUE rb_class_real (VALUE cl)
VALUE rb_obj_type (VALUE obj)
VALUE rb_obj_class (VALUE obj)
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_any_to_a (VALUE obj)
VALUE rb_any_to_s (VALUE obj)
VALUE rb_inspect (VALUE obj)
int inspect_i (ID id, VALUE value, VALUE str)
VALUE inspect_obj (VALUE obj, VALUE str)
VALUE rb_obj_inspect (VALUE obj)
VALUE rb_obj_is_instance_of (VALUE obj, VALUE c)
VALUE rb_obj_is_kind_of (VALUE obj, VALUE c)
VALUE rb_obj_dummy ()
VALUE rb_obj_tainted (VALUE obj)
VALUE rb_obj_taint (VALUE obj)
VALUE rb_obj_untaint (VALUE obj)
void rb_obj_infect (VALUE obj1, VALUE obj2)
VALUE rb_obj_freeze (VALUE obj)
VALUE rb_obj_frozen_p (VALUE obj)
VALUE nil_to_i (VALUE obj)
VALUE nil_to_f (VALUE obj)
VALUE nil_to_s (VALUE obj)
VALUE nil_to_a (VALUE obj)
VALUE nil_inspect (VALUE obj)
VALUE main_to_s (VALUE obj)
VALUE true_to_s (VALUE obj)
VALUE true_and (VALUE obj, VALUE obj2)
VALUE true_or (VALUE obj, VALUE obj2)
VALUE true_xor (VALUE obj, VALUE obj2)
VALUE false_to_s (VALUE obj)
VALUE false_and (VALUE obj, VALUE obj2)
VALUE false_or (VALUE obj, VALUE obj2)
VALUE false_xor (VALUE obj, VALUE obj2)
VALUE rb_true (VALUE obj)
VALUE rb_false (VALUE obj)
VALUE rb_obj_pattern_match (VALUE obj1, VALUE obj2)
VALUE sym_to_i (VALUE sym)
VALUE sym_to_int (VALUE sym)
VALUE sym_inspect (VALUE sym)
VALUE sym_to_s (VALUE sym)
VALUE sym_to_sym (VALUE sym)
VALUE rb_mod_to_s (VALUE klass)
VALUE rb_mod_freeze (VALUE mod)
VALUE rb_mod_eqq (VALUE mod, VALUE arg)
VALUE rb_class_inherited_p (VALUE mod, VALUE arg)
VALUE rb_mod_lt (VALUE mod, VALUE arg)
VALUE rb_mod_ge (VALUE mod, VALUE arg)
VALUE rb_mod_gt (VALUE mod, VALUE arg)
VALUE rb_mod_cmp (VALUE mod, VALUE arg)
VALUE rb_module_s_alloc (VALUE)
VALUE rb_class_s_alloc (VALUE)
VALUE rb_mod_initialize (VALUE module)
VALUE rb_class_initialize (int argc, VALUE *argv, VALUE klass)
VALUE rb_obj_alloc (VALUE klass)
VALUE rb_class_allocate_instance (VALUE)
VALUE rb_class_new_instance (int argc, VALUE *argv, VALUE klass)
VALUE rb_class_superclass (VALUE klass)
ID str_to_id (VALUE str)
ID rb_to_id (VALUE name)
VALUE rb_mod_attr (int argc, VALUE *argv, VALUE klass)
VALUE rb_mod_attr_reader (int argc, VALUE *argv, VALUE klass)
VALUE rb_mod_attr_writer (int argc, VALUE *argv, VALUE klass)
VALUE rb_mod_attr_accessor (int argc, VALUE *argv, VALUE klass)
VALUE rb_mod_const_get (VALUE mod, VALUE name)
VALUE rb_mod_const_set (VALUE mod, VALUE name, VALUE value)
VALUE rb_mod_const_defined (VALUE mod, VALUE name)
VALUE rb_obj_methods (int argc, VALUE *argv, VALUE obj)
VALUE rb_obj_protected_methods (int argc, VALUE *argv, VALUE obj)
VALUE rb_obj_private_methods (int argc, VALUE *argv, VALUE obj)
VALUE rb_obj_public_methods (int argc, VALUE *argv, VALUE obj)
VALUE rb_obj_ivar_get (VALUE obj, VALUE iv)
VALUE rb_obj_ivar_set (VALUE obj, VALUE iv, VALUE val)
VALUE rb_mod_cvar_get (VALUE obj, VALUE iv)
VALUE rb_mod_cvar_set (VALUE obj, VALUE iv, VALUE val)
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)
VALUE rb_to_integer (VALUE val, const char *method)
VALUE rb_to_int (VALUE val)
VALUE rb_Integer (VALUE val)
VALUE rb_f_integer (VALUE obj, VALUE arg)
double rb_cstr_to_dbl (char *p, int badcheck) const
double rb_str_to_dbl (VALUE str, int badcheck)
VALUE rb_Float (VALUE val)
VALUE rb_f_float (VALUE obj, VALUE arg)
double rb_num2dbl (VALUE val)
char * rb_str2cstr (VALUE str, long *len)
VALUE rb_String (VALUE val)
VALUE rb_f_string (VALUE obj, VALUE arg)
VALUE rb_f_array (VALUE obj, VALUE arg)
VALUE boot_defclass (char *name, VALUE super)
void Init_Object ()

Variables

VALUE rb_mKernel
VALUE rb_cObject
VALUE rb_cModule
VALUE rb_cClass
VALUE rb_cData
VALUE rb_cNilClass
VALUE rb_cTrueClass
VALUE rb_cFalseClass
VALUE rb_cSymbol
ID id_eq
ID id_eql
ID id_inspect
ID id_init_copy
VALUE ruby_top_self


Function Documentation

VALUE boot_defclass char *  name,
VALUE  super
[static]
 

Definition at line 2494 of file object.c.

References ID, name, rb_class_boot(), rb_class_tbl, rb_cObject, rb_const_set(), rb_intern(), rb_name_class(), st_add_direct(), and VALUE.

Referenced by Init_Object().

VALUE convert_type VALUE  val,
const char *  tname,
const char *  method,
int  raise
[static]
 

Definition at line 2112 of file object.c.

References ID, NIL_P, Qfalse, Qnil, Qtrue, rb_eTypeError, rb_funcall(), rb_intern(), rb_obj_classname(), rb_raise(), rb_respond_to(), and VALUE.

Referenced by rb_check_convert_type(), rb_convert_type(), rb_Integer(), and rb_to_integer().

VALUE false_and VALUE  obj,
VALUE  obj2
[static]
 

Definition at line 1001 of file object.c.

References Qfalse, and VALUE.

Referenced by Init_Object().

VALUE false_or VALUE  obj,
VALUE  obj2
[static]
 

Definition at line 1018 of file object.c.

References Qfalse, Qtrue, RTEST, and VALUE.

Referenced by Init_Object().

VALUE false_to_s VALUE  obj  )  [static]
 

Definition at line 984 of file object.c.

References rb_str_new2(), and VALUE.

Referenced by Init_Object().

VALUE false_xor VALUE  obj,
VALUE  obj2
[static]
 

Definition at line 1038 of file object.c.

References Qfalse, Qtrue, RTEST, and VALUE.

Referenced by Init_Object().

void init_copy VALUE  dest,
VALUE  obj
[static]
 

Definition at line 204 of file object.c.

References FL_EXIVAR, FL_TAINT, FL_TEST, id_init_copy, OBJ_FROZEN, rb_copy_generic_ivar(), rb_eTypeError, rb_funcall(), rb_gc_copy_finalizer(), rb_obj_classname(), rb_raise(), RBASIC, ROBJECT, st_copy(), st_free_table(), T_CLASS, T_MASK, T_MODULE, T_OBJECT, TYPE, and VALUE.

Referenced by rb_obj_clone(), and rb_obj_dup().

void Init_Object void   ) 
 

Definition at line 2585 of file object.c.

References boot_defclass(), CLASS_OF, false_and(), false_or(), false_to_s(), false_xor(), id_eq, id_eql, id_init_copy, id_inspect, main_to_s(), nil_inspect(), nil_to_a(), nil_to_f(), nil_to_i(), nil_to_s(), Qfalse, Qnil, Qtrue, rb_any_to_a(), rb_any_to_s(), rb_cClass, rb_cData, rb_cFalseClass, rb_class_allocate_instance(), rb_class_inherited_p(), rb_class_init_copy(), rb_class_initialize(), rb_class_instance_methods(), rb_class_new_instance(), rb_class_private_instance_methods(), rb_class_protected_instance_methods(), rb_class_public_instance_methods(), rb_class_s_alloc(), rb_class_superclass(), rb_cModule, rb_cNilClass, rb_cObject, rb_cSymbol, rb_cTrueClass, rb_define_alloc_func(), rb_define_class(), rb_define_global_const(), rb_define_global_function(), rb_define_method(), rb_define_module(), rb_define_private_method(), rb_define_singleton_method(), rb_equal(), rb_f_array(), rb_f_float(), rb_f_integer(), rb_f_sprintf(), rb_f_string(), rb_false(), rb_global_variable(), rb_include_module(), rb_intern(), rb_make_metaclass(), rb_mKernel, rb_mod_ancestors(), rb_mod_attr(), rb_mod_attr_accessor(), rb_mod_attr_reader(), rb_mod_attr_writer(), rb_mod_class_variables(), rb_mod_cmp(), rb_mod_const_defined(), rb_mod_const_get(), rb_mod_const_missing(), rb_mod_const_set(), rb_mod_constants(), rb_mod_cvar_get(), rb_mod_cvar_set(), rb_mod_eqq(), rb_mod_freeze(), rb_mod_ge(), rb_mod_gt(), rb_mod_include_p(), rb_mod_included_modules(), rb_mod_init_copy(), rb_mod_initialize(), rb_mod_lt(), rb_mod_name(), rb_mod_remove_const(), rb_mod_remove_cvar(), rb_mod_to_s(), rb_module_s_alloc(), rb_obj_alloc(), rb_obj_class(), rb_obj_clone(), rb_obj_dummy(), rb_obj_dup(), rb_obj_equal(), rb_obj_freeze(), rb_obj_frozen_p(), rb_obj_id(), rb_obj_id_obsolete(), rb_obj_init_copy(), rb_obj_inspect(), rb_obj_instance_variables(), rb_obj_is_instance_of(), rb_obj_is_kind_of(), rb_obj_ivar_get(), rb_obj_ivar_set(), rb_obj_methods(), rb_obj_pattern_match(), rb_obj_private_methods(), rb_obj_protected_methods(), rb_obj_public_methods(), rb_obj_remove_instance_variable(), rb_obj_singleton_methods(), rb_obj_taint(), rb_obj_tainted(), rb_obj_type(), rb_obj_untaint(), rb_sym_all_symbols(), rb_true(), rb_undef_alloc_func(), rb_undef_method(), ruby_top_self, sym_inspect(), sym_to_i(), sym_to_int(), sym_to_s(), sym_to_sym(), true_and(), true_or(), true_to_s(), true_xor(), and VALUE.

Referenced by rb_call_inits().

int inspect_i ID  id,
VALUE  value,
VALUE  str
[static]
 

Definition at line 378 of file object.c.

References CLASS_OF, ID, OBJ_INFECT, rb_id2name(), rb_inspect(), rb_is_instance_id(), rb_str_append(), rb_str_cat2(), RSTRING, ST_CONTINUE, and VALUE.

Referenced by inspect_obj().

VALUE inspect_obj VALUE  obj,
VALUE  str
[static]
 

Definition at line 407 of file object.c.

References inspect_i(), OBJ_INFECT, rb_str_cat2(), ROBJECT, RSTRING, st_foreach_safe(), and VALUE.

Referenced by rb_obj_inspect().

VALUE main_to_s VALUE  obj  )  [static]
 

Definition at line 878 of file object.c.

References rb_str_new2(), and VALUE.

Referenced by Init_Object().

VALUE nil_inspect VALUE  obj  )  [static]
 

Definition at line 849 of file object.c.

References rb_str_new2(), and VALUE.

Referenced by Init_Object().

VALUE nil_to_a VALUE  obj  )  [static]
 

Definition at line 835 of file object.c.

References rb_ary_new2(), and VALUE.

Referenced by Init_Object().

VALUE nil_to_f VALUE  obj  )  [static]
 

Definition at line 803 of file object.c.

References rb_float_new(), and VALUE.

Referenced by Init_Object().

VALUE nil_to_i VALUE  obj  )  [static]
 

Definition at line 787 of file object.c.

References INT2FIX, and VALUE.

Referenced by Init_Object().

VALUE nil_to_s VALUE  obj  )  [static]
 

Definition at line 819 of file object.c.

References rb_str_new2(), and VALUE.

Referenced by Init_Object().

VALUE rb_any_to_a VALUE  obj  )  [static]
 

Definition at line 335 of file object.c.

References rb_ary_new3(), rb_warn(), and VALUE.

Referenced by Init_Object().

VALUE rb_class_allocate_instance VALUE   )  [static]
 

Definition at line 1578 of file object.c.

References NEWOBJ, OBJSETUP, T_OBJECT, and VALUE.

Referenced by Init_Object().

VALUE rb_class_inherited_p VALUE  mod,
VALUE  arg
 

Definition at line 1328 of file object.c.

References FL_SINGLETON, FL_TEST, Qfalse, Qnil, Qtrue, rb_eTypeError, rb_raise(), RBASIC, RCLASS, T_CLASS, T_MODULE, TYPE, and VALUE.

Referenced by Init_Object(), r_object0(), rb_mod_cmp(), rb_mod_ge(), and rb_mod_lt().

VALUE rb_class_initialize int  argc,
VALUE argv,
VALUE  klass
[static]
 

Definition at line 1524 of file object.c.

References rb_check_inheritable(), rb_class_inherited(), rb_cObject, rb_eTypeError, rb_make_metaclass(), rb_mod_initialize(), rb_raise(), rb_scan_args(), RBASIC, RCLASS, and VALUE.

Referenced by Init_Object().

VALUE rb_class_s_alloc VALUE   )  [static]
 

Definition at line 1474 of file object.c.

References rb_class_boot(), and VALUE.

Referenced by Init_Object().

VALUE rb_class_superclass VALUE  klass  )  [static]
 

Definition at line 1625 of file object.c.

References FL_SINGLETON, FL_TEST, Qnil, rb_eTypeError, rb_raise(), RBASIC, RCLASS, T_ICLASS, TYPE, and VALUE.

Referenced by Init_Object().

double rb_cstr_to_dbl char *  p,
int  badcheck
const
 

Definition at line 2249 of file object.c.

References ALLOCA_N, end, ISDIGIT, ISSPACE, rb_eArgError, rb_invalid_str(), rb_raise(), rb_warn(), and strtod.

Referenced by rb_str_to_dbl().

VALUE rb_f_array VALUE  obj,
VALUE  arg
[static]
 

Definition at line 2487 of file object.c.

References rb_Array(), and VALUE.

Referenced by Init_Object().

VALUE rb_f_float VALUE  obj,
VALUE  arg
[static]
 

Definition at line 2388 of file object.c.

References rb_Float(), and VALUE.

Referenced by Init_Object().

VALUE rb_f_integer VALUE  obj,
VALUE  arg
[static]
 

Definition at line 2242 of file object.c.

References rb_Integer(), and VALUE.

Referenced by Init_Object().

VALUE rb_f_string VALUE  obj,
VALUE  arg
[static]
 

Definition at line 2451 of file object.c.

References rb_String(), and VALUE.

Referenced by Init_Object().

VALUE rb_false VALUE  obj  )  [static]
 

Definition at line 1068 of file object.c.

References Qfalse, and VALUE.

Referenced by Init_Object().

VALUE rb_mod_attr int  argc,
VALUE argv,
VALUE  klass
[static]
 

Definition at line 1715 of file object.c.

References name, Qnil, Qtrue, rb_attr(), rb_scan_args(), rb_to_id(), RTEST, and VALUE.

Referenced by Init_Object().

VALUE rb_mod_attr_accessor int  argc,
VALUE argv,
VALUE  klass
[static]
 

Definition at line 1786 of file object.c.

References Qnil, Qtrue, rb_attr(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_attr_reader int  argc,
VALUE argv,
VALUE  klass
[static]
 

Definition at line 1737 of file object.c.

References Qnil, Qtrue, rb_attr(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_attr_writer int  argc,
VALUE argv,
VALUE  klass
[static]
 

Definition at line 1759 of file object.c.

References Qnil, Qtrue, rb_attr(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_cmp VALUE  mod,
VALUE  arg
[static]
 

Definition at line 1439 of file object.c.

References INT2FIX, NIL_P, Qnil, rb_class_inherited_p(), T_CLASS, T_MODULE, TYPE, and VALUE.

Referenced by Init_Object().

VALUE rb_mod_const_defined VALUE  mod,
VALUE  name
[static]
 

Definition at line 1856 of file object.c.

References ID, name, rb_const_defined_at(), rb_id2name(), rb_is_const_id(), rb_name_error(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_const_get VALUE  mod,
VALUE  name
[static]
 

Definition at line 1809 of file object.c.

References ID, name, rb_const_get(), rb_id2name(), rb_is_const_id(), rb_name_error(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_const_set VALUE  mod,
VALUE  name,
VALUE  value
[static]
 

Definition at line 1833 of file object.c.

References ID, name, rb_const_set(), rb_id2name(), rb_is_const_id(), rb_name_error(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_cvar_get VALUE  obj,
VALUE  iv
[static]
 

Definition at line 2065 of file object.c.

References ID, rb_cvar_get(), rb_id2name(), rb_is_class_id(), rb_name_error(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_cvar_set VALUE  obj,
VALUE  iv,
VALUE  val
[static]
 

Definition at line 2099 of file object.c.

References ID, Qfalse, rb_cvar_set(), rb_id2name(), rb_is_class_id(), rb_name_error(), rb_to_id(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_eqq VALUE  mod,
VALUE  arg
[static]
 

Definition at line 1309 of file object.c.

References rb_obj_is_kind_of(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_freeze VALUE  mod  )  [static]
 

Definition at line 1291 of file object.c.

References rb_mod_to_s(), rb_obj_freeze(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_ge VALUE  mod,
VALUE  arg
[static]
 

Definition at line 1394 of file object.c.

References rb_class_inherited_p(), rb_eTypeError, rb_raise(), T_CLASS, T_MODULE, TYPE, and VALUE.

Referenced by Init_Object(), and rb_mod_gt().

VALUE rb_mod_gt VALUE  mod,
VALUE  arg
[static]
 

Definition at line 1420 of file object.c.

References Qfalse, rb_mod_ge(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_initialize VALUE  module  )  [static]
 

Definition at line 1504 of file object.c.

References Qnil, rb_block_given_p(), rb_mod_module_eval(), and VALUE.

Referenced by Init_Object(), and rb_class_initialize().

VALUE rb_mod_lt VALUE  mod,
VALUE  arg
[static]
 

Definition at line 1373 of file object.c.

References Qfalse, rb_class_inherited_p(), and VALUE.

Referenced by Init_Object().

VALUE rb_mod_to_s VALUE  klass  )  [static]
 

Definition at line 1259 of file object.c.

References FL_SINGLETON, FL_TEST, rb_any_to_s(), rb_class_name(), rb_inspect(), rb_iv_get(), rb_str_append(), rb_str_cat2(), rb_str_dup(), rb_str_new2(), T_CLASS, T_MODULE, TYPE, and VALUE.

Referenced by Init_Object(), and rb_mod_freeze().

VALUE rb_module_s_alloc VALUE   )  [static]
 

Definition at line 1463 of file object.c.

References rb_module_new(), RBASIC, and VALUE.

Referenced by Init_Object().

VALUE rb_obj_dummy  )  [static]
 

Definition at line 643 of file object.c.

References Qnil.

Referenced by Init_Object().

VALUE rb_obj_equal VALUE  obj1,
VALUE  obj2
[static]
 

Definition at line 94 of file object.c.

References Qfalse, Qtrue, and VALUE.

Referenced by Init_Object().

VALUE rb_obj_frozen_p VALUE  obj  )  [static]
 

Definition at line 762 of file object.c.

References OBJ_FROZEN, Qfalse, Qtrue, and VALUE.

Referenced by Init_Object().

VALUE rb_obj_id_obsolete VALUE  obj  ) 
 

Definition at line 149 of file object.c.

References rb_obj_id(), rb_warn(), and VALUE.

Referenced by Init_Object().

VALUE rb_obj_inspect VALUE  obj  )  [static]
 

Definition at line 432 of file object.c.

References inspect_obj(), rb_funcall(), rb_inspecting_p(), rb_intern(), rb_obj_classname(), rb_protect_inspect(), rb_str_new(), ROBJECT, RSTRING, snprintf(), T_OBJECT, TYPE, and