void pkg_hash_dump(hash_table_t *hash, void *data) { printf ("\n\n+=+%s+=+\n\n", __FUNCTION__); hash_table_foreach(hash, pkg_hash_dump_helper, data); printf ("\n+=+%s+=+\n\n", __FUNCTION__); }
static void hash_table_resize(struct hash_table* ht, size_t new_capacity) { struct hash_table* nht = calloc(1, sizeof(*nht)); hash_table_init(nht, ht->hash_fn, ht->eql_fn, new_capacity); hash_table_foreach(ht, e) hash_table_insert(nht, e->key, e->val); free(ht->hashes); free(ht->table); *ht = *nht; free(nht); }
void hash_table_free(hash_table_t *ht, void (*free_cb)(void* data)) { int node_free_cb(void *data, void *cbarg) { if (free_cb != NULL) { free_cb(data); } return hash_table_foreach_delete; } hash_table_foreach( ht, node_free_cb, NULL); free(ht->nodes); free(ht); }
Vector* finc_struct_init_data(FinCStruct* self, ADT p_raw) { Vector* l_vector; ADT old_data; old_data = private_data_p; private_data_p = p_raw; l_vector = vector_new(); hash_table_foreach(self->hash_field, private_finc_struct_init_data, l_vector); private_data_p = old_data; return l_vector; }
bool sort_list(port_type_t type) { hash_table_t *table = get_map_by_type(type); if (table == NULL) { return false; } uint table_size = hash_table_size(table); if (topn_ip != NULL) { topn_free(topn_ip); } topn_ip = topn_new(table_size, ip_compare, table, NULL, NULL); hash_table_foreach(table, sort_ip, topn_ip); //topn_foreach(topn_ip, print, NULL); return true; }
void wsi_x11_finish_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc) { struct wsi_x11 *wsi = (struct wsi_x11 *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_XCB]; if (wsi) { struct hash_entry *entry; hash_table_foreach(wsi->connections, entry) wsi_x11_connection_destroy(alloc, entry->data); _mesa_hash_table_destroy(wsi->connections, NULL); pthread_mutex_destroy(&wsi->mutex); vk_free(alloc, wsi); } }
void pkg_hash_fetch_all_installed(hash_table_t *hash, pkg_vec_t *all) { hash_table_foreach(hash, pkg_hash_fetch_all_installed_helper, all); qsort(all->pkgs, all->len, sizeof(void*), pkg_compare_names); }
void pkg_hash_fetch_available(hash_table_t *hash, pkg_vec_t *all) { hash_table_foreach(hash, pkg_hash_fetch_available_helper, all); qsort(all->pkgs, all->len, sizeof(pkg_t *), pkg_compare_names); }