Ruby  2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
constant.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  constant.h -
4 
5  $Author$
6  created at: Sun Nov 15 00:09:33 2009
7 
8  Copyright (C) 2009 Yusuke Endoh
9 
10 **********************************************************************/
11 #ifndef CONSTANT_H
12 #define CONSTANT_H
13 
14 typedef enum {
16 
18  CONST_PUBLIC = 0x00,
22 
23 #define RB_CONST_PRIVATE_P(ce) \
24  (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
25 #define RB_CONST_PUBLIC_P(ce) \
26  (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
27 
28 #define RB_CONST_DEPRECATED_P(ce) \
29  ((ce)->flag & CONST_DEPRECATED)
30 
31 typedef struct rb_const_entry_struct {
33  int line;
34  VALUE value; /* should be mark */
35  VALUE file; /* should be mark */
37 
41 void rb_free_const_table(struct rb_id_table *tbl);
46 int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
49 
50 #endif /* CONSTANT_H */
ID
unsigned long ID
Definition: ruby.h:103
CONST_PUBLIC
@ CONST_PUBLIC
Definition: constant.h:18
rb_const_source_location_at
VALUE rb_const_source_location_at(VALUE, ID)
Definition: variable.c:2467
rb_const_entry_struct::line
int line
Definition: constant.h:33
VALUE
unsigned long VALUE
Definition: ruby.h:102
rb_const_entry_struct::value
VALUE value
Definition: constant.h:34
rb_free_const_table
void rb_free_const_table(struct rb_id_table *tbl)
Definition: gc.c:2493
rb_const_flag_t
rb_const_flag_t
Definition: constant.h:14
rb_id_table
Definition: id_table.c:40
rb_autoloading_value
int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag)
Definition: variable.c:2078
rb_const_entry_struct::flag
rb_const_flag_t flag
Definition: constant.h:32
CONST_VISIBILITY_MAX
@ CONST_VISIBILITY_MAX
Definition: constant.h:20
CONST_PRIVATE
@ CONST_PRIVATE
Definition: constant.h:19
rb_public_const_get_from
VALUE rb_public_const_get_from(VALUE klass, ID id)
Definition: variable.c:2403
klass
VALUE klass
Definition: rb_mjit_min_header-2.7.2.h:13222
mod
#define mod(x, y)
Definition: date_strftime.c:28
rb_const_source_location
VALUE rb_const_source_location(VALUE, ID)
Definition: variable.c:2461
obj
const VALUE VALUE obj
Definition: rb_mjit_min_header-2.7.2.h:5738
argv
char ** argv
Definition: ruby.c:223
argc
int argc
Definition: ruby.c:222
rb_const_entry_t
struct rb_const_entry_struct rb_const_entry_t
rb_const_lookup
rb_const_entry_t * rb_const_lookup(VALUE klass, ID id)
Definition: variable.c:3352
rb_mod_deprecate_constant
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
Definition: variable.c:3022
rb_const_entry_struct::file
VALUE file
Definition: constant.h:35
CONST_VISIBILITY_MASK
@ CONST_VISIBILITY_MASK
Definition: constant.h:17
rb_mod_private_constant
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj)
Definition: variable.c:2982
CONST_DEPRECATED
@ CONST_DEPRECATED
Definition: constant.h:15
rb_public_const_get_at
VALUE rb_public_const_get_at(VALUE klass, ID id)
Definition: variable.c:2409
rb_const_entry_struct
Definition: constant.h:31
rb_mod_public_constant
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
Definition: variable.c:2996
rb_public_const_defined_from
int rb_public_const_defined_from(VALUE klass, ID id)
Definition: variable.c:2698