* Retrieve the 'value' stored in a hashmap given the provided 'key'. * If there is no matching entry, return NULL. */
| 98 | * If there is no matching entry, return NULL. |
| 99 | */ |
| 100 | static void *attr_hashmap_get(struct attr_hashmap *map, |
| 101 | const char *key, size_t keylen) |
| 102 | { |
| 103 | struct attr_hash_entry k; |
| 104 | struct attr_hash_entry *e; |
| 105 | |
| 106 | hashmap_entry_init(&k.ent, memhash(key, keylen)); |
| 107 | k.key = key; |
| 108 | k.keylen = keylen; |
| 109 | e = hashmap_get_entry(&map->map, &k, ent, NULL); |
| 110 | |
| 111 | return e ? e->value : NULL; |
| 112 | } |
| 113 | |
| 114 | /* Add 'value' to a hashmap based on the provided 'key'. */ |
| 115 | static void attr_hashmap_add(struct attr_hashmap *map, |
no test coverage detected