Ruby: include/ruby/internal/core/rhash.h Source File

Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)

rhash.h
Go to the documentation of this file.
1#ifndef RBIMPL_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_RHASH_H
24#include "ruby/internal/config.h"
25
26#ifdef STDC_HEADERS
27# include <stddef.h>
28#endif
29
30#include "ruby/internal/dllexport.h"
31#include "ruby/internal/value.h"
32#if !defined RUBY_EXPORT && !defined RUBY_NO_OLD_COMPATIBILITY
33# include "ruby/backward.h"
34#endif
35
46#define RHASH_TBL(h) rb_hash_tbl(h, __FILE__, __LINE__)
47
59#define RHASH_IFNONE(h) rb_hash_ifnone(h)
60
69#define RHASH_SIZE(h) rb_hash_size_num(h)
70
79#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
80
92#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
93
94struct st_table; /* in ruby/st.h */
95
96 RBIMPL_SYMBOL_EXPORT_BEGIN()
97
98
106size_t rb_hash_size_num(VALUE hash);
107
118struct st_table *rb_hash_tbl(VALUE hash, const char *file, int line);
119
128 VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
129 RBIMPL_SYMBOL_EXPORT_END()
130
131#endif /* RBIMPL_RHASH_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40