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))
size_t pmap_count(pmap const *map)
Return number of elements in the map.
void pmap_break(pmap *map)
Breaks an iteration.
#define pmap_get(type, map, key)
Returns the value of "key".
struct pmap pmap
A map which maps addresses to addresses.
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_destroy(pmap *map)
Deletes a map.
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.
int pmap_contains(pmap const *map, void const *key)
Checks if an entry with key "key" exists.
pmap * pmap_create_ex(size_t slots)
Creates a new empty map with an initial number of slots.
pmap * pmap_create(void)
Creates a new empty map.