|
Data Structures |
struct | _simple_map_el |
| Auxulary structure. More...
|
struct | MapTypeInfo |
struct | SimpleMap |
| Main SimpleMap structure. More...
|
Defines |
#define | STORAGE_TYPE extern |
Typedefs |
typedef int(* | MapCompareFunc )(char *, char *) |
typedef char *(* | MapCopyFunc )(char *) |
typedef void(* | MapDestructor )(void *) |
| Destructor signature.
|
typedef void(* | MapFreeFunc )(char *) |
typedef unsigned int(* | MapHashFunc )(char *) |
typedef int(* | MapIterator )(SimpleMap *map, char *key, void *value, void *data) |
| Map iterator function.
|
typedef _simple_map_el | SimpleMapEl |
| Auxulary structure.
|
Functions |
STORAGE_TYPE SimpleMap * | map_copy (SimpleMap *map) |
| Creates a copy of map.
|
STORAGE_TYPE int | map_foreach (SimpleMap *map, MapIterator iterator, void *data) |
| Iterates over all stored elements.
|
STORAGE_TYPE void | map_free (SimpleMap *map) |
| Deletes and frees the map.
|
STORAGE_TYPE void * | map_get (SimpleMap *map, char *key) |
| Returns an element by key or -1 if element with such key does not exists.
|
STORAGE_TYPE void * | map_get_element (SimpleMap *, char *key) |
| Searches for the element in the map.
|
STORAGE_TYPE int | map_has_key (SimpleMap *map, char *key) |
| Checks whether the element with given key exists or not.
|
STORAGE_TYPE SimpleMap * | map_new () |
| Creates new map with default size and no destructor.
|
STORAGE_TYPE SimpleMap * | map_new_configured (int size, MapDestructor destructor) |
| Creates new map with given size and destructor.
|
STORAGE_TYPE SimpleMap * | map_new_configured_full (int size, MapDestructor destructor, MapTypeInfo *pInfo) |
| Creates new map with given size, destructor, hash and compare functions.
|
STORAGE_TYPE SimpleMap * | map_new_with_destructor (MapDestructor destructor) |
| Creates new map with given destructor and default size.
|
STORAGE_TYPE void | map_remove (SimpleMap *map, char *key) |
| Removes element by key from map.
|
STORAGE_TYPE void | map_set (SimpleMap *map, char *key, void *value) |
| Creates new map element from key/value pair.
|