]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/lists.c
Rename ShowInvitesBans() to ShowChannelList(), make it more flexible
[ngircd-alex.git] / src / ngircd / lists.c
index fd86f3017efabea10175054619177b982f2a4670..c082f1c4c0b767713608355004cb6b41ae3fa14a 100644 (file)
@@ -385,4 +385,26 @@ Lists_Expire(struct list_head *h, const char *ListName)
        }
 }
 
+/**
+ * Return the number of entries of a list.
+ *
+ * @param h List head.
+ * @return Number of items.
+ */
+GLOBAL unsigned long
+Lists_Count(struct list_head *h)
+{
+       struct list_elem *e;
+       unsigned long count = 0;
+
+       assert(h != NULL);
+
+       e = h->first;
+       while (e) {
+               count++;
+               e = e->next;
+       }
+       return count;
+}
+
 /* -eof- */