Ruby: internal/struct.h File Reference

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

Data Structures | Macros | Enumerations | Functions
struct.h File Reference

Internal header for Struct. More...

`#include "ruby/internal/stdbool.h"`
`#include "internal/gc.h"`
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Data Structures
struct | RStruct

## Macros
#define | RSTRUCT(obj) ((struct RStruct *)(obj))
#define | RSTRUCT_LEN internal_RSTRUCT_LEN
#define | RSTRUCT_SET internal_RSTRUCT_SET
#define | RSTRUCT_GET internal_RSTRUCT_GET

## Enumerations
enum | { RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX , RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1) , RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1) , RSTRUCT_TRANSIENT_FLAG = FL_USER3 }

## Functions
VALUE | rb_struct_init_copy (VALUE copy, VALUE s)
VALUE | rb_struct_lookup (VALUE s, VALUE idx)
VALUE | rb_struct_s_keyword_init (VALUE klass)

## Detailed Description

Internal header for Struct.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file struct.h.

## Macro Definition Documentation

## ◆ RSTRUCT

#define RSTRUCT | ( |  | obj | ) | ((struct RStruct *)(obj))

Definition at line 34 of file struct.h.

## ◆ RSTRUCT_GET

#define RSTRUCT_GET internal_RSTRUCT_GET

Definition at line 54 of file struct.h.

## ◆ RSTRUCT_LEN

#define RSTRUCT_LEN internal_RSTRUCT_LEN

Definition at line 52 of file struct.h.

## ◆ RSTRUCT_SET

#define RSTRUCT_SET internal_RSTRUCT_SET

Definition at line 53 of file struct.h.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
RSTRUCT_EMBED_LEN_MAX |
RSTRUCT_EMBED_LEN_MASK |
RSTRUCT_EMBED_LEN_SHIFT |
RSTRUCT_TRANSIENT_FLAG |

Definition at line 16 of file struct.h.

## Function Documentation

## ◆ rb_struct_init_copy()

VALUE rb_struct_init_copy | ( | VALUE | copy,
|  | VALUE | s
| ) |  |

Definition at line 1010 of file struct.c.

References len, OBJ_INIT_COPY, rb_eTypeError, rb_raise(), RSTRUCT_GET, RSTRUCT_LEN, and RSTRUCT_SET.

Referenced by InitVM_Struct().

## ◆ rb_struct_lookup()

VALUE rb_struct_lookup | ( | VALUE | s,
|  | VALUE | idx
| ) |  |

Definition at line 1136 of file struct.c.

References Qnil.

Referenced by rb_obj_dig().

## ◆ rb_struct_s_keyword_init()

VALUE rb_struct_s_keyword_init | ( | VALUE | klass | ) |

Definition at line 60 of file struct.c.