Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Functions | Variables
object.c File Reference
#include "internal.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include "constant.h"
#include "id.h"
#include "probes.h"

Go to the source code of this file.

Macros

#define id_for_var(obj, name, part, type)   id_for_setter(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name")
 
#define id_for_setter(obj, name, type, message)   check_setter_id(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))
 
#define M(n)   {#n, (unsigned short)idTo_##n}
 
#define IMPLICIT_CONVERSIONS   7
 
#define OutOfRange()
 
#define rb_intern(str)   rb_intern_const(str)
 

Functions

VALUE rb_obj_hide (VALUE obj)
 Make the object invisible from Ruby code. More...
 
VALUE rb_obj_reveal (VALUE obj, VALUE klass)
 Make a hidden object visible again. More...
 
VALUE rb_obj_setup (VALUE obj, VALUE klass, VALUE type)
 Fills common (RBasic) fields in obj. More...
 
VALUE rb_equal (VALUE obj1, VALUE obj2)
 call-seq: obj === other -> true or false More...
 
int rb_eql (VALUE obj1, VALUE obj2)
 Determines if obj1 and obj2 are equal in terms of Object::eql?. More...
 
VALUE rb_obj_hash (VALUE obj)
 
VALUE rb_class_real (VALUE cl)
 Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions. More...
 
VALUE rb_obj_class (VALUE obj)
 call-seq: obj.class -> class More...
 
VALUE rb_obj_clone (VALUE obj)
 

:nodoc

Almost same as Object::clone ++ More...
 
VALUE rb_obj_dup (VALUE obj)
 call-seq: obj.dup -> an_object More...
 
VALUE rb_obj_init_copy (VALUE obj, VALUE orig)
 

:nodoc:

Default implementation of #initialize_copy More...
 
VALUE rb_obj_init_dup_clone (VALUE obj, VALUE orig)
 

:nodoc:

Default implementation of #initialize_dup and #initialize_clone More...
 
VALUE rb_any_to_s (VALUE obj)
 call-seq: obj.to_s -> string More...
 
VALUE rb_str_escape (VALUE str)
 
VALUE rb_inspect (VALUE obj)
 Convenient wrapper of Object::inspect. More...
 
VALUE rb_obj_is_instance_of (VALUE obj, VALUE c)
 call-seq: obj.instance_of?(class) -> true or false More...
 
VALUE rb_obj_is_kind_of (VALUE obj, VALUE c)
 call-seq: obj.is_a?(class) -> true or false obj.kind_of?(class) -> true or false More...
 
VALUE rb_obj_tainted (VALUE obj)
 call-seq: obj.tainted? -> true or false More...
 
VALUE rb_obj_taint (VALUE obj)
 call-seq: obj.taint -> obj More...
 
VALUE rb_obj_untaint (VALUE obj)
 call-seq: obj.untaint -> obj More...
 
VALUE rb_obj_untrusted (VALUE obj)
 call-seq: obj.untrusted? -> true or false More...
 
VALUE rb_obj_untrust (VALUE obj)
 call-seq: obj.untrust -> obj More...
 
VALUE rb_obj_trust (VALUE obj)
 call-seq: obj.trust -> obj More...
 
void rb_obj_infect (VALUE victim, VALUE carrier)
 Convenient function to infect victim with the taintedness of carrier. More...
 
VALUE rb_obj_freeze (VALUE obj)
 call-seq: obj.freeze -> obj More...
 
VALUE rb_obj_frozen_p (VALUE obj)
 call-seq: obj.frozen? -> true or false More...
 
VALUE rb_class_inherited_p (VALUE mod, VALUE arg)
 call-seq: mod <= other -> true, false, or nil More...
 
VALUE rb_obj_alloc (VALUE klass)
 Allocates an instance of klass. More...
 
VALUE rb_class_new_instance (int argc, const VALUE *argv, VALUE klass)
 Allocates and initializes an instance of klass. More...
 
VALUE rb_class_superclass (VALUE klass)
 call-seq: class.superclass -> a_super_class or nil More...
 
VALUE rb_class_get_superclass (VALUE klass)
 Returns the superclass of klass The return value might be an iclass of a module, unlike rb_class_superclass. More...
 
VALUE rb_convert_type (VALUE val, int type, const char *tname, const char *method)
 Converts an object into another type. More...
 
VALUE rb_check_convert_type (VALUE val, int type, const char *tname, const char *method)
 Tries to convert an object into another type. More...
 
VALUE rb_check_to_integer (VALUE val, const char *method)
 Tries to convert val into Integer. More...
 
VALUE rb_to_int (VALUE val)
 Converts val into Integer. More...
 
VALUE rb_check_to_int (VALUE val)
 Tries to convert val into Integer. More...
 
VALUE rb_Integer (VALUE val)
 Equivalent to Kernel#Integer in Ruby. More...
 
double rb_cstr_to_dbl (const char *p, int badcheck)
 Parses a string representation of a floating point number. More...
 
double rb_str_to_dbl (VALUE str, int badcheck)
 Parses a string representation of a floating point number. More...
 
VALUE rb_Float (VALUE val)
 Equivalent to Kernel#Float in Ruby. More...
 
VALUE rb_to_float (VALUE val)
 Converts a Numeric object into Float. More...
 
VALUE rb_check_to_float (VALUE val)
 Tries to convert an object into Float. More...
 
double rb_num2dbl (VALUE val)
 Converts a Numeric object to double. More...
 
VALUE rb_String (VALUE val)
 Equivalent to Kernel#String in Ruby. More...
 
VALUE rb_Array (VALUE val)
 Equivalent to Kernel#Array in Ruby. More...
 
VALUE rb_Hash (VALUE val)
 Equivalent to Kernel#Hash in Ruby. More...
 
void Init_Object (void)
 

Variables

VALUE rb_cBasicObject
 BasicObject class. More...
 
VALUE rb_mKernel
 Kernel module. More...
 
VALUE rb_cObject
 Object class. More...
 
VALUE rb_cModule
 Module class. More...
 
VALUE rb_cClass
 Class class. More...
 
VALUE rb_cData
 Data class. More...
 
VALUE rb_cNilClass
 NilClass class. More...
 
VALUE rb_cTrueClass
 TrueClass class. More...
 
VALUE rb_cFalseClass
 FalseClass class. More...
 

Macro Definition Documentation

◆ M

#define M (   n)    {#n, (unsigned short)idTo_##n}

◆ OutOfRange

#define OutOfRange ( )
Value:
((end - p > max_width) ? \
(w = max_width, ellipsis = "...") : \
(w = (int)(end - p), ellipsis = ""))

Referenced by rb_cstr_to_dbl().

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)