ft_lstiter.c
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   ft_lstiter.c                                       :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <marvin@42.fr>                      +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2022/07/12 15:42:02 by gychoi            #+#    #+#             */
 9  /*   Updated: 2022/07/12 15:45:14 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "libft.h"
14  
15  void	ft_lstiter(t_list *lst, void (*f)(void *))
16  {
17  	if (!lst || !f)
18  		return ;
19  	while (lst != NULL)
20  	{
21  		f(lst->content);
22  		lst = lst->next;
23  	}
24  }