12 #ifndef FIRM_ADT_PMAP_H 13 #define FIRM_ADT_PMAP_H 60 FIRM_API
void *
pmap_get(
pmap const *map,
void const *key);
67 #define pmap_get(type, map, key) ((type*)pmap_get(map, key)) 85 #define foreach_pmap(pmap, curr) \ 86 for (pmap_entry *curr = pmap_first(pmap); curr; curr = pmap_next(pmap)) pmap_entry * pmap_first(pmap *map)
Returns the first entry of a map if the map is not empty.
void pmap_insert(pmap *map, void const *key, void *value)
Inserts a pair (key,value) into the map.
void pmap_break(pmap *map)
Breaks an iteration.
pmap_entry * pmap_find(pmap const *map, void const *key)
Returns the key, value pair of "key".
pmap_entry * pmap_next(pmap *map)
Returns the next entry of a map or NULL if all entries were visited.
struct pmap pmap
A map which maps addresses to addresses.
pmap * pmap_create_ex(size_t slots)
Creates a new empty map with an initial number of slots.
void pmap_destroy(pmap *map)
Deletes a map.
pmap * pmap_create(void)
Creates a new empty map.
int pmap_contains(pmap const *map, void const *key)
Checks if an entry with key "key" exists.
size_t pmap_count(pmap const *map)
Return number of elements in the map.
#define pmap_get(type, map, key)
Returns the value of "key".