1#ifndef INTERNAL_STRUCT_H
2#define INTERNAL_STRUCT_H
44#define RSTRUCT(obj) ((struct RStruct *)(obj))
50void rb_struct_define_aref_method(
VALUE nstr,
ID name,
unsigned int off);
52static inline long RSTRUCT_EMBED_LEN(
VALUE st);
53static inline long RSTRUCT_LEN_RAW(
VALUE st);
54static inline int RSTRUCT_LENINT(
VALUE st);
55static inline const VALUE *RSTRUCT_CONST_PTR(
VALUE st);
56static inline void RSTRUCT_SET_RAW(
VALUE st,
long k,
VALUE v);
57static inline VALUE RSTRUCT_GET_RAW(
VALUE st,
long k);
60RSTRUCT_EMBED_LEN(
VALUE st)
63 ret >>= RSTRUCT_EMBED_LEN_SHIFT;
68RSTRUCT_LEN_RAW(
VALUE st)
71 return RSTRUCT_EMBED_LEN(st);
74 return RSTRUCT(st)->as.heap.len;
79RSTRUCT_LENINT(
VALUE st)
84static inline const VALUE *
85RSTRUCT_CONST_PTR(
VALUE st)
87 const struct RStruct *p = RSTRUCT(st);
93 return p->as.heap.ptr;
104RSTRUCT_GET_RAW(
VALUE st,
long k)
106 return RSTRUCT_CONST_PTR(st)[k];
110RSTRUCT_FIELDS_OBJ(
VALUE st)
112 return RSTRUCT(st)->fields_obj;
116RSTRUCT_SET_FIELDS_OBJ(
VALUE st,
VALUE fields_obj)
@ RUBY_FL_USHIFT
Number of bits in ruby_fl_type that are not open to users.
@ RUBY_FL_USER5
User-defined flag.
@ RUBY_FL_USER3
User-defined flag.
@ RUBY_FL_USER7
User-defined flag.
@ RUBY_FL_USER6
User-defined flag.
@ RUBY_FL_USER2
User-defined flag.
@ RUBY_FL_USER4
User-defined flag.
@ RUBY_FL_USER1
User-defined flag.
#define FL_TEST_RAW
Old name of RB_FL_TEST_RAW.
#define RB_OBJ_WRITE(old, slot, young)
Declaration of a "back" pointer.
int off
Offset inside of ptr.
int len
Length of the buffer.
#define rb_long2int
Just another name of rb_long2int_inline.
Ruby object's base components.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
uintptr_t VALUE
Type that represents a Ruby object.