-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_ary_foreach.c
25 lines (22 loc) · 1.07 KB
/
ft_ary_foreach.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ary_foreach.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyork <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/24 15:37:14 by kyork #+# #+# */
/* Updated: 2016/10/24 15:39:07 by kyork ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_ary_foreach(t_array *ary, void (*func)(void*, size_t))
{
size_t idx;
idx = 0;
while (idx < ary->item_count)
{
func(ft_ary_get(ary, idx), ary->item_size);
idx++;
}
}