Ruby 3.2.3p157 (2024-01-18 revision 52bb2ac0a6971d0391efa2275f7a66bff319087c)
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
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
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
141VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
143
144#endif /* RBIMPL_RHASH_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
This is the implementation detail of RHASH_SET_IFNONE.
Definition hash.c:103
struct st_table * rb_hash_tbl(VALUE hash, const char *file, int line)
This is the implementation detail of RHASH_TBL.
Definition hash.c:1641
size_t rb_hash_size_num(VALUE hash)
This is the implementation detail of RHASH_SIZE.
Definition hash.c:3026
Definition st.h:79
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40