Added ec_pdo_list_count().
authorFlorian Pose <fp@igh-essen.com>
Mon, 02 Jun 2008 08:54:51 +0000
changeset 931 482bbaf3e76b
parent 930 35358e9bb62b
child 932 dbcc06156a60
Added ec_pdo_list_count().
master/pdo_list.c
master/pdo_list.h
--- a/master/pdo_list.c	Fri May 30 14:50:57 2008 +0000
+++ b/master/pdo_list.c	Mon Jun 02 08:54:51 2008 +0000
@@ -278,3 +278,21 @@
 }
 
 /*****************************************************************************/
+
+/**
+ */
+unsigned int ec_pdo_list_count(
+        const ec_pdo_list_t *pl /**< Pdo list. */
+        )
+{
+    const ec_pdo_t *pdo;
+    unsigned int num = 0;
+
+    list_for_each_entry(pdo, &pl->list, list) {
+        num++;
+    }
+
+    return num;
+}
+
+/*****************************************************************************/
--- a/master/pdo_list.h	Fri May 30 14:50:57 2008 +0000
+++ b/master/pdo_list.h	Mon Jun 02 08:54:51 2008 +0000
@@ -75,6 +75,7 @@
 ec_pdo_t *ec_pdo_list_find_pdo(const ec_pdo_list_t *, uint16_t);
 const ec_pdo_t *ec_pdo_list_find_pdo_const(const ec_pdo_list_t *,
         uint16_t);
+unsigned int ec_pdo_list_count(const ec_pdo_list_t *);
 
 /*****************************************************************************/