cucon/pcmap.h: Constructive Maps from Pointers to Pointers
[Associative Containers (trees, maps, sets)]

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)

Detailed Description

This is a light wrapper over cucon/ucmap.h: Constructive Maps from Unsigned Integers to Pointers, specialised for pointer keys.

See also:
cucon/ucmap.h: Constructive Maps from Unsigned Integers to Pointers
cucon/pmap.h: Pointer-Keyed Hash Map

Function Documentation

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.

Precondition:
f must return 0 on equal pointers.

cu_bool_t cucon_pcmap_conj_int ( cucon_pcmap_t  map,
cu_clop(cb, cu_bool_t, void *key, int val)   
)

Sequentially conjunct cb over mappings in increasing key order.

cu_bool_t cucon_pcmap_conj_ptr ( cucon_pcmap_t  map,
cu_clop(cb, cu_bool_t, void *key, void *val)   
)

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.

Precondition:
f must return true on equal pointers.

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 {keyval}.

cucon_pcmap_t cucon_pcmap_singleton_ptr ( void *  key,
void *  val 
)

Return the map {keyval}.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.