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

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

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_ITER_LEV(h) rb_hash_iter_lev(h)
60
72#define RHASH_IFNONE(h) rb_hash_ifnone(h)
73
82#define RHASH_SIZE(h) rb_hash_size_num(h)
83
92#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
93
105#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
106
107struct st_table; /* in ruby/st.h */
108
109 RBIMPL_SYMBOL_EXPORT_BEGIN()
110
111
119size_t rb_hash_size_num(VALUE hash);
120
131struct st_table *rb_hash_tbl(VALUE hash, const char *file, int line);
132
141 VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
142 RBIMPL_SYMBOL_EXPORT_END()
143
144#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:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_hash_set_ifnone
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
This is the implementation detail of RHASH_SET_IFNONE.
Definition hash.c:103
rb_hash_tbl
struct st_table * rb_hash_tbl(VALUE hash, const char *file, int line)
This is the implementation detail of RHASH_TBL.
Definition hash.c:1662
rb_hash_size_num
size_t rb_hash_size_num(VALUE hash)
This is the implementation detail of RHASH_SIZE.
Definition hash.c:3047
st_table
Definition st.h:79
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40