Ruby 3.5.0dev (2025-07-15 revision e27c1152aa7b8b9f69c56142b4f50e132bba29dd)
set.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_SET_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_SET_H
25#include "ruby/internal/value.h"
26
28
29/* set.c */
30
41void rb_set_foreach(VALUE set, int (*func)(VALUE element, VALUE arg), VALUE arg);
42
48VALUE rb_set_new(void);
49
60
68bool rb_set_lookup(VALUE set, VALUE element);
69
79bool rb_set_add(VALUE set, VALUE element);
80
90
99bool rb_set_delete(VALUE set, VALUE element);
100
107size_t rb_set_size(VALUE set);
108
110
111#endif /* RBIMPL_INTERN_SET_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
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
size_t rb_set_size(VALUE set)
Returns the number of elements in the set.
Definition set.c:1961
VALUE rb_set_clear(VALUE set)
Removes all entries from set.
Definition set.c:1949
bool rb_set_delete(VALUE set, VALUE element)
Removes the element from from set.
Definition set.c:1955
bool rb_set_add(VALUE set, VALUE element)
Adds element to set.
Definition set.c:1943
void rb_set_foreach(VALUE set, int(*func)(VALUE element, VALUE arg), VALUE arg)
Iterates over a set.
Definition set.c:1919
bool rb_set_lookup(VALUE set, VALUE element)
Whether the set contains the given element.
Definition set.c:1937
VALUE rb_set_new(void)
Creates a new, empty set object.
Definition set.c:1925
VALUE rb_set_new_capa(size_t capa)
Identical to rb_set_new(), except it additionally specifies how many elements it is expected to conta...
Definition set.c:1931
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40