/* store the key/value pairs from a hash table into raw_data */ GRawData * parse_raw_data (GHashTable * ht, int ht_size, GModule module) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->size = ht_size; raw_data->module = module; raw_data->idx = 0; raw_data->items = new_grawdata_item (ht_size); g_hash_table_foreach (ht, (GHFunc) raw_data_iter, raw_data); sort_raw_data (raw_data, ht_size); return raw_data; }
GRawData * parse_raw_data (void *db, int ht_size, GModule module) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->size = ht_size; raw_data->module = module; raw_data->idx = 0; raw_data->items = new_grawdata_item (ht_size); tc_db_foreach (db, data_iter_generic, raw_data); sort_raw_data (raw_data, ht_size); return raw_data; }
/* store the key/value pairs from a hash table into raw_data */ GRawData * parse_raw_data (GHashTable * ht, int ht_size, GModule module) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->size = ht_size; raw_data->module = module; raw_data->idx = 0; raw_data->items = new_grawdata_item (ht_size); g_hash_table_foreach (ht, (GHFunc) raw_data_iter, raw_data); if (ht == ht_unique_vis) qsort (raw_data->items, ht_size, sizeof (GRawDataItem), cmp_data_desc); else qsort (raw_data->items, ht_size, sizeof (GRawDataItem), cmp_num_desc); return raw_data; }
GRawData * parse_raw_data (void *db, int ht_size, GModule module) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->size = ht_size; raw_data->module = module; raw_data->idx = 0; raw_data->items = new_grawdata_item (ht_size); tc_db_foreach (db, data_iter_generic, raw_data); sort_raw_data (raw_data, raw_data->idx); if (raw_data->idx != ht_size) LOG_DEBUG (("idx: %d!=ht size: %d - %d\n", raw_data->idx, ht_size, module)); return raw_data; }