diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-09 11:36:47 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-10 15:09:07 -0500 |
commit | c83d83814660b643b705ed7de4aa1fc35e2d20ad (patch) | |
tree | a40e8125e82391e69a16cac1ee73061243d00017 /src/common/container.h | |
parent | 33df3e37ffecfed309a1a0f210a96620c0ebb837 (diff) | |
download | tor-c83d83814660b643b705ed7de4aa1fc35e2d20ad.tar.gz tor-c83d83814660b643b705ed7de4aa1fc35e2d20ad.zip |
Implement proposal 227-vote-on-package-fingerprints.txt
This implementation includes tests and a little documentation.
Diffstat (limited to 'src/common/container.h')
-rw-r--r-- | src/common/container.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/container.h b/src/common/container.h index 377cdf5dba..6edc80f75b 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -94,8 +94,11 @@ void smartlist_del_keeporder(smartlist_t *sl, int idx); void smartlist_insert(smartlist_t *sl, int idx, void *val); void smartlist_sort(smartlist_t *sl, int (*compare)(const void **a, const void **b)); -void *smartlist_get_most_frequent(const smartlist_t *sl, - int (*compare)(const void **a, const void **b)); +void *smartlist_get_most_frequent_(const smartlist_t *sl, + int (*compare)(const void **a, const void **b), + int *count_out); +#define smartlist_get_most_frequent(sl, compare) \ + smartlist_get_most_frequent_((sl), (compare), NULL) void smartlist_uniq(smartlist_t *sl, int (*compare)(const void **a, const void **b), void (*free_fn)(void *elt)); @@ -106,6 +109,7 @@ void smartlist_sort_digests256(smartlist_t *sl); void smartlist_sort_pointers(smartlist_t *sl); char *smartlist_get_most_frequent_string(smartlist_t *sl); +char *smartlist_get_most_frequent_string_(smartlist_t *sl, int *count_out); char *smartlist_get_most_frequent_digest256(smartlist_t *sl); void smartlist_uniq_strings(smartlist_t *sl); |