diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-03-22 12:13:25 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2013-05-09 10:54:55 -0700 |
commit | d5bd4a4763dfa74572ce6ed0b565315c43ff9f87 (patch) | |
tree | 568c6cc8d0dd62a1f3911c15c7f2d0fa71945250 /src/or/fp_pair.h | |
parent | 96d3219176398f377dc4a1c84e14a54e7d2516df (diff) | |
download | tor-d5bd4a4763dfa74572ce6ed0b565315c43ff9f87.tar.gz tor-d5bd4a4763dfa74572ce6ed0b565315c43ff9f87.zip |
Implement fp_pair_map_t
Diffstat (limited to 'src/or/fp_pair.h')
-rw-r--r-- | src/or/fp_pair.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/or/fp_pair.h b/src/or/fp_pair.h new file mode 100644 index 0000000000..89f664a813 --- /dev/null +++ b/src/or/fp_pair.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2013, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file fp_pair.h + * \brief Header file for fp_pair.c. + **/ + +#ifndef _TOR_FP_PAIR_H +#define _TOR_FP_PAIR_H + +/* + * Declare fp_pair_map_t functions and structs + */ + +typedef struct fp_pair_map_entry_s fp_pair_map_entry_t; +typedef struct fp_pair_map_s fp_pair_map_t; +typedef fp_pair_map_entry_t *fp_pair_map_iter_t; + +fp_pair_map_t * fp_pair_map_new(void); +void * fp_pair_map_set(fp_pair_map_t *map, const fp_pair_t *key, void *val); +void * fp_pair_map_set_by_digests(fp_pair_map_t *map, + const char *first, const char *second, + void *val); +void * fp_pair_map_get(const fp_pair_map_t *map, const fp_pair_t *key); +void * fp_pair_map_get_by_digests(const fp_pair_map_t *map, + const char *first, const char *second); +void * fp_pair_map_remove(fp_pair_map_t *map, const fp_pair_t *key); +void fp_pair_map_free(fp_pair_map_t *map, void (*free_val)(void*)); +int fp_pair_map_isempty(const fp_pair_map_t *map); +int fp_pair_map_size(const fp_pair_map_t *map); +fp_pair_map_iter_t * fp_pair_map_iter_init(fp_pair_map_t *map); +fp_pair_map_iter_t * fp_pair_map_iter_next(fp_pair_map_t *map, + fp_pair_map_iter_t *iter); +fp_pair_map_iter_t * fp_pair_map_iter_next_rmv(fp_pair_map_t *map, + fp_pair_map_iter_t *iter); +void fp_pair_map_iter_get(fp_pair_map_iter_t *iter, + fp_pair_t *key_out, void **val_out); +int fp_pair_map_iter_done(fp_pair_map_iter_t *iter); +void fp_pair_map_assert_ok(const fp_pair_map_t *map); + +#undef DECLARE_MAP_FNS + +#endif + |