Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Typedefs | Enumerations | Functions
constant.h File Reference

Go to the source code of this file.

Data Structures

struct  rb_const_entry_struct
 

Macros

#define RB_CONST_PRIVATE_P(ce)   (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
 
#define RB_CONST_PUBLIC_P(ce)   (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
 
#define RB_CONST_DEPRECATED_P(ce)   ((ce)->flag & CONST_DEPRECATED)
 

Typedefs

typedef struct rb_const_entry_struct rb_const_entry_t
 

Enumerations

enum  rb_const_flag_t {
  CONST_DEPRECATED = 0x100, CONST_VISIBILITY_MASK = 0xff, CONST_PUBLIC = 0x00, CONST_PRIVATE,
  CONST_VISIBILITY_MAX
}
 

Functions

VALUE rb_mod_private_constant (int argc, const VALUE *argv, VALUE obj)
 
VALUE rb_mod_public_constant (int argc, const VALUE *argv, VALUE obj)
 
VALUE rb_mod_deprecate_constant (int argc, const VALUE *argv, VALUE obj)
 
void rb_free_const_table (struct rb_id_table *tbl)
 
VALUE rb_public_const_get (VALUE klass, ID id)
 
VALUE rb_public_const_get_at (VALUE klass, ID id)
 
VALUE rb_public_const_get_from (VALUE klass, ID id)
 
int rb_public_const_defined (VALUE klass, ID id)
 
int rb_public_const_defined_at (VALUE klass, ID id)
 
int rb_public_const_defined_from (VALUE klass, ID id)
 
rb_const_entry_trb_const_lookup (VALUE klass, ID id)
 

Macro Definition Documentation

◆ RB_CONST_DEPRECATED_P

#define RB_CONST_DEPRECATED_P (   ce)    ((ce)->flag & CONST_DEPRECATED)

Definition at line 28 of file constant.h.

Referenced by rb_const_warn_if_deprecated().

◆ RB_CONST_PRIVATE_P

#define RB_CONST_PRIVATE_P (   ce)    (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)

Definition at line 23 of file constant.h.

◆ RB_CONST_PUBLIC_P

#define RB_CONST_PUBLIC_P (   ce)    (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)

Definition at line 25 of file constant.h.

Typedef Documentation

◆ rb_const_entry_t

Enumeration Type Documentation

◆ rb_const_flag_t

Enumerator
CONST_DEPRECATED 
CONST_VISIBILITY_MASK 
CONST_PUBLIC 
CONST_PRIVATE 
CONST_VISIBILITY_MAX 

Definition at line 14 of file constant.h.

Function Documentation

◆ rb_const_lookup()

rb_const_entry_t* rb_const_lookup ( VALUE  klass,
ID  id 
)

Definition at line 3128 of file variable.c.

References rb_id_table_lookup(), RCLASS_CONST_TBL, and val.

Referenced by rb_autoload_str(), rb_const_remove(), and rb_deprecate_constant().

◆ rb_free_const_table()

void rb_free_const_table ( struct rb_id_table tbl)

Definition at line 2140 of file gc.c.

References rb_id_table_foreach_values().

◆ rb_mod_deprecate_constant()

VALUE rb_mod_deprecate_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2800 of file variable.c.

◆ rb_mod_private_constant()

VALUE rb_mod_private_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2772 of file variable.c.

◆ rb_mod_public_constant()

VALUE rb_mod_public_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2786 of file variable.c.

◆ rb_public_const_defined()

int rb_public_const_defined ( VALUE  klass,
ID  id 
)

Definition at line 2555 of file variable.c.

◆ rb_public_const_defined_at()

int rb_public_const_defined_at ( VALUE  klass,
ID  id 
)

Definition at line 2561 of file variable.c.

◆ rb_public_const_defined_from()

int rb_public_const_defined_from ( VALUE  klass,
ID  id 
)

Definition at line 2549 of file variable.c.

◆ rb_public_const_get()

VALUE rb_public_const_get ( VALUE  klass,
ID  id 
)

Definition at line 2310 of file variable.c.

◆ rb_public_const_get_at()

VALUE rb_public_const_get_at ( VALUE  klass,
ID  id 
)

Definition at line 2316 of file variable.c.

◆ rb_public_const_get_from()

VALUE rb_public_const_get_from ( VALUE  klass,
ID  id 
)

Definition at line 2304 of file variable.c.