diff --git a/legacy/eina/src/include/eina_inline_list.x b/legacy/eina/src/include/eina_inline_list.x index 43b3869fdf..5c77d9642a 100644 --- a/legacy/eina/src/include/eina_inline_list.x +++ b/legacy/eina/src/include/eina_inline_list.x @@ -27,6 +27,18 @@ * @{ */ +/** + * @brief Get the last list node in the list. + * + * @param list The list to get the last list node from. + * @return The last list node in the list. + * + * This function returns the last list node in the list @p list. If + * @p list is @c NULL or empty, @c NULL is returned. + * + * This is a order-1 operation (it takes the same short time + * regardless of the length of the list). + */ static inline Eina_List * eina_list_last(const Eina_List *list) { @@ -34,6 +46,16 @@ eina_list_last(const Eina_List *list) return list->accounting->last; } +/** + * @brief Get the next list node after the specified list node. + * + * @param list The list node to get the next list node from + * @return The next list node on success, @c NULL otherwise. + * + * This function returns the next list node after the current one in + * @p list. It is equivalent to list->next. If @p list is @c NULL or + * if no next list node exists, it returns @c NULL. + */ static inline Eina_List * eina_list_next(const Eina_List *list) { @@ -41,6 +63,17 @@ eina_list_next(const Eina_List *list) return list->next; } +/** + * @brief Get the previous list node before the specified list node. + * + * @param list The list node to get the previous list node from. + * @return The previous list node o success, @c NULL otherwise. + * if no previous list node exists + * + * This function returns the previous list node before the current one + * in @p list. It is equivalent to list->prev. If @p list is @c NULL or + * if no previous list node exists, it returns @c NULL. + */ static inline Eina_List * eina_list_prev(const Eina_List *list) { @@ -48,6 +81,16 @@ eina_list_prev(const Eina_List *list) return list->prev; } +/** + * @brief Get the list node data member. + * + * @param list The list node to get the data member of. + * @return The data member from the list node. + * + * This function returns the data member of the specified list node @p + * list. It is equivalent to list->data. If @p list is @c NULL, this + * function returns @c NULL. + */ static inline void * eina_list_data_get(const Eina_List *list) { @@ -55,6 +98,17 @@ eina_list_data_get(const Eina_List *list) return list->data; } +/** + * @brief Set the list node data member. + * + * @param list The list node to get the data member of. + * @param data The data member to the list node. + * @return The previous data value. + * + * This function set the data member @p data of the specified list node + * @p list. It returns the previous data of the node. If @p list is + * @c NULL, this function returns @c NULL. + */ static inline void * eina_list_data_set(Eina_List *list, const void *data) { @@ -65,6 +119,18 @@ eina_list_data_set(Eina_List *list, const void *data) return tmp; } +/** + * @brief Get the count of the number of items in a list. + * + * @param list The list whose count to return. + * @return The number of members in the list. + * + * This function returns how many members @p list contains. If the + * list is @c NULL, 0 is returned. + * + * NB: This is an order-1 operation and takes the same tiem regardless + * of the length of the list. + */ static inline unsigned int eina_list_count(const Eina_List *list) { diff --git a/legacy/eina/src/lib/eina_list.c b/legacy/eina/src/lib/eina_list.c index 1c276dca4c..3d5d0473ac 100644 --- a/legacy/eina/src/lib/eina_list.c +++ b/legacy/eina/src/lib/eina_list.c @@ -1240,71 +1240,6 @@ eina_list_nth_list(const Eina_List *list, unsigned int n) abort(); } -/** - * @brief Get the last list node in the list. - * - * @param list The list to get the last list node from. - * @return The last list node in the list. - * - * This function returns the last list node in the list. If @p list is - * @c NULL or empty, @c NULL is returned. - * - * This is a order-1 operation (it takes the same short time - * regardless of the length of the list). - */ -static inline Eina_List *eina_list_last(const Eina_List *list); - -/** - * @brief Get the next list node after the specified list node. - * - * @param list The list node to get the next list node from - * @return The next list node on success, @c NULL otherwise. - * - * This function returns the next list node after the current one in - * @p list. It is equivalent to list->next. If @p list is @c NULL or - * if no next list node exists, it returns @c NULL. - */ -static inline Eina_List *eina_list_next(const Eina_List *list); - -/** - * @brief Get the previous list node before the specified list node. - * - * @param list The list node to get the previous list node from. - * @return The previous list node o success, @c NULL otherwise. - * if no previous list node exists - * - * This function returns the previous list node before the current one - * in @p list. It is equivalent to list->prev. If @p list is @c NULL or - * if no previous list node exists, it returns @c NULL. - */ -static inline Eina_List *eina_list_prev(const Eina_List *list); - -/** - * @brief Get the list node data member. - * - * @param list The list node to get the data member of. - * @return The data member from the list node. - * - * This function returns the data member of the specified list node @p - * list. It is equivalent to list->data. If @p list is @c NULL, this - * function returns @c NULL. - */ -static inline void *eina_list_data_get(const Eina_List *list); - -/** - * @brief Get the count of the number of items in a list. - * - * @param list The list whose count to return. - * @return The number of members in the list. - * - * This function returns how many members @p list contains. If the - * list is @c NULL, 0 is returned. - * - * NB: This is an order-1 operation and takes the same tiem regardless - * of the length of the list. - */ -static inline unsigned int eina_list_count(const Eina_List *list); - /** * @brief Reverse all the elements in the list. *