Ruby 3.4.4p34 (2025-05-14 revision a38531fd3f617bf734ef7d6c595325f69985ea1d)
hash.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_HASH_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_HASH_H
25#include "ruby/internal/value.h"
26#include "ruby/st.h"
27
29
30/* hash.c */
31
48void rb_st_foreach_safe(struct st_table *st, st_foreach_callback_func *func, st_data_t arg);
49
51#define st_foreach_safe rb_st_foreach_safe
52
71
83void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
84
100VALUE rb_hash(VALUE obj);
101
107VALUE rb_hash_new(void);
108
118VALUE rb_hash_new_capa(long capa);
119
127VALUE rb_hash_dup(VALUE hash);
128
130VALUE rb_hash_freeze(VALUE obj);
131
142VALUE rb_hash_aref(VALUE hash, VALUE key);
143
156VALUE rb_hash_lookup(VALUE hash, VALUE key);
157
181VALUE rb_hash_lookup2(VALUE hash, VALUE key, VALUE def);
182
193VALUE rb_hash_fetch(VALUE hash, VALUE key);
194
208VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val);
209
218VALUE rb_hash_clear(VALUE hash);
219
229VALUE rb_hash_delete_if(VALUE hash);
230
240VALUE rb_hash_delete(VALUE hash, VALUE key);
241
259void rb_hash_bulk_insert(long argc, const VALUE *argv, VALUE hash);
260
269typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
270
285VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
286
287/* file.c */
288
297int rb_path_check(const char *path);
298
299/* hash.c */
300
307VALUE rb_env_clear(void);
308
316VALUE rb_hash_size(VALUE hash);
317
319
320#endif /* RBIMPL_INTERN_HASH_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
VALUE rb_check_hash_type(VALUE obj)
Try converting an object to its hash representation using its to_hash method, if any.
Definition hash.c:1866
void rb_st_foreach_safe(struct st_table *st, st_foreach_callback_func *func, st_data_t arg)
Identical to rb_st_foreach(), except it raises exceptions when the callback function tampers the tabl...
VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value)
Type of callback functions to pass to rb_hash_update_by().
Definition hash.h:269
int capa
Designed capacity of the buffer.
Definition io.h:11
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40