-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstclear_bonus.c
43 lines (39 loc) · 1.33 KB
/
ft_lstclear_bonus.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
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: acalin-b <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/25 16:51:44 by acalin-b #+# #+# */
/* Updated: 2023/03/25 17:08:05 by acalin-b ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdio.h>
#include <stdlib.h>
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *tmp;
if (!lst || !del)
return ;
while (*lst)
{
tmp = (*lst)->next;
ft_lstdelone(*lst, del);
*lst = tmp;
}
}
//int main(void)
//{
// t_list *new;
// t_list *new2;
//
// new = ft_lstnew("Hello");
// new2 = ft_lstnew("World");
// printf("%s", new->content);
// printf("%s", new2->content);
// ft_lstclear(&new, free);
// return (0);
//}
//