From c217be996d55560b6fbb2932ab498372306b2379 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 3 Nov 2007 20:12:38 +0000 Subject: r14677@tombo: nickm | 2007-11-03 15:16:27 -0400 Add a smartlist_bsearch_idx function that gives more useful output than regular bsearch for the value-not-found case. svn:r12360 --- src/common/container.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common/container.h') diff --git a/src/common/container.h b/src/common/container.h index 35ba743173..bbf654f5f2 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -106,6 +106,10 @@ void smartlist_uniq_digests(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)) ATTR_PURE; +int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, + int (*compare)(const void *key, const void **member), + int *found_out) + ATTR_PURE; void smartlist_pqueue_add(smartlist_t *sl, int (*compare)(const void *a, const void *b), -- cgit v1.2.3-54-g00ecf