/* map.h - associative array code (header) */ /* PUBLIC DOMAIN - Jon Mayo - July 15, 2007 * initial version: 2007-07-24 * last modified: 2007-07-27 * $Id$ */ #ifndef MAP_H #define MAP_H #define MAP_FEATURE_FLAG_ALLOCATE_KEY 1 #define MAP_FEATURE_FLAG_REPLACE 2 #define MAP_FEATURE_FLAG_RESIZE 4 struct map_container; struct map_container *map_create(unsigned initial_size_bits, unsigned option_flags, void (*free_cb)(void*)); void map_cursor_clear(struct map_container *m); void *map_cursor_next(struct map_container *m); void *map_lookup(struct map_container *m, const char *key); int map_add(struct map_container *m, const char *key, void *data); void *map_remove(struct map_container *m, const char *key); void map_free(struct map_container *m); #endif