Ruby: include/ruby/internal/core/rbasic.h File Reference

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

Data Structures | Macros | Enumerations | Functions
rbasic.h File Reference

Defines struct RBasic. More...

`#include "ruby/internal/attr/artificial.h"`
`#include "ruby/internal/attr/constexpr.h"`
`#include "ruby/internal/attr/forceinline.h"`
`#include "ruby/internal/attr/noalias.h"`
`#include "ruby/internal/attr/pure.h"`
`#include "ruby/internal/cast.h"`
`#include "ruby/internal/dllexport.h"`
`#include "ruby/internal/special_consts.h"`
`#include "ruby/internal/value.h"`
`#include "ruby/assert.h"`

Go to the source code of this file.

## Data Structures
struct | RBasic
| Ruby's object's, base components. More...

## Macros
#define | RBASIC(obj)
| Convenient casting macro.

## Enumerations
enum | ruby_rvalue_flags { RVALUE_EMBED_LEN_MAX = RBIMPL_RVALUE_EMBED_LEN_MAX }
| This is an enum because GDB wants it (rather than a macro). More...

## Functions
VALUE | rb_obj_hide (VALUE obj)
| Make the object invisible from Ruby code.
VALUE | rb_obj_reveal (VALUE obj, VALUE klass)
| Make a hidden object visible again.
static VALUE | RBASIC_CLASS (VALUE obj)
| Queries the class of an object.

## Detailed Description

Defines struct RBasic.

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 rbasic.h.

## Macro Definition Documentation

## ◆ RBASIC

#define RBASIC | ( |  | obj | ) |

Value:
RBIMPL_CAST((struct RBasic *)(obj))
RBasic
Ruby's object's, base components.
Definition rbasic.h:64

Convenient casting macro.

Parameters

  obj | Arbitrary Ruby object.

Returns
  The passed object casted to RBasic.

Definition at line 40 of file rbasic.h.

Referenced by RARRAY_EMBED_LEN(), RB_BUILTIN_TYPE(), rb_check_inheritable(), rb_class_real(), rb_cvar_set(), RB_FL_REVERSE_RAW(), RB_FL_SET_RAW(), RB_FL_TEST_RAW(), RB_FL_UNSET_RAW(), rb_freeze_singleton_class(), rb_hash_dup(), rb_mod_init_copy(), rb_obj_freeze_inline(), rb_obj_setup(), rb_profile_frame_classpath(), rb_reg_options(), rb_str_drop_bytes(), RBASIC_CLASS(), and RSTRING_EMBED_LEN().

## Enumeration Type Documentation

## ◆ ruby_rvalue_flags

enum ruby_rvalue_flags

This is an enum because GDB wants it (rather than a macro).

People need not bother.

Enumerator
RVALUE_EMBED_LEN_MAX | Max possible number of objects that can be embedded.

Definition at line 53 of file rbasic.h.

## Function Documentation

## ◆ RBASIC_CLASS()

static VALUE RBASIC_CLASS | ( | VALUE | obj | ) |
| inlinestatic

Queries the class of an object.

Parameters

  [in] | obj | An object.

Returns
  Its class.

Definition at line 152 of file rbasic.h.

Referenced by rb_class_of(), rb_extract_keywords(), rb_freeze_singleton_class(), and rb_obj_freeze_inline().