RTS API Documentation  1.10.11
Macros | Functions
Hash Functions
+ Collaboration diagram for Hash Functions:

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)
 

Functions

switch_status_t switch_core_hash_init_case (_Out_ switch_hash_t **hash, switch_bool_t case_sensitive)
 Initialize a hash table. More...
 
switch_status_t switch_core_hash_destroy (_Inout_ switch_hash_t **hash)
 Destroy an existing hash table. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void * switch_core_hash_delete (_In_ switch_hash_t *hash, _In_z_ const char *key)
 Delete data from a hash based on desired key. More...
 
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. More...
 
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. More...
 
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. More...
 
void * switch_core_hash_find (_In_ switch_hash_t *hash, _In_z_ const char *key)
 Retrieve data from a given hash. More...
 
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. More...
 
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. More...
 
switch_hash_index_tswitch_core_hash_first_iter (_In_ switch_hash_t *hash, switch_hash_index_t *hi)
 Gets the first element of a hashtable. More...
 
switch_bool_t switch_core_hash_empty (switch_hash_t *hash)
 tells if a hash is empty More...
 
switch_hash_index_tswitch_core_hash_next (_In_ switch_hash_index_t **hi)
 Gets the next element of a hashtable. More...
 
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. More...
 
void switch_core_hash_this_val (switch_hash_index_t *hi, void *val)
 
switch_status_t switch_core_inthash_init (switch_inthash_t **hash)
 
switch_status_t switch_core_inthash_destroy (switch_inthash_t **hash)
 
switch_status_t switch_core_inthash_insert (switch_inthash_t *hash, uint32_t key, const void *data)
 
void * switch_core_inthash_delete (switch_inthash_t *hash, uint32_t key)
 
void * switch_core_inthash_find (switch_inthash_t *hash, uint32_t key)
 

Detailed Description

Macro Definition Documentation

◆ switch_core_hash_first

#define switch_core_hash_first (   _h)    switch_core_hash_first_iter(_h, NULL)

◆ switch_core_hash_init

#define switch_core_hash_init (   _hash)    switch_core_hash_init_case(_hash, SWITCH_TRUE)

◆ switch_core_hash_init_nocase

#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().

◆ switch_core_hash_insert

#define switch_core_hash_insert (   _h,
  _k,
  _d 
)    switch_core_hash_insert_destructor(_h, _k, _d, NULL)

◆ switch_core_hash_insert_alloc

#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().

◆ switch_core_hash_insert_dup

#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.

Function Documentation

◆ switch_core_hash_delete()

void* switch_core_hash_delete ( _In_ switch_hash_t hash,
_In_z_ const char *  key 
)

◆ switch_core_hash_delete_locked()

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.

Parameters
hashthe hash to delete from
keythe key from which to delete the data
mutexoptional mutex to lock
Returns
a pointer to the deleted data

◆ switch_core_hash_delete_multi()

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.

Parameters
hashthe hash to delete from
callbackthe function to call which returns SWITCH_TRUE to delete, SWITCH_FALSE to preserve
Returns
SWITCH_STATUS_SUCCESS if any data is deleted

◆ switch_core_hash_delete_wrlock()

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.

Parameters
hashthe hash to delete from
keythe key from which to delete the data
mutexoptional rwlock to wrlock
Returns
a pointer to the deleted data

◆ switch_core_hash_destroy()

switch_status_t switch_core_hash_destroy ( _Inout_ switch_hash_t **  hash)

◆ switch_core_hash_empty()

switch_bool_t switch_core_hash_empty ( switch_hash_t hash)

tells if a hash is empty

Parameters
hashthe hashtable
Returns
TRUE or FALSE depending on if the hash is empty

Definition at line 306 of file switch_core_hash.c.

References switch_core_hash_first, SWITCH_FALSE, and SWITCH_TRUE.

307 {
309 
310  if (hi) {
311  free(hi);
312  return SWITCH_FALSE;
313  }
314 
315  return SWITCH_TRUE;
316 
317 }
#define switch_core_hash_first(_h)
Definition: switch_core.h:1592

◆ switch_core_hash_find()

void* switch_core_hash_find ( _In_ switch_hash_t hash,
_In_z_ const char *  key 
)

Retrieve data from a given hash.

Parameters
hashthe hash to retrieve from
keythe key to retrieve
Returns
a pointer to the data held in the key

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().

◆ switch_core_hash_find_locked()

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.

Parameters
hashthe hash to retrieve from
keythe key to retrieve
mutexoptional mutex to lock
Returns
a pointer to the data held in the key

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().

◆ switch_core_hash_find_rdlock()

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.

Parameters
hashthe hash to retrieve from
keythe key to retrieve
mutexoptional rwlock to rdlock
Returns
a pointer to the data held in the key

◆ switch_core_hash_first_iter()

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.

Parameters
deprecate_me[deprecated] NULL
hashthe hashtable to use
Returns
The element, or NULL if it wasn't found

Referenced by switch_jb_pop_nack(), switch_xml_clear_user_cache(), and unsub_all_switch_event_channel().

◆ switch_core_hash_init_case()

switch_status_t switch_core_hash_init_case ( _Out_ switch_hash_t **  hash,
switch_bool_t  case_sensitive 
)

Initialize a hash table.

Parameters
hasha NULL pointer to a hash table to aim at the new hash
poolthe pool to use for the new hash
Returns
SWITCH_STATUS_SUCCESS if the hash is created

Referenced by switch_core_init().

◆ switch_core_hash_insert_alloc_destructor()

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.

Parameters
hashthe hash to add data to
keythe name of the key to add the data to
sizethe size in bytes to allocate
Returns
pointer to the allocated memory
Note
the string key must be a constant or a dynamic string

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.

105  {
106  char *dkey;
107  void *data;
108 
109  if (!size) return NULL;
110 
111  dkey = strdup(key);
112  data = malloc(size);
113 
114  assert(data);
115 
117  memset(data, 0, size);
118  return data;
119  }
120 
121  free(data);
122  switch_safe_free(dkey);
123 
124  return NULL;
125 }
switch_hash_t * hash
Definition: switch_event.c:76
int switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
Definition: switch_utils.h:885
char * key
Definition: switch_msrp.c:64
memset(buf, 0, buflen)

◆ switch_core_hash_insert_auto_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.

Parameters
hashthe hash to add data to
keythe name of the key to add the data to
datathe data to add
Returns
SWITCH_STATUS_SUCCESS if the data is added
Note
the string key must be a constant or a dynamic string

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.

76 {
77  char *dkey = strdup(key);
78 
80  return SWITCH_STATUS_SUCCESS;
81  }
82 
83  switch_safe_free(dkey);
84 
85  return SWITCH_STATUS_FALSE;
86 }
int switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
Definition: switch_utils.h:885
char * key
Definition: switch_msrp.c:64

◆ switch_core_hash_insert_destructor()

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.

Parameters
hashthe hash to add data to
keythe name of the key to add the data to
datathe data to add
Returns
SWITCH_STATUS_SUCCESS if the data is added
Note
the string key must be a constant or a dynamic string

◆ switch_core_hash_insert_dup_auto_free()

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.

Parameters
hashthe hash to add str to
keythe name of the key to add the str to
strstring to strdup and add
Returns
SWITCH_STATUS_SUCCESS if the data is added
Note
the string key must be a constant or a dynamic string

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.

89 {
90  char *dkey = strdup(key);
91  char *dup = strdup(str);
92 
93  assert(dup);
94 
96  return SWITCH_STATUS_SUCCESS;
97  }
98 
99  switch_safe_free(dup);
100  switch_safe_free(dkey);
101 
102  return SWITCH_STATUS_FALSE;
103 }
int switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
Definition: switch_utils.h:885
char * key
Definition: switch_msrp.c:64

◆ switch_core_hash_insert_dup_destructor()

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.

Parameters
hashthe hash to add str to
keythe name of the key to add the str to
strstring to strdup and add
Returns
SWITCH_STATUS_SUCCESS if the data is added
Note
the string key must be a constant or a dynamic string

◆ switch_core_hash_insert_locked()

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.

Parameters
hashthe hash to add data to
keythe name of the key to add the data to
datathe data to add
mutexoptional mutex to lock
Returns
SWITCH_STATUS_SUCCESS if the data is added
Note
the string key must be a constant or a dynamic string

Referenced by switch_channel_set_private(), and switch_loadable_module_unload_module().

◆ switch_core_hash_insert_pointer()

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.

Parameters
hashthe hash to add data to
dataunique pointer to add
Returns
SWITCH_STATUS_SUCCESS if the data is added

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().

59 {
60  size_t bytes_required = snprintf(NULL, 0, "%p", data) + 1;
61  char *dkey = malloc(bytes_required);
62  size_t bytes_written = snprintf(dkey, bytes_required, "%p", data);
63 
64  if (bytes_written > 0 && bytes_written < bytes_required) {
66  return SWITCH_STATUS_SUCCESS;
67  }
68  }
69 
70  switch_safe_free(dkey);
71 
72  return SWITCH_STATUS_FALSE;
73 }
int switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
Definition: switch_utils.h:885

◆ switch_core_hash_insert_wrlock()

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.

Parameters
hashthe hash to retrieve from
keythe key to retrieve
mutexoptional rwlock to wrlock
Returns
a pointer to the data held in the key

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().

175 {
177 
178  if (rwlock) {
180  }
181 
182  status = switch_core_hash_insert(hash, key, data);
183 
184  if (rwlock) {
186  }
187 
188  return status;
189 }
switch_status_t switch_thread_rwlock_unlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:286
switch_status_t switch_thread_rwlock_wrlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:260
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75
switch_status_t
Common return values.
#define switch_core_hash_insert(_h, _k, _d)
Definition: switch_core.h:1479
char * key
Definition: switch_msrp.c:64

◆ switch_core_hash_next()

switch_hash_index_t* switch_core_hash_next ( _In_ switch_hash_index_t **  hi)

◆ switch_core_hash_this()

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 
)

◆ switch_core_hash_this_val()

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().

335 {
336  switch_hashtable_this_val(hi, val);
337 }
void switch_hashtable_this_val(switch_hashtable_iterator_t *i, void *val)

◆ switch_core_inthash_delete()

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().

365 {
366  return switch_hashtable_remove(hash, (void *)&key);
367 }
void * switch_hashtable_remove(switch_hashtable_t *h, void *k)
char * key
Definition: switch_msrp.c:64

◆ switch_core_inthash_destroy()

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().

346 {
348 
349  return SWITCH_STATUS_SUCCESS;
350 }
void switch_hashtable_destroy(switch_hashtable_t **h)

◆ switch_core_inthash_find()

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().

370 {
371  return switch_hashtable_search(hash, (void *)&key);
372 }
void * switch_hashtable_search(switch_hashtable_t *h, void *k)
char * key
Definition: switch_msrp.c:64

◆ switch_core_inthash_init()

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().

341 {
343 }
static uint32_t switch_hash_default_int(void *ky)
switch_status_t switch_create_hashtable(switch_hashtable_t **hp, unsigned int minsize, unsigned int(*hashfunction)(void *), int(*key_eq_fn)(void *, void *))
static int switch_hash_equalkeys_int(void *k1, void *k2)

◆ switch_core_inthash_insert()

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().

353 {
354  uint32_t *k = NULL;
355  int r = 0;
356 
357  switch_zmalloc(k, sizeof(*k));
358  *k = key;
360 
362 }
int switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor)
#define switch_zmalloc(ptr, len)
char * key
Definition: switch_msrp.c:64