return &ac->accessor;
}
+
+EAPI int
+eina_list_data_idx(const Eina_List *list, void *data)
+{
+ const Eina_List *l;
+ void *list_data;
+ int ret = 0;
+
+ if (!list) return -1;
+ EINA_MAGIC_CHECK_LIST(list, -1);
+
+ EINA_LIST_FOREACH(list, l, list_data)
+ {
+ if (list_data == data)
+ return ret;
+ ret++;
+ }
+
+ return -1;
+}
EAPI Eina_Accessor *eina_list_accessor_new(const Eina_List *list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
+ * @brief Find the member of the list and return the index.
+ *
+ * @param list The list.
+ * @param data The data member.
+ * @return The index of data member if found, @c -1 otherwise.
+ *
+ * This function searches in @p list from beginning to end for the
+ * first member whose data pointer is @p data. If it is found, the
+ * index of the data will be returned, otherwise @c -1 will be returned.
+ *
+ * @warning @p list must be a pointer to the first element of the list.
+ *
+ */
+EAPI int eina_list_data_idx(const Eina_List *list, void *data);
+
+/**
* @def EINA_LIST_FOREACH
* @brief Macro to iterate over a list.
*