Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Functions | Variables
symbol.h File Reference
`#include "id.h"`

Go to the source code of this file.

## Data Structures
struct | RSymbol
struct | rb_symbols_t

## Macros
#define | DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
#define | STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
#define | RSYMBOL(obj) (R_CAST(RSymbol)(obj))
#define | is_notop_id(id) ((id)>tLAST_OP_ID)
#define | is_local_id(id) (id_type(id)==ID_LOCAL)
#define | is_global_id(id) (id_type(id)==ID_GLOBAL)
#define | is_instance_id(id) (id_type(id)==ID_INSTANCE)
#define | is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET)
#define | is_const_id(id) (id_type(id)==ID_CONST)
#define | is_class_id(id) (id_type(id)==ID_CLASS)
#define | is_junk_id(id) (id_type(id)==ID_JUNK)
#define | is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
#define | is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
#define | is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
#define | is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
#define | is_const_sym(sym) (sym_type(sym)==ID_CONST)
#define | is_class_sym(sym) (sym_type(sym)==ID_CLASS)
#define | is_junk_sym(sym) (sym_type(sym)==ID_JUNK)

## Typedefs
typedef uint32_t | rb_id_serial_t

## Functions
int | rb_enc_symname_type (const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset)
RUBY_SYMBOL_EXPORT_BEGIN size_t | rb_sym_immortal_count (void)

## Variables
const RUBY_FUNC_EXPORTED unsigned int | ruby_global_name_punct_bits [(0x7e - 0x20+31)/32]

## Macro Definition Documentation

## ◆ DYNAMIC_ID_P

#define DYNAMIC_ID_P | ( |  | id | ) | (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)

Definition at line 17 of file symbol.h.

## ◆ is_attrset_id

#define is_attrset_id | ( |  | id | ) | ((id)==idASET||id_type(id)==ID_ATTRSET)

Definition at line 39 of file symbol.h.

## ◆ is_attrset_sym

#define is_attrset_sym | ( |  | sym | ) | (sym_type(sym)==ID_ATTRSET)

Definition at line 98 of file symbol.h.

## ◆ is_class_id

#define is_class_id | ( |  | id | ) | (id_type(id)==ID_CLASS)

Definition at line 41 of file symbol.h.

## ◆ is_class_sym

#define is_class_sym | ( |  | sym | ) | (sym_type(sym)==ID_CLASS)

Definition at line 100 of file symbol.h.

## ◆ is_const_id

#define is_const_id | ( |  | id | ) | (id_type(id)==ID_CONST)

Definition at line 40 of file symbol.h.

## ◆ is_const_sym

#define is_const_sym | ( |  | sym | ) | (sym_type(sym)==ID_CONST)

Definition at line 99 of file symbol.h.

## ◆ is_global_id

#define is_global_id | ( |  | id | ) | (id_type(id)==ID_GLOBAL)

Definition at line 37 of file symbol.h.

## ◆ is_global_sym

#define is_global_sym | ( |  | sym | ) | (sym_type(sym)==ID_GLOBAL)

Definition at line 96 of file symbol.h.

## ◆ is_instance_id

#define is_instance_id | ( |  | id | ) | (id_type(id)==ID_INSTANCE)

Definition at line 38 of file symbol.h.

## ◆ is_instance_sym

#define is_instance_sym | ( |  | sym | ) | (sym_type(sym)==ID_INSTANCE)

Definition at line 97 of file symbol.h.

## ◆ is_junk_id

#define is_junk_id | ( |  | id | ) | (id_type(id)==ID_JUNK)

Definition at line 42 of file symbol.h.

## ◆ is_junk_sym

#define is_junk_sym | ( |  | sym | ) | (sym_type(sym)==ID_JUNK)

Definition at line 101 of file symbol.h.

## ◆ is_local_id

#define is_local_id | ( |  | id | ) | (id_type(id)==ID_LOCAL)

Definition at line 36 of file symbol.h.

## ◆ is_local_sym

#define is_local_sym | ( |  | sym | ) | (sym_type(sym)==ID_LOCAL)

Definition at line 95 of file symbol.h.

## ◆ is_notop_id

#define is_notop_id | ( |  | id | ) | ((id)>tLAST_OP_ID)

Definition at line 35 of file symbol.h.

## ◆ RSYMBOL

#define RSYMBOL | ( |  | obj | ) | (R_CAST(RSymbol)(obj))

Definition at line 33 of file symbol.h.

## ◆ STATIC_ID2SYM

#define STATIC_ID2SYM | ( |  | id | ) | (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)

Definition at line 18 of file symbol.h.

## Typedef Documentation

## ◆ rb_id_serial_t

typedef uint32_t rb_id_serial_t

Definition at line 55 of file symbol.h.

## Function Documentation

## ◆ rb_enc_symname_type()

int rb_enc_symname_type | ( | const char * | name,
|  | long | len,
|  | rb_encoding * | enc,
|  | unsigned int | allowed_attrset
| ) |  |

Definition at line 233 of file symbol.c.

References ID_GLOBAL, ID_JUNK, len, name, and rb_enc_asciicompat.

Referenced by rb_enc_symname2_p().

## ◆ rb_sym_immortal_count()

RUBY_SYMBOL_EXPORT_BEGIN size_t rb_sym_immortal_count | ( | void |  | ) |

Definition at line 848 of file symbol.c.

References global_symbols.

## Variable Documentation

## ◆ ruby_global_name_punct_bits

const RUBY_FUNC_EXPORTED unsigned int ruby_global_name_punct_bits[(0x7e - 0x20+31)/32]

Definition at line 103 of file symbol.h.