Esempio n. 1
0
static void remove_undefined(struct cdump_map *map)
{
	struct cdump_map undefs;

	/* We can't delete inside iterator, so gather all the undefs
	 * then remove them. */
	strmap_init(&undefs);

	strmap_iterate(map, gather_undefines, &undefs);
	strmap_iterate(&undefs, remove_from_map, map);
	strmap_clear(&undefs);
}
Esempio n. 2
0
int main(void)
{
	STRMAP(char *) map;

	plan_tests(3);

	strmap_init(&map);
	ok1(strmap_add(&map, "hello", "hello"));
	ok1(strmap_add(&map, "world", "world"));
	strmap_iterate(&map, find_string, (const char *)"hello");
	ok1(found);
	strmap_clear(&map);

	/* This exits depending on whether all tests passed */
	return exit_status();
}
Esempio n. 3
0
void rirtype_strmap_free(struct rirtype_strmap *map)
{
    strmap_iterate(map, (strmap_it_cb)itfree_rirtypestring, NULL);
    strmap_clear(map);
}
Esempio n. 4
0
void rirobjmap_free(struct rirobj_strmap *map, struct rir_common *c)
{
    strmap_iterate(map, (strmap_it_cb)itfree_rirobjects, c);
    strmap_clear(map);
}
Esempio n. 5
0
static void destroy_definitions(struct cdump_definitions *defs)
{
	strmap_clear(&defs->enums);
	strmap_clear(&defs->structs);
	strmap_clear(&defs->unions);
}