Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Defines enum ruby_special_consts. More...
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/attr/enum_extensibility.h"
#include "ruby/internal/stdbool.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Macros | |
#define | USE_FLONUM 1 |
#define | RTEST RB_TEST |
This is an old name of RB_TEST. | |
#define | FIXNUM_P RB_FIXNUM_P |
Old name of RB_FIXNUM_P. | |
#define | IMMEDIATE_P RB_IMMEDIATE_P |
Old name of RB_IMMEDIATE_P. | |
#define | NIL_P RB_NIL_P |
Old name of RB_NIL_P. | |
#define | SPECIAL_CONST_P RB_SPECIAL_CONST_P |
Old name of RB_SPECIAL_CONST_P. | |
#define | STATIC_SYM_P RB_STATIC_SYM_P |
Old name of RB_STATIC_SYM_P. | |
#define | Qfalse RUBY_Qfalse |
Old name of RUBY_Qfalse. | |
#define | Qnil RUBY_Qnil |
Old name of RUBY_Qnil. | |
#define | Qtrue RUBY_Qtrue |
Old name of RUBY_Qtrue. | |
#define | Qundef RUBY_Qundef |
Old name of RUBY_Qundef. | |
#define | FIXNUM_FLAG RUBY_FIXNUM_FLAG |
Old name of RUBY_FIXNUM_FLAG. | |
#define | FLONUM_FLAG RUBY_FLONUM_FLAG |
Old name of RUBY_FLONUM_FLAG. | |
#define | FLONUM_MASK RUBY_FLONUM_MASK |
Old name of RUBY_FLONUM_MASK. | |
#define | FLONUM_P RB_FLONUM_P |
Old name of RB_FLONUM_P. | |
#define | IMMEDIATE_MASK RUBY_IMMEDIATE_MASK |
Old name of RUBY_IMMEDIATE_MASK. | |
#define | SYMBOL_FLAG RUBY_SYMBOL_FLAG |
Old name of RUBY_SYMBOL_FLAG. |
Enumerations | |
enum | ruby_special_consts { RUBY_Qfalse , RUBY_Qtrue , RUBY_Qnil , RUBY_Qundef , RUBY_IMMEDIATE_MASK , RUBY_FIXNUM_FLAG , RUBY_FLONUM_MASK , RUBY_FLONUM_FLAG , RUBY_SYMBOL_FLAG , RUBY_SPECIAL_SHIFT = 8 } |
special constants - i.e. More... |
Functions | |
static bool | RB_TEST (VALUE obj) |
Emulates Ruby's "if" statement. | |
static bool | RB_NIL_P (VALUE obj) |
Checks if the given object is nil. | |
static bool | RB_UNDEF_P (VALUE obj) |
Checks if the given object is undef. | |
static bool | RB_NIL_OR_UNDEF_P (VALUE obj) |
Checks if the given object is nil or undef. | |
static bool | RB_FIXNUM_P (VALUE obj) |
Checks if the given object is a so-called Fixnum. | |
static bool | RB_STATIC_SYM_P (VALUE obj) |
Checks if the given object is a static symbol. | |
static bool | RB_FLONUM_P (VALUE obj) |
Checks if the given object is a so-called Flonum. | |
static bool | RB_IMMEDIATE_P (VALUE obj) |
Checks if the given object is an immediate i.e. | |
static bool | RB_SPECIAL_CONST_P (VALUE obj) |
Checks if the given object is of enum ruby_special_consts. | |
static VALUE | rb_special_const_p (VALUE obj) |
Identical to RB_SPECIAL_CONST_P, except it returns a VALUE. |
Defines enum ruby_special_consts.
Definition in file special_consts.h.
#define RTEST RB_TEST |
This is an old name of RB_TEST.
Not sure which name is preferred.
Definition at line 51 of file special_consts.h.
Referenced by rb_category_warning(), rb_cmpint(), rb_compile_warning(), rb_debug_inspector_frame_iseq_get(), rb_econv_has_convpath_p(), rb_enumeratorize_with_size_kw(), rb_eql(), rb_equal(), rb_f_global_variables(), rb_io_maybe_wait_readable(), rb_io_maybe_wait_writable(), rb_io_set_timeout(), rb_io_set_write_io(), rb_io_wait_readable(), rb_io_wait_writable(), rb_mod_class_variables(), rb_mod_constants(), rb_obj_singleton_methods(), rb_range_values(), rb_str_format(), rb_sys_warning(), rb_thread_wakeup(), rb_tracepoint_new(), rb_warning(), and ruby_init().
#define USE_FLONUM 1 |
Definition at line 45 of file special_consts.h.
enum ruby_special_consts |
special constants - i.e.
non-zero and non-fixnum constants
Enumerator | |
---|---|
RUBY_Qfalse |
|
RUBY_Qtrue |
|
RUBY_Qnil |
|
RUBY_Qundef | Represents so-called undef. |
RUBY_IMMEDIATE_MASK | Bit mask detecting special consts. |
RUBY_FIXNUM_FLAG | Flag to denote a fixnum. |
RUBY_FLONUM_MASK | Bit mask detecting a flonum. |
RUBY_FLONUM_FLAG | Flag to denote a flonum. |
RUBY_SYMBOL_FLAG | Flag to denote a static symbol. |
RUBY_SPECIAL_SHIFT | Least significant 8 bits are reserved. |
Definition at line 84 of file special_consts.h.
|
inlinestatic |
Checks if the given object is a so-called Fixnum.
[in] | obj | An arbitrary ruby object. |
true | obj is a Fixnum. |
false | Anything else. |
Definition at line 247 of file special_consts.h.
Referenced by rb_class_of(), rb_fiber_scheduler_io_result_apply(), RB_FIX2INT(), RB_FIX2UINT(), rb_fix2ulong(), RB_FIXNUM_P(), RB_INT2FIX(), rb_integer_type_p(), rb_num2int_inline(), rb_num2ll_inline(), rb_num2long_inline(), rb_num2short_inline(), rb_num2ull_inline(), rb_num2ulong_inline(), and rb_type().
|
inlinestatic |
Checks if the given object is a so-called Flonum.
[in] | obj | An arbitrary ruby object. |
true | obj is a Flonum. |
false | Anything else. |
Definition at line 288 of file special_consts.h.
Referenced by rb_class_of(), RB_FLOAT_TYPE_P(), RB_FLONUM_P(), and rb_type().
|
inlinestatic |
Checks if the given object is an immediate i.e.
an object which has no corresponding storage inside of the object space.
[in] | obj | An arbitrary ruby object. |
true | obj is a Flonum. |
false | Anything else. |
Definition at line 311 of file special_consts.h.
Referenced by RB_IMMEDIATE_P(), and RB_SPECIAL_CONST_P().
|
inlinestatic |
Checks if the given object is nil or undef.
Can be used to see if a keyword argument is not given or given nil.
[in] | obj | An arbitrary ruby object. |
true | obj is RUBY_Qnil or RUBY_Qundef. |
false | Anything else. |
Definition at line 206 of file special_consts.h.
Referenced by RB_NIL_OR_UNDEF_P().
|
inlinestatic |
Checks if the given object is nil.
[in] | obj | An arbitrary ruby object. |
true | obj is RUBY_Qnil. |
false | Anything else. |
Definition at line 173 of file special_consts.h.
Referenced by RB_NIL_P().
|
inlinestatic |
Checks if the given object is of enum ruby_special_consts.
[in] | obj | An arbitrary ruby object. |
true | obj is a special constant. |
false | Anything else. |
Definition at line 327 of file special_consts.h.
Referenced by RB_BUILTIN_TYPE(), rb_class_of(), rb_define_const(), RB_DYNAMIC_SYM_P(), RB_FL_ABLE(), RB_FLOAT_TYPE_P(), rb_integer_type_p(), rb_ractor_shareable_p(), RB_SPECIAL_CONST_P(), rb_special_const_p(), rb_type(), and RBASIC_CLASS().
Identical to RB_SPECIAL_CONST_P, except it returns a VALUE.
[in] | obj | An arbitrary ruby object. |
RUBY_Qtrue | obj is a special constant. |
RUBY_Qfalse | Anything else. |
Definition at line 347 of file special_consts.h.
Referenced by rb_special_const_p().
|
inlinestatic |
Checks if the given object is a static symbol.
[in] | obj | An arbitrary ruby object. |
true | obj is a static symbol |
false | Anything else. |
Definition at line 267 of file special_consts.h.
Referenced by rb_class_of(), RB_STATIC_SYM_P(), RB_SYMBOL_P(), and rb_type().
|
inlinestatic |
Emulates Ruby's "if" statement.
[in] | obj | An arbitrary ruby object. |
false | obj is either RUBY_Qfalse or RUBY_Qnil. |
true | Anything else. |
Definition at line 138 of file special_consts.h.
Referenced by RB_TEST().
|
inlinestatic |
Checks if the given object is undef.
[in] | obj | An arbitrary ruby object. |
true | obj is RUBY_Qundef. |
false | Anything else. |
Definition at line 189 of file special_consts.h.
Referenced by RB_UNDEF_P().