libft/list/ft_lstiter.c

28 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/12 11:42:24 by rparodi #+# #+# */
/* Updated: 2024/10/31 17:46:55 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Apply the function given in arguments at all the element of the list
*
* @param lst the chained list
* @param f the pointer to function
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
while (lst != NULL)
{
f(lst->content);
lst = lst->next;
}
}