-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter.c
31 lines (28 loc) · 1.25 KB
/
ft_lstiter.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbutt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/24 20:20:49 by mbutt #+# #+# */
/* Updated: 2019/03/25 11:54:53 by mbutt ### ########.fr */
/* */
/* ************************************************************************** */
/*
** Description - Iterates the list lst and applies the function f to to each
** link.
** Param#1 - A pointer to the first link of a list.
** Param#2 - The address of a function to apply to each link of a list.
** Return Value - None.
** Lib function - None.
*/
#include "libft.h"
void ft_lstiter(t_list *lst, void (*f)(t_list *elem))
{
while (lst)
{
f(lst);
lst = lst->next;
}
}