aboutsummaryrefslogtreecommitdiffstats
path: root/common/strlist.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-09-18 23:25:54 +0000
committerNeal H. Walfield <[email protected]>2015-09-18 23:26:48 +0000
commit8499c4f84a664bedbdf5a5689cb02420909f1968 (patch)
treefc234f6a7b8df59b428ecd264932c014119e8c34 /common/strlist.c
parentgpgconf: Change displayed name of Dirmngr to "Network Manager". (diff)
downloadgnupg-8499c4f84a664bedbdf5a5689cb02420909f1968.tar.gz
gnupg-8499c4f84a664bedbdf5a5689cb02420909f1968.zip
common: Add new function strlist_length.
* common/strlist.c (strlist_length): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>.
Diffstat (limited to 'common/strlist.c')
-rw-r--r--common/strlist.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/strlist.c b/common/strlist.c
index 967509c56..9bd6195f9 100644
--- a/common/strlist.c
+++ b/common/strlist.c
@@ -221,3 +221,13 @@ strlist_find (strlist_t haystack, const char *needle)
return haystack;
return NULL;
}
+
+int
+strlist_length (strlist_t list)
+{
+ int i;
+ for (i = 0; list; list = list->next)
+ i ++;
+
+ return i;
+}