Lines Matching refs:value
51 * - these auxiliary macros cast the key and value parameters as
66 long value;
96 * - HASHMAP_ADD - only add key/value if key doesn't exist yet;
97 * - HASHMAP_SET - add key/value pair if key doesn't exist yet; otherwise,
98 * update value;
99 * - HASHMAP_UPDATE - update value, if key already exists; otherwise, do
101 * - HASHMAP_APPEND - always add key/value pair, even if key already exists.
105 * used, it will return last inserted key/value entry (first in a bucket
123 * hashmap__insert() adds key/value entry w/ various semantics, depending on
124 * provided strategy value. If a given key/value pair replaced already
125 * existing key/value pair, both old key and old value will be returned
129 int hashmap_insert(struct hashmap *map, long key, long value,
133 #define hashmap__insert(map, key, value, strategy, old_key, old_value) \
134 hashmap_insert((map), (long)(key), (long)(value), (strategy), \
138 #define hashmap__add(map, key, value) \
139 hashmap__insert((map), (key), (value), HASHMAP_ADD, NULL, NULL)
141 #define hashmap__set(map, key, value, old_key, old_value) \
142 hashmap__insert((map), (key), (value), HASHMAP_SET, (old_key), (old_value))
144 #define hashmap__update(map, key, value, old_key, old_value) \
145 hashmap__insert((map), (key), (value), HASHMAP_UPDATE, (old_key), (old_value))
147 #define hashmap__append(map, key, value) \
148 hashmap__insert((map), (key), (value), HASHMAP_APPEND, NULL, NULL)
157 bool hashmap_find(const struct hashmap *map, long key, long *value);
159 #define hashmap__find(map, key, value) \
160 hashmap_find((map), (long)(key), hashmap_cast_ptr(value))