Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "ruby/defines.h"
Go to the source code of this file.
Data Structures | |
struct | st_hash_type |
struct | st_table |
Macros | |
#define | ST_DATA_T_DEFINED |
#define | CHAR_BIT 8 |
#define | MAX_ST_INDEX_VAL (~(st_index_t) 0) |
#define | SIZEOF_ST_INDEX_T SIZEOF_VOIDP |
#define | ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) |
#define | ST_DATA_COMPATIBLE_P(type) 0 |
#define | st_is_member(table, key) st_lookup((table),(key),(st_data_t *)0) |
#define | st_strcasecmp st_locale_insensitive_strcasecmp |
#define | st_strncasecmp st_locale_insensitive_strncasecmp |
#define | st_hash_start(h) ((st_index_t)(h)) |
Typedefs | |
typedef struct st_table | st_table |
typedef st_data_t | st_index_t |
typedef int | st_compare_func(st_data_t, st_data_t) |
typedef st_index_t | st_hash_func(st_data_t) |
typedef char | st_check_for_sizeof_st_index_t[SIZEOF_VOIDP==(int) sizeof(st_index_t) ? 1 :-1] |
typedef struct st_table_entry | st_table_entry |
typedef int | st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing) |
Enumerations | |
enum | st_retval { ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK } |
Variables | |
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long | st_data_t |
#define MAX_ST_INDEX_VAL (~(st_index_t) 0) |
#define ST_DATA_COMPATIBLE_P | ( | type | ) | 0 |
Definition at line 72 of file st.h.
Referenced by rb_hash_keys(), and rb_hash_values().
#define st_hash_start | ( | h | ) | ((st_index_t)(h)) |
#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) |
#define st_strcasecmp st_locale_insensitive_strcasecmp |
#define st_strncasecmp st_locale_insensitive_strncasecmp |
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP==(int) sizeof(st_index_t) ? 1 :-1] |
typedef st_index_t st_hash_func(st_data_t) |
typedef st_data_t st_index_t |
typedef struct st_table_entry st_table_entry |
CONSTFUNC | ( | int | st_numcmpst_data_t, st_data_t | ) |
CONSTFUNC | ( | st_index_t | st_numhashst_data_t | ) |
CONSTFUNC | ( | st_index_t | st_hash_uint32st_index_t h, uint32_t i | ) |
CONSTFUNC | ( | st_index_t | st_hash_uintst_index_t h, st_index_t i | ) |
CONSTFUNC | ( | st_index_t | st_hash_endst_index_t h | ) |
PUREFUNC | ( | int | st_locale_insensitive_strcasecmpconst char *s1, const char *s2 | ) |
PUREFUNC | ( | int | st_locale_insensitive_strncasecmpconst char *s1, const char *s2, size_t n | ) |
PUREFUNC | ( | size_t | st_memsizeconst st_table * | ) |
PUREFUNC | ( | st_index_t | st_hashconst void *ptr, size_t len, st_index_t h | ) |
Definition at line 1159 of file st.c.
References do_hash(), and st_add_direct_with_hash().
void st_clear | ( | st_table * | ) |
Definition at line 653 of file st.c.
References make_tab_empty(), and st_table::rebuilds_num.
Referenced by id2key(), rb_generic_ivar_table(), rb_hash_clear(), rb_hash_initialize_copy(), rb_struct_s_def(), struct_make_members_list(), and trace_object_allocations_clear().
Definition at line 1219 of file st.c.
References st_table::bins, bins_size(), st_table::entries, get_allocated_entries(), malloc, MEMCPY, and NULL.
Definition at line 1294 of file st.c.
References st_general_delete().
Definition at line 1527 of file st.c.
References FALSE, func, and st_general_foreach().
Referenced by hash_foreach_call(), and st_foreach_safe().
void st_free_table | ( | st_table * | ) |
Definition at line 664 of file st.c.
References st_table::bins, st_table::entries, free, and NULL.
Definition at line 1051 of file st.c.
References bin, st_table::bins, do_hash(), st_table::entries, ENTRY_BASE, find_entry(), find_table_entry_ind(), st_table_entry::hash, st_table_entry::key, NULL, and UNDEFINED_ENTRY_IND.
Referenced by make_unique_str(), and rb_feature_p().
st_table* st_init_numtable | ( | void | ) |
Definition at line 608 of file st.c.
References st_init_table(), and type_numhash.
st_table* st_init_numtable_with_size | ( | st_index_t | ) |
Definition at line 615 of file st.c.
References st_init_table_with_size(), and type_numhash.
st_table* st_init_strcasetable | ( | void | ) |
Definition at line 638 of file st.c.
References st_init_table().
Referenced by encoding_name(), Init_transcode(), make_transcoder_entry(), rb_enc_init(), and transcode_search_path().
st_table* st_init_strcasetable_with_size | ( | st_index_t | ) |
Definition at line 646 of file st.c.
References st_init_table_with_size().
st_table* st_init_strtable | ( | void | ) |
Definition at line 623 of file st.c.
References st_init_table().
st_table* st_init_strtable_with_size | ( | st_index_t | ) |
Definition at line 630 of file st.c.
References st_init_table_with_size().
st_table* st_init_table | ( | const struct st_hash_type * | ) |
Definition at line 600 of file st.c.
References st_init_table_with_size().
Referenced by st_init_numtable(), st_init_strcasetable(), and st_init_strtable().
st_table* st_init_table_with_size | ( | const struct st_hash_type * | , |
st_index_t | |||
) |
Definition at line 553 of file st.c.
References st_table::bin_power, st_features::bin_power, st_table::bins, bins_size(), st_table::entries, st_table::entry_power, get_allocated_entries(), get_power2(), getenv, make_tab_empty(), malloc, MAX_POWER2_FOR_TABLES_WITHOUT_BINS, NULL, st_table::rebuilds_num, st_table::size_ind, st_features::size_ind, ST_INIT_VAL_BYTE, and st_table::type.
Referenced by rebuild_table(), st_init_numtable_with_size(), st_init_strcasetable_with_size(), st_init_strtable_with_size(), and st_init_table().
Definition at line 1086 of file st.c.
References bin, st_table::bins, do_hash(), st_table::entries, st_table::entries_bound, ENTRY_BASE, find_entry(), find_table_bin_ptr_and_reserve(), get_allocated_entries(), get_size_ind(), st_table_entry::hash, st_table_entry::key, NULL, st_table::num_entries, rebuild_table_if_necessary(), st_table_entry::record, set_bin(), st_assert, UNDEFINED_BIN_IND, and UNDEFINED_ENTRY_IND.
Definition at line 1171 of file st.c.
References bin, st_table::bins, do_hash(), st_table::entries, st_table::entries_bound, ENTRY_BASE, find_entry(), find_table_bin_ptr_and_reserve(), get_allocated_entries(), get_size_ind(), st_table_entry::hash, st_table_entry::key, NULL, rebuild_table_if_necessary(), st_table::rebuilds_num, st_table_entry::record, set_bin(), st_assert, UNDEFINED_BIN_IND, and UNDEFINED_ENTRY_IND.
Referenced by enc_alias_internal().
st_index_t st_keys | ( | st_table * | table, |
st_data_t * | keys, | ||
st_index_t | size | ||
) |
Definition at line 1564 of file st.c.
References st_general_keys().
st_index_t st_keys_check | ( | st_table * | table, |
st_data_t * | keys, | ||
st_index_t | size, | ||
st_data_t | never | ||
) |
Definition at line 1028 of file st.c.
References bin, st_table::bins, do_hash(), st_table::entries, ENTRY_BASE, find_entry(), find_table_entry_ind(), st_table_entry::hash, NULL, st_table_entry::record, and UNDEFINED_ENTRY_IND.
Definition at line 1315 of file st.c.
References bin, st_table::bins, DELETED_ENTRY_P, st_table::entries, st_table::entries_bound, st_table::entries_start, ENTRY_BASE, find_entry(), find_table_bin_ind(), get_bin(), get_size_ind(), st_table_entry::hash, st_table_entry::key, MARK_BIN_DELETED, MARK_ENTRY_DELETED, NULL, st_table::num_entries, st_table_entry::record, st_assert, UNDEFINED_BIN_IND, UNDEFINED_ENTRY_IND, and update_range_for_deleted().
Referenced by rb_hash_shift().
int st_update | ( | st_table * | table, |
st_data_t | key, | ||
st_update_callback_func * | func, | ||
st_data_t | arg | ||
) |
Definition at line 1371 of file st.c.
References bin, st_table::bins, do_hash(), st_table::entries, ENTRY_BASE, find_entry(), find_table_bin_ind(), get_bin(), get_size_ind(), st_table_entry::hash, st_table_entry::key, MARK_BIN_DELETED, MARK_ENTRY_DELETED, NULL, st_table::num_entries, st_table::rebuilds_num, st_table_entry::record, st_add_direct_with_hash(), st_assert, ST_CONTINUE, st_data_t, ST_DELETE, UNDEFINED_BIN_IND, UNDEFINED_ENTRY_IND, and update_range_for_deleted().
Referenced by cv_i(), generic_ivar_set(), load_unlock(), local_var_list_add(), rb_ary_or(), rb_hash_add_new_element(), register_fstring(), register_sym(), ruby_init_ext(), sv_i(), tbl_update(), wmap_aset(), wmap_finalize(), and zone_str().
st_index_t st_values | ( | st_table * | table, |
st_data_t * | values, | ||
st_index_t | size | ||
) |
Definition at line 1601 of file st.c.
References st_general_values().
st_index_t st_values_check | ( | st_table * | table, |
st_data_t * | values, | ||
st_index_t | size, | ||
st_data_t | never | ||
) |
Definition at line 1608 of file st.c.
References st_general_values().
Referenced by rb_hash_values().
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t |
Definition at line 22 of file st.h.
Referenced by add_opt_method(), autoload_data(), autoload_delete(), classname(), constat_delete(), constat_handle(), constat_reset(), cv_i(), cvar_lookup_at(), define_final0(), delete_unique_str(), enc_alias_internal(), enc_dup_name(), enc_names(), enc_register_at(), enc_set_default_encoding(), encoding_name(), fc_path(), features_index_add_single(), find_class_path(), flatten(), freeobj_i(), gc_mark_roots(), gen_ivar_compat_tbl_i(), gen_ivar_each(), gen_ivtbl_get(), generic_ivar_defined(), generic_ivar_delete(), generic_ivar_get(), generic_ivar_remove(), generic_ivar_set(), generic_ivar_update(), get_syserr(), get_transcoder_entry(), has_ivars(), hash_foreach_call(), hash_foreach_ensure(), ibf_dump_id(), ibf_dump_id_list(), ibf_dump_iseq(), ibf_dump_object_hash(), ibf_table_index(), ibf_table_lookup(), id2key(), init_constants(), Init_w32_codepage(), iseq_build_from_ary_body(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), iv_index_tbl_extend(), list_id_table_foreach_values(), load_lock(), load_unlock(), local_var_list_add(), local_var_list_update(), lookup_allocation_info(), lookup_method_table(), lookup_rollback_func(), lookup_str_id(), lookup_str_sym(), make_transcoder_entry(), make_unique_str(), mark_hash(), mark_set(), mark_tbl(), method_entry_i(), mod_cvar_at(), newobj_i(), obj_alloc_by_klass(), obj_ivar_each(), object_allocations_reporter(), ole_vstr2wc(), onig_st_insert_strend(), onig_st_lookup_strend(), r_copy_ivar(), r_entry0(), r_fixup_compat(), r_object0(), r_prepare(), r_symlink(), r_symreal(), rb_ary_and(), rb_ary_or(), rb_autoload_str(), rb_check_exec_env(), rb_check_exec_options(), rb_class_ivar_set(), rb_class_path_cached(), rb_const_set(), rb_copy_generic_ivar(), rb_cvar_get(), rb_cvar_set(), rb_econv_asciicompat_encoding(), rb_enc_aliases(), rb_enc_name_list(), rb_enc_registered(), rb_enc_unicode_p(), rb_execarg_extract_options(), rb_execarg_parent_start1(), rb_extract_keywords(), rb_feature_p(), rb_free_generic_ivar(), rb_gc_copy_finalizer(), rb_gc_unprotect_logging(), rb_generic_ivar_table(), rb_get_kwargs(), rb_hash_delete_entry(), rb_id_serial_to_id(), rb_ident_hash(), rb_ivar_defined(), rb_ivar_delete(), rb_ivar_lookup(), rb_marshal_define_compat(), rb_method_entry_make(), rb_mod_init_copy(), rb_mod_remove_cvar(), rb_obj_remove_instance_variable(), rb_objspace_call_finalizer(), rb_st_copy(), rb_str_free(), rb_thread_start_timer_thread(), rb_tmp_class_path(), rb_undefine_finalizer(), rb_vm_check_redefinition_opt_method(), reachable_objects_from(), register_fstring(), register_init_ext(), register_label(), register_sym(), remove_duplicate_keys(), remove_invalid_alternative_data(), rsock_intern_family(), rsock_intern_family_noprefix(), rsock_intern_ip_optname(), rsock_intern_iplevel(), rsock_intern_ipproto(), rsock_intern_ipv6_optname(), rsock_intern_local_optname(), rsock_intern_protocol_family(), rsock_intern_scm_optname(), rsock_intern_so_optname(), rsock_intern_socktype(), rsock_intern_tcp_optname(), rsock_intern_udp_optname(), ruby_init_ext(), ruby_register_rollback_func_for_ensure(), run_final(), set_syserr(), socklist_delete(), socklist_insert(), socklist_lookup(), st_foreach_safe(), st_general_foreach(), st_general_keys(), st_general_values(), st_hash(), st_locale_insensitive_strncasecmp(), st_memsize(), st_update(), sv_i(), syserr_initialize(), threadptr_local_aref(), transcode_search_path(), transcode_search_path_i(), unknown_keyword_error(), unregister_sym(), val2dispatch(), validate_labels(), vm_getivar(), vm_setivar(), w_class(), w_ivar(), w_object(), w_objivar(), w_symbol(), wmap_aref(), wmap_aset(), wmap_aset_update(), wmap_each(), wmap_each_key(), wmap_each_value(), wmap_final_func(), wmap_finalize(), wmap_keys(), wmap_mark(), wmap_memsize(), wmap_values(), zone_str(), and zone_str_update().