27 lines
1.1 KiB
C
27 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_list_foreach.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/08/14 13:21:57 by jhalford #+# #+# */
|
|
/* Updated: 2016/08/18 18:05:03 by jhalford ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "ft_list.h"
|
|
|
|
void ft_list_foreach(t_list *begin_list, void (*f)(void *))
|
|
{
|
|
t_list *list_ptr;
|
|
|
|
list_ptr = begin_list;
|
|
while (list_ptr)
|
|
{
|
|
(*f)(list_ptr->data);
|
|
list_ptr = list_ptr->next;
|
|
}
|
|
}
|