Ruby: object.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Functions | Variables
object.c File Reference
`#include "ruby/internal/config.h"`
`#include <ctype.h>`
`#include <errno.h>`
`#include <float.h>`
`#include <math.h>`
`#include <stdio.h>`
`#include "constant.h"`
`#include "id.h"`
`#include "internal.h"`
`#include "internal/array.h"`
`#include "internal/class.h"`
`#include "internal/error.h"`
`#include "internal/eval.h"`
`#include "internal/inits.h"`
`#include "internal/numeric.h"`
`#include "internal/object.h"`
`#include "internal/struct.h"`
`#include "internal/symbol.h"`
`#include "internal/variable.h"`
`#include "probes.h"`
`#include "ruby/encoding.h"`
`#include "ruby/st.h"`
`#include "ruby/util.h"`
`#include "ruby/assert.h"`
`#include "builtin.h"`
`#include "kernel.rbinc"`

Go to the source code of this file.

## Macros
#define | case_equal rb_equal
| call-seq: obj === other -> true or false More...
#define | false_or true_and
#define | false_xor true_and
#define | wrong_constant_name bad_const_name
#define | id_for_var(obj, name, type) id_for_setter(obj, name, type, bad_##type##_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 | try_to_int(val, mid, raise) convert_type_with_id(val, "Integer", mid, raise, -1)
#define | opts_exception_p(opts) rb_opts_exception_p((opts), TRUE)
#define | OutOfRange()

## 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)
| This function is an optimized version of calling #==. 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)
VALUE | rb_obj_clone (VALUE obj)
| Almost same as `Object::clone`. More...
VALUE | rb_obj_dup (VALUE obj)
| Equivalent to `Object#dup` in Ruby. More...
VALUE | rb_obj_size (VALUE self, VALUE args, VALUE obj)
VALUE | rb_obj_init_copy (VALUE obj, VALUE orig)
| Default implementation of `#initialize_copy`. More...
VALUE | rb_obj_init_dup_clone (VALUE obj, VALUE orig)
| Default implementation of `#initialize_dup`. More...
VALUE | rb_any_to_s (VALUE obj)
| Default implementation of `#to_s`. 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)
| Determines if obj is an instance of c. More...
VALUE | rb_obj_is_kind_of (VALUE obj, VALUE c)
| Determines if obj is a kind of c. More...
VALUE | rb_obj_tainted (VALUE obj)
| call-seq: obj.tainted? -> 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? -> 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)
| Does nothing. More...
VALUE | rb_obj_freeze (VALUE obj)
| Make the object unmodifiable. More...
VALUE | rb_obj_frozen_p (VALUE obj)
VALUE | rb_false (VALUE obj)
VALUE | rb_class_inherited_p (VALUE mod, VALUE arg)
| Determines if mod inherits arg. More...
VALUE | rb_obj_alloc (VALUE klass)
| Allocates an instance of klass. More...
VALUE | rb_class_new_instance_pass_kw (int argc, const VALUE *argv, VALUE klass)
VALUE | rb_class_new_instance_kw (int argc, const VALUE *argv, VALUE klass, int kw_splat)
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)
| Returns the superclass of klass. 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...
int | rb_bool_expected (VALUE obj, const char *flagname)
int | rb_opts_exception_p (VALUE opts, int default_value)
double | rb_cstr_to_dbl (const char *p, int badcheck)
| Parses a string representation of a floating point number. More...
| FUNC_MINIMIZED (double rb_str_to_dbl(VALUE str, int badcheck))
double | rb_str_to_dbl (VALUE str, int badcheck)
| Parses a string representation of a floating point number. More...
| FUNC_MINIMIZED (VALUE rb_Float(VALUE val))
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_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 = ""))
int
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque