summaryrefslogtreecommitdiffabout
path: root/src/linked-list.c
Side-by-side diff
Diffstat (limited to 'src/linked-list.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/linked-list.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/linked-list.c b/src/linked-list.c
index 095b63e..3c57bf0 100644
--- a/src/linked-list.c
+++ b/src/linked-list.c
@@ -17,7 +17,7 @@
#include <cflow.h>
static struct linked_list *
-deref_linked_list (struct linked_list **plist)
+deref_linked_list(struct linked_list **plist)
{
if (!*plist) {
struct linked_list *list = xmalloc(sizeof(*list));
@@ -144,3 +144,16 @@ data_in_list(void *data, struct linked_list *list)
return 1;
return 0;
}
+
+size_t
+linked_list_size(struct linked_list *list)
+{
+ size_t size = 0;
+ if (list) {
+ struct linked_list_entry *p;
+ for (p = linked_list_head(list); p; p = p->next)
+ size++;
+ }
+ return size;
+}
+

Return to:

Send suggestions and report system problems to the System administrator.