Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Enumerations | Functions
id_table.h File Reference
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Enumerations
enum | rb_id_table_iterator_result { ID_TABLE_CONTINUE = ST_CONTINUE, ID_TABLE_STOP = ST_STOP, ID_TABLE_DELETE = ST_DELETE, ID_TABLE_REPLACE = ST_REPLACE, ID_TABLE_ITERATOR_RESULT_END }

## Functions
struct rb_id_table * | rb_id_table_create (size_t size)
void | rb_id_table_free (struct rb_id_table *tbl)
void | rb_id_table_clear (struct rb_id_table *tbl)
size_t | rb_id_table_size (const struct rb_id_table *tbl)
size_t | rb_id_table_memsize (const struct rb_id_table *tbl)
int | rb_id_table_insert (struct rb_id_table *tbl, ID id, VALUE val)
int | rb_id_table_lookup (struct rb_id_table *tbl, ID id, VALUE *valp)
int | rb_id_table_delete (struct rb_id_table *tbl, ID id)
enum rb_id_table_iterator_result | rb_id_table_update_callback_func_t (ID *id, VALUE *val, void *data, int existing)
enum rb_id_table_iterator_result | rb_id_table_foreach_func_t (ID id, VALUE val, void *data)
enum rb_id_table_iterator_result | rb_id_table_foreach_values_func_t (VALUE val, void *data)
void | rb_id_table_foreach (struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
void | rb_id_table_foreach_with_replace (struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, rb_id_table_update_callback_func_t *replace, void *data)
void | rb_id_table_foreach_values (struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)

## Enumeration Type Documentation

## ◆ rb_id_table_iterator_result

enum rb_id_table_iterator_result

Enumerator
ID_TABLE_CONTINUE |
ID_TABLE_STOP |
ID_TABLE_DELETE |
ID_TABLE_REPLACE |
ID_TABLE_ITERATOR_RESULT_END |

Definition at line 8 of file id_table.h.

## Function Documentation

## ◆ rb_id_table_clear()

void rb_id_table_clear | ( | struct rb_id_table * | tbl | ) |

Definition at line 109 of file id_table.c.

References rb_id_table::capa, rb_id_table::items, MEMZERO, rb_id_table::num, and rb_id_table::used.

## ◆ rb_id_table_create()

struct rb_id_table* rb_id_table_create | ( | size_t | size | ) |

Definition at line 95 of file id_table.c.

References ALLOC.

## ◆ rb_id_table_delete()

int rb_id_table_delete | ( | struct rb_id_table * | tbl,
|  | ID | id
| ) |  |

Definition at line 262 of file id_table.c.

References key.

Referenced by rb_const_remove().

## ◆ rb_id_table_foreach()

void rb_id_table_foreach | ( | struct rb_id_table * | tbl,
|  | rb_id_table_foreach_func_t * | func,
|  | void * | data
| ) |  |

Definition at line 292 of file id_table.c.

References rb_id_table::capa, i, ITEM_GET_KEY, ITEM_KEY_ISSET, and key.

Referenced by rb_f_global_variables(), rb_mod_const_at(), rb_obj_singleton_methods(), and rb_undef_methods_from().

## ◆ rb_id_table_foreach_func_t()

enum rb_id_table_iterator_result rb_id_table_foreach_func_t | ( | ID | id,
|  | VALUE | val,
|  | void * | data
| ) |  |

## ◆ rb_id_table_foreach_values()

void rb_id_table_foreach_values | ( | struct rb_id_table * | tbl,
|  | rb_id_table_foreach_values_func_t * | func,
|  | void * | data
| ) |  |

Definition at line 311 of file id_table.c.

References rb_id_table::capa, i, ID_TABLE_DELETE, ITEM_KEY_ISSET, rb_id_table::items, and rb_id_item::val.

Referenced by rb_free_const_table().

## ◆ rb_id_table_foreach_values_func_t()

enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t | ( | VALUE | val,
|  | void * | data
| ) |  |

## ◆ rb_id_table_foreach_with_replace()

void rb_id_table_foreach_with_replace | ( | struct rb_id_table * | tbl,
|  | rb_id_table_foreach_func_t * | func,
|  | rb_id_table_update_callback_func_t * | replace,
|  | void * | data
| ) |  |

Definition at line 270 of file id_table.c.

References assert, rb_id_table::capa, i, ID_TABLE_REPLACE, ID_TABLE_STOP, ITEM_GET_KEY, ITEM_KEY_ISSET, rb_id_table::items, key, NULL, Qundef, TRUE, and rb_id_item::val.

## ◆ rb_id_table_free()

void rb_id_table_free | ( | struct rb_id_table * | tbl | ) |

Definition at line 102 of file id_table.c.

References rb_id_table::items, and xfree.

## ◆ rb_id_table_insert()

int rb_id_table_insert | ( | struct rb_id_table * | tbl,
|  | ID | id,
|  | VALUE | val
| ) |  |

Definition at line 256 of file id_table.c.

## ◆ rb_id_table_lookup()

int rb_id_table_lookup | ( | struct rb_id_table * | tbl,
|  | ID | id,
|  | VALUE * | valp
| ) |  |

Definition at line 226 of file id_table.c.

References key.

Referenced by rb_alias_variable(), rb_const_lookup(), and rb_f_untrace_var().

## ◆ rb_id_table_memsize()

size_t rb_id_table_memsize | ( | const struct rb_id_table * | tbl | ) |

Definition at line 123 of file id_table.c.

References rb_id_table::capa.

## ◆ rb_id_table_size()

size_t rb_id_table_size | ( | const struct rb_id_table * | tbl | ) |

Definition at line 117 of file id_table.c.

References rb_id_table::num.

Referenced by rb_class_has_methods().

## ◆ rb_id_table_update_callback_func_t()

enum rb_id_table_iterator_result rb_id_table_update_callback_func_t | ( | ID * | id,
|  | VALUE * | val,
|  | void * | data,
|  | int | existing
| ) |  |