} map_pair_t;
struct map_t {
- hashfn_t hash_func;
+ map_hashfn_t hash_func;
rbt_t* tree;
};
return cmp;
}
-map_t* map_new(cmp_t* cmp, hashfn_t hash_fn)
+map_t* map_new(cmp_t* cmp, map_hashfn_t hash_fn)
{
map_t* map = (map_t*)mem_allocate(sizeof(map_t), &map_free);
cmp_t* comp = cmp_new(cmp, &map_compare_nodes);
#include "rbt.h"
/** Function pointer that returns the 32-bit hash of the given object. */
-typedef uint32_t (*hashfn_t)(void* obj);
+typedef uint32_t (*map_hashfn_t)(void* obj);
/* map data structure */
struct map_t;
*
* @return The new map.
*/
-map_t* map_new(cmp_t* cmp, hashfn_t hash_fn);
+map_t* map_new(cmp_t* cmp, map_hashfn_t hash_fn);
/**
* @brief Determines whether the map contains the given key or not.
} set_pair_t;
struct set_t {
- hashfn_t hash_func;
+ set_hashfn_t hash_func;
rbt_t* tree;
};
return cmp;
}
-set_t* set_new(cmp_t* cmp, hashfn_t hash_fn)
+set_t* set_new(cmp_t* cmp, set_hashfn_t hash_fn)
{
set_t* set = (set_t*)mem_allocate(sizeof(set_t), &set_free);
cmp_t* comp = cmp_new(cmp, &set_compare_nodes);
#include "rbt.h"
/** Function pointer that returns the 32-bit hash of the given object. */
-typedef uint32_t (*hashfn_t)(void* obj);
+typedef uint32_t (*set_hashfn_t)(void* obj);
/* Set data structure */
struct set_t;
*
* @return the newly constructed set.
*/
-set_t* set_new(cmp_t* cmp, hashfn_t hash_fn);
+set_t* set_new(cmp_t* cmp, set_hashfn_t hash_fn);
/**
* @brief Determines if the value is a member of the set.