2#define RUBY_ID_TABLE_H 1
3#include "ruby/internal/config.h"
17enum rb_id_table_iterator_result {
18 ID_TABLE_CONTINUE = ST_CONTINUE,
19 ID_TABLE_STOP = ST_STOP,
20 ID_TABLE_DELETE = ST_DELETE,
21 ID_TABLE_REPLACE = ST_REPLACE,
22 ID_TABLE_ITERATOR_RESULT_END
29void rb_id_table_free_items(
struct rb_id_table *tbl);
32size_t rb_id_table_memsize(
const struct rb_id_table *tbl);
38typedef enum rb_id_table_iterator_result rb_id_table_update_value_callback_func_t(
VALUE *val,
void *data,
int existing);
39typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(
ID id,
VALUE val,
void *data);
40typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(
VALUE val,
void *data);
41void rb_id_table_foreach(
struct rb_id_table *tbl, rb_id_table_foreach_func_t *func,
void *data);
42void rb_id_table_foreach_values(
struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func,
void *data);
43void rb_id_table_foreach_values_with_replace(
struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, rb_id_table_update_value_callback_func_t *replace,
void *data);
46VALUE rb_managed_id_table_new(
size_t capa);
48int rb_managed_id_table_insert(
VALUE table,
ID id,
VALUE val);
49int rb_managed_id_table_lookup(
VALUE table,
ID id,
VALUE *valp);
50size_t rb_managed_id_table_size(
VALUE table);
51void rb_managed_id_table_foreach(
VALUE table, rb_id_table_foreach_func_t *func,
void *data);
52void rb_managed_id_table_foreach_values(
VALUE table, rb_id_table_foreach_values_func_t *func,
void *data);
53int rb_managed_id_table_delete(
VALUE table,
ID id);
57RUBY_SYMBOL_EXPORT_BEGIN
58size_t rb_id_table_size(
const struct rb_id_table *tbl);
int capa
Designed capacity of the buffer.
VALUE type(ANYARGS)
ANYARGS-ed function type.
This is the struct that holds necessary info for a struct.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
uintptr_t VALUE
Type that represents a Ruby object.