summaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-06-04 19:19:01 +0000
committerNick Mathewson <nickm@torproject.org>2007-06-04 19:19:01 +0000
commitbb6f53d60c78ad8d747bd48cb621083fe1de6bad (patch)
treef3eb9fb510ca1a417c4c5dfd2242253ade7f11e4 /src/common/container.c
parent32d12dcfbc02bc2e8c65bbed4e10f990fc41b77c (diff)
downloadtor-bb6f53d60c78ad8d747bd48cb621083fe1de6bad.tar.gz
tor-bb6f53d60c78ad8d747bd48cb621083fe1de6bad.zip
r13243@catbus: nickm | 2007-06-04 15:17:15 -0400
Start of code to compute consensus network-status stuff from a bunch of votes. Strangely, it does not yet feel like an enormous ugly hack. svn:r10489
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/container.c b/src/common/container.c
index a3663c48f6..9333ccdb16 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -196,6 +196,18 @@ smartlist_string_isin(const smartlist_t *sl, const char *element)
return 0;
}
+/** DOCDOC */
+int
+smartlist_string_pos(const smartlist_t *sl, const char *element)
+{
+ int i;
+ if (!sl) return -1;
+ for (i=0; i < sl->num_used; i++)
+ if (strcmp((const char*)sl->list[i],element)==0)
+ return i;
+ return -1;
+}
+
/** Return true iff <b>sl</b> has some element E such that
* !strcasecmp(E,<b>element</b>)
*/