Defines | |
#define | cucon_pcmap_int_none cucon_ucmap_int_none |
Functions | |
cucon_pcmap_t | cucon_pcmap_empty () |
cucon_pcmap_t | cucon_pcmap_singleton (void *key, uintptr_t val) |
cucon_pcmap_t | cucon_pcmap_singleton_ptr (void *key, void *val) |
cu_bool_t | cucon_pcmap_is_singleton (cucon_pcmap_t map) |
cu_bool_t | cucon_pcmap_is_empty (cucon_pcmap_t map) |
cucon_pcmap_t | cucon_pcmap_insert (cucon_pcmap_t map, void *key, uintptr_t val) |
cucon_pcmap_t | cucon_pcmap_insert_ptr (cucon_pcmap_t map, void *key, void *val) |
cucon_pcmap_t | cucon_pcmap_insert_int (cucon_pcmap_t map, void *key, int val) |
cu_bool_t | cucon_pcmap_contains (cucon_pcmap_t map, void *key) |
cu_bool_t | cucon_pcmap_find (cucon_pcmap_t map, void *key, uintptr_t *val_out) |
void * | cucon_pcmap_find_ptr (cucon_pcmap_t map, void *key) |
int | cucon_pcmap_find_int (cucon_pcmap_t map, void *key) |
cu_bool_t | cucon_pcmap_conj_ptr (cucon_pcmap_t map, cu_clop(cb, cu_bool_t, void *key, void *val)) |
cu_bool_t | cucon_pcmap_conj_int (cucon_pcmap_t map, cu_clop(cb, cu_bool_t, void *key, int val)) |
cu_bool_t | cucon_pcmap_eq (cucon_pcmap_t map0, cucon_pcmap_t map1) |
cu_bool_t | cucon_pcmap_eq_ptr (cu_clop(f, cu_bool_t, void const *, void const *), cucon_pcmap_t map0, cucon_pcmap_t map1) |
int | cucon_pcmap_cmp (cucon_pcmap_t map0, cucon_pcmap_t map1) |
int | cucon_pcmap_cmp_ptr (cu_clop(f, int, void const *, void const *), cucon_pcmap_t map0, cucon_pcmap_t map1) |
void | cucon_pcmap_dump (cucon_pcmap_t map, FILE *out) |
This is a light wrapper over cucon/ucmap.h: Constructive Maps from Unsigned Integers to Pointers, specialised for pointer keys.
int cucon_pcmap_cmp | ( | cucon_pcmap_t | map0, | |
cucon_pcmap_t | map1 | |||
) |
Return -1, 0, or 1 when map0 is less, equal, or greater than map1, where the value slots are compared as integers or by pointer equality.
int cucon_pcmap_cmp_ptr | ( | cu_clop(f, int, void const *, void const *) | , | |
cucon_pcmap_t | map0, | |||
cucon_pcmap_t | map1 | |||
) |
Return -1, 0, or 1 when map0 is less, equal, or greater than map1, where the value solts are compared according to f.
Sequentially conjunct cb over mappings in increasing key order.
Sequentially conjunct cb over mappings in increasing key order.
cu_bool_t cucon_pcmap_contains | ( | cucon_pcmap_t | map, | |
void * | key | |||
) |
True iff map has a mapping from key.
void cucon_pcmap_dump | ( | cucon_pcmap_t | map, | |
FILE * | out | |||
) |
Debug dump.
cucon_pcmap_t cucon_pcmap_empty | ( | ) |
The empty map. Due to the constructive nature, this always returns the same value.
cu_bool_t cucon_pcmap_eq | ( | cucon_pcmap_t | map0, | |
cucon_pcmap_t | map1 | |||
) |
True iff map0 and map1 are equal, where values are compared as integers or by pointer comparison.
cu_bool_t cucon_pcmap_eq_ptr | ( | cu_clop(f, cu_bool_t, void const *, void const *) | , | |
cucon_pcmap_t | map0, | |||
cucon_pcmap_t | map1 | |||
) |
True iff map0 and map1 are equal, where f compares the values.
cu_bool_t cucon_pcmap_find | ( | cucon_pcmap_t | map, | |
void * | key, | |||
uintptr_t * | val_out | |||
) |
If key is found in map, assign its value to v_out
and return true, else return false.
int cucon_pcmap_find_int | ( | cucon_pcmap_t | map, | |
void * | key | |||
) |
Return the mapping of key in map, or (uintptr_t)-1 of none.
void* cucon_pcmap_find_ptr | ( | cucon_pcmap_t | map, | |
void * | key | |||
) |
Return the mapping of key in map, or NULL
if none.
cucon_pcmap_t cucon_pcmap_insert | ( | cucon_pcmap_t | map, | |
void * | key, | |||
uintptr_t | val | |||
) |
Return a map which agrees with map everywhere, except that key maps to val.
cucon_pcmap_t cucon_pcmap_insert_int | ( | cucon_pcmap_t | map, | |
void * | key, | |||
int | val | |||
) |
Return a map which agrees on map everywhere, except that key maps to val. That is a mapping for key is either inserted or replaced.
cucon_pcmap_t cucon_pcmap_insert_ptr | ( | cucon_pcmap_t | map, | |
void * | key, | |||
void * | val | |||
) |
Return a map which agrees on map everywhere, except that key maps to val. That is a mapping for key is either inserted or replaced.
cu_bool_t cucon_pcmap_is_empty | ( | cucon_pcmap_t | map | ) |
True iff map is the empty map. Due to the constructive nature, there is only one empty map.
cu_bool_t cucon_pcmap_is_singleton | ( | cucon_pcmap_t | map | ) |
True iff the domain of map is a singleton.
cucon_pcmap_t cucon_pcmap_singleton | ( | void * | key, | |
uintptr_t | val | |||
) |
Return the map {key ↦ val}.
cucon_pcmap_t cucon_pcmap_singleton_ptr | ( | void * | key, | |
void * | val | |||
) |
Return the map {key ↦ val}.