diff options
Diffstat (limited to 'runtime/map.c')
-rw-r--r-- | runtime/map.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/map.c b/runtime/map.c index 0942fdaa..936383be 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -1,8 +1,14 @@ +#ifndef _MAP_C_ +#define _MAP_C_ + /* -*- linux-c -*- */ /** @file map.c * @brief Implements maps (associative arrays) and lists */ +#include "map.h" +#include "alloc.c" + static int map_sizes[] = { sizeof(struct map_node_int64), sizeof(struct map_node_stat), @@ -33,6 +39,11 @@ static unsigned mixed_hash(const char *key1, long key2) return hash_long((unsigned long)(hash ^ key2), HASH_TABLE_BITS); } +/** @addtogroup maps + * Implements maps (associative arrays) and lists + * @{ + */ + /** Create a new map. * Maps must be created at module initialization time. * @param max_entries The maximum number of entries allowed. Currently that number will @@ -766,8 +777,16 @@ void _stp_map_stat_add(MAP map, int64_t val) /* histogram */ } +/** @} */ + /********************** List Functions *********************/ +/** @addtogroup lists + * Lists are special cases of maps. + * @b Example: + * @include list.c + * @{ */ + /** Create a new list. * A list is a map that internally has an incrementing long key for each member. * Lists do not wrap if elements are added to exceed their maximum size. @@ -857,3 +876,5 @@ inline int _stp_list_size(MAP map) { return map->num; } +/** @} */ +#endif /* _MAP_C_ */ |