RTS API Documentation
1.10.11
|
Macros | |
#define | switch_core_hash_init(_hash) switch_core_hash_init_case(_hash, SWITCH_TRUE) |
#define | switch_core_hash_init_nocase(_hash) switch_core_hash_init_case(_hash, SWITCH_FALSE) |
#define | switch_core_hash_insert(_h, _k, _d) switch_core_hash_insert_destructor(_h, _k, _d, NULL) |
#define | switch_core_hash_insert_alloc(_h, _k, _s) switch_core_hash_insert_alloc_destructor(_h, _k, _s, NULL) |
#define | switch_core_hash_insert_dup(_h, _k, _d) switch_core_hash_insert_dup_destructor(_h, _k, _d, NULL) |
#define | switch_core_hash_first(_h) switch_core_hash_first_iter(_h, NULL) |
#define switch_core_hash_first | ( | _h | ) | switch_core_hash_first_iter(_h, NULL) |
Definition at line 1592 of file switch_core.h.
Referenced by do_chat_send(), switch_core_hash_delete_multi(), switch_core_hash_empty(), switch_core_mime_index(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_vars_ans(), switch_event_channel_unsub_channel(), switch_event_get_custom_events(), switch_event_shutdown(), switch_loadable_module_enumerate_loaded(), switch_loadable_module_get_codecs(), switch_loadable_module_init(), switch_loadable_module_runtime(), switch_loadable_module_shutdown(), and switch_rtp_shutdown().
#define switch_core_hash_init | ( | _hash | ) | switch_core_hash_init_case(_hash, SWITCH_TRUE) |
Definition at line 1431 of file switch_core.h.
Referenced by switch_channel_alloc(), switch_channel_global_init(), switch_channel_set_app_flag_key(), switch_console_init(), switch_core_session_init(), switch_event_init(), switch_ivr_digit_stream_parser_new(), switch_ivr_dmachine_create(), switch_live_array_create(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_init(), switch_rtp_init(), and switch_xml_init().
#define switch_core_hash_init_nocase | ( | _hash | ) | switch_core_hash_init_case(_hash, SWITCH_FALSE) |
Definition at line 1432 of file switch_core.h.
Referenced by switch_loadable_module_init().
#define switch_core_hash_insert | ( | _h, | |
_k, | |||
_d | |||
) | switch_core_hash_insert_destructor(_h, _k, _d, NULL) |
Definition at line 1479 of file switch_core.h.
Referenced by switch_channel_set_app_flag_key(), switch_channel_set_device_id(), switch_console_add_complete_func(), switch_console_del_complete_func(), switch_core_hash_insert_locked(), switch_core_hash_insert_wrlock(), switch_core_mime_add_type(), switch_core_register_secondary_recover_callback(), switch_core_session_request_uuid(), switch_core_session_set_external_id(), switch_core_session_set_uuid(), switch_event_channel_permission_modify(), switch_event_channel_sub_channel(), switch_event_reserve_subclass_detailed(), switch_ivr_digit_stream_parser_set_event(), switch_ivr_dmachine_bind(), switch_live_array_add(), switch_live_array_add_alias(), switch_live_array_create(), switch_load_core_config(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_process(), switch_loadable_module_unprocess(), switch_rtp_request_port(), and switch_xml_user_cache().
#define switch_core_hash_insert_alloc | ( | _h, | |
_k, | |||
_s | |||
) | switch_core_hash_insert_alloc_destructor(_h, _k, _s, NULL) |
Definition at line 1490 of file switch_core.h.
Referenced by switch_xml_user_cache().
#define switch_core_hash_insert_dup | ( | _h, | |
_k, | |||
_d | |||
) | switch_core_hash_insert_dup_destructor(_h, _k, _d, NULL) |
Definition at line 1501 of file switch_core.h.
void* switch_core_hash_delete | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key | ||
) |
Delete data from a hash based on desired key.
hash | the hash to delete from |
key | the key from which to delete the data |
Referenced by process_device_hup(), switch_core_session_perform_destroy(), switch_core_session_set_external_id(), switch_core_session_set_uuid(), switch_core_unregister_secondary_recover_callback(), switch_event_channel_permission_clear(), switch_event_free_subclass_detailed(), switch_ivr_digit_stream_parser_del_event(), switch_ivr_dmachine_clear_realm(), switch_live_array_clear_alias(), switch_live_array_del(), switch_live_array_destroy(), switch_loadable_module_shutdown(), switch_loadable_module_unload_module(), switch_loadable_module_unprocess(), switch_xml_clear_user_cache(), switch_xml_user_cache(), and unsub_all_switch_event_channel().
void* switch_core_hash_delete_locked | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ switch_mutex_t * | mutex | ||
) |
Delete data from a hash based on desired key.
hash | the hash to delete from |
key | the key from which to delete the data |
mutex | optional mutex to lock |
switch_status_t switch_core_hash_delete_multi | ( | _In_ switch_hash_t * | hash, |
_In_ switch_hash_delete_callback_t | callback, | ||
_In_opt_ void * | pData | ||
) |
Delete data from a hash based on callback function.
hash | the hash to delete from |
callback | the function to call which returns SWITCH_TRUE to delete, SWITCH_FALSE to preserve |
void* switch_core_hash_delete_wrlock | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ switch_thread_rwlock_t * | rwlock | ||
) |
Delete data from a hash based on desired key.
hash | the hash to delete from |
key | the key from which to delete the data |
mutex | optional rwlock to wrlock |
switch_status_t switch_core_hash_destroy | ( | _Inout_ switch_hash_t ** | hash | ) |
Destroy an existing hash table.
hash | the hash to destroy |
Referenced by switch_channel_global_uninit(), switch_channel_uninit(), switch_console_shutdown(), switch_core_destroy(), switch_core_session_uninit(), switch_event_shutdown(), switch_ivr_digit_stream_parser_destroy(), switch_ivr_dmachine_destroy(), switch_live_array_destroy(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_init(), switch_loadable_module_shutdown(), SWITCH_MODULE_SHUTDOWN_FUNCTION(), switch_rtp_shutdown(), and switch_xml_destroy().
switch_bool_t switch_core_hash_empty | ( | switch_hash_t * | hash | ) |
tells if a hash is empty
hash | the hashtable |
Definition at line 306 of file switch_core_hash.c.
References switch_core_hash_first, SWITCH_FALSE, and SWITCH_TRUE.
void* switch_core_hash_find | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key | ||
) |
Retrieve data from a given hash.
hash | the hash to retrieve from |
key | the key to retrieve |
Referenced by _switch_event_channel_broadcast(), switch_channel_clear_app_flag_key(), switch_channel_set_app_flag_key(), switch_channel_set_device_id(), switch_channel_test_app_flag_key(), switch_check_network_list_ip_port_token(), switch_console_run_complete_func(), switch_core_get_secondary_recover_callback(), switch_core_mime_add_type(), switch_core_mime_ext2type(), switch_core_mime_type2ext(), switch_core_register_secondary_recover_callback(), switch_core_session_event_send(), switch_core_session_message_send(), switch_core_session_perform_force_locate(), switch_core_session_perform_locate(), switch_core_session_request_uuid(), switch_core_session_set_external_id(), switch_core_session_set_uuid(), switch_default_ptime(), switch_event_bind_removable(), switch_event_build_param_string(), switch_event_channel_permission_clear(), switch_event_channel_permission_modify(), switch_event_channel_permission_verify(), switch_event_channel_sub_channel(), switch_event_channel_unsub_channel(), switch_event_free_subclass_detailed(), switch_event_reserve_subclass_detailed(), switch_ivr_digit_stream_parser_feed(), switch_ivr_dmachine_bind(), switch_ivr_dmachine_clear_realm(), switch_ivr_dmachine_set_realm(), switch_live_array_add(), switch_live_array_create(), switch_live_array_del(), switch_live_array_get(), switch_loadable_module_exists(), switch_loadable_module_get_codec_interface(), switch_loadable_module_get_database_interface(), switch_loadable_module_get_endpoint_interface(), switch_loadable_module_get_file_interface(), switch_loadable_module_process(), switch_loadable_module_protect(), switch_loadable_module_unload_module(), switch_loadable_module_unprocess(), switch_lookup_timezone(), switch_rtp_release_port(), switch_rtp_request_port(), switch_xml_clear_user_cache(), switch_xml_locate_user_cache(), and switch_xml_user_cache().
void* switch_core_hash_find_locked | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_ switch_mutex_t * | mutex | ||
) |
Retrieve data from a given hash.
hash | the hash to retrieve from |
key | the key to retrieve |
mutex | optional mutex to lock |
Referenced by switch_channel_get_private(), switch_channel_get_private_partner(), switch_loadable_module_get_management_interface(), switch_loadable_module_get_say_interface(), and switch_loadable_module_load_module_ex().
void* switch_core_hash_find_rdlock | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_ switch_thread_rwlock_t * | rwlock | ||
) |
Retrieve data from a given hash.
hash | the hash to retrieve from |
key | the key to retrieve |
mutex | optional rwlock to rdlock |
switch_hash_index_t* switch_core_hash_first_iter | ( | _In_ switch_hash_t * | hash, |
switch_hash_index_t * | hi | ||
) |
Gets the first element of a hashtable.
deprecate_me | [deprecated] NULL |
hash | the hashtable to use |
Referenced by switch_jb_pop_nack(), switch_xml_clear_user_cache(), and unsub_all_switch_event_channel().
switch_status_t switch_core_hash_init_case | ( | _Out_ switch_hash_t ** | hash, |
switch_bool_t | case_sensitive | ||
) |
Initialize a hash table.
hash | a NULL pointer to a hash table to aim at the new hash |
pool | the pool to use for the new hash |
Referenced by switch_core_init().
void* switch_core_hash_insert_alloc_destructor | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ size_t | size, | ||
hashtable_destructor_t | destructor | ||
) |
Allocate memory and insert into a hash.
hash | the hash to add data to |
key | the name of the key to add the data to |
size | the size in bytes to allocate |
Definition at line 105 of file switch_core_hash.c.
References HASHTABLE_DUP_CHECK, HASHTABLE_FLAG_FREE_KEY, memset(), switch_hashtable_insert_destructor(), and switch_safe_free.
switch_status_t switch_core_hash_insert_auto_free | ( | switch_hash_t * | hash, |
const char * | key, | ||
const void * | data | ||
) |
Insert data into a hash and set flags so the value is automatically freed on delete.
hash | the hash to add data to |
key | the name of the key to add the data to |
data | the data to add |
Definition at line 75 of file switch_core_hash.c.
References HASHTABLE_DUP_CHECK, HASHTABLE_FLAG_FREE_KEY, HASHTABLE_FLAG_FREE_VALUE, switch_hashtable_insert_destructor(), switch_safe_free, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_hash_insert_destructor | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ const void * | data, | ||
hashtable_destructor_t | destructor | ||
) |
Insert data into a hash.
hash | the hash to add data to |
key | the name of the key to add the data to |
data | the data to add |
switch_status_t switch_core_hash_insert_dup_auto_free | ( | switch_hash_t * | hash, |
const char * | key, | ||
const char * | str | ||
) |
Insert strdup(str) into a hash and set flags so the value is automatically freed on delete.
hash | the hash to add str to |
key | the name of the key to add the str to |
str | string to strdup and add |
Definition at line 88 of file switch_core_hash.c.
References HASHTABLE_DUP_CHECK, HASHTABLE_FLAG_FREE_KEY, HASHTABLE_FLAG_FREE_VALUE, switch_hashtable_insert_destructor(), switch_safe_free, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_hash_insert_dup_destructor | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ const char * | str, | ||
hashtable_destructor_t | destructor | ||
) |
Insert strdup(str) into a hash.
hash | the hash to add str to |
key | the name of the key to add the str to |
str | string to strdup and add |
switch_status_t switch_core_hash_insert_locked | ( | _In_ switch_hash_t * | hash, |
_In_z_ const char * | key, | ||
_In_opt_ const void * | data, | ||
_In_opt_ switch_mutex_t * | mutex | ||
) |
Insert data into a hash.
hash | the hash to add data to |
key | the name of the key to add the data to |
data | the data to add |
mutex | optional mutex to lock |
Referenced by switch_channel_set_private(), and switch_loadable_module_unload_module().
switch_status_t switch_core_hash_insert_pointer | ( | switch_hash_t * | hash, |
const void * | data | ||
) |
Insert data into a hash with an auto-generated key based on the data pointer.
hash | the hash to add data to |
data | unique pointer to add |
Definition at line 58 of file switch_core_hash.c.
References HASHTABLE_DUP_CHECK, HASHTABLE_FLAG_FREE_KEY, switch_hashtable_insert_destructor(), switch_safe_free, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_loadable_module_process().
switch_status_t switch_core_hash_insert_wrlock | ( | switch_hash_t * | hash, |
const char * | key, | ||
const void * | data, | ||
switch_thread_rwlock_t * | rwlock | ||
) |
Retrieve data from a given hash.
hash | the hash to retrieve from |
key | the key to retrieve |
mutex | optional rwlock to wrlock |
Definition at line 174 of file switch_core_hash.c.
References switch_core_hash_insert, SWITCH_STATUS_FALSE, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
switch_hash_index_t* switch_core_hash_next | ( | _In_ switch_hash_index_t ** | hi | ) |
Gets the next element of a hashtable.
hi | The current element |
Referenced by do_chat_send(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_vars_ans(), switch_event_channel_unsub_channel(), switch_event_get_custom_events(), switch_event_shutdown(), switch_jb_pop_nack(), switch_loadable_module_enumerate_loaded(), switch_loadable_module_get_codecs(), switch_loadable_module_init(), switch_loadable_module_runtime(), switch_loadable_module_shutdown(), and switch_rtp_shutdown().
void switch_core_hash_this | ( | _In_ switch_hash_index_t * | hi, |
_Out_opt_ptrdiff_cap_(klen) const void ** | key, | ||
_Out_opt_ switch_ssize_t * | klen, | ||
_Out_ void ** | val | ||
) |
Gets the key and value of the current hash element.
hi | The current element |
key | [out] the key |
klen | [out] the key's size |
val | [out] the value |
Referenced by do_chat_send(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_vars_ans(), switch_event_channel_unsub_channel(), switch_event_get_custom_events(), switch_event_shutdown(), switch_jb_pop_nack(), switch_loadable_module_enumerate_loaded(), switch_loadable_module_get_codecs(), switch_loadable_module_init(), switch_loadable_module_runtime(), switch_loadable_module_shutdown(), switch_rtp_shutdown(), switch_xml_clear_user_cache(), and unsub_all_switch_event_channel().
void switch_core_hash_this_val | ( | switch_hash_index_t * | hi, |
void * | val | ||
) |
Definition at line 334 of file switch_core_hash.c.
References switch_hashtable_this_val().
void* switch_core_inthash_delete | ( | switch_inthash_t * | hash, |
uint32_t | key | ||
) |
Definition at line 364 of file switch_core_hash.c.
References switch_hashtable_remove().
Referenced by hide_node(), switch_jb_pop_nack(), and switch_jb_put_packet().
switch_status_t switch_core_inthash_destroy | ( | switch_inthash_t ** | hash | ) |
Definition at line 345 of file switch_core_hash.c.
References switch_hashtable_destroy(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_jb_destroy(), and switch_jb_reset().
void* switch_core_inthash_find | ( | switch_inthash_t * | hash, |
uint32_t | key | ||
) |
Definition at line 369 of file switch_core_hash.c.
References switch_hashtable_search().
Referenced by jb_miss(), jb_next_packet_by_seq(), jb_next_packet_by_ts(), switch_jb_get_packet_by_seq(), and switch_jb_peek_frame().
switch_status_t switch_core_inthash_init | ( | switch_inthash_t ** | hash | ) |
Definition at line 340 of file switch_core_hash.c.
References switch_create_hashtable(), switch_hash_default_int(), and switch_hash_equalkeys_int().
Referenced by switch_jb_create(), switch_jb_reset(), and switch_jb_ts_mode().
switch_status_t switch_core_inthash_insert | ( | switch_inthash_t * | hash, |
uint32_t | key, | ||
const void * | data | ||
) |
Definition at line 352 of file switch_core_hash.c.
References HASHTABLE_DUP_CHECK, HASHTABLE_FLAG_FREE_KEY, key, switch_hashtable_insert_destructor(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_zmalloc.
Referenced by add_node(), jb_miss(), switch_jb_pop_nack(), and switch_jb_put_packet().