Ruby: include/ruby/internal/variable.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

variable.h
Go to the documentation of this file.
1#ifndef RBIMPL_VARIABLE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_VARIABLE_H
23#include "ruby/internal/dllexport.h"
24#include "ruby/internal/value.h"
25#include "ruby/internal/attr/noreturn.h"
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29typedef VALUE rb_gvar_getter_t(ID id, VALUE *data);
30typedef void rb_gvar_setter_t(VALUE val, ID id, VALUE *data);
31typedef void rb_gvar_marker_t(VALUE *var);
32
33 rb_gvar_getter_t rb_gvar_undef_getter;
34 rb_gvar_setter_t rb_gvar_undef_setter;
35 rb_gvar_marker_t rb_gvar_undef_marker;
36
37 rb_gvar_getter_t rb_gvar_val_getter;
38 rb_gvar_setter_t rb_gvar_val_setter;
39 rb_gvar_marker_t rb_gvar_val_marker;
40
41 rb_gvar_getter_t rb_gvar_var_getter;
42 rb_gvar_setter_t rb_gvar_var_setter;
43 rb_gvar_marker_t rb_gvar_var_marker;
44
45 RBIMPL_ATTR_NORETURN()
46 rb_gvar_setter_t rb_gvar_readonly_setter;
47
48void rb_define_variable(const char*,VALUE*);
49void rb_define_virtual_variable(const char*,rb_gvar_getter_t*,rb_gvar_setter_t*);
50void rb_define_hooked_variable(const char*,VALUE*,rb_gvar_getter_t*,rb_gvar_setter_t*);
51void rb_define_readonly_variable(const char*,const VALUE*);
52void rb_define_const(VALUE,const char*,VALUE);
53void rb_define_global_const(const char*,VALUE);
54
55 VALUE rb_gv_set(const char*, VALUE);
56 VALUE rb_gv_get(const char*);
57 VALUE rb_iv_get(VALUE, const char*);
58 VALUE rb_iv_set(VALUE, const char*, VALUE);
59
60 RBIMPL_SYMBOL_EXPORT_END()
61
62#endif /* RBIMPL_VARIABLE_H */
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_define_virtual_variable
void rb_define_virtual_variable(const char *, rb_gvar_getter_t *, rb_gvar_setter_t *)
Definition: variable.c:593
rb_gvar_var_setter
rb_gvar_setter_t rb_gvar_var_setter
Definition: variable.h:42
rb_gvar_var_marker
rb_gvar_marker_t rb_gvar_var_marker
Definition: variable.h:43
rb_gv_set
VALUE rb_gv_set(const char *, VALUE)
Definition: variable.c:754
rb_gvar_marker_t
void rb_gvar_marker_t(VALUE *var)
Definition: variable.h:31
rb_gvar_setter_t
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
Definition: variable.h:30
rb_define_variable
void rb_define_variable(const char *, VALUE *)
Definition: variable.c:581
rb_define_global_const
void rb_define_global_const(const char *, VALUE)
Definition: variable.c:3162
rb_gvar_val_setter
rb_gvar_setter_t rb_gvar_val_setter
Definition: variable.h:38
rb_gvar_undef_marker
rb_gvar_marker_t rb_gvar_undef_marker
Definition: variable.h:35
rb_gvar_readonly_setter
rb_gvar_setter_t rb_gvar_readonly_setter
Definition: variable.h:46
rb_iv_set
VALUE rb_iv_set(VALUE, const char *, VALUE)
Definition: variable.c:3580
rb_gvar_undef_getter
rb_gvar_getter_t rb_gvar_undef_getter
Definition: variable.h:33
rb_gvar_val_marker
rb_gvar_marker_t rb_gvar_val_marker
Definition: variable.h:39
rb_define_const
void rb_define_const(VALUE, const char *, VALUE)
Definition: variable.c:3150
rb_define_readonly_variable
void rb_define_readonly_variable(const char *, const VALUE *)
Definition: variable.c:587
rb_gv_get
VALUE rb_gv_get(const char *)
Definition: variable.c:768
rb_define_hooked_variable
void rb_define_hooked_variable(const char *, VALUE *, rb_gvar_getter_t *, rb_gvar_setter_t *)
Definition: variable.c:562
rb_iv_get
VALUE rb_iv_get(VALUE, const char *)
Definition: variable.c:3569
rb_gvar_getter_t
VALUE rb_gvar_getter_t(ID id, VALUE *data)
Definition: variable.h:29
rb_gvar_undef_setter
rb_gvar_setter_t rb_gvar_undef_setter
Definition: variable.h:34
rb_gvar_val_getter
rb_gvar_getter_t rb_gvar_val_getter
Definition: variable.h:37
rb_gvar_var_getter
rb_gvar_getter_t rb_gvar_var_getter
Definition: variable.h:41
noreturn.h
Defines RBIMPL_ATTR_NORETURN.
RBIMPL_ATTR_NORETURN
#define RBIMPL_ATTR_NORETURN()
Wraps (or simulates) [[noreturn]]
Definition: noreturn.h:38
const
#define const
Definition: strftime.c:108
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39