48 static inline unsigned int
52 return (
unsigned) siphash24g(&a->key,
DIGEST_LEN*2);
74 HT_INIT(fp_pair_map_impl, &result->head);
93 memcpy(&(search.key), key,
sizeof(*key));
94 resolve = HT_FIND(fp_pair_map_impl, &(map->head), &search);
96 oldval = resolve->val;
100 memcpy(&(resolve->key), key,
sizeof(*key));
102 HT_INSERT(fp_pair_map_impl, &(map->head), resolve);
115 const char *first,
const char *second,
142 memcpy(&(search.key), key,
sizeof(*key));
143 resolve = HT_FIND(fp_pair_map_impl, &(map->head), &search);
144 if (resolve) val = resolve->val;
155 const char *first,
const char *second)
184 memcpy(&(search.key), key,
sizeof(*key));
185 resolve = HT_REMOVE(fp_pair_map_impl, &(map->head), &search);
204 for (ent = HT_START(fp_pair_map_impl, &(map->head));
205 ent != NULL; ent = next) {
207 next = HT_NEXT_RMV(fp_pair_map_impl, &(map->head), ent);
208 if (free_val) free_val(this->val);
212 HT_CLEAR(fp_pair_map_impl, &(map->head));
225 return HT_EMPTY(&(map->head));
236 return HT_SIZE(&(map->head));
247 return HT_START(fp_pair_map_impl, &(map->head));
260 return HT_NEXT(fp_pair_map_impl, &(map->head), iter);
277 iter = HT_NEXT_RMV(fp_pair_map_impl, &(map->head), iter);
293 if (key_out) memcpy(key_out, &((*iter)->key),
sizeof(
fp_pair_t));
294 if (val_out) *val_out = (*iter)->val;
303 return (iter == NULL);
313 tor_assert(!fp_pair_map_impl_HT_REP_IS_BAD_(&(map->head)));