In routerlist_assert_ok(), check r2 before taking &(r2->cache_info)
[tor.git] / src / or / fp_pair.h
blob89f664a813ba7ad9d25fcf94bf0e944137cb7298
1 /* Copyright (c) 2013, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 /**
5 * \file fp_pair.h
6 * \brief Header file for fp_pair.c.
7 **/
9 #ifndef _TOR_FP_PAIR_H
10 #define _TOR_FP_PAIR_H
13 * Declare fp_pair_map_t functions and structs
16 typedef struct fp_pair_map_entry_s fp_pair_map_entry_t;
17 typedef struct fp_pair_map_s fp_pair_map_t;
18 typedef fp_pair_map_entry_t *fp_pair_map_iter_t;
20 fp_pair_map_t * fp_pair_map_new(void);
21 void * fp_pair_map_set(fp_pair_map_t *map, const fp_pair_t *key, void *val);
22 void * fp_pair_map_set_by_digests(fp_pair_map_t *map,
23 const char *first, const char *second,
24 void *val);
25 void * fp_pair_map_get(const fp_pair_map_t *map, const fp_pair_t *key);
26 void * fp_pair_map_get_by_digests(const fp_pair_map_t *map,
27 const char *first, const char *second);
28 void * fp_pair_map_remove(fp_pair_map_t *map, const fp_pair_t *key);
29 void fp_pair_map_free(fp_pair_map_t *map, void (*free_val)(void*));
30 int fp_pair_map_isempty(const fp_pair_map_t *map);
31 int fp_pair_map_size(const fp_pair_map_t *map);
32 fp_pair_map_iter_t * fp_pair_map_iter_init(fp_pair_map_t *map);
33 fp_pair_map_iter_t * fp_pair_map_iter_next(fp_pair_map_t *map,
34 fp_pair_map_iter_t *iter);
35 fp_pair_map_iter_t * fp_pair_map_iter_next_rmv(fp_pair_map_t *map,
36 fp_pair_map_iter_t *iter);
37 void fp_pair_map_iter_get(fp_pair_map_iter_t *iter,
38 fp_pair_t *key_out, void **val_out);
39 int fp_pair_map_iter_done(fp_pair_map_iter_t *iter);
40 void fp_pair_map_assert_ok(const fp_pair_map_t *map);
42 #undef DECLARE_MAP_FNS
44 #endif