diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-11-03 20:12:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-11-03 20:12:38 +0000 |
commit | c217be996d55560b6fbb2932ab498372306b2379 (patch) | |
tree | fbc188a15cd3d6dbc7cf8505f0bac1ad973d95f5 /src/common/container.h | |
parent | d4e339ed879ef60e645a2b2d1fea87aaecc342fe (diff) | |
download | tor-c217be996d55560b6fbb2932ab498372306b2379.tar.gz tor-c217be996d55560b6fbb2932ab498372306b2379.zip |
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
Diffstat (limited to 'src/common/container.h')
-rw-r--r-- | src/common/container.h | 4 |
1 files changed, 4 insertions, 0 deletions
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), |