| 106 | } |
| 107 | |
| 108 | void *strmap_put(struct strmap *map, const char *str, void *data) |
| 109 | { |
| 110 | struct strmap_entry *entry = find_strmap_entry(map, str); |
| 111 | |
| 112 | if (entry) { |
| 113 | void *old = entry->value; |
| 114 | entry->value = data; |
| 115 | return old; |
| 116 | } |
| 117 | |
| 118 | entry = create_entry(map, str, data); |
| 119 | hashmap_add(&map->map, &entry->ent); |
| 120 | return NULL; |
| 121 | } |
| 122 | |
| 123 | struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str) |
| 124 | { |