commit | 334c8e178008f3184382aae6c2cd13b9652169e2 | [log] [tgz] |
---|---|---|
author | Daniel Willmann <daniel@totalueberwachung.de> | Fri Apr 08 10:46:19 2011 +0200 |
committer | Holger Hans Peter Freyther <zecke@selfish.org> | Sat Apr 09 20:52:18 2011 +0200 |
tree | 32a5edb304298d22dd6e4432fcdcc07fc360e946 | |
parent | 2d42ddeba37ed7e0d54bf10dc66b7549ad43bc5b [diff] |
Add a function to search for a counter by name
diff --git a/src/statistics.c b/src/statistics.c index 183005d..d1ffe52 100644 --- a/src/statistics.c +++ b/src/statistics.c
@@ -64,3 +64,13 @@ return rc; } +struct counter *counter_get_by_name(const char *name) +{ + struct counter *ctr; + + llist_for_each_entry(ctr, &counters, list) { + if (!strcmp(ctr->name, name)) + return ctr; + } + return NULL; +}