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

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

rhash.h
Go to the documentation of this file.
1#ifndef RBIMPL_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_RHASH_H
35#include "ruby/internal/config.h"
36
37#ifdef STDC_HEADERS
38# include <stddef.h>
39#endif
40
41#include "ruby/internal/dllexport.h"
42#include "ruby/internal/value.h"
43#if !defined RUBY_EXPORT && !defined RUBY_NO_OLD_COMPATIBILITY
44# include "ruby/backward.h"
45#endif
46
47#define RHASH_TBL(h) rb_hash_tbl(h, __FILE__, __LINE__)
48#define RHASH_ITER_LEV(h) rb_hash_iter_lev(h)
49#define RHASH_IFNONE(h) rb_hash_ifnone(h)
50#define RHASH_SIZE(h) rb_hash_size_num(h)
51#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
52#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
53
54struct st_table; /* in ruby/st.h */
55
56 RBIMPL_SYMBOL_EXPORT_BEGIN()
57size_t rb_hash_size_num(VALUE hash);
58struct st_table *rb_hash_tbl(VALUE, const char *file, int line);
59 VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
60 RBIMPL_SYMBOL_EXPORT_END()
61
62#endif /* RBIMPL_RHASH_H */
backward.h
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
config.h
Thin wrapper to ruby/config.h.
rb_hash_tbl
struct st_table * rb_hash_tbl(VALUE, const char *file, int line)
Definition: hash.c:1609
rb_hash_set_ifnone
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
Definition: hash.c:113
rb_hash_size_num
size_t rb_hash_size_num(VALUE hash)
Definition: hash.c:2987
const
#define const
Definition: strftime.c:108
file
Definition: gzappend.c:170
st_table
Definition: st.h:79
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38