Ruby: include/ruby/internal/intern/object.h File Reference

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

Macros | Functions
object.h File Reference

Public APIs related to rb_cObject. More...

`#include "ruby/internal/attr/pure.h"`
`#include "ruby/internal/dllexport.h"`
`#include "ruby/internal/value.h"`

Go to the source code of this file.

## Macros
#define | RB_OBJ_INIT_COPY(obj, orig) ((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
#define | OBJ_INIT_COPY(obj, orig) RB_OBJ_INIT_COPY(obj, orig)

## Functions
VALUE | rb_class_new_instance_pass_kw (int, const VALUE *, VALUE)
VALUE | rb_class_new_instance (int, const VALUE *, VALUE)
| Allocates and initializes an instance of klass. More...
VALUE | rb_class_new_instance_kw (int, const VALUE *, VALUE, int)
int | rb_eql (VALUE, VALUE)
| Determines if obj1 and obj2 are equal in terms of `Object::eql`?. More...
VALUE | rb_any_to_s (VALUE)
| Default implementation of `#to_s`. More...
VALUE | rb_inspect (VALUE)
| Convenient wrapper of `Object::inspect`. More...
VALUE | rb_obj_is_instance_of (VALUE, VALUE)
| Determines if obj is an instance of c. More...
VALUE | rb_obj_is_kind_of (VALUE, VALUE)
| Determines if obj is a kind of c. More...
VALUE | rb_obj_alloc (VALUE)
| Allocates an instance of klass. More...
VALUE | rb_obj_clone (VALUE)
| Almost same as `Object::clone`. More...
VALUE | rb_obj_dup (VALUE)
| Equivalent to `Object#dup` in Ruby. More...
VALUE | rb_obj_init_copy (VALUE, VALUE)
| Default implementation of `#initialize_copy`. More...
VALUE | rb_obj_taint (VALUE)
| call-seq: obj.taint -> obj More...
VALUE | rb_obj_tainted (VALUE)
| call-seq: obj.tainted? -> false More...
VALUE | rb_obj_untaint (VALUE)
| call-seq: obj.untaint -> obj More...
VALUE | rb_obj_untrust (VALUE)
| call-seq: obj.untrust -> obj More...
VALUE | rb_obj_untrusted (VALUE)
| call-seq: obj.untrusted? -> false More...
VALUE | rb_obj_trust (VALUE)
| call-seq: obj.trust -> obj More...
VALUE | rb_obj_freeze (VALUE)
| Make the object unmodifiable. More...
VALUE | rb_obj_frozen_p (VALUE)
VALUE | rb_obj_id (VALUE)
VALUE | rb_memory_id (VALUE)
VALUE | rb_obj_class (VALUE)
VALUE | rb_class_real (VALUE)
| Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions. More...
VALUE | rb_class_inherited_p (VALUE, VALUE)
| Determines if mod inherits arg. More...
VALUE | rb_class_superclass (VALUE)
| Returns the superclass of klass. More...
VALUE | rb_class_get_superclass (VALUE)
| 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, int, const char *, const char *)
| Converts an object into another type. More...
VALUE | rb_check_convert_type (VALUE, int, const char *, const char *)
| Tries to convert an object into another type. More...
VALUE | rb_check_to_integer (VALUE, const char *)
| Tries to convert val into `Integer`. More...
VALUE | rb_check_to_float (VALUE)
| Tries to convert an object into `Float`. More...
VALUE | rb_to_int (VALUE)
| Converts val into `Integer`. More...
VALUE | rb_check_to_int (VALUE)
| Tries to convert val into Integer. More...
VALUE | rb_Integer (VALUE)
| Equivalent to `Kernel#Integer` in Ruby. More...
VALUE | rb_to_float (VALUE)
| Converts a `Numeric` object into `Float`. More...
VALUE | rb_Float (VALUE)
| Equivalent to `Kernel#Float` in Ruby. More...
VALUE | rb_String (VALUE)
| Equivalent to `Kernel#String` in Ruby. More...
VALUE | rb_Array (VALUE)
| Equivalent to `Kernel#Array` in Ruby. More...
VALUE | rb_Hash (VALUE)
| Equivalent to `Kernel#Hash` in Ruby. More...
double | rb_cstr_to_dbl (const char *, int)
| Parses a string representation of a floating point number. More...
double | rb_str_to_dbl (VALUE, int)
| Parses a string representation of a floating point number. More...

## Detailed Description

Public APIs related to rb_cObject.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Warning
  Symbols prefixed with either `RBIMPL` or `rbimpl` are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.

Note
  To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance `__VA_ARGS__` is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file object.h.

## Macro Definition Documentation

## ◆ OBJ_INIT_COPY

#define OBJ_INIT_COPY | ( |  | obj,
|  |  | orig
| ) |  | RB_OBJ_INIT_COPY(obj, orig)

Definition at line 31 of file object.h.

## ◆ RB_OBJ_INIT_COPY

#define RB_OBJ_INIT_COPY | ( |  | obj,
|  |  | orig
| ) |  | ((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))

Definition at line 29 of file object.h.

## Function Documentation

## ◆ rb_memory_id()

VALUE rb_memory_id | ( | VALUE | obj | ) |

Definition at line 4077 of file gc.c.

Referenced by rb_exec_recursive_paired(), and rb_exec_recursive_paired_outer().

## ◆ rb_obj_id()

VALUE rb_obj_id | ( | VALUE | obj | ) |

Definition at line 4110 of file gc.c.

Referenced by Init_GC().