diff options
Diffstat (limited to 'include/ruby/st.h')
| -rw-r--r-- | include/ruby/st.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/ruby/st.h b/include/ruby/st.h index ea1637bd9f..b510989b6b 100644 --- a/include/ruby/st.h +++ b/include/ruby/st.h @@ -1,7 +1,7 @@ /* This is a public domain general purpose hash table package originally written by Peter Moore @ UCB. - The hash table data strutures were redesigned and the package was + The hash table data structures were redesigned and the package was rewritten by Vladimir Makarov <vmakarov@redhat.com>. */ #ifndef RUBY_ST_H @@ -84,13 +84,12 @@ struct st_table { const struct st_hash_type *type; /* Number of entries currently in the table. */ st_index_t num_entries; - /* Array of bins used for access by keys. */ - st_index_t *bins; /* Start and bound index of entries in array entries. entries_starts and entries_bound are in interval [0,allocated_entries]. */ st_index_t entries_start, entries_bound; - /* Array of size 2^entry_power. */ + /* Array of size 2^entry_power. + Optionnally followed by an array of bins used for access by keys. */ st_table_entry *entries; }; @@ -98,6 +97,8 @@ struct st_table { enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK, ST_REPLACE}; +size_t rb_st_table_size(const struct st_table *tbl); +#define st_table_size rb_st_table_size st_table *rb_st_init_table(const struct st_hash_type *); #define st_init_table rb_st_init_table st_table *rb_st_init_table_with_size(const struct st_hash_type *, st_index_t); |
