From c83d83814660b643b705ed7de4aa1fc35e2d20ad Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 9 Jan 2015 11:36:47 -0500 Subject: Implement proposal 227-vote-on-package-fingerprints.txt This implementation includes tests and a little documentation. --- src/common/container.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common/container.h') 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); -- cgit v1.2.3-54-g00ecf