Added ec_pdo_list_find_by_pos_const().
--- a/master/pdo_list.c Mon Jun 02 08:54:51 2008 +0000
+++ b/master/pdo_list.c Mon Jun 02 10:12:31 2008 +0000
@@ -279,6 +279,28 @@
/*****************************************************************************/
+/** Finds a Pdo via its position in the list.
+ *
+ * Const version.
+ */
+const ec_pdo_t *ec_pdo_list_find_pdo_by_pos_const(
+ const ec_pdo_list_t *pl, /**< Pdo list. */
+ unsigned int pos /**< Position in the list. */
+ )
+{
+ const ec_pdo_t *pdo;
+
+ list_for_each_entry(pdo, &pl->list, list) {
+ if (pos--)
+ continue;
+ return pdo;
+ }
+
+ return NULL;
+}
+
+/*****************************************************************************/
+
/**
*/
unsigned int ec_pdo_list_count(
--- a/master/pdo_list.h Mon Jun 02 08:54:51 2008 +0000
+++ b/master/pdo_list.h Mon Jun 02 10:12:31 2008 +0000
@@ -75,6 +75,8 @@
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);
+const ec_pdo_t *ec_pdo_list_find_pdo_by_pos_const(
+ const ec_pdo_list_t *, unsigned int);
unsigned int ec_pdo_list_count(const ec_pdo_list_t *);
/*****************************************************************************/