summaryrefslogtreecommitdiff
path: root/src/slist.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-12-05 07:24:59 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-12-05 07:24:59 +0000
commit4439817d4df10956b884e0d47ac6e3d18c141238 (patch)
tree924574441e19c77fc6e4aca1acebb6d7aad19296 /src/slist.c
parentadded config file format to manpage (diff)
check wether config file was empty
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@29 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/slist.c')
-rw-r--r--src/slist.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/slist.c b/src/slist.c
index 8dd1963..24da141 100644
--- a/src/slist.c
+++ b/src/slist.c
@@ -115,3 +115,16 @@ void slist_clear(slist_t* lst)
lst->first_ = NULL;
}
+
+int slist_length(slist_t* lst)
+{
+ if(!lst || !lst->first_)
+ return 0;
+
+ int len = 0;
+ slist_element_t* tmp;
+ for(tmp = lst->first_; tmp; tmp = tmp->next_)
+ len++;
+
+ return len;
+}